The bps.gui extension is a namespace assembling GUI properties and functions. More...
Classes | |
| class | MessageBox |
| A class to display message boxes. More... | |
Functions | |
| Number | exec () |
| Executes the event loop for standalone GUI scripts. | |
| Widget | loadUiFile (Widget aParent, String aFileName) |
| Loads a ui file that was created by the Qt Designer into a widget. | |
| Widget | loadUiText (Widget aParent, String aXml) |
| Loads a ui XML text that was created by the Qt Designer into a widget. | |
Variables | |
| QString | uiFileName |
| This is a convenience UI filename suggestion, derived from the script name. | |
The bps.gui extension is a namespace assembling GUI properties and functions.
The extension needs to be loaded before it can be used. Note that the bps extension will automaticly be loaded before the bps.gui extension:
var retval = 0; if (isGui) { importExtension('bps.gui'); with (bps.gui) { var ui = loadUiFile(0, uiFileName); ui.show(); retval = exec(); } } else { perror('This is a GUI script. Please run it by gui.exe, not by bps.exe.'); retval = 1; } retval;
| Number bps::gui::exec | ( | ) |
Executes the event loop for standalone GUI scripts.
Call this after showing a non-modal main widget.
| Widget bps::gui::loadUiFile | ( | Widget | aParent, |
| String | aFileName | ||
| ) |
Loads a ui file that was created by the Qt Designer into a widget.
| aParent | Parent widget object. Pass 0 if there is no parent. |
| aFileName | Name of the ui file to load. |
| Error | thrown when file can not read, or the ui content not processed without error. |
| Widget bps::gui::loadUiText | ( | Widget | aParent, |
| String | aXml | ||
| ) |
Loads a ui XML text that was created by the Qt Designer into a widget.
| aParent | Parent widget object. Pass 0 if there is no parent. |
| aXml | The XML code describing the widget. |
| Error | when the ui content not processed without error. |
| QString bps::gui::uiFileName |
This is a convenience UI filename suggestion, derived from the script name.
If scriptFileName is for example C:\test\hello.js, then uiFileName will be set to C:\test\hello.ui