LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

UIR Stuff - Color problem with dimmed controls.

Hi to everyone,
I've got a problem with dimmed control color.
Here it comes:
My customer (another word for 'GOD' in my company) was very specific with the uir and its color, and I have a problem with it because when I dimmed a control it takes a variant color based on the color of the background and not on the color of the decoration which is just below.

Try that:
Create a panel, make its background color a beautiful purple.
Create a decoration, and make it a good old flashy green. (I really does believe the man is blind!!)
Now create a control on the panel, position it on the decoration, and dimmed it; you will see the control color based on purple and not green.

I'm not sure there is a solution for this probl
em. If so, it could be one thing to improve for your next version; otherwise I'll be glad to try anything you propose.

Thanks for everything, Florent.
0 Kudos
Message 1 of 4
(2,947 Views)
This is the way we draw dimmed controls. When a control is dimmed, every other pixel is not drawn (or transparent) meaning the background shows through on those pixels. The pixels that are drawn are still the same color of the button. This is a pretty common way of visually marking disabled UI objects.

The only workaround for this would be to change the colors yourself with SetCtrlAttibrute and swallow the controls events to disable it with your own desired graphics effect.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 4
(2,947 Views)
To the point! (as I like). Thanks, chris.

Adjusting the control color every time I dimmed one is ok, but I've got dozen of controls to handle so I think I'll talk the man out of it.

Just one question:
"swallow the controls events to disable it"? Excuse me, I'm french and my english is not THAT good...In other words, I don't get the idea.

Thanks anyway, Florent.
0 Kudos
Message 3 of 4
(2,947 Views)
Yes, sorry, even in English it doesn't make much sense. Swallowing events is discussed in the CVI help. All it means is in your callback function, if you return a positive value (return 1;) instead of returning 0, then that causes the event not to continue processing. For example, if you didn't want EVENT_COMMIT events to occur on a button, you could "swallow" the EVENT_LEFT_CLICK event, by returning a positive value, and the EVENT_COMMIT would never be sent out. See the CVI Online help for more information.

Chris
0 Kudos
Message 4 of 4
(2,947 Views)