FlightGear next
FGDialog Class Referenceabstract

An XML-configured dialog box. More...

#include <dialog.hxx>

Inherits SGWeakReferenced.

Inherited by FGPUICompatDialog.

Public Types

enum  WindowStyle { Window , ModalDialog , MessageBox }
 
enum  WindowFlags { Resizable = 1 << 0 , Closeable = 1 << 1 , ButtonBox = 1 << 2 }
 

Public Member Functions

virtual ~FGDialog ()
 Destructor.
 
virtual void updateValues (const std::string &objectName="")=0
 Update the values of all GUI objects with a specific name, or all if an empty name is given (default).
 
virtual void applyValues (const std::string &objectName="")=0
 Apply the values of all GUI objects with a specific name, or all if an empty name is given (default)
 
virtual void update ()=0
 Update state.
 
virtual const char * getName ()
 
virtual void bringToFront ()
 
virtual void close ()=0
 Close the dialog.
 
WindowStyle windowStyle () const
 
bool isFlagSet (WindowFlags f) const
 
virtual void runCallback (const std::string &name, SGPropertyNode_ptr args={})=0
 
std::string translationDomain () const noexcept
 Return the translation domain of the dialog.
 
void setTranslationDomain (std::string domain) noexcept
 Set the translation domain of the dialog.
 

Protected Member Functions

 FGDialog (SGPropertyNode *props, std::string translationDomain="core")
 Construct a new GUI widget configured by a property tree.
 

Detailed Description

An XML-configured dialog box.

The GUI manager stores only the property tree for the dialog boxes. This class creates a PUI dialog box on demand from the properties in that tree. The manager recreates the dialog every time it needs to show it.

Definition at line 20 of file dialog.hxx.

Member Enumeration Documentation

◆ WindowFlags

Enumerator
Resizable 
Closeable 
ButtonBox 

Definition at line 79 of file dialog.hxx.

◆ WindowStyle

Enumerator
Window 
ModalDialog 
MessageBox 

Definition at line 73 of file dialog.hxx.

Constructor & Destructor Documentation

◆ ~FGDialog()

FGDialog::~FGDialog ( )
virtualdefault

Destructor.

◆ FGDialog()

FGDialog::FGDialog ( SGPropertyNode * props,
std::string translationDomain = "core" )
protected

Construct a new GUI widget configured by a property tree.

The configuration properties are not part of the main FlightGear property tree; the GUI manager reads them from individual configuration files.

Parameters
propsA property tree describing the dialog.
translationDomaindomain used to fetch translations of dialog elements such as labels

The translationDomain may be overwridden from props.

Definition at line 45 of file dialog.cxx.

Member Function Documentation

◆ applyValues()

virtual void FGDialog::applyValues ( const std::string & objectName = "")
pure virtual

Apply the values of all GUI objects with a specific name, or all if an empty name is given (default)

This method copies values from the GUI object(s) to the FlightGear property tree.

Parameters
objectNameThe name of the GUI object(s) to update. Use the empty name for all objects.

Implemented in FGPUICompatDialog.

◆ bringToFront()

virtual void FGDialog::bringToFront ( )
inlinevirtual

Reimplemented in FGPUICompatDialog.

Definition at line 64 of file dialog.hxx.

◆ close()

virtual void FGDialog::close ( )
pure virtual

Close the dialog.

This should actually close the GUI assets associated, if you want an 'are you sure?' interaction, it needs to be handled in advance of this interaction.

Implemented in FGPUICompatDialog.

◆ getName()

virtual const char * FGDialog::getName ( )
inlinevirtual

Reimplemented in FGPUICompatDialog.

Definition at line 63 of file dialog.hxx.

◆ isFlagSet()

bool FGDialog::isFlagSet ( WindowFlags f) const

Definition at line 93 of file dialog.cxx.

◆ runCallback()

virtual void FGDialog::runCallback ( const std::string & name,
SGPropertyNode_ptr args = {} )
pure virtual

Implemented in FGPUICompatDialog.

◆ setTranslationDomain()

void FGDialog::setTranslationDomain ( std::string domain)
noexcept

Set the translation domain of the dialog.

This is the domain used to fetch translations of dialog elements such as labels.

Definition at line 66 of file dialog.cxx.

◆ translationDomain()

std::string FGDialog::translationDomain ( ) const
noexcept

Return the translation domain of the dialog.

This is the domain used to fetch translations of dialog elements such as labels.

Definition at line 61 of file dialog.cxx.

◆ update()

virtual void FGDialog::update ( )
pure virtual

Update state.

Called on active dialogs before rendering.

Implemented in FGPUICompatDialog.

◆ updateValues()

virtual void FGDialog::updateValues ( const std::string & objectName = "")
pure virtual

Update the values of all GUI objects with a specific name, or all if an empty name is given (default).

This method copies values from the FlightGear property tree to the GUI object(s).

Parameters
objectNameThe name of the GUI object(s) to update. Use the empty name for all objects.

Implemented in FGPUICompatDialog.

◆ windowStyle()

FGDialog::WindowStyle FGDialog::windowStyle ( ) const

Definition at line 88 of file dialog.cxx.


The documentation for this class was generated from the following files: