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

ObjCryst::WXCrystObj Class Reference

Base class for all displayed ObjCryst objects (with a title, and a sizer to stack objects). More...

Inheritance diagram for ObjCryst::WXCrystObj:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WXCrystObj (wxWindow *parent, int orient=wxHORIZONTAL, bool showName=true)
 Constructor, with a.

virtual ~WXCrystObj ()
void OnToggleCollapse (wxCommandEvent &WXUNUSED(event))
 Only display the title, and collapse everything else.

virtual bool OnChangeName (const int id)=0
 When a WXFieldName has been changed by the user, it is handled here.

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.

virtual void OnEnable (wxUpdateUIEvent &event)
virtual bool Enable (bool enable)
virtual void BottomLayout (WXCrystObjBasic *pChild)
 Ask for a new Layout with recalculated size hints, because a child has been changed or added.

virtual void AddChild (WXCrystObjBasic *pChild, bool doBottomLayout=true)
 Notify that a new children has been added, also adding it to the correct sizer (which can be the top sizer or not).


Protected Attributes

wxBoxSizer * mpTopSizer
 Top sizer including the title and WXCrystObj::mpSizer.

wxBoxSizer * mpSizer
 Sizer including all sub-objects.

WXFieldNamempWXTitle
 The title.

bool mIsExpanded
 To be used for collapsing the sub-objects.

WXCrystObjBasicList mList
 All windows but the title and collapse button are in this list.

wxButton * mpCollapseButton
 The collapse button.


Detailed Description

Base class for all displayed ObjCryst objects (with a title, and a sizer to stack objects).

A button (which should be used to collapse the object) is used to create an indentation for the sub-objects.

Todo:
Allow the objects to be collabsable. The difficulty is that even if the object is not shown, it is not removed by the Sizer as long as it is not deleted... Needs some testing ! Otherwise it would also be possible to delete and re-create sub-objects when collapsing, but that would be more difficult.


Constructor & Destructor Documentation

ObjCryst::WXCrystObj::WXCrystObj wxWindow *  parent,
int  orient = wxHORIZONTAL,
bool  showName = true
 

Constructor, with a.

virtual ObjCryst::WXCrystObj::~WXCrystObj  )  [virtual]
 


Member Function Documentation

virtual void ObjCryst::WXCrystObj::AddChild WXCrystObjBasic pChild,
bool  doBottomLayout = true
[virtual]
 

Notify that a new children has been added, also adding it to the correct sizer (which can be the top sizer or not).

Parameters:
doBottomLayout ask for a new Layout of the window and of its parents.

Reimplemented from ObjCryst::WXCrystObjBasic.

virtual void ObjCryst::WXCrystObj::BottomLayout WXCrystObjBasic pChild  )  [virtual]
 

Ask for a new Layout with recalculated size hints, because a child has been changed or added.

Parameters:
pChild: the modified child. If null, this will mean we are asking for a new layout of the window itself (useful when a sub-window is deleted).

Reimplemented from ObjCryst::WXCrystObjBasic.

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

Reimplemented in ObjCryst::WXCrystal, ObjCryst::WXDiffractionSingleCrystal, ObjCryst::WXOptimizationObj, ObjCryst::WXMolecule, ObjCryst::WXPowderPattern, ObjCryst::WXPowderPatternBackground, and ObjCryst::WXRefinableObj.

virtual bool ObjCryst::WXCrystObj::Enable bool  enable  )  [virtual]
 

Reimplemented in ObjCryst::WXCrystal, and ObjCryst::WXMolecule.

virtual bool ObjCryst::WXCrystObj::OnChangeName const int  id  )  [pure virtual]
 

When a WXFieldName has been changed by the user, it is handled here.

This returns true if the value has been handled (for inheritance purposes).

Implemented in ObjCryst::WXCrystal, ObjCryst::WXOptimizationObj, ObjCryst::WXProfilePseudoVoigt, ObjCryst::WXProfileDoubleExponentialPseudoVoigt, ObjCryst::WXRegistry< T >, ObjCryst::WXRefinableObj, ObjCryst::WXScatteringPowerAtom, ObjCryst::WXScatteringPowerSphere, ObjCryst::WXRegistry< ZAtom >, ObjCryst::WXRegistry< ScatteringPower >, ObjCryst::WXRegistry< Scatterer >, and ObjCryst::WXRegistry< PowderPatternComponent >.

virtual void ObjCryst::WXCrystObj::OnEnable wxUpdateUIEvent &  event  )  [virtual]
 

void ObjCryst::WXCrystObj::OnToggleCollapse wxCommandEvent &  WXUNUSED(event)  ) 
 

Only display the title, and collapse everything else.

Bug:
: the windows do collapse, but the size of the window is not changed, so it is pretty useless so far...

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

Reimplemented in ObjCryst::WXAtom, ObjCryst::WXCrystal, ObjCryst::WXDiffractionSingleCrystal, ObjCryst::WXOptimizationObj, ObjCryst::WXMolecule, ObjCryst::WXPowderPattern, ObjCryst::WXPowderPatternBackground, ObjCryst::WXPowderPatternDiffraction, ObjCryst::WXRefinableObj, ObjCryst::WXScatteringPowerAtom, and ObjCryst::WXScatteringPowerSphere.


Member Data Documentation

bool ObjCryst::WXCrystObj::mIsExpanded [protected]
 

To be used for collapsing the sub-objects.

WXCrystObjBasicList ObjCryst::WXCrystObj::mList [protected]
 

All windows but the title and collapse button are in this list.

wxButton* ObjCryst::WXCrystObj::mpCollapseButton [protected]
 

The collapse button.

wxBoxSizer* ObjCryst::WXCrystObj::mpSizer [protected]
 

Sizer including all sub-objects.

wxBoxSizer* ObjCryst::WXCrystObj::mpTopSizer [protected]
 

Top sizer including the title and WXCrystObj::mpSizer.

WXFieldName* ObjCryst::WXCrystObj::mpWXTitle [protected]
 

The title.


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