LabWindows/CVI Idea Exchange

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

up/down control

Status: New

Hi,

 

I'd suggest to provide a simple up/down control, i.e. the arrows found in numeric or ring controls, but without the numeric / ring field.

 

For example, they might be used to adjust cursor position or scroll through a list.

 

Right now, it's not possible to set the numeric field width to zero, so there will always be a numeric control attached to the arrows (same is true for rings)

 

When I tried to accomplish something like this (following the discussion here) by putting two controls on top of each other, see below, I had to realize that z-plane order is not maintained. While this might be a bug, it's also not nice because the dashed line indicating the focus is disturbing, too.

 

Two controls on top of each other:

 

ctrl-1.jpg

 

After clicking on the numeric control:

 

ctrl-2.jpg

 

Thanks! 

 

 

Summary: I am looking for this control:  up-down.jpg

6 Comments
LuisG
NI Employee (retired)

Wolfgang,

 

How about a picture ring in which you hide the frame and you color the background transparent?

 

Luis

Wolfgang
Trusted Enthusiast

Hi Luis,

 

Thanks for your suggestion. I've tried to implement it but failed to achieve a nice result: Because the picture ring cannot be of width zero (minimum is 20 pixels), the dashed line indicating the focus is still interfering with the other control on top of it..., similar to my picture above.

LuisG
NI Employee (retired)

Ah, okay. Well, there's still another little trick you can do to get around that. Controls typically only show the dashed focus line if they don't have a label. If they do, then that line goes around the label instead. Now, you probably don't want a label for your inc/dec arrows. However, what you can do is to let it have some label text anyway but position the label well outside the panel boundaries (e.g. [20000,20000]). The label will not be seen, but it will force CVI to draw the dashed line around it instead of the main control.

 

Luis

Wolfgang
Trusted Enthusiast

Thanks Luis,

 

that does the trick for stacked controls and is even scalable, very nice!

 

Still, I would like a 'standalone' button (both a horizontal and a vertical version) that could be used e.g. for moving a graph cursor on a graph and could be placed anywhere on the GUI, i.e. without an 'overlay-control'.

LuisG
NI Employee (retired)

Understood.

 

By the way, it might not be exactly what you're looking for but, since you mentioned moving a graph cursor on a graph, in case you're not familiar with the graph cursor palette custom control I wanted to draw your attention to it:

 

samples\userint\custctrl\graphcursors\graphcursorctrl.cws

 

If all you want is arrows to move the cursors, you can hide everything else in the palette besides the compass (i.e. arrows).

Wolfgang
Trusted Enthusiast

Thanks again!

 

OK, I wasn't precise enough... the application I have in mind uses regular lines (PlotLine) on a graph to indicate certain regions of interest (offset, threshold values, ...). It would be useful to have a control similar to the one provided in graphcursorctrl.fp but with the ability to obtain a suitable event allowing to perform certain actions not related to graph cursors...e.g. move a line (or rectangle) in a certain direction.

 

Btw, there is one attribute that can not be set in graphcursorctrl, that is the decoration the controls are sitting on - it can not made invisible leaving only the buttons visible