LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Numerical Control Inc/Dec Resizing in CVI

Now I understand the elongation feature.  As I worked your demonstration, the arrows at the two ends of the slider bar are elongated with this attribute.  It works for vertical as well as horizontal slider bars.  I didn't see it earlier because I was expecting the inc/dec arrow  buttons of the slider's associated numerical control to be elongated.

Steve
0 Kudos
Message 11 of 15
(2,255 Views)
Ah, I see what you mean.

As far as the arrows in associated numeric display are concerned, the only attribute that has an impact on them is 20472, the one we talked about earlier in the thread. That attribute causes the arrows to grow proportionally. Unfortunately there's no attribute that affect only the height (or only the width) of those arrows.

Luis
0 Kudos
Message 12 of 15
(2,238 Views)
The behavior of attribute 20472 for the slider control numerical inc/dec buttons is a bit odd.  Although this attribute dimensionally elongates the buttons,  the effective 'hot' area of the inc/dec buttons that will will respond to mouse click (or touch screen finger touch) is still only the original rectangle size of the buttons.

Steve
0 Kudos
Message 13 of 15
(2,224 Views)
Steve,

I'm not too surprised that there might be problems with this attribute (like I said earlier, not being officially supported, it didn't go through a whole lot of testing). Having said that, however, I could't really reproduce this behavior you're describing. Try running the following code, and then let me know what you find:

#include <utility.h>
#include <userint.h>
static int panelHandle, ctrl;
panelHandle = NewPanel (0, "", 100, 100, 300, 500);
ctrl = NewCtrl (panelHandle, CTRL_NUMERIC_POINTER_HSLIDE_LS, "", 100, 100);
SetCtrlAttribute (panelHandle, ctrl, 20472, 100);
SetCtrlAttribute (panelHandle, ctrl, ATTR_TEXT_POINT_SIZE, 40);
SetCtrlAttribute (panelHandle, ctrl, ATTR_DIG_DISP_WIDTH, 200);
SetCtrlAttribute (panelHandle, ctrl, ATTR_DIG_DISP_LEFT, 100);
SetCtrlAttribute (panelHandle, ctrl, ATTR_DIG_DISP_TOP, 200);
DisplayPanel (panelHandle);
RunUserInterface();

0 Kudos
Message 14 of 15
(2,217 Views)
Thanks, it now works properly.

My slider control is statically created.  So all I needed to do was insert one additional statement to resolve the slider's numeric inc/dec button elongation oddity, as shown below.

      SetCtrlAttribute(handlePanel, PANEL1_SLIDERCTRL,20472,40);
      SetCtrlAttribute(handlePanel, PANEL1_SLIDERCTRL,ATTR_DIG_DISP_WIDTH,85);

Steve
  
0 Kudos
Message 15 of 15
(2,206 Views)