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

ObjCryst::WXFieldRefPar Class Reference

A field for a RefinablePar. More...

Inheritance diagram for ObjCryst::WXFieldRefPar:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WXFieldRefPar (wxWindow *parent, const string &label, RefinablePar *refpar, const int hsize=50, const bool enableFixButton=true, const bool enableLimitedButton=true)
 ~WXFieldRefPar ()
 When a new value is entered (must type it and then hit the 'enter' key).

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

void OnToggleFix (wxCommandEvent &WXUNUSED(event))
 Toggle the 'fixed' status of the parameter.

void OnToggleLimited (wxCommandEvent &WXUNUSED(event))
 Toggle the 'limited' status of the parameter.

void OnPopupMenu (wxMouseEvent &event)
 Opens the popu menu, to allow changing limits.

void OnPopupMenuChoice (wxCommandEvent &event)
 Opens the popu menu, to allow changing limits.

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.

RefinableParGetRefPar ()
 Get the RefinablePar associated to this field.

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.


Protected Attributes

REAL mValue
wxCheckBox * mpButtonFix
wxCheckBox * mpButtonLimited
wxTextCtrl * mpField
RefinableParmpRefPar
REAL mValueOld
bool mIsSelfUpdating

Detailed Description

A field for a RefinablePar.

This shows the 'human' value of the parameter, and allows the modification of the parameter. A button allows to fix/unfix the parameter.

Todo:
: allow acces to the parameters limits


Constructor & Destructor Documentation

ObjCryst::WXFieldRefPar::WXFieldRefPar wxWindow *  parent,
const string &  label,
RefinablePar refpar,
const int  hsize = 50,
const bool  enableFixButton = true,
const bool  enableLimitedButton = true
 

ObjCryst::WXFieldRefPar::~WXFieldRefPar  ) 
 

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

The Field reads the new value, and directly changes the RefinablePar value (contrary to what happens for WXFieldName)by using RefinablePar::SetHumanValue().


Member Function Documentation

virtual void ObjCryst::WXFieldRefPar::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.

RefinablePar& ObjCryst::WXFieldRefPar::GetRefPar  ) 
 

Get the RefinablePar associated to this field.

void ObjCryst::WXFieldRefPar::OnEnter wxCommandEvent &  WXUNUSED(event)  ) 
 

void ObjCryst::WXFieldRefPar::OnPopupMenu wxMouseEvent &  event  ) 
 

Opens the popu menu, to allow changing limits.

void ObjCryst::WXFieldRefPar::OnPopupMenuChoice wxCommandEvent &  event  ) 
 

Opens the popu menu, to allow changing limits.

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

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

void ObjCryst::WXFieldRefPar::OnToggleFix wxCommandEvent &  WXUNUSED(event)  ) 
 

Toggle the 'fixed' status of the parameter.

void ObjCryst::WXFieldRefPar::OnToggleLimited wxCommandEvent &  WXUNUSED(event)  ) 
 

Toggle the 'limited' status of the parameter.

void ObjCryst::WXFieldRefPar::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::WXFieldRefPar::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::WXFieldRefPar::ValidateUserInput  )  [virtual]
 

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

Implements ObjCryst::WXField.


Member Data Documentation

bool ObjCryst::WXFieldRefPar::mIsSelfUpdating [protected]
 

wxCheckBox* ObjCryst::WXFieldRefPar::mpButtonFix [protected]
 

wxCheckBox* ObjCryst::WXFieldRefPar::mpButtonLimited [protected]
 

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

RefinablePar* ObjCryst::WXFieldRefPar::mpRefPar [protected]
 

REAL ObjCryst::WXFieldRefPar::mValue [protected]
 

REAL ObjCryst::WXFieldRefPar::mValueOld [protected]
 


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