FlightGear next
FGPUICompatDialog Class Reference

An XML-configured dialog box. More...

#include <FGPUICompatDialog.hxx>

Inherits FGDialog.

Classes

class  DialogPeer
 

Public Member Functions

 FGPUICompatDialog (SGPropertyNode *props, std::string translationDomain="core")
 Construct a new GUI widget configured by a property tree.
 
virtual ~FGPUICompatDialog ()
 Destructor.
 
virtual void updateValues (const std::string &objectName="")
 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="")
 Apply the values of all GUI objects with a specific name, or all if an empty name is given (default).
 
bool init ()
 
void update () override
 Update state.
 
void relayout ()
 Recompute the dialog's layout.
 
void setNeedsLayout ()
 
virtual const char * getName ()
 
virtual void bringToFront ()
 
std::string nameString () const
 
std::string nasalModule () const
 
SGRectd geometry () const
 
double getX () const
 
double getY () const
 
double width () const
 
double height () const
 
void close () override
 Close the dialog.
 
std::string title () const
 
void setTitle (const std::string &s)
 
const std::string & windowType () const
 
uint32_t uiVersion () const
 return the UI XML syntax version used by this dialog.
 
PUICompatObjectRef widgetByName (const std::string &name) const
 find the dialog widget with the specified name, or nullptr.
 
void runCallback (const std::string &name, SGPropertyNode_ptr args) override
 
- Public Member Functions inherited from FGDialog
virtual ~FGDialog ()
 Destructor.
 
WindowStyle windowStyle () const
 
bool isFlagSet (WindowFlags f) const
 
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.
 

Static Public Member Functions

static void setupGhost (nasal::Hash &compatModule)
 

Friends

naRef f_makeDialogPeer (const nasal::CallContext &ctx)
 
naRef f_dialogRootObject (FGPUICompatDialog &dialog, naContext c)
 

Additional Inherited Members

- Public Types inherited from FGDialog
enum  WindowStyle { Window , ModalDialog , MessageBox }
 
enum  WindowFlags { Resizable = 1 << 0 , Closeable = 1 << 1 , ButtonBox = 1 << 2 }
 
- Protected Member Functions inherited from FGDialog
 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 35 of file FGPUICompatDialog.hxx.

Constructor & Destructor Documentation

◆ FGPUICompatDialog()

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

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 115 of file FGPUICompatDialog.cxx.

◆ ~FGPUICompatDialog()

FGPUICompatDialog::~FGPUICompatDialog ( )
virtual

Destructor.

Definition at line 125 of file FGPUICompatDialog.cxx.

Member Function Documentation

◆ applyValues()

void FGPUICompatDialog::applyValues ( const std::string & objectName = "")
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.

Implements FGDialog.

Definition at line 237 of file FGPUICompatDialog.cxx.

◆ bringToFront()

void FGPUICompatDialog::bringToFront ( )
virtual

Reimplemented from FGDialog.

Definition at line 201 of file FGPUICompatDialog.cxx.

◆ close()

void FGPUICompatDialog::close ( )
overridevirtual

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.

Implements FGDialog.

Definition at line 130 of file FGPUICompatDialog.cxx.

◆ geometry()

SGRectd FGPUICompatDialog::geometry ( ) const

Definition at line 317 of file FGPUICompatDialog.cxx.

◆ getName()

const char * FGPUICompatDialog::getName ( )
virtual

Reimplemented from FGDialog.

Definition at line 227 of file FGPUICompatDialog.cxx.

◆ getX()

double FGPUICompatDialog::getX ( ) const

Definition at line 297 of file FGPUICompatDialog.cxx.

◆ getY()

double FGPUICompatDialog::getY ( ) const

Definition at line 302 of file FGPUICompatDialog.cxx.

◆ height()

double FGPUICompatDialog::height ( ) const

Definition at line 312 of file FGPUICompatDialog.cxx.

◆ init()

bool FGPUICompatDialog::init ( )

Definition at line 154 of file FGPUICompatDialog.cxx.

◆ nameString()

std::string FGPUICompatDialog::nameString ( ) const

Definition at line 322 of file FGPUICompatDialog.cxx.

◆ nasalModule()

std::string FGPUICompatDialog::nasalModule ( ) const

Definition at line 327 of file FGPUICompatDialog.cxx.

◆ relayout()

void FGPUICompatDialog::relayout ( )

Recompute the dialog's layout.

Definition at line 260 of file FGPUICompatDialog.cxx.

◆ runCallback()

void FGPUICompatDialog::runCallback ( const std::string & name,
SGPropertyNode_ptr args )
overridevirtual

Implements FGDialog.

Definition at line 206 of file FGPUICompatDialog.cxx.

◆ setNeedsLayout()

void FGPUICompatDialog::setNeedsLayout ( )
inline

Definition at line 101 of file FGPUICompatDialog.hxx.

◆ setTitle()

void FGPUICompatDialog::setTitle ( const std::string & s)

Definition at line 349 of file FGPUICompatDialog.cxx.

◆ setupGhost()

void FGPUICompatDialog::setupGhost ( nasal::Hash & compatModule)
static

Definition at line 87 of file FGPUICompatDialog.cxx.

◆ title()

std::string FGPUICompatDialog::title ( ) const

Definition at line 338 of file FGPUICompatDialog.cxx.

◆ uiVersion()

uint32_t FGPUICompatDialog::uiVersion ( ) const
inline

return the UI XML syntax version used by this dialog.

0 = no version specified explicitly, 1 = compatible with PUI dialogs in older versions of FlightGear. Higher numbers indicate features than only work with the updated XML UI.

Definition at line 136 of file FGPUICompatDialog.hxx.

◆ update()

void FGPUICompatDialog::update ( )
overridevirtual

Update state.

Called on active dialogs before rendering.

Implements FGDialog.

Definition at line 242 of file FGPUICompatDialog.cxx.

◆ updateValues()

void FGPUICompatDialog::updateValues ( const std::string & objectName = "")
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.

Implements FGDialog.

Definition at line 232 of file FGPUICompatDialog.cxx.

◆ widgetByName()

PUICompatObjectRef FGPUICompatDialog::widgetByName ( const std::string & name) const

find the dialog widget with the specified name, or nullptr.

Definition at line 355 of file FGPUICompatDialog.cxx.

◆ width()

double FGPUICompatDialog::width ( ) const

Definition at line 307 of file FGPUICompatDialog.cxx.

◆ windowType()

const std::string & FGPUICompatDialog::windowType ( ) const
inline

Definition at line 124 of file FGPUICompatDialog.hxx.

Friends And Related Symbol Documentation

◆ f_dialogRootObject

naRef f_dialogRootObject ( FGPUICompatDialog & dialog,
naContext c )
friend

Definition at line 69 of file FGPUICompatDialog.cxx.

◆ f_makeDialogPeer

naRef f_makeDialogPeer ( const nasal::CallContext & ctx)
friend

Definition at line 76 of file FGPUICompatDialog.cxx.


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