Skip to content

Commit

Permalink
corrected some wx.ALIGN or wx.CENTER issues with python3.8 and wxpyth…
Browse files Browse the repository at this point in the history
…on 4.1.1
  • Loading branch information
BM32ESRF committed Feb 22, 2024
1 parent 3989205 commit 1658240
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 16 deletions.
7 changes: 5 additions & 2 deletions LaueTools/Daxm/gui/boxes/input_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ def Create(self):
hbox.Add(self.fluo_btn, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

# assemble
self.Add(self.notebook, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL, 5)
self.Add(hbox, 0, wx.ALIGN_CENTER | wx.EXPAND | wx.ALL, 5)
# self.Add(self.notebook, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL, 5)
# self.Add(hbox, 0, wx.ALIGN_CENTER | wx.EXPAND | wx.ALL, 5)

self.Add(self.notebook, 0, wx.EXPAND | wx.ALL, 5)
self.Add(hbox, 0,wx.EXPAND | wx.ALL, 5)

# bindings
self.mat_cbx.Bind_to(self.OnModifyAnything)
Expand Down
14 changes: 10 additions & 4 deletions LaueTools/Daxm/gui/boxes/input_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,16 @@ def Create(self):
grid = wx.GridSizer(rows=1, cols=5, hgap=5, vgap=0)
grid.Add(wx.StaticText(parent=self._parent, id=wx.ID_ANY, label="ascan yf"),
0, wx.ALIGN_CENTER)
grid.Add(self.ystart_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)
grid.Add(self.ystop_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)
grid.Add(self.step_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)
grid.Add(self.expo_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)
#grid.Add(self.ystart_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)
# grid.Add(self.ystop_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)
# grid.Add(self.step_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)
# grid.Add(self.expo_txt, 0, wx.EXPAND | wx.ALIGN_CENTER)

grid.Add(self.ystart_txt, 0, wx.EXPAND )
grid.Add(self.ystop_txt, 0, wx.EXPAND )
grid.Add(self.step_txt, 0, wx.EXPAND )
grid.Add(self.expo_txt, 0, wx.EXPAND )


self.AddSpacer(10)
self.Add(self.spec_fs, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15)
Expand Down
4 changes: 3 additions & 1 deletion LaueTools/Daxm/gui/boxes/input_wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ def Create(self):
self.notebook.AddPage(panel2, "Customized", False)

# assemble
self.Add(self.notebook, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL, 5)
# self.Add(self.notebook, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL, 5)
self.Add(self.notebook, 1, wx.EXPAND | wx.ALL, 5)


# bindings
self.qty_spn.Bind_to(self.OnModifyQty)
Expand Down
42 changes: 33 additions & 9 deletions LaueTools/Daxm/gui/panels/experiment/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,32 +79,56 @@ def _CreatePlot(self):

def _CreateCtrl(self):

vbox = wx.StaticBox(self, -1)
vbox_sizer = wx.StaticBoxSizer(vbox, wx.VERTICAL)
# vbox = wx.StaticBox(self, -1)
# vbox_sizer = wx.StaticBoxSizer(vbox, wx.VERTICAL)

vbox = wx.BoxSizer(wx.VERTICAL)

# # orientation
# self._ctrl_ori = LabelComboBox(vbox, label="Axes: ", style=wx.CB_SORT,
# value=self._img_orient, choices=["ij", "xy"])

# # scan slider
# self._ctrl_scan = SpinSliderCtrl(vbox, "Frame: ", size=(60, -1),
# style=wx.SL_MIN_MAX_LABELS | wx.SL_TOP,
# min=1, max=self._img_qty, initial=1)

# # checkboxes
# self._ctrl_center = wx.CheckBox(vbox, wx.ID_ANY, label="Show detector center")
# self._ctrl_lims = wx.CheckBox(vbox, wx.ID_ANY, label="Show scan limits")

# orientation
self._ctrl_ori = LabelComboBox(vbox, label="Axes: ", style=wx.CB_SORT,
self._ctrl_ori = LabelComboBox(self, label="Axes: ", style=wx.CB_SORT,
value=self._img_orient, choices=["ij", "xy"])

# scan slider
self._ctrl_scan = SpinSliderCtrl(vbox, "Frame: ", size=(60, -1),
self._ctrl_scan = SpinSliderCtrl(self, "Frame: ", size=(60, -1),
style=wx.SL_MIN_MAX_LABELS | wx.SL_TOP,
min=1, max=self._img_qty, initial=1)

# checkboxes
self._ctrl_center = wx.CheckBox(vbox, wx.ID_ANY, label="Show detector center")
self._ctrl_lims = wx.CheckBox(vbox, wx.ID_ANY, label="Show scan limits")
self._ctrl_center = wx.CheckBox(self, wx.ID_ANY, label="Show detector center")
self._ctrl_lims = wx.CheckBox(self, wx.ID_ANY, label="Show scan limits")


#assemble
hbox = wx.GridSizer(rows=1, cols=3, vgap=0, hgap=5)
hbox.Add(self._ctrl_ori, 0, wx.ALIGN_CENTER_VERTICAL)
hbox.Add(self._ctrl_center, 0, wx.ALIGN_CENTER_VERTICAL)
hbox.Add(self._ctrl_lims, 0, wx.ALIGN_CENTER_VERTICAL)

vbox_sizer.Add(hbox, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10)
vbox_sizer.Add(self._ctrl_scan, 0, wx.EXPAND| wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10)
# vbox_sizer.Add(hbox, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL)#, 10)
# vbox_sizer.Add(self._ctrl_scan, 0, wx.EXPAND| wx.ALIGN_CENTER_VERTICAL | wx.ALL)#, 10)

# vbox.Add(hbox, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10)
# vbox.Add(self._ctrl_scan, 0, wx.EXPAND| wx.ALIGN_CENTER_VERTICAL | wx.ALL, 10)

vbox.Add(hbox, 0, wx.EXPAND | wx.ALL, 10)
vbox.Add(self._ctrl_scan, 0, wx.EXPAND | wx.ALL, 10)

# self._mainbox.Add(vbox_sizer, 0, wx.EXPAND|wx.ALL, 5)
self._mainbox.Add(vbox, 0, wx.EXPAND|wx.ALL, 5)

self._mainbox.Add(vbox_sizer, 0, wx.EXPAND|wx.ALL, 5)

#bindings
self._ctrl_ori.Bind_to(self._OnSelectAxes)
Expand Down

0 comments on commit 1658240

Please sign in to comment.