Example Code

XControl Example: UI Panels with Collapse/Expand and Dock/Undock functionality

Code and Documents

Attachment

Download All

Summary:

With this example I would like to demonsrate User Interface with "Collapsible" SubPanels. All panels organized in vertical linked list like "Side Panel". Each Panel can be collapsed/expanded and can be undocked to the "floating" panel and then docked back to the list. In additional each panel may have optional menu. This example can be used for building pretty complicated and flexible User Interface. Standard Oscilloscope example was redesigned into three SubVIs and then these SubVIs was inserted into three Panels.

Function:

Technically each panel contain three panes, separated with splitters. Upper pane is Title and tool bar with three buttons. Pane in the middle is the body of panel (where own SubVI inserted). Lower pane is the container for the next panels and so on. See more details on the screenshot below.

Steps to execute code:

  1. Download attached archive
  2. Unpack this archive
  3. Open project UI Panels Example.lvproj
  4. Run VI named Oscilloscope Example.vi
  5. Press Collapse/Expand buttons, then press Dock/Undock buttons
  6. Stop this VI with stop button and explore code of XControl

Screenshots:

ScreenShot.png


VI attached below

Update: Added version saved for LabVIEW 8.0. May be will be useful for someone who haven't LabVIEW 2010.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Cedric51
Member
Member
on

Hi Andrey,

Very nice application!

In my case, instead of having the 3 VIs 'Display.vi', 'Trigger.vi' and 'Channel and position.vi', I want to use the same SubVI in the three windows. The idea is then to pass data from the main VI to the selected subVI. To do that, I think I have to use reentrant VIs but I dont know how to do that. Any suggestions?

Regards,

Cedric

KevinKM
Member
Member
on

Hi Andrey,

Your application very good, I am trying to use it in my application. There is a small bug in your program. When i click the undock button for the first time i get the error shown below. It happens only for the first time. Any suggestions how to fix this?

error.png

Regards,
KM
dsavir
Active Participant
Active Participant
on

This is totally awesome. Thank you so much for sharing!

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Peter_S
Member
Member
on

I get the same error. Problem is in subVIs\Pane Bounds to Panel Bounds.vi.

The "Pane Bounds In" Heights element is  only 5. A minimal height of 100 is ok:

Pane Bounds to Panel Bounds.png

Contributors