11-18-2008 01:02 AM
Hi,
I am looking for the SetCtrlAttribute controlAttribute to set the background of numeric gauge
In the documentation of numeric control there is no hint.
greetings
juergen
Solved! Go to Solution.
11-18-2008 03:20 AM
Hello Jürgen,
I also verified that the frame color attribute for numeric gauge is just effecting the color of the bubble in the middle.
I tried the following workaround:
- Change the background color of the gauge to transparent using the UIR color brush.
- Create flat circle decoration. Place it at exactly the same coordinates as the gauge.
- Change the Z-order of the decoration so that it is behind the gauge.
- Change the frame color of the decoration from the code.
It does not look perfect but if you really have to do it, this may help.
11-18-2008 10:46 AM
Hello Juergen,
Is ATTR_FILL_COLOR the attribute that you're looking for?
11-19-2008 12:06 AM
Hi Luis,
Now I remember having the same issue myself some time ago.
ATTR_FILL_COLOR works but I cannot reach that attribute from the parameter assistant if you select "Numeric" as control type.
And in the help text of this attribute it says it is valid for numeric slide and ring slide (gauge not mentioned).
Actually, after making a few trials I -once again- got confused about color attributes. Some control types have a color attribute devoted to them. Command button and binary switch are two that I noticed at a quick glance. Others control types respond to the attributes in a different way.
For example, for the Numeric Meter, ATTR_FILL_COLOR again paints only the "bubble", while ATTR_FRAME_COLOR paints it completely.
For the gauge it is different: ATTR_FILL_COLOR paints only the meter and ATTR_FRAME_COLOR paints the bubble and the digital display frame.
Luis, don't you think that is a bit inconsistent and thus misleading?
Kudos in advance, if you could you shed some light on this (the logic behind this naming convention)?
11-19-2008 01:56 AM
Hi
Thank you both for posting. The ATTR_FILL_COLOR is working well and is excatly what i need.
But after a few years of programming i am reading first the help before posting here. So I knew ATTR_FILL_COLOR
I read the same l as Erren : .....(gauge not mentioned).
Seems it has been forgotten. So Luis please report this leak to right place at ni.
So in next releases of CVI there is no need for workarounds or "just try and look what happens".
Greetings
juergen
11-19-2008 10:57 AM
Hello guys,
I think the reason both you failed to find the attribute is because gauges do not consitute, by themselves, a control type. They're considered a "numeric slide", as are all the other numeric controls that have a scale (whether straight or round). In the parameter assistant that's reachable from the SetCtrlAttribute function panel, there is a drop-down list of all the control types that will allow the attributes to be filtered. If you select "numeric slide" in that list (note that there's no "gauge" option) you should be able to find the "fill color" attribute in the filtered list below. The control types on this list mirror the organization of the "Create" menu in the UI Editor. But I readily admit that this isn't obvious, and even if it were, it's not clear where one type ends and another begins.
A much more reliable way of finding the attributes that are supported by a given control is to right-click on the control in the UI Editor and select "Control Help". When you do, you are taken to the main help topic for the control type that corresponds to that control. If you then click on the "Numeric Slide Control Attributes" link you'll see the full set of attributes that operate on the control.
Eren, you bring up a very good point about the inconsistency of how some attributes are paired up with the various control types. The examples you brought up are valid, and I'm not going to try to defend the current arrangement. All I can say is that this is a result of a (necessarily) incrementalist design of the UI Library, over a 15-year period. Initially, the general philosophy was for different controls to share common attributes whenever possible. Sometimes this decision was valid, other times it became a bit of stretch. But as time passed, and the types of controls introduced in later versions became more and more specialized, that philosophy was oftentimes stretched way too far. And at other times, when the decision was made that new attributes really were needed, that too created inconsistency. I think the UI events illustrate this even more powerfully than the attributes. For example, a "commit" event might make a lot of sense for a command button. But it's a lot less clear what "commit" means for a list or a tree control.
Luis
11-20-2008 12:34 AM
Hi Luis,
I understand the issues about the product history forcing you to make some decisions.
If you change the way the controls are grouped and the attributes are named, is that going to create backward-compatibility problems (compiling a code written in a previous version in a new IDE)?
Well, I think you can at least arrange the controls in the "create control menu" as they are grouped in the parameter assistant. It prefer having a "non-intuitive consistency" to not being consistent at all. There should be some type of "matching" feel somewhere.
If gauges are considered as a slide then they could be placed in a lower level menu, for example under "Numeric Slides". This would not only "teach" us how you grouped the gauge but also remind us that their parameters can be found under "Numeric Slide" in parameter assistant.
So we ended up with a consistancy even if it is not intuitive to look for gauges under slides. But you can depend on programmers being quick-learning creatures 😉
After reading my post I felt like I sounded like a wise-a** but consider this like a humble product improvement suggestion.
Best regards,
11-20-2008 01:56 AM
Hi Luis,
I tried the right click and it pointed my to the right place!
Seems i have learned something important more.
Well i would be very happy if i will see in future release of CVI a picture of a gauge on right click help.
Greetings from the
Lake of Constance, Germany
06-21-2011 07:02 PM
How do you reach the ATTR_FILL_COLOR property on the numeric gauge?
06-22-2011 12:29 AM
either by Library / User Interface Library / Controls / General Functions / SetCtrlAttribute or in the IDE by using the brush