23 #include "wx/wxprec.h"
31 #include "ObjCryst/wxCryst/wxAtom.h"
50 static const long ID_ATOM_SCATTPOW=WXCRYST_ID();
52 BEGIN_EVENT_TABLE(WXAtom,wxWindow)
53 EVT_BUTTON(ID_ATOM_SCATTPOW, WXAtom::OnChangeScattPow)
56 WXAtom::WXAtom(wxWindow* parent, Atom *obj):
57 WXScatterer(parent,obj),mpAtom(obj)
59 VFN_DEBUG_MESSAGE(
"WXAtom::WXAtom()",6)
61 mpFieldScattPower=new WXFieldChoice(this,ID_ATOM_SCATTPOW,"Scattering Power:");
62 mpSizer->Add(mpFieldScattPower,0,wxALIGN_LEFT);
63 mList.Add(mpFieldScattPower);
65 this->BottomLayout(0);
66 this->CrystUpdate(true,true);
70 mpAtom->WXNotifyDelete();
73 void WXAtom::OnChangeScattPow(wxCommandEvent & WXUNUSED(event))
75 VFN_DEBUG_MESSAGE(
"WXAtom::OnChangeScattPow()",6)
77 const ScatteringPower *scatt=
79 (mpAtom->GetCrystal().GetScatteringPowerRegistry(),(wxWindow*)this,
80 "Choose a new Scattering Power",choice);
82 mpAtom->Init(mpAtom->GetX(),mpAtom->GetY(),mpAtom->GetZ(),mpAtom->GetName(),
83 scatt,mpAtom->GetOccupancy());
T * WXDialogChooseFromRegistry(ObjRegistry< T > ®, wxWindow *parent, const string &message, int &choice)
This function allows to pick up one object in a registry.
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 necessar...
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
virtual const string & GetName() const
Name of the object.
const ScatteringPower & GetScatteringPower() const
Get the ScatteringPowerAtom corresponding to this atom.