FOX/ObjCryst++  1.10.X (development)
wxScatterer.cpp
1 /* ObjCryst++ Object-Oriented Crystallographic Library
2  (c) 2000-2002 Vincent Favre-Nicolin vincefn@users.sourceforge.net
3  2000-2001 University of Geneva (Switzerland)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 //#include <sstream> //for stringstream
20 #include <fstream>
21 
22 // wx headers, with or without precompilation
23 #include "wx/wxprec.h"
24 #ifdef __BORLANDC__
25  #pragma hdrstop
26 #endif
27 #ifndef WX_PRECOMP
28  #include "wx/wx.h"
29 #endif
30 
31 #include "ObjCryst/wxCryst/wxScatterer.h"
32 
33 //Fixes for Cygwin; where do those stupid macros come from ? Somewhere in wxMSW headers
34 #ifdef max
35 #undef max
36 #endif
37 #ifdef min
38 #undef min
39 #endif
40 #ifdef DrawText
41 #undef DrawText
42 #endif
43 
44 namespace ObjCryst
45 {
47 //
48 // WXScatterer
49 //
51 WXScatterer::WXScatterer(wxWindow* parent, Scatterer *obj):
52 WXRefinableObj(parent,(RefinableObj*)obj),mpScatterer(obj)
53 {
54  VFN_DEBUG_MESSAGE("WXScatterer::WXScatterer()",6)
55  mpWXTitle->SetForegroundColour(wxColour(0,100,0));
56  //Lattice
57  wxBoxSizer* sizer=new wxBoxSizer(wxHORIZONTAL);
58 
59  WXCrystObjBasic* pFieldX
60  =mpScatterer->GetPar(mpScatterer->mXYZ.data()+0).WXCreate(this);
61  WXCrystObjBasic* pFieldY
62  =mpScatterer->GetPar(mpScatterer->mXYZ.data()+1).WXCreate(this);
63  WXCrystObjBasic* pFieldZ
64  =mpScatterer->GetPar(mpScatterer->mXYZ.data()+2).WXCreate(this);
65  WXCrystObjBasic* pFieldPopu
66  =mpScatterer->GetPar(&(mpScatterer->mOccupancy)).WXCreate(this);
67  dynamic_cast<WXField *> (pFieldX)->SetLabel("X R");
68  dynamic_cast<WXField *> (pFieldY)->SetLabel("Y R");
69  dynamic_cast<WXField *> (pFieldZ)->SetLabel("Z R");
70  dynamic_cast<WXField *> (pFieldPopu)->SetLabel("Occup R");
71  sizer->Add(pFieldX ,0,wxALIGN_CENTER);
72  sizer->Add(pFieldY ,0,wxALIGN_CENTER);
73  sizer->Add(pFieldZ ,0,wxALIGN_CENTER);
74  sizer->Add(pFieldPopu ,0,wxALIGN_CENTER);
75 
76  mpSizer->Add(sizer,0,wxALIGN_LEFT);
77  mList.Add(pFieldX);
78  mList.Add(pFieldY);
79  mList.Add(pFieldZ);
80  mList.Add(pFieldPopu);
81  //layout & update is done in derived objects
82 }
83 
84 }// namespace
85 
WXFieldName * mpWXTitle
The title.
Definition: wxCryst.h:273
WXCrystObjBasicList mList
All windows but the title and collapse button are in this list.
Definition: wxCryst.h:277
WXCrystObjBasic(wxWindow *parent)
Constructor.
Definition: wxCryst.cpp:129
wxBoxSizer * mpSizer
Sizer including all sub-objects.
Definition: wxCryst.h:271
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: Atom.cpp:47