LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to program 'Right click and create new device on front panel'

I may need a software function of 'Right click and create new device on front panel'.

 

Just after right click the menu pop up, then select 'create new device', then new device appear, by moving the mouse, can put the device wherever you want.

 

May I know how to implement this, thanks.

0 Kudos
Message 1 of 11
(2,823 Views)

What do you mean by "new device"?

0 Kudos
Message 2 of 11
(2,803 Views)

Please see the attached drawing

0 Kudos
Message 3 of 11
(2,776 Views)

That image tells nothing. You can use a menu item, combo box, ring. etc. to list items that you can select from. What do you want to use? Do you not understand how to programatically populate it?

0 Kudos
Message 4 of 11
(2,759 Views)

The part about "moving the mouse, can put the device wherever you want" makes me wonder if they are thinking "Controls on the fly"

0 Kudos
Message 5 of 11
(2,750 Views)

Please see the attached screen, after click the 'New Device', there will been a frame following the mouse, wherever left

click the mouse it will place a frame in the front panel as the attached the other screen.

Download All
0 Kudos
Message 6 of 11
(2,710 Views)

Do you mean that you wish the user to be able to draw new controls onto the front panel, in much the same way that you would draw a rectangle in a drawing package like paint?  What would the control be used for?

 

Ravens Fan, your link seems to be broken.. did you mean this? Smiley Very Happy

 

Ian

0 Kudos
Message 7 of 11
(2,694 Views)

Yes, Ian.  That's the one.  I don't know how I got that link messed up.  Maybe I didn't clear out the box completely when I pasted in the link data.

0 Kudos
Message 8 of 11
(2,677 Views)

Yes, almost like that, it will be used to display some temperature node.

0 Kudos
Message 9 of 11
(2,645 Views)

If you want to make a conrol on the FP in runtime, you can do that by using a vi, then using SETLayeredAttributes WindowsAPI (just in case you want to remove that FP layer to make a free-hanging control, then you can use GetWindowLong and SetParent Windows API to make that control VI the child of your FP. In case you want to move this control, you can use the SendMessage() API to move it on an event (Say double click of mouse control). In case you want to resize the control in runtime, you can do that too.

 

Is this what you were looking for?

 

Also check the attached VIs and link for the SETLayeredAttributes API, they might help.

 

http://decibel.ni.com/content/docs/DOC-15177 - Will explain SetLayeredAttributes function

 

 

FraggerFox!

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
Download All
0 Kudos
Message 10 of 11
(2,628 Views)