Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PG_PropertyEditor Class Reference

Widget for editing properties. More...

#include <pgpropertyeditor.h>

Inheritance diagram for PG_PropertyEditor:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PG_PropertyEditor (PG_Widget *parent, const PG_Rect &rect, const std::string &style="PropertyEditor", int labelWidthPercentage=70)
 Creates a PG_PropertyEditor widget.
virtual std::string GetStyleName (const std::string &widgetName)
 Returns the style name that the PropertyFields shall use.
void Reload ()
 Reloads all PropertyFields from their original values and updates the widget.
bool Valid (bool focus=false)
 Checks if all PropertyFields contain valid values.
bool Apply ()
 Writes the PropertyFields' values to their original variables, provided they are valid.
PG_Rect RegisterProperty (const std::string &name, PG_PropertyEditorField *propertyEditorField, int height=-1)
 Adds a PropertyField to the widget.
 ~PG_PropertyEditor ()

Classes

class  PG_PropertyEditorField
 Interface for all the different PropertyFields. More...

Detailed Description

Widget for editing properties.

Author:
Martin Bickel
This is a property editor as popular with VisualBasic and other RAD tools It is a container for other a number of PropertyFields

Definition at line 48 of file pgpropertyeditor.h.


Constructor & Destructor Documentation

PG_PropertyEditor::PG_PropertyEditor PG_Widget parent,
const PG_Rect rect,
const std::string &  style = "PropertyEditor",
int  labelWidthPercentage = 70
 

Creates a PG_PropertyEditor widget.

Parameters:
parent the parentobject for the new widget or NULL if it is a toplevel widget
rect initial position for the widget
style Widgetstyle to load. This style should be defined at your theme file (default = "PropertyEditor")
labelWidthPercentage The PropertyEditor consists of two columns: label and editable field. This sets the width of the label column

Definition at line 35 of file pgpropertyeditor.cpp.

PG_PropertyEditor::~PG_PropertyEditor  ) 
 

Definition at line 88 of file pgpropertyeditor.cpp.


Member Function Documentation

bool PG_PropertyEditor::Apply  ) 
 

Writes the PropertyFields' values to their original variables, provided they are valid.

Definition at line 59 of file pgpropertyeditor.cpp.

Referenced by GameParameterEditorWidget::Apply().

std::string PG_PropertyEditor::GetStyleName const std::string &  widgetName  )  [virtual]
 

Returns the style name that the PropertyFields shall use.

Reimplemented in ASC_PropertyEditor.

Definition at line 39 of file pgpropertyeditor.cpp.

Referenced by ASC_PropertyEditor::GetStyleName().

PG_Rect PG_PropertyEditor::RegisterProperty const std::string &  name,
PG_PropertyEditorField propertyEditorField,
int  height = -1
 

Adds a PropertyField to the widget.

The PropertyEditor will take ownership of the PropertyEditorFields and delete them on its own destruction.

Definition at line 73 of file pgpropertyeditor.cpp.

References PG_Label::LoadThemeStyle(), PG_ScrollWidget::my_widthScrollbar, PG_Rect::PG_Rect(), and PG_Rect::Width().

Referenced by PG_PropertyEditor_LineField::PG_PropertyEditor_LineField(), PG_PropertyField_Button::PG_PropertyField_Button(), and PG_PropertyField_Checkbox< B >::PG_PropertyField_Checkbox().

void PG_PropertyEditor::Reload  ) 
 

Reloads all PropertyFields from their original values and updates the widget.

Definition at line 43 of file pgpropertyeditor.cpp.

Referenced by GameParameterEditorWidget::LoadParameter(), and GameParameterEditorWidget::ResetParameter().

bool PG_PropertyEditor::Valid bool  focus = false  ) 
 

Checks if all PropertyFields contain valid values.

Definition at line 49 of file pgpropertyeditor.cpp.

Referenced by GameParameterEditorWidget::Valid().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:19:16 2008 for Advanced Strategic Command by  doxygen 1.4.2