LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LabView's Color Picker

I am trying to use the LabView color picker in a right click menu.  I would like to be able to right click on a waveform graph and have a right click menu item called "Change Background Color" with an arrow next to it.  If you click on the item, the LabView color picker appears.
 
LabView doesn't expose this control to users and I was wondering if anyone knows a way to access it.  I am open to making .dll calls, so if someone knows a function prototype for the color picker that might work.
 
Thanks for the help,
Zach
0 Kudos
Message 1 of 14
(12,742 Views)
Use a color box, under numeric controls.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 14
(12,717 Views)
To illustrate...

Message Edited by _orko_ on 09-05-2007 03:32 PM


--------------------

"I have made no decision...
My main concern now is to open as many options to the future as I can."
-- from Stephen Baxter's "The Time Ships"
0 Kudos
Message 3 of 14
(12,709 Views)

Thanks for the replies,

I realize that one can click on a color box to display the color picker.  For my application that won't do.  I really need to be able to launch the color picker independently of a color box.  Ideally I would have a right click menu item and when I click on that menu item, the color picker is displayed.  I will most likely need to call the color picker in a non-standard way such as a .dll call. 

 

Thanks,

Zach

0 Kudos
Message 4 of 14
(12,700 Views)

I would suggest creating your own popup VI for the right click. In that VI, have a transparent color box with text under it as your text with the arrow. Clicking it would open the color dialog.

If you want to save some time, there were some implementations for right click menus on the web. I would suggest searching the LAVA forums (I believe PJM_LabVIEW posted one).


___________________
Try to take over the world!
Message 5 of 14
(12,696 Views)

If you re using LV 8.0 or upwards, you can configure Rt Click menu by customizing the run-time short-cut menu.

Else, you ve to right the code on your own.

- Partha ( CLD until Oct 2024 🙂 )
Message 6 of 14
(12,657 Views)
A quick draft...
- Partha ( CLD until Oct 2024 🙂 )
Message 7 of 14
(12,656 Views)
On a different approach, you can try the .NET solution if you're working in Windows and don't care about portability. See attached example. This makes use of the ColorDialog common dialog. Using this requires a wrapper DLL to get the frontmost window so the Color Dialog pops up in the front. Otherwise it displays, but in the back of all windows and you have to alt-Tab to it. The wrapper DLL comes from this MSDN article, referenced in this thread.
Message 8 of 14
(12,617 Views)

I actually realized that my earlier suggestion is not viable because you can't make a color control transparent and because opening the dialog from it causes its color to change.

I think I would just write my own dialog. Here's a quick example showing how you can do it based on LV's dialog (LV 7.0).


___________________
Try to take over the world!
Message 9 of 14
(12,610 Views)
Thanks Everyone,
 
I really like the .NET solution and think I'll pursue it.
 
     -Zach
0 Kudos
Message 10 of 14
(12,594 Views)