Shiny Language Reference

Language Reference > User Interface


savelayout

bool savelayout();

bool savelayout(string LayoutFile);

 

Saves the current panel layout

As of Brass v0.21, all plugins can take advantage of the 100% Configuration System. This system allows for the plugin display panel to be designed visually by the plugin developer, then altered by any user of the plugin simply by pointing and clicking.

You can find a comprehensive description of the layout load and save process, and the structure behind it at the loadlayout reference page.

When called without an optional filename parameter, the SAVELAYOUT statement saves the current panel layout to the current user's layout file found in <Brass Install Folder>\SSE\<Plugin Name>\<UserName>_layout.sld. Under normal circumstances you will call SAVELAYOUT as the last statement in your Shutdown handler.

When called with a filename parameter, Brass will save the current panel layout to the specified file. Brass will only save the layout for controls originally created with the Panel Designer. Dynamically created controls are omitted from the save as Brass has no way to be sure that the same control will be created the next time the plugin is loaded.

 

Parameters

LayoutFile

Optional. Brass will save the current layout into the specified file.

 

Return Value

TRUE if the saving process succeeded, otherwise FALSE.

 

Example Code

Assuming a layout has been created with the Panel Designer, the following code is a complete plugin that will load the controls and enable the 100% Configuration System.

function Init()
{
    // Load the user's layout, or the default layout if no custom layout exists
    loadlayout();
}

function Shutdown()
{
    // Save the current layout ready for the next time the user loads the plugin
    savelayout();
}