FlightGear next
|
XML-configured GUI subsystem. More...
#include <new_gui.hxx>
Inherits SGSubsystem.
Public Types | |
using | FGDialogRef = SGSharedPtr<FGDialog> |
Public Member Functions | |
NewGUI () | |
Constructor. | |
virtual | ~NewGUI () |
Destructor. | |
void | bind () override |
void | init () override |
void | reinit () override |
void | shutdown () override |
void | unbind () override |
void | update (double delta_time_sec) override |
void | postinit () override |
virtual void | redraw () |
Redraw the GUI picking up new GUI colors. | |
virtual void | newDialog (SGPropertyNode *node) |
Creates a new dialog box, using the same property format as the gui/dialogs configuration files. | |
virtual bool | showDialog (const std::string &name) |
Display a dialog box. | |
virtual bool | toggleDialog (const std::string &name) |
Toggle display of a dialog box. | |
virtual bool | closeActiveDialog () |
Close the currenty active dialog. | |
virtual bool | closeDialog (const std::string &name) |
Close a named dialog, if it is open. | |
virtual SGPropertyNode_ptr | getDialogProperties (const std::string &name) |
Get dialog property tree's root node. | |
virtual FGMenuBar * | getMenuBar () |
Return a pointer to the current menubar. | |
virtual void | setActiveDialog (FGDialog *dialog) |
Ignore this method. | |
virtual FGDialogRef | getActiveDialog () |
Get the dialog currently active, if any. | |
virtual FGDialogRef | getDialog (const std::string &name) |
Get the named dialog if active. | |
virtual FGColor * | getColor (const char *name) const |
virtual FGColor * | getColor (const std::string &name) const |
Static Public Member Functions | |
static const char * | staticSubsystemClassId () |
Protected Member Functions | |
virtual bool | getMenuBarVisible () const |
Test if the menubar is visible. | |
virtual void | setMenuBarVisible (bool visible) |
Show or hide the menubar. | |
virtual void | setStyle () |
virtual void | reset (bool reload) |
Used by reinit() and redraw() to close all dialogs and to apply current GUI colors. | |
bool | getMenuBarOverlapHide () const |
void | setMenuBarOverlapHide (bool hide) |
XML-configured GUI subsystem.
This subsystem manages the graphical user interface for FlightGear. It creates a menubar from the XML configuration file in $FG_ROOT/gui/menubar.xml, then stores the configuration properties for XML-configured dialog boxes found in $FG_ROOT/gui/dialogs/. It can show or hide the menubar, and can display any dialog by name.
Definition at line 30 of file new_gui.hxx.
using NewGUI::FGDialogRef = SGSharedPtr<FGDialog> |
Definition at line 33 of file new_gui.hxx.
NewGUI::NewGUI | ( | ) |
Constructor.
Definition at line 64 of file new_gui.cxx.
|
virtual |
Destructor.
Definition at line 68 of file new_gui.cxx.
|
override |
Definition at line 246 of file new_gui.cxx.
|
virtual |
Close the currenty active dialog.
This function is intended to be called from code (pui callbacks, for instance) that registers its dialog object as active via setActiveDialog(). Other user-level code should use the closeDialog(name) API.
Definition at line 337 of file new_gui.cxx.
|
virtual |
Close a named dialog, if it is open.
name | The name of the dialog box. |
Definition at line 369 of file new_gui.cxx.
|
virtual |
Get the dialog currently active, if any.
Definition at line 432 of file new_gui.cxx.
|
inlinevirtual |
Definition at line 151 of file new_gui.hxx.
|
inlinevirtual |
Definition at line 155 of file new_gui.hxx.
|
virtual |
Get the named dialog if active.
Definition at line 413 of file new_gui.cxx.
|
virtual |
Get dialog property tree's root node.
name | The name of the dialog box. |
Definition at line 384 of file new_gui.cxx.
|
virtual |
Return a pointer to the current menubar.
Definition at line 438 of file new_gui.cxx.
|
protected |
Definition at line 465 of file new_gui.cxx.
|
protectedvirtual |
Test if the menubar is visible.
This method exists only for binding.
Definition at line 444 of file new_gui.cxx.
|
override |
Definition at line 116 of file new_gui.cxx.
|
virtual |
Creates a new dialog box, using the same property format as the gui/dialogs configuration files.
Does not display the resulting dialog. If a pre-existing dialog of the same name exists, it will be deleted. The node argument will be stored in the GUI subsystem using SGPropertNode_ptr reference counting. It should not be deleted by user code.
node | A property node containing the dialog definition |
Definition at line 479 of file new_gui.cxx.
|
override |
Definition at line 255 of file new_gui.cxx.
|
virtual |
Redraw the GUI picking up new GUI colors.
Definition at line 176 of file new_gui.cxx.
|
override |
Definition at line 169 of file new_gui.cxx.
|
protectedvirtual |
Used by reinit() and redraw() to close all dialogs and to apply current GUI colors.
If "reload" is false, reopens all dialogs. Otherwise reloads all XML dialog files from disk and reopens all but Nasal * generated dialogs, omitting dynamic widgets. (This is only useful for GUI development.)
Definition at line 212 of file new_gui.cxx.
|
virtual |
Ignore this method.
This method is for internal use only, but it has to be public so that a non-class callback can see it.
Definition at line 423 of file new_gui.cxx.
|
protected |
Definition at line 471 of file new_gui.cxx.
|
protectedvirtual |
Show or hide the menubar.
This method exists only for binding.
Definition at line 454 of file new_gui.cxx.
|
protectedvirtual |
Definition at line 579 of file new_gui.cxx.
|
virtual |
Display a dialog box.
At initialization time, the subsystem reads all of the XML configuration files from the directory $FG_ROOT/gui/dialogs/. The configuration for each dialog specifies a name, and this method invokes the dialog with the name specified (if it exists).
name | The name of the dialog box. |
Definition at line 281 of file new_gui.cxx.
|
override |
Definition at line 157 of file new_gui.cxx.
|
inlinestatic |
Definition at line 55 of file new_gui.hxx.
|
virtual |
Toggle display of a dialog box.
name | The name of the dialog box. |
Definition at line 324 of file new_gui.cxx.
|
override |
Definition at line 251 of file new_gui.cxx.
|
override |
Definition at line 272 of file new_gui.cxx.