LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Hidden splitters to get a kind of "smart panel resize"

Solved!
Go to solution

This idea came to my mind some weeks ago and I implemented it successfully.

I don't know if this can have a more general usage and/or it's a good candidate for a product suggestion.

For sure the same effect can be obtained with different approaches, but I haven't been able to find a CVI built-in method to do this.

Before posting in the Idea Exchange I would like having feedback from some NI users.

 

The need is quite common: when a panel is resized, some controls should be resized too, some others should be moved.

I use splitters to resize portions of the same panel.

I thought that if controls could be attached to right and bottom borders of the panel (like to splitters), the panel resize would be handled automatically.

Unfortunately I haven't find a way to set a property "attach to border".

And so I created two hidden splitters, just near the right and the bottom border.

They are hidden because the user must not interact with these special splitters.

I added code inside EVENT_PANEL_SIZE callback to move the plitters near the new panel borders calling OperateSplitter().

All the other approaches I used in the past required a lot of code and I was not satisfied by them.

 

I attach a uir whre you can see in red the two special splitters.

You can switch the uit into "Operate mode" and resize the panel.

Then you must manually move the splitters near the new borders to see what I mean.

 

My doubt is:

is this a good approach to handle panel resizing?

If this is the case, would you approve a suggestion to NI so that right and bottom borders could work as splitters (with "attach to" behavior)?

In this case, no more code would be necessary inside EVENT_PANEL_SIZE callback.

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
Message 1 of 6
(4,041 Views)

Hidden splitters are the usual way I have been handling this situation for several years and yes: I would support a suggestion to add this functionality to panel borders



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 6
(4,012 Views)

Hello vix, sometimes I have a bit of time to spend digging into NI website and today I came across this contribution from nickb that exactly addresses this scenario:

LabWindows/CVI Tip: Use Splitter Controls to Handle Panel Sizing

It seems to me it's a valuable sample code to add to CVI developer's toolbox Smiley Happy



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 3 of 6
(3,995 Views)

I've searched in the community but not in the user groups Smiley Frustrated

At least this means my idea was not so bad Smiley Wink

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 4 of 6
(3,980 Views)

I've just added a new product suggestion here.

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 6
(3,939 Views)
Solution
Accepted by topic author vix

There's also the userint\docking.prj shipping example, which does more or less the same thing.

Message 6 of 6
(3,820 Views)