LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Numerical Control Inc/Dec Resizing in CVI

The inc/dec feature of the CVI numerical control cannot be independently resized.   For touch screen applications this can be a problem as the increment/decrement arrows are very small.  The size of the increment/decrement arrorw is dependent only on the size of the control's text font,  which causes the arrows to  grow primarily in the vertical direction.   A workaround using independent picture boxes for the increment/decrement arrows might be solution, but then you have to replicate a lot of the functionality that NI has placed natively into the increment/decrement.    Appreciate your comments.
0 Kudos
Message 1 of 15
(6,693 Views)
I see no other solution to your needs unless you make inc/dec arrows disappear and rely only on keyboard capabilities to alter control value (up / down keys work exactly as inc/dec arrows)


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 15
(6,670 Views)
Steve,

Although it's not officially supported, you should be able to change the width of the inc/dec arrows with the following call:

SetCtrlAttribute (panel, ctrl, 20472, newWidth);

Luis
Message 3 of 15
(6,669 Views)

Hello Luis,


Although it's not officially supported, you should be able to change the width of the inc/dec arrows with the following call:

SetCtrlAttribute (panel, ctrl, 20472, newWidth);

just wondering: why is this attribute not officially supported? It seems like a feature that might come in handy from time to time...

0 Kudos
Message 4 of 15
(6,657 Views)
Good question, Wim.

We needed something like this inside the UI library in some very specific situations (during printing, for example), and so we implemented it a few years ago. But because no one had ever requested it (to my knowledge) we decided that it wasn't really worth spending much time testing it more extensively outside of those specific cases, which we would have had to do in order to support it officially. Instead, we decided to spend the time in features which seemed more urgent to us at the time (everything has a cost-benefit analysis of some sort...)

Now that you are stating that you would find it useful, and if a couple of other people also agree that it would useful, we'd be happy to reconsider and maybe support it officially in a future version.

Luis
0 Kudos
Message 5 of 15
(6,647 Views)
Thanks, this is fantastic.  I tried this new feature, and it works.  By the way, it looks like resizing (both width and height?) of increment/decrement buttons has been a standard feature of LabView.  This feature should definitely be in future versions.  Make's you wonder about what other un-documented , great features there may be in CVI?
0 Kudos
Message 6 of 15
(6,637 Views)
Is there an attribute that can be used to resize the Inc/Dec Arrows for Slider Controls that works similarly to the undocumented attribute that is used to resize the Numerical Control?   Again, this is particular useful for touch screen applications?

Appreciate your response
0 Kudos
Message 7 of 15
(6,384 Views)
Steve,

Try this one:

    SetCtrlAttribute (panel, ctrl, 20468, newArrowLength);

Luis
0 Kudos
Message 8 of 15
(6,348 Views)
Thanks, Luis

While the 20472 attribute continues to work well for the numerical type control with inc/dec arrow elongation, the 20468 attribute did not work in increasing the length of slider type  inc/dec arrow controls.

Steve
0 Kudos
Message 9 of 15
(6,334 Views)
Really? That's odd. Do you get an error back, or does it just not do anything at all?

Can you try running this code in the interactive window and see what happens:

#include <utility.h>
#include <userint.h>
static int panelHandle, ctrl;
panelHandle = NewPanel (0, "", 100, 100, 300, 300);
ctrl = NewCtrl (panelHandle, CTRL_NUMERIC_POINTER_HSLIDE_LS, "", 100, 100);
SetCtrlAttribute (panelHandle, ctrl, 20468, 50);
DisplayPanel (panelHandle);
Delay (2.0);
DiscardPanel (panelHandle);

0 Kudos
Message 10 of 15
(6,318 Views)