Skip to content

Commit 3ce35c9

Browse files
committed
Merge branch 'update-wxglade' into maint
* update several wxg files for wxglade-0.8.3 * fix out-of-sync code in aboutdialog.py
2 parents 7c28f11 + 3623bed commit 3ce35c9

8 files changed

Lines changed: 389 additions & 400 deletions

File tree

src/diffpy/pdfgui/gui/aboutdialog.py

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
from diffpy.pdfgui.gui.pdfguiglobals import iconpath
2020
from diffpy.pdfgui.version import __version__, __date__
2121

22-
# FIXME - this is not in sync with the wxglade file
2322

24-
25-
_acknowledgement = \
26-
'''\
23+
_acknowledgement = '''\
2724
This software was developed by the Billinge-group as part of the Distributed
2825
Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US
2926
National Science Foundation under grant DMR-0520547. Developments of PDFfit2
@@ -42,6 +39,8 @@
4239
computer programs for studying nanostructure in crystals,
4340
J. Phys.: Condens. Matter 19, 335219 (2007).'''
4441

42+
_copyright = "(c) 2005-{year},".format(year= __date__[:4])
43+
4544
_homepage = "http://www.diffpy.org"
4645

4746
# authors list is shuffled randomly every time
@@ -72,30 +71,27 @@ class DialogAbout(wx.Dialog):
7271
def __init__(self, *args, **kwds):
7372

7473
# begin wxGlade: DialogAbout.__init__
75-
kwds["style"] = wx.DEFAULT_DIALOG_STYLE
74+
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE
7675
wx.Dialog.__init__(self, *args, **kwds)
77-
self.bitmap_logo = wx.StaticBitmap(self, -1,
78-
wx.Bitmap(iconpath("logo.png")))
79-
self.label_title = wx.StaticText(self, -1, "PDFgui")
80-
self.label_version = wx.StaticText(self, -1, "")
81-
self.label_build = wx.StaticText(self, -1, "Build:")
82-
self.label_svnrevision = wx.StaticText(self, -1, "")
83-
self.label_copyright = wx.StaticText(self, -1, "(c) 2005-2009,")
84-
self.label_author = wx.StaticText(self, -1, "author")
85-
self.hyperlink = wx.lib.agw.hyperlink.HyperLinkCtrl(self, -1,
86-
_homepage, URL=_homepage)
87-
self.hyperlink_paper = wx.lib.agw.hyperlink.HyperLinkCtrl(self, -1,
88-
_paper, URL=_paper)
89-
self.hyperlink_license = wx.lib.agw.hyperlink.HyperLinkCtrl(self, -1,
90-
_license, URL=_license)
91-
self.static_line_1 = wx.StaticLine(self, -1)
92-
self.label_acknowledgement = wx.StaticText(self, -1, _acknowledgement)
93-
self.static_line_2 = wx.StaticLine(self, -1)
94-
self.bitmap_button_nsf = wx.BitmapButton(self, -1, wx.NullBitmap)
95-
self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap)
96-
self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap)
97-
self.bitmap_button_columbia = wx.BitmapButton(self, -1, wx.NullBitmap)
98-
self.static_line_3 = wx.StaticLine(self, -1)
76+
self.SetSize((600, 595))
77+
self.bitmap_logo = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap(iconpath("logo.png")))
78+
self.label_title = wx.StaticText(self, wx.ID_ANY, "PDFgui")
79+
self.label_version = wx.StaticText(self, wx.ID_ANY, "")
80+
self.label_build = wx.StaticText(self, wx.ID_ANY, "Build:")
81+
self.label_svnrevision = wx.StaticText(self, wx.ID_ANY, "")
82+
self.label_copyright = wx.StaticText(self, wx.ID_ANY, "")
83+
self.label_author = wx.StaticText(self, wx.ID_ANY, "author")
84+
self.hyperlink = wx.lib.agw.hyperlink.HyperLinkCtrl(self, wx.ID_ANY, _homepage, URL=_homepage)
85+
self.hyperlink_license = wx.lib.agw.hyperlink.HyperLinkCtrl(self, wx.ID_ANY, _license, URL=_license)
86+
self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
87+
self.label_acknowledgement = wx.StaticText(self, wx.ID_ANY, "")
88+
self.hyperlink_paper = wx.lib.agw.hyperlink.HyperLinkCtrl(self, wx.ID_ANY, _paper, URL=_paper)
89+
self.static_line_2 = wx.StaticLine(self, wx.ID_ANY)
90+
self.bitmap_button_nsf = wx.BitmapButton(self, wx.ID_ANY, wx.NullBitmap)
91+
self.bitmap_button_danse = wx.BitmapButton(self, wx.ID_ANY, wx.NullBitmap)
92+
self.bitmap_button_msu = wx.BitmapButton(self, wx.ID_ANY, wx.NullBitmap)
93+
self.bitmap_button_columbia = wx.BitmapButton(self, wx.ID_ANY, wx.NullBitmap)
94+
self.static_line_3 = wx.StaticLine(self, wx.ID_ANY)
9995
self.button_OK = wx.Button(self, wx.ID_OK, "OK")
10096

10197
self.__set_properties()
@@ -111,10 +107,9 @@ def __init__(self, *args, **kwds):
111107
random.shuffle(_authors)
112108
strLabel = ", ".join(_authors)
113109
self.label_author.SetLabel(strLabel)
114-
# set copyright year to that of the current release
115-
syear = __date__[:4]
116-
scprt = self.label_copyright.GetLabel().replace('2009', syear)
117-
self.label_copyright.SetLabel(scprt)
110+
# setup acknowledgement and copyright text labels
111+
self.label_acknowledgement.SetLabel(_acknowledgement)
112+
self.label_copyright.SetLabel(_copyright)
118113
# display version and svn revison numbers
119114
verwords = __version__.split('.post', 1)
120115
version = verwords[0]
@@ -161,23 +156,23 @@ def __do_layout(self):
161156
sizer_build = wx.BoxSizer(wx.HORIZONTAL)
162157
sizer_title = wx.BoxSizer(wx.HORIZONTAL)
163158
sizer_header.Add(self.bitmap_logo, 0, wx.EXPAND, 0)
164-
sizer_title.Add(self.label_title, 0, wx.LEFT|wx.TOP|wx.EXPAND, 10)
159+
sizer_title.Add(self.label_title, 0, wx.EXPAND | wx.LEFT | wx.TOP, 10)
165160
sizer_title.Add((20, 20), 0, wx.EXPAND, 0)
166-
sizer_title.Add(self.label_version, 0, wx.RIGHT|wx.ALIGN_BOTTOM, 10)
161+
sizer_title.Add(self.label_version, 0, wx.ALIGN_BOTTOM | wx.RIGHT, 10)
167162
sizer_titles.Add(sizer_title, 0, wx.EXPAND, 0)
168-
sizer_build.Add(self.label_build, 0, wx.LEFT|wx.RIGHT, 10)
163+
sizer_build.Add(self.label_build, 0, wx.LEFT | wx.RIGHT, 10)
169164
sizer_build.Add(self.label_svnrevision, 0, 0, 0)
170-
sizer_titles.Add(sizer_build, 0, wx.TOP|wx.EXPAND, 5)
171-
sizer_titles.Add(self.label_copyright, 0, wx.LEFT|wx.RIGHT|wx.TOP, 10)
172-
sizer_titles.Add(self.label_author, 0, wx.LEFT|wx.RIGHT, 10)
173-
sizer_titles.Add(self.hyperlink, 0, wx.LEFT|wx.RIGHT, 10)
165+
sizer_titles.Add(sizer_build, 0, wx.EXPAND | wx.TOP, 5)
166+
sizer_titles.Add(self.label_copyright, 0, wx.LEFT | wx.RIGHT | wx.TOP, 10)
167+
sizer_titles.Add(self.label_author, 0, wx.LEFT | wx.RIGHT, 10)
168+
sizer_titles.Add(self.hyperlink, 0, wx.LEFT | wx.RIGHT, 10)
174169
sizer_titles.Add((20, 20), 0, 0, 0)
175-
sizer_titles.Add(self.hyperlink_license, 0, wx.LEFT|wx.RIGHT, 10)
170+
sizer_titles.Add(self.hyperlink_license, 0, wx.LEFT | wx.RIGHT, 10)
176171
sizer_header.Add(sizer_titles, 0, wx.EXPAND, 0)
177-
sizer_main.Add(sizer_header, 0, wx.BOTTOM|wx.EXPAND, 3)
172+
sizer_main.Add(sizer_header, 0, wx.BOTTOM | wx.EXPAND, 3)
178173
sizer_main.Add(self.static_line_1, 0, wx.EXPAND, 0)
179-
sizer_main.Add(self.label_acknowledgement, 0, wx.LEFT|wx.TOP|wx.BOTTOM, 7)
180-
sizer_main.Add(self.hyperlink_paper, 0, wx.LEFT|wx.TOP|wx.BOTTOM, 7)
174+
sizer_main.Add(self.label_acknowledgement, 0, wx.BOTTOM | wx.LEFT | wx.TOP, 7)
175+
sizer_main.Add(self.hyperlink_paper, 0, wx.BOTTOM | wx.LEFT | wx.TOP, 7)
181176
sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0)
182177
sizer_logos.Add(self.bitmap_button_nsf, 0, wx.LEFT, 2)
183178
sizer_logos.Add(self.bitmap_button_danse, 0, wx.LEFT, 2)

src/diffpy/pdfgui/gui/calculationpanel.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,32 @@ class CalculationPanel(wx.Panel, PDFPanel):
2525
def __init__(self, *args, **kwds):
2626
PDFPanel.__init__(self)
2727
# begin wxGlade: CalculationPanel.__init__
28-
kwds["style"] = wx.TAB_TRAVERSAL
28+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
2929
wx.Panel.__init__(self, *args, **kwds)
30-
self.sizer_panelname_staticbox = wx.StaticBox(self, -1, "")
31-
self.panelNameLabel = wx.StaticText(self, -1, "Calculation Configuration")
32-
self.radioBoxStype = wx.RadioBox(self, -1, "Scatterer Type", choices=["Neutron", "X-ray"], majorDimension=2, style=wx.RA_SPECIFY_COLS)
33-
self.labelCalcRange = wx.StaticText(self, -1, "Range", style=wx.ALIGN_RIGHT)
34-
self.textCtrlCalcFrom = wx.TextCtrl(self, -1, "1.0")
35-
self.labelTo = wx.StaticText(self, -1, "to", style=wx.ALIGN_RIGHT)
36-
self.textCtrlCalcTo = wx.TextCtrl(self, -1, "10.0")
37-
self.labelRStep = wx.StaticText(self, -1, "spacing", style=wx.ALIGN_RIGHT)
38-
self.textCtrlRStep = wx.TextCtrl(self, -1, "0.01")
39-
self.labelScaleFactor = wx.StaticText(self, -1, "Scale Factor", style=wx.ALIGN_RIGHT)
40-
self.textCtrlScaleFactor = wx.TextCtrl(self, -1, "1.0")
41-
self.labelQmax = wx.StaticText(self, -1, "Qmax", style=wx.ALIGN_RIGHT)
42-
self.textCtrlQmax = wx.TextCtrl(self, -1, "25.0")
43-
self.label_1 = wx.StaticText(self, -1, "")
44-
self.label_1_copy = wx.StaticText(self, -1, "")
45-
self.labelQdamp = wx.StaticText(self, -1, "Qdamp", style=wx.ALIGN_RIGHT)
46-
self.textCtrlQdamp = wx.TextCtrl(self, -1, "0.0")
47-
self.labelQbroad = wx.StaticText(self, -1, "Qbroad", style=wx.ALIGN_RIGHT)
48-
self.textCtrlQbroad = wx.TextCtrl(self, -1, "0.0")
49-
self.label_1_copy_2 = wx.StaticText(self, -1, "")
50-
self.label_1_copy_1 = wx.StaticText(self, -1, "")
51-
self.label_1_copy_6 = wx.StaticText(self, -1, "")
52-
self.label_1_copy_5 = wx.StaticText(self, -1, "")
53-
self.label_1_copy_3 = wx.StaticText(self, -1, "")
54-
self.label_1_copy_4 = wx.StaticText(self, -1, "")
30+
self.panelNameLabel = wx.StaticText(self, wx.ID_ANY, "Calculation Configuration")
31+
self.radioBoxStype = wx.RadioBox(self, wx.ID_ANY, "Scatterer Type", choices=["Neutron", "X-ray"], majorDimension=2, style=wx.RA_SPECIFY_COLS)
32+
self.labelCalcRange = wx.StaticText(self, wx.ID_ANY, "Range", style=wx.ALIGN_RIGHT)
33+
self.textCtrlCalcFrom = wx.TextCtrl(self, wx.ID_ANY, "1.0")
34+
self.labelTo = wx.StaticText(self, wx.ID_ANY, "to", style=wx.ALIGN_RIGHT)
35+
self.textCtrlCalcTo = wx.TextCtrl(self, wx.ID_ANY, "10.0")
36+
self.labelRStep = wx.StaticText(self, wx.ID_ANY, "spacing", style=wx.ALIGN_RIGHT)
37+
self.textCtrlRStep = wx.TextCtrl(self, wx.ID_ANY, "0.01")
38+
self.labelScaleFactor = wx.StaticText(self, wx.ID_ANY, "Scale Factor", style=wx.ALIGN_RIGHT)
39+
self.textCtrlScaleFactor = wx.TextCtrl(self, wx.ID_ANY, "1.0")
40+
self.labelQmax = wx.StaticText(self, wx.ID_ANY, "Qmax", style=wx.ALIGN_RIGHT)
41+
self.textCtrlQmax = wx.TextCtrl(self, wx.ID_ANY, "25.0")
42+
self.label_1 = wx.StaticText(self, wx.ID_ANY, "")
43+
self.label_1_copy = wx.StaticText(self, wx.ID_ANY, "")
44+
self.labelQdamp = wx.StaticText(self, wx.ID_ANY, "Qdamp", style=wx.ALIGN_RIGHT)
45+
self.textCtrlQdamp = wx.TextCtrl(self, wx.ID_ANY, "0.0")
46+
self.labelQbroad = wx.StaticText(self, wx.ID_ANY, "Qbroad", style=wx.ALIGN_RIGHT)
47+
self.textCtrlQbroad = wx.TextCtrl(self, wx.ID_ANY, "0.0")
48+
self.label_1_copy_2 = wx.StaticText(self, wx.ID_ANY, "")
49+
self.label_1_copy_1 = wx.StaticText(self, wx.ID_ANY, "")
50+
self.label_1_copy_6 = wx.StaticText(self, wx.ID_ANY, "")
51+
self.label_1_copy_5 = wx.StaticText(self, wx.ID_ANY, "")
52+
self.label_1_copy_3 = wx.StaticText(self, wx.ID_ANY, "")
53+
self.label_1_copy_4 = wx.StaticText(self, wx.ID_ANY, "")
5554

5655
self.__set_properties()
5756
self.__do_layout()
@@ -72,37 +71,38 @@ def __do_layout(self):
7271
sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
7372
outerSizer = wx.BoxSizer(wx.VERTICAL)
7473
grid_sizer_1 = wx.FlexGridSizer(4, 6, 5, 10)
75-
sizer_panelname = wx.StaticBoxSizer(self.sizer_panelname_staticbox, wx.HORIZONTAL)
76-
sizer_panelname.Add(self.panelNameLabel, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
77-
outerSizer.Add(sizer_panelname, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 5)
74+
sizer_panelname = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, ""), wx.HORIZONTAL)
75+
sizer_panelname.Add(self.panelNameLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)
76+
outerSizer.Add(sizer_panelname, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 5)
7877
outerSizer.Add((450, 5), 0, 0, 0)
79-
outerSizer.Add(self.radioBoxStype, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
80-
grid_sizer_1.Add(self.labelCalcRange, 0, wx.LEFT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
78+
outerSizer.Add(self.radioBoxStype, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
79+
grid_sizer_1.Add(self.labelCalcRange, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, 5)
8180
grid_sizer_1.Add(self.textCtrlCalcFrom, 0, wx.ALIGN_CENTER_VERTICAL, 0)
82-
grid_sizer_1.Add(self.labelTo, 0, wx.LEFT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 20)
81+
grid_sizer_1.Add(self.labelTo, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, 20)
8382
grid_sizer_1.Add(self.textCtrlCalcTo, 0, wx.ALIGN_CENTER_VERTICAL, 0)
84-
grid_sizer_1.Add(self.labelRStep, 0, wx.LEFT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
83+
grid_sizer_1.Add(self.labelRStep, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, 5)
8584
grid_sizer_1.Add(self.textCtrlRStep, 0, wx.ALIGN_CENTER_VERTICAL, 0)
86-
grid_sizer_1.Add(self.labelScaleFactor, 0, wx.LEFT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
85+
grid_sizer_1.Add(self.labelScaleFactor, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, 5)
8786
grid_sizer_1.Add(self.textCtrlScaleFactor, 0, wx.ALIGN_CENTER_VERTICAL, 0)
88-
grid_sizer_1.Add(self.labelQmax, 0, wx.LEFT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 20)
87+
grid_sizer_1.Add(self.labelQmax, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, 20)
8988
grid_sizer_1.Add(self.textCtrlQmax, 0, wx.ALIGN_CENTER_VERTICAL, 0)
9089
grid_sizer_1.Add(self.label_1, 0, 0, 0)
9190
grid_sizer_1.Add(self.label_1_copy, 0, 0, 0)
92-
grid_sizer_1.Add(self.labelQdamp, 0, wx.LEFT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
91+
grid_sizer_1.Add(self.labelQdamp, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, 5)
9392
grid_sizer_1.Add(self.textCtrlQdamp, 0, wx.ALIGN_CENTER_VERTICAL, 0)
94-
grid_sizer_1.Add(self.labelQbroad, 0, wx.LEFT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
93+
grid_sizer_1.Add(self.labelQbroad, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, 5)
9594
grid_sizer_1.Add(self.textCtrlQbroad, 0, wx.ALIGN_CENTER_VERTICAL, 0)
9695
grid_sizer_1.Add(self.label_1_copy_2, 0, 0, 0)
9796
grid_sizer_1.Add(self.label_1_copy_1, 0, 0, 0)
9897
grid_sizer_1.Add(self.label_1_copy_6, 0, 0, 0)
9998
grid_sizer_1.Add(self.label_1_copy_5, 0, 0, 0)
10099
grid_sizer_1.Add(self.label_1_copy_3, 0, 0, 0)
101100
grid_sizer_1.Add(self.label_1_copy_4, 0, 0, 0)
102-
outerSizer.Add(grid_sizer_1, 0, wx.ALL|wx.EXPAND, 5)
101+
outerSizer.Add(grid_sizer_1, 0, wx.ALL | wx.EXPAND, 5)
103102
sizer_1.Add(outerSizer, 1, wx.EXPAND, 0)
104103
self.SetSizer(sizer_1)
105104
sizer_1.Fit(self)
105+
self.Layout()
106106
# end wxGlade
107107

108108
# USER CONFIGURATION CODE #################################################

0 commit comments

Comments
 (0)