LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Steve D.

Allow simple line drawing between controls in CVI panels

Status: New

When developing a process mimic, it is very helpful to have lines and arrows linking the controls, to make it easier to visualise the process flow. A simple example would be to have a line or an arrow from the control that sets a motor's voltage to the control that shows the measured motor speed. Obviously any real-world example would be much more complicated than this.

 

If there is already a way of doing this, then my request is to make it much more clear in the help system. My searches yielded nothing beyond making a bitmap in another tool, putting controls on top and controlling the Z-plane to get what I want.

7 Comments
LuisG
NI Employee (retired)

Do you need to use diagonal lines, or do vertical or horizontal lines suffice?

Steve D.
Member

Nearly every process mimic I see uses vertical and horizontal lines. Diagonal lines are only used in exceptional circumstances.

 

I realise that I am opening a can of worms here, because the next demand will be to set the thickness and colour of the lines, shortly followed by requests that addiditional switch and selector control styles are added that allow the signal flow to be clear. EG a switch in the off position shows the line broken, but in the on position it is continous.

 

 

LuisG
NI Employee (retired)

The reason I asked is because, if you could get by with simple horizontal or vertical lines, even if they needed to be of varying widths or colors (in other words, no arrowheads and no switches), my recommendation would be to use a classic-style splitter control. More info in the next-to-last paragraph here.

 

Luis

40tude
NI Employee (retired)

Diagonal, vertical, horizontal

Width from 1 to infinite

Option : arrows may be usefull in some cases

 

Best regards, Philippe

Regards, Philippe proud to be using LabWindows since version 1.2
// --------------------------------------------------------------------------------------------
gdargaud
Active Participant

I think you could do this simply by overlaying a transparent canvas over the whole panel and simply drawing lines on it to the coordinates of your controls which you get with GetCtrlAttribute(..., ..., ATTR_TOP, &Top)

gdargaud
Active Participant

Sorry, dumb idea. If you set a canvas on top, then you can't do anything on the panel anymore ! It could work only if no user interaction is needed (in a demo for instance).

 

LuisG
NI Employee (retired)

Well, I don't think it's a dumb idea. As long as the arrows don't have to overlap other controls you can still use a canvas, although you'd put the canvas at the bottom of the z-plane order, rather than at the top.