LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert color numeric in Table

Solved!
Go to solution

Hi,

 

I have a table control in my UIR file. in that i have a column, if user clicks on any cell in that column, color selector should come similar to color numeric control and user selected color should display in that cell.

 

I am not sure how to add a color numeric control in a particular column for each cell in a table.

 

Is there any way to acheive this functionality in CVI?? Are there any ActiveX controls for this?

 

Thanks,

Haari

 

 

0 Kudos
Message 1 of 7
(3,947 Views)

Hi,

 

yes, you can hide the built-in popup menu items and add your own menu items, see the example treemenu.cws (it works the same way for table controls)

0 Kudos
Message 2 of 7
(3,945 Views)

Hi Wolfgang,

 

From treemenu.cws, i got to know how to add menu items to a table but not sure how to add color selector kind of thing to a menu item similar to color numeric control.

 

Thanks,

Haari

0 Kudos
Message 3 of 7
(3,934 Views)

From treemenu.cws, i got to know how to add menu items to a table but not sure how to add color selector kind of thing to a menu item similar to color numeric control.



Hi haari,

 

my idea was to actually use a color numeric control... using the runpopup menu to display a small popup panel containing just a color numeric control. (The programmers toolbox also provides a similar function, ColorChangePopup, but I have not used it myself)

0 Kudos
Message 4 of 7
(3,931 Views)

 Hi Wolfgang,

 

I got what you are trying to tell.....but i dont want to display a color numeric control and then when user clicks on it, color palette will be displayed. I dont want in that way. I want to display color palette directly when user clicks on a particular cell in a table.

 

Is this possible in CVI?? Are there any ActiveX controls for that???

 

Thanks,

haari

0 Kudos
Message 5 of 7
(3,924 Views)

but i dont want to display a color numeric control and then when user clicks on it, color palette will be displayed. I dont want in that way. I want to display color palette directly when user clicks on a particular cell in a table.

I think that this is also possible in CVI - with some extra effort requiring to build your own color palette: The color palette used by CVI is a panel with several controls; while I am not aware that it is possible to directly access this color palette, you can build something similar (with the benefit that you can adapt it to your liking) using the color picker control (see e.g. colorpickerdemo.cws). Displaying your panel than avoids the extra step of a color numeric because your popup panel provides the color picker functionality directly.

0 Kudos
Message 6 of 7
(3,921 Views)
Solution
Accepted by topic author haari

Also, if you would like to display the Windows color dialog directly (see image attached), you can do so via the Win32 ChooseColor function.

 

So you could use a picture cell, for example, set its background color accordingly, and catch the mouse click event on the cell in order to launch the ChooseColor dialog.

 

Luis

Message 7 of 7
(3,916 Views)