LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI V8.5 – I have a problem with coloured command buttons when dimmed.

If I try to use coloured command buttons and then dim the button the effect is not that of a dimmed button. For example if I use a red button with white text (similar to the 'Stop' button used in the CVI development environment) the main colour remains the same and the text actually turns black! I have found that using any colour combination, other than the standard windows gray and black, does not work even if I try to set the colours using SetCtrlAttribute() after dimming. Does anyone have a solution?
By the way coloured dimmed buttons in CVI versions up to and including V7.1.1 worked perfectly well for me.
 
Thanks
Richard L
0 Kudos
Message 1 of 13
(4,368 Views)
Hello Richard,
 
We did in fact change the dimming of controls between 7.1 and 8.0. The reason for the change was because there were several problems with the old algorithm that couldn't be salvaged by simply tweaking it (the old algorithm consisted simply of superimposing a checkerboard pattern on the control). Those problems had to do with non-rectangular controls, like knobs and slides, and controls that overlapped other controls.
 
When we came up with the new algorithm, we knew that it might not be easy to tell when a control is dimmed whenever there was a single dimmed control. In other words, when there was no way for the end user to compare a dimmed with a non-dimmed control.
 
Allow me to elaborate...
 
After 8.0, dimming consists of multiple steps: washing out borders, etching text, "transparentifying" bitmaps (when those are present), and changing the control colors to make them less luminous. It is this last step that is the most difficult, since this can perceived subjectively. We spent a fair amount of time tweaking the color transforms, but I realize that for some color combinations, the end result isn't always very good. In the example that you gave, the color does change from red to a darker shade of red, but I realize that this doesn't make it obviously dimmed, especially if there aren't other non-dimmed controls to compare it against.
 
Based on your feedback, we will continue to tweak the color transforms further, to try to make it blend into the panel background better.
 
Another important element is the etching of the text. This consists of shadowing the text and changing its color, usually towards grey. Visually, this seems to work better when the text is black than when it is white. But I think that the reason it works better is because we are all used to see this a lot more (black=active, gray=inactive). This is what is customarily done in Windows dialogs, for example, and most applications follow suit. For example, when you browse through the various Windows dialogs, you see a lot of dimmed controls, and the reason that it's obviously that they're dimmed is because we're all used to seeing them: gray text, gray borders, etc. If the colors were to change, then we'd lose that frame of reference, and it would become a lot harder to tell.
 
So the moral of the story is: yes, we will continue to try to improve the color transforms, but it will probably never work very well with non-standard colors. So my recommendation is that if you need to rely on dimming being obvious, then you should consider using system colors, especially black text.
 
Luis
Message 2 of 13
(4,352 Views)

Thanks Luis,

 

I have developed many applications over the last 10 years or so and most use coloured command buttons. Some of theses applications still get the occasional tweak so the problems with CVI V8 make it impossible for me to re-compile using this version. It does seem strange to me that most software applications that are in general use manage to create proper dimmed buttons regardless of colours used. In fact NI themselves use coloured buttons in the CVI development environment. So it is a bit odd being told by NI (your explanation is the same as that given by NI UK Support and like you they say there is little chance this issue will be resolved in the near to medium future) that CVI version 8 users can only use standard windows colours, i.e. grey or white button with black text.

 

Regards

Richard

0 Kudos
Message 3 of 13
(4,324 Views)

I want to second Richard's concerns.

The old algorithm might have had some drawbacks (although I never encountered one) for the developers but being aware of it we could -and did- make it work for us.

With the new algorithm, the main dimming ability is hindered for the sake of better performance in some special cases that has lower probability to occur.
I think application developers use dimming mostly for simple purposes like preventing the user from pressing the EXIT button while a serious process is running etc.

S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 13
(4,308 Views)

Hello Richard and Eren,

You both raise valid points. Although we want to continue using the new dimming algorithm, and we will continue tweaking it such that it works better with non-standard colors, there is no good reason why we can't also offer the old algorithm, if you do prefer it. Although it has its problems, I agree that for certain controls (command buttons, for example) it can work just fine.

In the next version of CVI, we will add an option for toggling between the two algorithms. The only caveat is that the choice will probably be global. It will not be per-control.

Thanks for the feedback!

Luis

0 Kudos
Message 5 of 13
(4,294 Views)
Richard L Replies <x@no.email> wrote in
news:1204110615266-661538@exchange.ni.com:

> Thanks Luis,
>
> &nbsp;
>
> I have developed many applications over the last 10 years or so and
> most use coloured command buttons. Some of theses applications still
> get the occasional&nbsp;tweak so the problems with CVI V8 make it
> impossible for me to re-compile using this version. It does seem
> strange to me that most software applications that are in general use
> manage to create proper dimmed buttons regardless of colours used. In
> fact NI themselves use coloured buttons in the CVI development
> environment. So it is a bit odd being told by NI (your explanation is
> the same as that given by NI UK Support and like you they say there is
> little chance this issue will be resolved in the near to medium
> future) that CVI version 8 users can only use standard windows
> colours, i.e. grey or white&nbsp;button with black text.
>
> &nbsp;
>
> Regards
>
> Richard
>

It looks like NI have had the B-team on CVI development since V7. What with
countless bugs introduced at every iteration, 'improvements' which break
perfectly good existing programs, monstrous installation packages and now
they can't even dim a control properly without reference to a committee.
I'll be sticking with the older versions as long as possible. Shame that NI
are putting all their effort behind LabView. Ugh.
0 Kudos
Message 6 of 13
(4,276 Views)
I have just tried CVI version 9.0 and found that the issue with dimmed command button colours has still has not been resolved! Will NI ever sort this problem out?
0 Kudos
Message 7 of 13
(4,004 Views)

Hello Richard,

 

In 9.0 there is a system attribute that allows you to pick the method of dimming that was in effect prior to version 8.0 Have you tried using it?

 

    SetSystemAttribute (ATTR_USE_CHECKERBOARD_DIMMING, 1);

 

Luis

0 Kudos
Message 8 of 13
(3,999 Views)

Hi,

 

It is nice to see that it is possible to use the old method.

But I'd prefer to have it also in the "User Interface Preferences" kind of menu, in the UIR editor, so that we can try the control appearance while in the UIR editor without having to run the code.

 

I did not install 9.0 yet, so I do not know if this option is available.

Is it? 

S. Eren BALCI
IMESTEK
0 Kudos
Message 9 of 13
(3,979 Views)

That's a good point. No, it's not currently available in the UI Editor. We could certainly add it to the Preferences dialog, and have it control how it looks in the editor, but since this was implemented as a global runtime attribute (system attribute) it can't really be associated with any one .uir file. At runtime, it would still require you to add the SetSytemAttribute call to any program where you want the old style. And that might be confusing to some users who might have the option turned on in the editor, but then start seeing a different behavior at runtime.

 

So I'll have to think about that some more.

 

Luis

0 Kudos
Message 10 of 13
(3,950 Views)