Python Script Engine
1.0
GL Studio Editor Python Script API
|
Classes | |
class | DocumentArray |
Functions | |
Module Methods | |
Methods that can be called on the module. | |
String | MakeValidObjectName (String inputStr) |
int | Choice (String button0, String button1, String button2, String text) |
int | ChoiceWithDefault (String button0, String button1, String button2, int defaultChoice, String text) |
bool | Question (String s) |
bool | QuestionDefault (String s, bool defaultAnswer) |
void | Error (String s) |
void | MsgBox (String s) |
String | SaveDialog (String caption, String directory, String filters, String defaultSuffix=String()) |
String | OpenDialog (String caption, String directory, String filters, bool isCreateFileAllowed=false) |
String | OpenDirectoryDialog (String caption, String directory) |
std::vector< String > | OpenMultiselectDialog (String caption, String directory, String filters) |
String | GetApplicationLanguage () |
void | RegisterAlternateClassPathChooser (PyObject *pyfunc) |
void | UnregisterAlternateClassPathChooser () |
void | RegisterCatalyzerScriptChooser (PyObject *pyfunc) |
void | UnregisterCatalyzerScriptChooser () |
The Editor Python Script Engine global features.
int Choice | ( | String | button0, |
String | button1, | ||
String | button2, | ||
String | text | ||
) |
Creates and shows a pop-up dialog box and displays a text string and up to (3) buttons labeled according to the first three input parameters.
To hide any of the buttons, pass an empty string to the corresponding param. A question icon is displayed. This is equivalent to the fltk "fl_choice" message type.
button0 | The label for button 0 (ESC is shortcut for this Right button) |
button1 | The label for button 1 (RET is shortcut for this Center button) |
button2 | The label for button 2 (left-most button) |
text | The text string to display |
int ChoiceWithDefault | ( | String | button0, |
String | button1, | ||
String | button2, | ||
int | defaultChoice, | ||
String | text | ||
) |
Creates and shows a pop-up dialog box and displays a text string and up to (3) buttons labeled according to the first three input parameters.
To hide any of the buttons, pass an empty string to the corresponding param. A question icon is displayed. This is equivalent to the fltk "fl_choice" message type.
button0 | The label for button 0 (ESC is shortcut for this Right button) |
button1 | The label for button 1 (RET is shortcut for this Center button) |
button2 | The label for button 2 (left-most button) |
defaultChoice | The value returned when in command-line mode |
text | The text string to display |
void Error | ( | String | s | ) |
Creates and shows a pop-up dialog box and displays a text string and (1) button labeled 'OK'.
An exclamation icon is displayed. This is equivalent to the fltk "fl_alert" message type.
s | The text string to display |
String GetApplicationLanguage | ( | ) |
Returns the language code that is currently in use.
String MakeValidObjectName | ( | String | inputStr | ) |
Make a string a valid C++ identifier.
inputStr | a string that will be converted to a valid C++ identifier |
if | the inputStr could not be made into a valid C++ identifier. |
void MsgBox | ( | String | s | ) |
Creates and shows a pop-up dialog box and displays a text string and (1) button labeled 'OK'.
An 'i' (information) icon is displayed. This is equivalent to the fltk "fl_message" message type.
s | The text string to display |
String OpenDialog | ( | String | caption, |
String | directory, | ||
String | filters, | ||
bool | isCreateFileAllowed = false |
||
) |
Displays an open dialog.
caption | The dialog box title | |
[in,out] | directory | As input, the starting directory; as output, the returning the chosen directory. |
filters | The filters of the form "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" | |
isCreateFileAllowed | If enabled, allows the file dialog to create new files |
String OpenDirectoryDialog | ( | String | caption, |
String | directory | ||
) |
Displays an open directory dialog.
caption | The dialog box title | |
[in,out] | directory | As input, the starting directory; as output, the returning the chosen directory. |
std::vector<String > OpenMultiselectDialog | ( | String | caption, |
String | directory, | ||
String | filters | ||
) |
Displays an open dialog.
caption | The dialog box title. | |
[in,out] | directory | As input, the starting directory; as output, the returning the chosen directory. |
filters | The filters of the form "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" |
bool Question | ( | String | s | ) |
Creates and shows a pop-up dialog box and displays a text string and (2) buttons labeled 'Yes' and 'No'.
A question mark icon is displayed. This is equivalent to the fltk "fl_choice" message type.
s | The text string to display |
bool QuestionDefault | ( | String | s, |
bool | defaultAnswer | ||
) |
Creates and shows a pop-up dialog box and displays a text string and (2) buttons labeled 'Yes' and 'No'.
A question mark icon is displayed. This is equivalent to the fltk "fl_choice" message type. This calls ChoiceWithDefault with buttons for "Yes" and "No.
s | The text string to display |
defaultAnswer | The value returned when in command-line mode |
void RegisterAlternateClassPathChooser | ( | PyObject * | pyfunc | ) |
Register a function that can provide a path to an alternate class header file.
Overwrites any previously registered alternate class path chooser
pyfunc | the python function to call. Should take no parameters and return a string which is a path to the alternate class header (either an absolute file path or a path relative to the gls file) |
void RegisterCatalyzerScriptChooser | ( | PyObject * | pyfunc | ) |
Register a function that can provide a path to an Catalyzer Script.
Overwrites any previously registered catalyzer script chooser
pyfunc | the python function to call. Should take no parameters and return a string which is a path to catalyzer script (either an absolute file path or a path relative to the gls file) |
String SaveDialog | ( | String | caption, |
String | directory, | ||
String | filters, | ||
String | defaultSuffix = String () |
||
) |
Displays a save dialog.
caption | The dialog box title | |
[in,out] | directory | As input, the starting directory; as output, the returning the chosen directory. |
filters | The filters of the form "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" | |
defaultSuffix | the default extension to add if the user does not provide one. Can be NULL. |
void UnregisterAlternateClassPathChooser | ( | ) |
Clears out any registered alternate clas path chooser so that the default alternate class path chooser is used.
void UnregisterCatalyzerScriptChooser | ( | ) |
Clears out any registered catalyzer script chooser so that the default catlyzer script chooser is used.