04-16-2009 04:20 AM
I am having a problem with setting the attribute checkerboard dimming. I am using CVI 9 and build my panels and controls programmatically. So in keeping up with the latest changes in CVI I am trying to add this additional attribute to my routines that are building all my various controls.
However, calling SetCtrlAttribute ( panel_handle, control_id, ATTR_USE_CHECKERBOARD_DIMMING, attribute_value )
results in the error 'the attribute is not valid'. Interestingly, for a panel with 4 controls (button, ring, numeric, numeric color), I receive 3 errors...
As implied by the help this is supposed to be an attribute that can (and has to) be set for any individual control? I remember some discussion in this forum that this was supposed to be a system wide attribute, but probably I got confused.
Beause it is an attribute for most controls, I would expect it to work on a per control basis. Somehow, in my case, it does not. This is how my code looks like:
NewCheckBoxControl
SetControlSize
SetControlOnColor
...
SetControlDimmedMode
SetControlTabPosition
SetControlCheckerboardDimming
Any ideas? I tried playing with the sequence of the calls, but it didn't help.
Thanks, Wolfgang
Solved! Go to Solution.
04-16-2009 12:30 PM
Hi Wolfgang,
I apologize for this, but there was a bug in the 9.0 documentation that suggested that ATTR_CHECKERBOARD_DIMMING was a control attribute. It's really a system attribute.
You should be receiving a CVI update soon that has this corrected. In the meanwhile, just ignore the documentation and use it with SetSystemAttribute instead. You should set this option globally before loading or creating your controls. Another change related to this attribute that has been made since 9.0 is to have this option also prevent text from being etched (which is the default behavior when dimming controls)
Luis
04-17-2009 02:42 AM
Thanks!
So the correct usage is SetSystemAttribute ( ATTR_USE_CHECKERBOARD_DIMMING,...) and indeed this works as expected 🙂