| Background | The base class drawing a widget background. |
| Box | A box capable of holding child widgets. |
| ImageBackground | An image background drawing an image with optional border. |
| RoundedBackground | A somewhat fancier background with rounded corners. |
| Widget | The base class of all widgets. |
| debugDraw | Set to true to debug drawing, i.e. wait for a keystroke before drawing each widget. | ||||||||||||||||||||||||
| theme |
The "theme" property array. The base array defines the following properties:
|
| addDelayedCall(delay, f) | Add a function which will be called once after some (minimal) delay. |
| addStream(s, handler) | Add an input stream to check for input, and its handler. |
| clearIdleTick() | Clear the handler to be called repeatedly after a minimal delay. |
| exit() | Exit from the event loop. |
| getFocus():abguibase.Widget | Get the widget which currently has the focus. |
| moveFocus(backwards) | Move the focus forward or backwards. |
| removeDelayedCalls(f) | Remove a function from the list of delayed calls. |
| removeStream(s) | Remove an input stream checked for input, and the handler which was added with it. |
| requestEvents() | Setup the UI module such that the standard ui.cmd() events are requested, on which focusable widgets rely. |
| run() | Run the event handling loop. |
| setIdleTick(delay, handler) | Set a handler to be called regularly after a minimal delay, whenever the event loop is idle. |
| setRoot(root:abguibase.Widget):abguibase.Widget | Set the root of the widget hierarchy to show. |
| update() | Update the UI, i.e. perform all necessary redraws. |
The m GUI framework offers the following functionality:
This module and its accompanying modules abgui, abdialog, abfilegui can serve as a standard framework for graphical m applications. If set up properly, the abguibase.run event loop will serialize user input, external events, stream input and timer events, and call the corresponding handlers. It thus provides a common callback-driven application framework.
A simple example showing an image, a table and three radio buttons:use abgui, abguibase, ui, graph // build the UI view:abguibase.Box=abguibase.Box(); view.add(abgui.Image("tests\\mShell.png")); table:abgui.Table=abgui.Table([ ["Strawberry",1.5,false], ["Vanilla",1.3,true], ], ["Flavour", "Price", "Ok"]); view.add(table); row:abguibase.Box=abguibase.Box(3); // three horizontal buttons view.add(row); group:abgui.RadioButton=abgui.RadioButton("Now"); row.add(group); row.add(abgui.RadioButton("Later", group)); row.add(abgui.RadioButton("Never", group)); // show the view abguibase.setRoot(view); // setup the menu ui.menu("GuiSample", ["Buy", "Exit"]); do cmd=abguibase.run(); case cmd in "Buy": // do something end until cmd=null or cmd="Exit"