Helm Panels have always been able to launch other panels and documents, and now you can control those additional “windows” once they have launched. Helm V2.32 adds new features for window management, which allow a master panel to communicate with sub-panels or applications that it has launched.
Launching applications and panels.
All commands for window management are provided by the “Root Panel” object. There are two script commands that can be used to open new windows.
LAUNCH can only be used to launch Helm Panels.
RootPanel: Launch (“c:\mypanel.helm”) – launches the panel “mypanel.helm”
RUNAPP takes the same parameters, but can be used to open any document, web page or application.
RootPanel: RunApp (“notepad.exe”) – launches the Notepad editor.
RootPanel: RunApp (“notepad.exe”,”c:\\data.txt”) – launches the Notepad editor with file “c:\data.txt”
RootPanel: RunApp (“c:\document.pdf”) – opens the file “document.pdf” using your preferred PDF document reader.
RootPanel: RunApp (“http://www.rascular.com”) – opens the Rascular website using your preferred browser.
Managing panels after launch.
In order to control panels after you’ve launched them, we need a way of referring to them. To achieve this, there’s an additional “WindowName” parameter for the Launch and RunApp commands. You can give any Window Name you like to a launched panel. If you leave it empty, the panel will work, but you won’t be able to send control commands to it.
Because you can’t give two windows the same name, using Launch or RunApp with an existing Window Name will bring the original window to the front.
Let’s say we want to have one master panel, which occupies the left side of the screen, and a couple of different overlapping sub-panels on the right side. The subpanels might be controlling audio and keyers respectively.
We can make our master panel automatically launch the sub-panels when it starts. To do this, we must write a script for the Root Panel “OnStartup”event. We’ll give these two panels the WindowNames “keyers” and “audio”.
RootPanel: Launch (“c:\keyerpanel.helm”, “”, “keyers”)
RootPanel: Launch (“c:\audiopanel.helm”, “”, “audio”)
Now, we want buttons to switch between the sub-panels. Place two buttons on the master panel, and set their OnClick script to call the “Root Panel:Restore” command. This takes the Window Name of a previously opened window as a parameter.
Button 1: OnClick
RootPanel: Restore (“keyers”)
Button 2: OnClick
RootPanel: Restore (“audio”)
“Restore” will bring the chosen window to the front, at its normal size and position.
When we run the panel, the two sub-panels will be launched. We can bring either to the front, using the buttons on the master panel.
We can also make the sub-panels close by adding commands to the master panel’s “OnShutDown” script:
RootPanel: Close (“keyers”)
RootPanel: Close (“audio”)
List of Window Management commands
Launch – Launch another Helm Panel.
RunApp – Launch any document, application or URL.
Close – Close a window.
Maximize – Maximize a window to the Full Screen.
Minimize – Minimize a window to the TaskBar
Restore – Restore a minimized window to original size. This also brings the window to the front.
Resize – Set the size (in pixels) of a window.
Move – Move a window to a specific pixel position on screen.