LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Wolfgang

Size of UI Controls

Status: New

This issue is that old that we all forgot about it... Smiley Wink

 

But this thread brought it back to my attention and I'd like to suggest two improvements:

 

Setting the width or the height of a control does not always succeed because there are limitations concerning the minimum and maximum size.

 

Suggestion 1:

 

If a function fails it should return a warning. However, calling e.g. status = SetCtrlAttribute ( panel_handle, PANEL_RING, ATTR_WIDTH, 5 ) returns success (0) even though the width of the ring control will be much larger than 5 pixels. For checkboxes, the situation is even worse because checkboxes are drawn right aligned to a transparent rectangular frame. So calling status = SetCtrlAttribute ( panel_handle, PANEL_CHECKBOX, ATTR_WIDTH, 500 ) will result in a transparent drawing rectangle of width of 500 but with the checkbox size remaining at the default size. Since the checkbox is drawn right aligned to this transparent frame the checkbox eventually may disappear from the panel (setting the width to say 10000 will not draw anything).

 

Suggestion 2:

 

Complement the documentation, the idea is given below:

 

Constant: ATTR_WIDTH
Data Type: int
Description:  The width of the control body in pixels.
Valid Range: 0 to 32767
Control Type Restrictions: Not valid for controls of type CTRL_VERTICAL_SPLITTER and CTRL_VERTICAL_SPLITTER_LS

For checkboxes, the minimum size is ... pixels, and the maximum size is ... pixels.

For ring controls, the minimum size is ... pixels.

...
LabWindows/CVI Compatibility: LabWindows/CVI 3.0 and later

Control Types:  All