This plugin generates a scripted class with variables for widgets and code to find widgets by their name.
More...
|
void | Generate (notnull BaseContainer widgetSource, notnull BaseContainer exportRule, string scriptClassName, string destinationPath) |
| Generates the class name for the generated class.
|
|
bool | IsWidgetExportRequired (notnull BaseContainer ws, notnull array< BaseContainer > path) |
| Checks if conditions for widget export are satisfied.
|
|
string | ResolveWidgetVariableName (BaseContainer ws) |
| Resolves variable name for widget.
|
|
bool | ValidateWidget (BaseContainer ws) |
| Performs various validations related to exporting of this widget.
|
|
array< BaseContainer > | ResolveWidgetComponentsForExport (WidgetSource ws) |
| Generates an array of components which will be exported for this widget.
|
|
string | GenerateScriptClassName (string path, notnull BaseContainer exportRule) |
|
string | ResolveDestinationPath (string fileOutName) |
| Resolves the target directory where the file must be saved.
|
|
bool | ButtonOK () |
|
bool | ButtonCancel () |
|
|
static void | BuildWidgetArray (notnull BaseContainer ws, notnull array< BaseContainer > pathToThis, notnull out array< BaseContainer > outArray, notnull out array< ref array< BaseContainer > > outArrayPaths) |
| Converts a widget tree into a widget array.
|
|
static string | GetStringPathToWidget (notnull array< BaseContainer > path) |
| Returns path to widget separated with dots First widget is omitted.
|
|
static string | GetWidgetName (BaseContainer ws) |
|
static void | _print (string str, LogLevel logLevel=LogLevel.NORMAL) |
| Prefixes Print() calls with "[SCR_GenerateLayoutClassPlugin] ".
|
|
This plugin generates a scripted class with variables for widgets and code to find widgets by their name.
It also generates code to find all widget components.
◆ _print()
static void SCR_GenerateLayoutClassPlugin._print |
( |
string | str, |
|
|
LogLevel | logLevel = LogLevel::NORMAL ) |
|
staticprotected |
Prefixes Print() calls with "[SCR_GenerateLayoutClassPlugin] ".
◆ BuildWidgetArray()
static void SCR_GenerateLayoutClassPlugin.BuildWidgetArray |
( |
notnull BaseContainer | ws, |
|
|
notnull array< BaseContainer > | pathToThis, |
|
|
notnull out array< BaseContainer > | outArray, |
|
|
notnull out array< ref array< BaseContainer > > | outArrayPaths ) |
|
staticprotected |
Converts a widget tree into a widget array.
- Parameters
-
[in] | ws | |
[in] | pathToThis | |
[out] | outArray | - each element will contain a WidgetSource |
[out] | outArrayPaths | - each element will contain a path to this widget, including this widget |
◆ ButtonCancel()
bool SCR_GenerateLayoutClassPlugin.ButtonCancel |
( |
| ) |
|
|
protected |
◆ ButtonOK()
bool SCR_GenerateLayoutClassPlugin.ButtonOK |
( |
| ) |
|
|
protected |
◆ Generate()
void SCR_GenerateLayoutClassPlugin.Generate |
( |
notnull BaseContainer | widgetSource, |
|
|
notnull BaseContainer | exportRule, |
|
|
string | scriptClassName, |
|
|
string | destinationPath ) |
|
protected |
Generates the class name for the generated class.
- Parameters
-
[in] | widgetSource | |
[in] | exportRule | |
[in] | scriptClassName | |
[in] | destinationPath | |
◆ GenerateScriptClassName()
string SCR_GenerateLayoutClassPlugin.GenerateScriptClassName |
( |
string | path, |
|
|
notnull BaseContainer | exportRule ) |
|
protected |
◆ GetStringPathToWidget()
static string SCR_GenerateLayoutClassPlugin.GetStringPathToWidget |
( |
notnull array< BaseContainer > | path | ) |
|
|
staticprotected |
Returns path to widget separated with dots First widget is omitted.
- Parameters
-
[in] | path | array of base containers |
- Returns
- path compliant with Widget.FindWidget() or "_error_" if path is empty
◆ GetWidgetName()
static string SCR_GenerateLayoutClassPlugin.GetWidgetName |
( |
BaseContainer | ws | ) |
|
|
staticprotected |
- Parameters
-
- Returns
- widget's Name property, or empty string in case of no Name property
◆ IsWidgetExportRequired()
bool SCR_GenerateLayoutClassPlugin.IsWidgetExportRequired |
( |
notnull BaseContainer | ws, |
|
|
notnull array< BaseContainer > | path ) |
|
protected |
Checks if conditions for widget export are satisfied.
◆ ResolveDestinationPath()
string SCR_GenerateLayoutClassPlugin.ResolveDestinationPath |
( |
string | fileOutName | ) |
|
|
protected |
Resolves the target directory where the file must be saved.
◆ ResolveWidgetComponentsForExport()
array< BaseContainer > SCR_GenerateLayoutClassPlugin.ResolveWidgetComponentsForExport |
( |
WidgetSource | ws | ) |
|
|
protected |
Generates an array of components which will be exported for this widget.
◆ ResolveWidgetVariableName()
string SCR_GenerateLayoutClassPlugin.ResolveWidgetVariableName |
( |
BaseContainer | ws | ) |
|
|
protected |
Resolves variable name for widget.
◆ Run()
override void SCR_GenerateLayoutClassPlugin.Run |
( |
| ) |
|
◆ ValidateWidget()
bool SCR_GenerateLayoutClassPlugin.ValidateWidget |
( |
BaseContainer | ws | ) |
|
|
protected |
Performs various validations related to exporting of this widget.
- Returns
- widget export validity
◆ DIALOG_CAPTION
◆ INTRO_TEXT
const string SCR_GenerateLayoutClassPlugin.INTRO_TEXT = "This plugin autogenerates widget-binding scripts for .layout files.\n\n" |
|
staticprotected |
◆ PLUGIN_NAME
const string SCR_GenerateLayoutClassPlugin.PLUGIN_NAME = "Generate Class from Layout" |
|
staticprotected |
◆ PLUGIN_VERSION
const string SCR_GenerateLayoutClassPlugin.PLUGIN_VERSION = "0.5.1" |
|
staticprotected |
The documentation for this interface was generated from the following file:
- WorkbenchGame/ResourceManager/SCR_GenerateLayoutClassPlugin.c