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

ObjCryst::WXFieldString Class Reference

A field which directly links to a string. More...

Inheritance diagram for ObjCryst::WXFieldString:

Inheritance graph
[legend]
Collaboration diagram for ObjCryst::WXFieldString:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WXFieldString (wxWindow *parent, string &st, const int field_id, const int hsize=50, bool isEditable=true)
void OnEnter (wxCommandEvent &event)
 When a new value is entered (must type it and then hit the 'enter' key).

void OnText (wxCommandEvent &WXUNUSED(event))
 Records when text is entered (either from self-updating or user input).

void SetValue (const string &)
 This actually posts an UpdateUI event, so that it is safe to call it from a non-graphic thread.

const string GetValue () const
 Get the current name.

virtual void CrystUpdate (const bool updateUI=false, const bool mutexlock=false)
 Get new values to be displayed from the underlying object, and raise flag if an UI update is necessary.

virtual void UpdateUI (const bool mutexlock=false)
 Update the User Interface, if necessary.

void Revert ()
 After a user entry, this allows to go back to the last value, if for some reason the entry was rejected (because the object is currently busy, ...).

virtual void ValidateUserInput ()
 This function shall be called when a new value has been entered.

virtual void SetSize (int width, int height)
 Change the size of the field (excluding the title).


Protected Attributes

string * mpString
 The WXCrystObj whose name is shown here.

string mValue
 Last name displayed.

wxTextCtrl * mpField
 The text window.

string mValueOld
 Last name displayed, before the value was changed by the user.

bool mIsSelfUpdating
 Set to true if the Field is being updated, so that no 'EVT_TEXT' is understood as user input.


Detailed Description

A field which directly links to a string.


Constructor & Destructor Documentation

ObjCryst::WXFieldString::WXFieldString wxWindow *  parent,
string &  st,
const int  field_id,
const int  hsize = 50,
bool  isEditable = true
 


Member Function Documentation

virtual void ObjCryst::WXFieldString::CrystUpdate const bool  updateUI = false,
const bool  mutexlock = false
[virtual]
 

Get new values to be displayed from the underlying object, and raise flag if an UI update is necessary.

The actual GUI update is not made here. UpdateUI() should be called separately, from the main thread.

Parameters:
updateUI: if true, this will call UpdateUI, either directly (if in the main thread), or by sending a message.
mutexlock: if true, a Mutex will be used to lock the data shared between main and background thread. The idea is to only use a few Mutexes to lock data from the top objects (wxRefinableObj,...), when calling CrystUpdate() and UpdateUI(). As sub-objects (WXField,...) are only updated from within a top object, the mutex lock in the top object will also lock the data in the sub-objects.

Implements ObjCryst::WXCrystObjBasic.

const string ObjCryst::WXFieldString::GetValue  )  const
 

Get the current name.

void ObjCryst::WXFieldString::OnEnter wxCommandEvent &  event  ) 
 

When a new value is entered (must type it and then hit the 'enter' key).

The Field reads the new value, then forwards the event to its owner, who will take care of anything that must be done.

void ObjCryst::WXFieldString::OnText wxCommandEvent &  WXUNUSED(event)  ) 
 

Records when text is entered (either from self-updating or user input).

void ObjCryst::WXFieldString::Revert  )  [virtual]
 

After a user entry, this allows to go back to the last value, if for some reason the entry was rejected (because the object is currently busy, ...).

Implements ObjCryst::WXField.

virtual void ObjCryst::WXFieldString::SetSize int  width,
int  height
[virtual]
 

Change the size of the field (excluding the title).

Reimplemented from ObjCryst::WXField.

void ObjCryst::WXFieldString::SetValue const string &   ) 
 

This actually posts an UpdateUI event, so that it is safe to call it from a non-graphic thread.

virtual void ObjCryst::WXFieldString::UpdateUI const bool  mutexlock = false  )  [virtual]
 

Update the User Interface, if necessary.

Parameters:
mutexlock: if true, a Mutex will be used to lock the data shared between main and background thread.
The idea is to only use a few Mutexes to lock data from the top objects (wxRefinableObj,...), when calling CrystUpdate() and UpdateUI(). As sub-objects (WXField,...) are only updated from within a top object, the mutex lock in the top object will also lock the data in the sub-objects.

Implements ObjCryst::WXCrystObjBasic.

virtual void ObjCryst::WXFieldString::ValidateUserInput  )  [virtual]
 

This function shall be called when a new value has been entered.

Implements ObjCryst::WXField.


Member Data Documentation

bool ObjCryst::WXFieldString::mIsSelfUpdating [protected]
 

Set to true if the Field is being updated, so that no 'EVT_TEXT' is understood as user input.

wxTextCtrl* ObjCryst::WXFieldString::mpField [protected]
 

The text window.

string* ObjCryst::WXFieldString::mpString [protected]
 

The WXCrystObj whose name is shown here.

string ObjCryst::WXFieldString::mValue [protected]
 

Last name displayed.

string ObjCryst::WXFieldString::mValueOld [protected]
 

Last name displayed, before the value was changed by the user.

Not used yet, could be useful for undo.


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 15:06:27 2006 for ObjCryst++ by doxygen 1.3.6