Maintenance: FGPUIDialog
Inconsistent whitespace.
This commit is contained in:
parent
a3c4dcf522
commit
cc2336c5fa
2 changed files with 568 additions and 585 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,14 @@
|
|||
// FGPUIDialog.hxx - XML-configured dialog box.
|
||||
|
||||
#ifndef FG_PUI_DIALOG_HXX
|
||||
#define FG_PUI_DIALOG_HXX 1
|
||||
#pragma once
|
||||
|
||||
#include "dialog.hxx"
|
||||
|
||||
#include <plib/puAux.h>
|
||||
|
||||
#include <simgear/props/props.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/props/condition.hxx>
|
||||
#include <simgear/props/props.hxx>
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
@ -21,9 +20,13 @@
|
|||
#define FGCLASS_WAYPOINTLIST 0x00000008
|
||||
#define FGCLASS_LOGLIST 0x00000010
|
||||
|
||||
class GUI_ID { public: GUI_ID(int id) : id(id) {} virtual ~GUI_ID() {} int id; };
|
||||
|
||||
|
||||
class GUI_ID
|
||||
{
|
||||
public:
|
||||
GUI_ID(int id) : id(id) {}
|
||||
virtual ~GUI_ID() {}
|
||||
int id;
|
||||
};
|
||||
|
||||
class NewGUI;
|
||||
class FGColor;
|
||||
|
@ -41,7 +44,6 @@ class puFont;
|
|||
class FGPUIDialog : public FGDialog
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Construct a new GUI widget configured by a property tree.
|
||||
*
|
||||
|
@ -51,13 +53,13 @@ public:
|
|||
*
|
||||
* @param props A property tree describing the dialog.
|
||||
*/
|
||||
FGPUIDialog (SGPropertyNode * props);
|
||||
FGPUIDialog(SGPropertyNode* props);
|
||||
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
virtual ~FGPUIDialog ();
|
||||
virtual ~FGPUIDialog();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -89,7 +91,7 @@ public:
|
|||
/**
|
||||
* Update state. Called on active dialogs before rendering.
|
||||
*/
|
||||
virtual void update ();
|
||||
virtual void update();
|
||||
|
||||
/**
|
||||
* Recompute the dialog's layout
|
||||
|
@ -97,10 +99,11 @@ public:
|
|||
void relayout();
|
||||
|
||||
|
||||
void setNeedsLayout() {
|
||||
void setNeedsLayout()
|
||||
{
|
||||
_needsRelayout = true;
|
||||
}
|
||||
virtual const char * getName();
|
||||
virtual const char* getName();
|
||||
virtual void bringToFront();
|
||||
|
||||
class ActiveWidget
|
||||
|
@ -108,8 +111,8 @@ public:
|
|||
public:
|
||||
virtual void update() = 0;
|
||||
};
|
||||
private:
|
||||
|
||||
private:
|
||||
enum {
|
||||
BACKGROUND = 0x01,
|
||||
FOREGROUND = 0x02,
|
||||
|
@ -121,40 +124,40 @@ private:
|
|||
};
|
||||
|
||||
// Show the dialog.
|
||||
void display (SGPropertyNode * props);
|
||||
void display(SGPropertyNode* props);
|
||||
|
||||
// Build the dialog or a subobject of it.
|
||||
puObject * makeObject (SGPropertyNode * props,
|
||||
puObject* makeObject(SGPropertyNode* props,
|
||||
int parentWidth, int parentHeight);
|
||||
|
||||
// Common configuration for all GUI objects.
|
||||
void setupObject (puObject * object, SGPropertyNode * props);
|
||||
void setupObject(puObject* object, SGPropertyNode* props);
|
||||
|
||||
// Common configuration for all GUI group objects.
|
||||
void setupGroup (puGroup * group, SGPropertyNode * props,
|
||||
void setupGroup(puGroup* group, SGPropertyNode* props,
|
||||
int width, int height, bool makeFrame = false);
|
||||
|
||||
// Set object colors: the "which" argument defines which color qualities
|
||||
// (PUCOL_LABEL, etc.) should pick up the <color> property.
|
||||
void setColor(puObject * object, SGPropertyNode * props, int which = 0);
|
||||
void setColor(puObject* object, SGPropertyNode* props, int which = 0);
|
||||
|
||||
// return key code number for keystring
|
||||
int getKeyCode(const char *keystring);
|
||||
int getKeyCode(const char* keystring);
|
||||
|
||||
/**
|
||||
* Apply layout sizes to a tree of puObjects
|
||||
*/
|
||||
void applySize(puObject *object);
|
||||
void applySize(puObject* object);
|
||||
|
||||
// The top-level PUI object.
|
||||
puObject * _object;
|
||||
puObject* _object;
|
||||
|
||||
// The GUI subsystem.
|
||||
NewGUI * _gui;
|
||||
NewGUI* _gui;
|
||||
|
||||
// The dialog font. Defaults to the global gui font, but can get
|
||||
// overridden by a top level font definition.
|
||||
puFont * _font;
|
||||
puFont* _font;
|
||||
|
||||
// The source xml tree, so that we can pass data back, such as the
|
||||
// last position.
|
||||
|
@ -171,25 +174,26 @@ private:
|
|||
// with a GUI object, so we have to keep track of all the special
|
||||
// data we allocated and then free it manually when the dialog
|
||||
// closes.
|
||||
std::vector<void *> _info;
|
||||
std::vector<void*> _info;
|
||||
struct PropertyObject {
|
||||
PropertyObject (const char * name,
|
||||
puObject * object,
|
||||
PropertyObject(const char* name,
|
||||
puObject* object,
|
||||
SGPropertyNode_ptr node);
|
||||
std::string name;
|
||||
puObject * object;
|
||||
puObject* object;
|
||||
SGPropertyNode_ptr node;
|
||||
};
|
||||
std::vector<PropertyObject *> _propertyObjects;
|
||||
std::vector<PropertyObject *> _liveObjects;
|
||||
std::vector<PropertyObject*> _propertyObjects;
|
||||
std::vector<PropertyObject*> _liveObjects;
|
||||
|
||||
class ConditionalObject : public SGConditional
|
||||
{
|
||||
public:
|
||||
ConditionalObject(const std::string& aName, puObject* aPu) :
|
||||
_name(aName),
|
||||
ConditionalObject(const std::string& aName, puObject* aPu) : _name(aName),
|
||||
_pu(aPu)
|
||||
{ ; }
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
void update(FGPUIDialog* aDlg);
|
||||
|
||||
|
@ -203,5 +207,3 @@ private:
|
|||
|
||||
std::vector<ActiveWidget*> _activeWidgets;
|
||||
};
|
||||
|
||||
#endif // __DIALOG_HXX
|
||||
|
|
Loading…
Add table
Reference in a new issue