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

PG_PropertyField_Integer< IntegerType > Class Template Reference

#include <pgpropertyfield_integer.h>

Inheritance diagram for PG_PropertyField_Integer< IntegerType >:

Inheritance graph
[legend]
List of all members.

Public Types

typedef PG_Signal2< PG_PropertyField_Integer *,
IntegerType > 
IntegerPropertySignal

Public Member Functions

 PG_PropertyField_Integer (PG_PropertyEditor *propertyEditor, const std::string &name, IntegerType *myInteger)
 Creates a PG_PropertyField_Integer.
 PG_PropertyField_Integer (PG_PropertyEditor *propertyEditor, const std::string &name, IntegerType myInteger)
 Creates a PG_PropertyField_Integer.
void SetRange (IntegerType min, IntegerType max)
virtual bool CheckValue (IntegerType value)
bool Valid ()
 checks if the entered value is valid
bool Apply ()
 Write the entered value back into the referenced variable (if it exists), provided the value is valid.
void Reload ()
 Reloads the entry field with the current value of the referenced variable (if it exists).

Public Attributes

IntegerPropertySignal sigValueChanged
IntegerPropertySignal sigValueApplied

Protected Member Functions

bool convert (IntegerType &i)
void set (IntegerType i)
bool EditEnd ()

Detailed Description

template<class IntegerType = int>
class PG_PropertyField_Integer< IntegerType >

Author:
Martin Bickel
Integer field for a PG_PropertyEditor

Definition at line 44 of file pgpropertyfield_integer.h.


Member Typedef Documentation

template<class IntegerType = int>
typedef PG_Signal2<PG_PropertyField_Integer*, IntegerType> PG_PropertyField_Integer< IntegerType >::IntegerPropertySignal
 

Definition at line 75 of file pgpropertyfield_integer.h.


Constructor & Destructor Documentation

template<class IntegerType = int>
PG_PropertyField_Integer< IntegerType >::PG_PropertyField_Integer PG_PropertyEditor propertyEditor,
const std::string &  name,
IntegerType *  myInteger
[inline]
 

Creates a PG_PropertyField_Integer.

Parameters:
propertyEditor The PG_PropertyEditor for which the PropertyField shall be registered for
name The label shown for the PropertyField
myInteger The variable that is edited. Make sure the variable exists for the whole lifetime of the PG_PropertyEditor

Definition at line 84 of file pgpropertyfield_integer.h.

References max(), min(), and PG_PropertyField_Integer< IntegerType >::Reload().

template<class IntegerType = int>
PG_PropertyField_Integer< IntegerType >::PG_PropertyField_Integer PG_PropertyEditor propertyEditor,
const std::string &  name,
IntegerType  myInteger
[inline]
 

Creates a PG_PropertyField_Integer.

Parameters:
propertyEditor The PG_PropertyEditor for which the PropertyField shall be registered for
name The label shown for the PropertyField
myInteger The initial value for the editor field

Definition at line 95 of file pgpropertyfield_integer.h.

References max(), min(), and PG_PropertyField_Integer< IntegerType >::set().


Member Function Documentation

template<class IntegerType = int>
bool PG_PropertyField_Integer< IntegerType >::Apply  )  [inline, virtual]
 

Write the entered value back into the referenced variable (if it exists), provided the value is valid.

Returns:
false if the value is not valid

Implements PG_PropertyEditor::PG_PropertyEditorField.

Definition at line 124 of file pgpropertyfield_integer.h.

References PG_PropertyField_Integer< IntegerType >::CheckValue(), PG_PropertyField_Integer< IntegerType >::convert(), and PG_PropertyField_Integer< IntegerType >::sigValueApplied.

template<class IntegerType = int>
virtual bool PG_PropertyField_Integer< IntegerType >::CheckValue IntegerType  value  )  [inline, virtual]
 

Definition at line 109 of file pgpropertyfield_integer.h.

Referenced by PG_PropertyField_Integer< IntegerType >::Apply(), and PG_PropertyField_Integer< IntegerType >::Valid().

template<class IntegerType = int>
bool PG_PropertyField_Integer< IntegerType >::convert IntegerType &  i  )  [inline, protected]
 

Definition at line 49 of file pgpropertyfield_integer.h.

References PG_Widget::GetText(), and PG_PropertyEditor_LineField::lineEdit.

Referenced by PG_PropertyField_Integer< IntegerType >::Apply(), PG_PropertyField_Integer< IntegerType >::EditEnd(), and PG_PropertyField_Integer< IntegerType >::Valid().

template<class IntegerType = int>
bool PG_PropertyField_Integer< IntegerType >::EditEnd  )  [inline, protected, virtual]
 

Implements PG_PropertyEditor_LineField.

Definition at line 64 of file pgpropertyfield_integer.h.

References PG_PropertyField_Integer< IntegerType >::convert(), and PG_PropertyField_Integer< IntegerType >::sigValueChanged.

template<class IntegerType = int>
void PG_PropertyField_Integer< IntegerType >::Reload  )  [inline, virtual]
 

Reloads the entry field with the current value of the referenced variable (if it exists).

Implements PG_PropertyEditor::PG_PropertyEditorField.

Definition at line 140 of file pgpropertyfield_integer.h.

References PG_PropertyField_Integer< IntegerType >::set().

Referenced by PG_PropertyField_Integer< IntegerType >::PG_PropertyField_Integer().

template<class IntegerType = int>
void PG_PropertyField_Integer< IntegerType >::set IntegerType  i  )  [inline, protected]
 

Definition at line 58 of file pgpropertyfield_integer.h.

References PG_PropertyEditor_LineField::lineEdit, and PG_LineEdit::SetText().

Referenced by PG_PropertyField_Integer< IntegerType >::PG_PropertyField_Integer(), and PG_PropertyField_Integer< IntegerType >::Reload().

template<class IntegerType = int>
void PG_PropertyField_Integer< IntegerType >::SetRange IntegerType  min,
IntegerType  max
[inline]
 

Definition at line 102 of file pgpropertyfield_integer.h.

Referenced by GameParameterEditorWidget::GameParameterEditorWidget().

template<class IntegerType = int>
bool PG_PropertyField_Integer< IntegerType >::Valid  )  [inline, virtual]
 

checks if the entered value is valid

Implements PG_PropertyEditor::PG_PropertyEditorField.

Definition at line 113 of file pgpropertyfield_integer.h.

References PG_PropertyField_Integer< IntegerType >::CheckValue(), and PG_PropertyField_Integer< IntegerType >::convert().


Member Data Documentation

template<class IntegerType = int>
IntegerPropertySignal PG_PropertyField_Integer< IntegerType >::sigValueApplied
 

Definition at line 77 of file pgpropertyfield_integer.h.

Referenced by PG_PropertyField_Integer< IntegerType >::Apply().

template<class IntegerType = int>
IntegerPropertySignal PG_PropertyField_Integer< IntegerType >::sigValueChanged
 

Definition at line 76 of file pgpropertyfield_integer.h.

Referenced by PG_PropertyField_Integer< IntegerType >::EditEnd().


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