[91f151a] | 1 | |
---|
| 2 | import wx |
---|
| 3 | import sys |
---|
| 4 | from copy import deepcopy |
---|
[79492222] | 5 | from sas.guiframe.utils import check_float |
---|
[91f151a] | 6 | |
---|
| 7 | _BOX_WIDTH = 60 |
---|
[49ab5d7] | 8 | if sys.platform.count("win32") > 0: |
---|
[91f151a] | 9 | _STATICBOX_WIDTH = 450 |
---|
| 10 | PANEL_WIDTH = 500 |
---|
| 11 | PANEL_HEIGHT = 290 |
---|
| 12 | FONT_VARIANT = 0 |
---|
| 13 | else: |
---|
| 14 | _STATICBOX_WIDTH = 480 |
---|
| 15 | PANEL_WIDTH = 530 |
---|
| 16 | PANEL_HEIGHT = 320 |
---|
| 17 | FONT_VARIANT = 1 |
---|
[49ab5d7] | 18 | |
---|
[91f151a] | 19 | class ApertureDialog(wx.Dialog): |
---|
[6d48919] | 20 | def __init__(self, parent=None, manager=None, aperture=None, *args, **kwds): |
---|
[ad6f597] | 21 | """ |
---|
[6137b150] | 22 | Dialog allows to enter values for aperture |
---|
[ad6f597] | 23 | """ |
---|
[6d48919] | 24 | kwds['size'] = (PANEL_WIDTH, PANEL_HEIGHT) |
---|
[ad6f597] | 25 | kwds['title'] = "Aperture Editor" |
---|
| 26 | wx.Dialog.__init__(self, parent=parent, *args, **kwds) |
---|
| 27 | self.parent = parent |
---|
| 28 | self.manager = manager |
---|
| 29 | self._aperture = aperture |
---|
| 30 | self._reset_aperture = deepcopy(aperture) |
---|
| 31 | self._notes = "" |
---|
[49ab5d7] | 32 | |
---|
[b0ab6cb] | 33 | #Attributes for panel |
---|
| 34 | self.aperture_name_tcl = None |
---|
| 35 | self.main_sizer = None |
---|
| 36 | self.box_aperture = None |
---|
| 37 | self.boxsizer_aperture = None |
---|
| 38 | self.name_sizer = None |
---|
| 39 | self.name_sizer = None |
---|
[49ab5d7] | 40 | self.size_name_tcl = None |
---|
[b0ab6cb] | 41 | self.type_sizer = None |
---|
| 42 | self.distance_sizer = None |
---|
| 43 | self.size_name_sizer = None |
---|
| 44 | self.aperture_size_unit_tcl = None |
---|
| 45 | self.aperture_size_sizer = None |
---|
| 46 | self.button_sizer = None |
---|
| 47 | self.aperture_name_tcl = None |
---|
| 48 | self.type_tcl = None |
---|
| 49 | self.distance_tcl = None |
---|
| 50 | self.distance_unit_tcl = None |
---|
| 51 | self.x_aperture_size_tcl = None |
---|
| 52 | self.y_aperture_size_tcl = None |
---|
| 53 | self.z_aperture_size_tcl = None |
---|
| 54 | self.bt_apply = None |
---|
| 55 | self.bt_cancel = None |
---|
| 56 | self.bt_close = None |
---|
[49ab5d7] | 57 | |
---|
[ad6f597] | 58 | self._do_layout() |
---|
| 59 | self.set_values() |
---|
[49ab5d7] | 60 | |
---|
[91f151a] | 61 | def _define_structure(self): |
---|
| 62 | """ |
---|
[49ab5d7] | 63 | define initial sizer |
---|
[91f151a] | 64 | """ |
---|
| 65 | self.main_sizer = wx.BoxSizer(wx.VERTICAL) |
---|
[6d48919] | 66 | self.box_aperture = wx.StaticBox(self, -1, str("Aperture")) |
---|
[2f732b0] | 67 | self.boxsizer_aperture = wx.StaticBoxSizer(self.box_aperture, wx.VERTICAL) |
---|
[91f151a] | 68 | self.name_sizer = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 69 | self.type_sizer = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 70 | self.distance_sizer = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 71 | self.size_name_sizer = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 72 | self.aperture_size_sizer = wx.BoxSizer(wx.HORIZONTAL) |
---|
| 73 | self.button_sizer = wx.BoxSizer(wx.HORIZONTAL) |
---|
[49ab5d7] | 74 | |
---|
[91f151a] | 75 | def _layout_name(self): |
---|
| 76 | """ |
---|
[6137b150] | 77 | Do the layout for aperture name related widgets |
---|
[91f151a] | 78 | """ |
---|
| 79 | #Aperture name [string] |
---|
[49ab5d7] | 80 | aperture_name_txt = wx.StaticText(self, -1, 'Aperture Name : ') |
---|
[2f732b0] | 81 | self.aperture_name_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH * 5, 20), style=0) |
---|
[49ab5d7] | 82 | self.name_sizer.AddMany([(aperture_name_txt, 0, wx.LEFT | wx.RIGHT, 10), |
---|
[2f732b0] | 83 | (self.aperture_name_tcl, 0, wx.EXPAND)]) |
---|
[91f151a] | 84 | def _layout_type(self): |
---|
| 85 | """ |
---|
[6137b150] | 86 | Do the layout for aperture type related widgets |
---|
[91f151a] | 87 | """ |
---|
| 88 | #Aperture type [string] |
---|
[49ab5d7] | 89 | type_txt = wx.StaticText(self, -1, 'Type: ') |
---|
[91f151a] | 90 | self.type_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) |
---|
[49ab5d7] | 91 | self.type_sizer.AddMany([(type_txt, 0, wx.LEFT | wx.RIGHT, 10), |
---|
[2f732b0] | 92 | (self.type_tcl, 0, wx.LEFT, 20)]) |
---|
[49ab5d7] | 93 | |
---|
[91f151a] | 94 | def _layout_distance(self): |
---|
| 95 | """ |
---|
[6137b150] | 96 | Do the layout for aperture distance related widgets |
---|
[91f151a] | 97 | """ |
---|
| 98 | #Aperture distance [float] |
---|
[49ab5d7] | 99 | distance_txt = wx.StaticText(self, -1, 'Distance:') |
---|
| 100 | self.distance_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), |
---|
| 101 | style=0) |
---|
| 102 | distance_unit_txt = wx.StaticText(self, -1, 'Unit: ') |
---|
[2f732b0] | 103 | self.distance_unit_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) |
---|
[49ab5d7] | 104 | self.distance_sizer.AddMany([(distance_txt, 0, wx.LEFT | wx.RIGHT, 10), |
---|
[91f151a] | 105 | (self.distance_tcl, 0, wx.LEFT, 10), |
---|
[2f732b0] | 106 | (distance_unit_txt, 0, wx.LEFT | wx.RIGHT, 10), |
---|
[49ab5d7] | 107 | (self.distance_unit_tcl, 0, wx.EXPAND)]) |
---|
[91f151a] | 108 | def _layout_size_name(self): |
---|
| 109 | """ |
---|
[6137b150] | 110 | Do the layout for size name related widgets |
---|
[91f151a] | 111 | """ |
---|
| 112 | # Size name [string] |
---|
[49ab5d7] | 113 | size_name_txt = wx.StaticText(self, -1, 'Size Name : ') |
---|
[2f732b0] | 114 | self.size_name_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH * 5, 20), style=0) |
---|
[49ab5d7] | 115 | self.size_name_sizer.AddMany([(size_name_txt, 0, wx.LEFT | wx.RIGHT, 10), |
---|
[2f732b0] | 116 | (self.size_name_tcl, 0, wx.EXPAND)]) |
---|
[49ab5d7] | 117 | |
---|
[91f151a] | 118 | def _layout_size(self): |
---|
| 119 | """ |
---|
[6137b150] | 120 | Do the layout for aperture size related widgets |
---|
[91f151a] | 121 | """ |
---|
| 122 | #Aperture size [Vector] |
---|
[49ab5d7] | 123 | aperture_size_txt = wx.StaticText(self, -1, 'Size:') |
---|
| 124 | x_aperture_size_txt = wx.StaticText(self, -1, 'x = ') |
---|
[2f732b0] | 125 | self.x_aperture_size_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) |
---|
[49ab5d7] | 126 | y_aperture_size_txt = wx.StaticText(self, -1, 'y = ') |
---|
[2f732b0] | 127 | self.y_aperture_size_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) |
---|
[49ab5d7] | 128 | z_aperture_size_txt = wx.StaticText(self, -1, 'z = ') |
---|
[2f732b0] | 129 | self.z_aperture_size_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) |
---|
[49ab5d7] | 130 | aperture_size_unit_txt = wx.StaticText(self, -1, 'Unit: ') |
---|
[2f732b0] | 131 | self.aperture_size_unit_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) |
---|
| 132 | self.aperture_size_sizer.AddMany([(aperture_size_txt, 0, wx.LEFT | wx.RIGHT, 10), |
---|
| 133 | (x_aperture_size_txt, 0, wx.LEFT, 17), |
---|
| 134 | (self.x_aperture_size_tcl, 0, wx.RIGHT, 10), |
---|
| 135 | (y_aperture_size_txt, 0, wx.EXPAND), |
---|
| 136 | (self.y_aperture_size_tcl, 0, wx.RIGHT, 10), |
---|
| 137 | (z_aperture_size_txt, 0, wx.EXPAND), |
---|
| 138 | (self.z_aperture_size_tcl, 0, wx.RIGHT, 10), |
---|
| 139 | (aperture_size_unit_txt, 0, wx.EXPAND), |
---|
| 140 | (self.aperture_size_unit_tcl, 0, wx.RIGHT, 10)]) |
---|
[49ab5d7] | 141 | |
---|
| 142 | def _layout_button(self): |
---|
[91f151a] | 143 | """ |
---|
[6137b150] | 144 | Do the layout for the button widgets |
---|
[49ab5d7] | 145 | """ |
---|
| 146 | self.bt_apply = wx.Button(self, -1, 'Apply') |
---|
[91f151a] | 147 | self.bt_apply.Bind(wx.EVT_BUTTON, self.on_click_apply) |
---|
| 148 | self.bt_apply.SetToolTipString("Apply current changes to aperture.") |
---|
[49ab5d7] | 149 | self.bt_cancel = wx.Button(self, -1, 'Cancel') |
---|
[91f151a] | 150 | self.bt_cancel.SetToolTipString("Cancel current changes.") |
---|
| 151 | self.bt_cancel.Bind(wx.EVT_BUTTON, self.on_click_cancel) |
---|
[49ab5d7] | 152 | self.bt_close = wx.Button(self, wx.ID_CANCEL, 'Close') |
---|
[91f151a] | 153 | self.bt_close.SetToolTipString("Close window.") |
---|
| 154 | self.button_sizer.AddMany([(self.bt_apply, 0, wx.LEFT, 200), |
---|
| 155 | (self.bt_cancel, 0, wx.LEFT, 10), |
---|
| 156 | (self.bt_close, 0, wx.LEFT, 10)]) |
---|
[49ab5d7] | 157 | |
---|
| 158 | def _do_layout(self):#, data=None): |
---|
[91f151a] | 159 | """ |
---|
[6137b150] | 160 | Draw the current panel |
---|
[91f151a] | 161 | """ |
---|
| 162 | self._define_structure() |
---|
| 163 | self._layout_name() |
---|
| 164 | self._layout_type() |
---|
| 165 | self._layout_distance() |
---|
| 166 | self._layout_size_name() |
---|
| 167 | self._layout_size() |
---|
| 168 | self._layout_button() |
---|
[2f732b0] | 169 | self.boxsizer_aperture.AddMany([(self.name_sizer, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5), |
---|
| 170 | (self.type_sizer, 0, |
---|
| 171 | wx.EXPAND | wx.TOP | wx.BOTTOM, 5), |
---|
| 172 | (self.distance_sizer, 0, |
---|
| 173 | wx.EXPAND | wx.TOP | wx.BOTTOM, 5), |
---|
| 174 | (self.size_name_sizer, 0, |
---|
| 175 | wx.EXPAND | wx.TOP | wx.BOTTOM, 5), |
---|
| 176 | (self.aperture_size_sizer, 0, |
---|
| 177 | wx.EXPAND | wx.TOP | wx.BOTTOM, 5)]) |
---|
[91f151a] | 178 | self.main_sizer.AddMany([(self.boxsizer_aperture, 0, wx.ALL, 10), |
---|
[2f732b0] | 179 | (self.button_sizer, 0, |
---|
| 180 | wx.EXPAND | wx.TOP | wx.BOTTOM, 5)]) |
---|
[91f151a] | 181 | self.SetSizer(self.main_sizer) |
---|
| 182 | self.SetAutoLayout(True) |
---|
[49ab5d7] | 183 | |
---|
[91f151a] | 184 | def set_manager(self, manager): |
---|
[49ab5d7] | 185 | """ |
---|
[6137b150] | 186 | Set manager of this window |
---|
[91f151a] | 187 | """ |
---|
| 188 | self.manager = manager |
---|
[49ab5d7] | 189 | |
---|
[91f151a] | 190 | def reset_aperture(self): |
---|
| 191 | """ |
---|
[6137b150] | 192 | put the default value of the detector back to the current aperture |
---|
[91f151a] | 193 | """ |
---|
| 194 | self._aperture.name = self._reset_aperture.name |
---|
| 195 | self._aperture.type = self._reset_aperture.type |
---|
| 196 | self._aperture.size_name = self._reset_aperture.size_name |
---|
| 197 | self._aperture.size.x = self._reset_aperture.size.x |
---|
| 198 | self._aperture.size.y = self._reset_aperture.size.y |
---|
| 199 | self._aperture.size.z = self._reset_aperture.size.z |
---|
| 200 | self._aperture.size_unit = self._reset_aperture.size_unit |
---|
| 201 | self._aperture.distance = self._reset_aperture.distance |
---|
| 202 | self._aperture.distance_unit = self._reset_aperture.distance_unit |
---|
[49ab5d7] | 203 | |
---|
[91f151a] | 204 | def set_values(self): |
---|
| 205 | """ |
---|
[6137b150] | 206 | take the aperture values of the current data and display them |
---|
| 207 | through the panel |
---|
[91f151a] | 208 | """ |
---|
| 209 | aperture = self._aperture |
---|
| 210 | #Name |
---|
| 211 | self.aperture_name_tcl.SetValue(str(aperture.name)) |
---|
| 212 | #Type |
---|
| 213 | self.type_tcl.SetValue(str(aperture.type)) |
---|
| 214 | #distance |
---|
| 215 | self.distance_tcl.SetValue(str(aperture.distance)) |
---|
| 216 | #distance unit |
---|
| 217 | self.distance_unit_tcl.SetValue(str(aperture.distance_unit)) |
---|
[2f732b0] | 218 | #Size name |
---|
[91f151a] | 219 | self.size_name_tcl.SetValue(str(aperture.size_name)) |
---|
| 220 | #Aperture size as a vector |
---|
| 221 | x, y, z = aperture.size.x, aperture.size.y, aperture.size.z |
---|
[49ab5d7] | 222 | self.x_aperture_size_tcl.SetValue(str(x)) |
---|
| 223 | self.y_aperture_size_tcl.SetValue(str(y)) |
---|
| 224 | self.z_aperture_size_tcl.SetValue(str(z)) |
---|
[91f151a] | 225 | self.aperture_size_unit_tcl.SetValue(str(aperture.size_unit)) |
---|
[49ab5d7] | 226 | |
---|
[91f151a] | 227 | def get_aperture(self): |
---|
| 228 | """ |
---|
[6137b150] | 229 | return the current aperture |
---|
[91f151a] | 230 | """ |
---|
| 231 | return self._aperture |
---|
[49ab5d7] | 232 | |
---|
[91f151a] | 233 | def get_notes(self): |
---|
| 234 | """ |
---|
[6137b150] | 235 | return notes |
---|
[91f151a] | 236 | """ |
---|
| 237 | return self._notes |
---|
[49ab5d7] | 238 | |
---|
[91f151a] | 239 | def on_change_name(self): |
---|
| 240 | """ |
---|
[6137b150] | 241 | Change name |
---|
[91f151a] | 242 | """ |
---|
| 243 | #Change the name of the aperture |
---|
| 244 | name = self.aperture_name_tcl.GetValue().lstrip().rstrip() |
---|
| 245 | if name == "": |
---|
| 246 | name = str(None) |
---|
| 247 | if self._aperture.name != name: |
---|
| 248 | self._notes += "Change sample 's " |
---|
[49ab5d7] | 249 | self._notes += "name from %s to %s \n" % (self._aperture.name, name) |
---|
[91f151a] | 250 | self._aperture.name = name |
---|
[49ab5d7] | 251 | |
---|
[91f151a] | 252 | def on_change_type(self): |
---|
| 253 | """ |
---|
[6137b150] | 254 | Change aperture type |
---|
[91f151a] | 255 | """ |
---|
[2f732b0] | 256 | #Change type |
---|
| 257 | type_value = self.type_tcl.GetValue().lstrip().rstrip() |
---|
| 258 | self._aperture.type = type_value |
---|
[91f151a] | 259 | self._notes += " Change type from" |
---|
[2f732b0] | 260 | self._notes += " %s to %s \n" % (self._aperture.type, type_value) |
---|
[49ab5d7] | 261 | |
---|
[91f151a] | 262 | def on_change_distance(self): |
---|
| 263 | """ |
---|
[6137b150] | 264 | Change distance of the aperture |
---|
[91f151a] | 265 | """ |
---|
| 266 | #Change distance |
---|
| 267 | distance = self.distance_tcl.GetValue().lstrip().rstrip() |
---|
| 268 | if distance == "" or distance == str(None): |
---|
| 269 | distance = None |
---|
| 270 | self._aperture.distance = distance |
---|
| 271 | else: |
---|
| 272 | if check_float(self.distance_tcl): |
---|
| 273 | if self._aperture.distance != float(distance): |
---|
| 274 | self._notes += "Change distance from " |
---|
[2f732b0] | 275 | self._notes += "%s to %s \n" % (self._aperture.distance, distance) |
---|
[49ab5d7] | 276 | self._aperture.distance = float(distance) |
---|
[91f151a] | 277 | else: |
---|
| 278 | self._notes += "Error: Expected a float for distance " |
---|
| 279 | self._notes += "won't changes distance from " |
---|
[49ab5d7] | 280 | self._notes += "%s to %s" % (self._aperture.distance, distance) |
---|
[91f151a] | 281 | #change the distance unit |
---|
| 282 | unit = self.distance_unit_tcl.GetValue().lstrip().rstrip() |
---|
| 283 | if self._aperture.distance_unit != unit: |
---|
| 284 | self._notes += " Change distance 's unit from " |
---|
[49ab5d7] | 285 | self._notes += "%s to %s" % (self._aperture.distance_unit, unit) |
---|
| 286 | |
---|
[91f151a] | 287 | def on_change_size_name(self): |
---|
| 288 | """ |
---|
[6137b150] | 289 | Change the size's name |
---|
[91f151a] | 290 | """ |
---|
| 291 | #Change size name |
---|
| 292 | size_name = self.size_name_tcl.GetValue().lstrip().rstrip() |
---|
| 293 | self._aperture.size_name = size_name |
---|
| 294 | self._notes += " Change size name from" |
---|
[49ab5d7] | 295 | self._notes += " %s to %s \n" % (self._aperture.size_name, size_name) |
---|
| 296 | |
---|
[91f151a] | 297 | def on_change_size(self): |
---|
| 298 | """ |
---|
[6137b150] | 299 | Change aperture size |
---|
[91f151a] | 300 | """ |
---|
| 301 | #Change x coordinate |
---|
| 302 | x_aperture_size = self.x_aperture_size_tcl.GetValue().lstrip().rstrip() |
---|
| 303 | if x_aperture_size == "" or x_aperture_size == str(None): |
---|
| 304 | x_aperture_size = None |
---|
| 305 | else: |
---|
| 306 | if check_float(self.x_aperture_size_tcl): |
---|
[2f732b0] | 307 | if self._aperture.size.x != float(x_aperture_size): |
---|
[91f151a] | 308 | self._notes += "Change x of aperture size from " |
---|
[2f732b0] | 309 | self._notes += "%s to %s \n" % (self._aperture.size.x, x_aperture_size) |
---|
[49ab5d7] | 310 | self._aperture.aperture_size.x = float(x_aperture_size) |
---|
[91f151a] | 311 | else: |
---|
[6d48919] | 312 | self._notes += "Error: Expected a" |
---|
| 313 | self._notes += " float for the aperture size 's x " |
---|
[91f151a] | 314 | self._notes += "won't changes x aperture size from " |
---|
[2f732b0] | 315 | self._notes += "%s to %s" % (self._aperture.size.x, x_aperture_size) |
---|
[91f151a] | 316 | #Change y coordinate |
---|
| 317 | y_aperture_size = self.y_aperture_size_tcl.GetValue().lstrip().rstrip() |
---|
| 318 | if y_aperture_size == "" or y_aperture_size == str(None): |
---|
| 319 | y_aperture_size = None |
---|
| 320 | self._aperture.size.y = y_aperture_size |
---|
| 321 | else: |
---|
| 322 | if check_float(self.y_aperture_size_tcl): |
---|
| 323 | if self._aperture.size.y != float(y_aperture_size): |
---|
| 324 | self._notes += "Change y of aperture size from " |
---|
[2f732b0] | 325 | self._notes += "%s to %s \n" % (self._aperture.size.y, y_aperture_size) |
---|
[49ab5d7] | 326 | self._aperture.size.y = float(y_aperture_size) |
---|
[91f151a] | 327 | else: |
---|
[6d48919] | 328 | self._notes += "Error: Expected a float for the" |
---|
| 329 | self._notes += " aperture size's y " |
---|
[91f151a] | 330 | self._notes += "won't changes y aperture size from " |
---|
[2f732b0] | 331 | self._notes += "%s to %s" % (self._aperture.size.y, y_aperture_size) |
---|
[91f151a] | 332 | #Change z coordinate |
---|
| 333 | z_aperture_size = self.z_aperture_size_tcl.GetValue().lstrip().rstrip() |
---|
| 334 | if z_aperture_size == "" or z_aperture_size == str(None): |
---|
| 335 | z_aperture_size = None |
---|
| 336 | self._aperture.size.z = z_aperture_size |
---|
| 337 | else: |
---|
| 338 | if check_float(self.z_aperture_size_tcl): |
---|
| 339 | if self._aperture.size.z != float(z_aperture_size): |
---|
| 340 | self._notes += "Change z of aperture size from " |
---|
[2f732b0] | 341 | self._notes += "%s to %s \n" % (self._aperture.size.z, z_aperture_size) |
---|
[49ab5d7] | 342 | self._aperture.size.z = float(z_aperture_size) |
---|
[91f151a] | 343 | else: |
---|
| 344 | self._notes += "Error: Expected a float for the offset 's x " |
---|
| 345 | self._notes += "won't changes z aperture size from " |
---|
[2f732b0] | 346 | self._notes += "%s to %s" % (self._aperture.size.z, z_aperture_size) |
---|
[91f151a] | 347 | #change the aperture center unit |
---|
| 348 | unit = self.aperture_size_unit_tcl.GetValue().lstrip().rstrip() |
---|
| 349 | if self._aperture.size_unit != unit: |
---|
| 350 | self._notes += " Change aperture size's unit from " |
---|
[49ab5d7] | 351 | self._notes += "%s to %s" % (self._aperture.size_unit, unit) |
---|
[91f151a] | 352 | self._aperture.size_unit = unit |
---|
[49ab5d7] | 353 | |
---|
[91f151a] | 354 | def on_click_apply(self, event): |
---|
| 355 | """ |
---|
[6137b150] | 356 | Apply user values to the aperture |
---|
[91f151a] | 357 | """ |
---|
| 358 | self.on_change_name() |
---|
| 359 | self.on_change_type() |
---|
| 360 | self.on_change_distance() |
---|
| 361 | self.on_change_size_name() |
---|
| 362 | self.on_change_size() |
---|
| 363 | self.set_values() |
---|
| 364 | if self.manager is not None: |
---|
| 365 | self.manager.set_aperture(self._aperture) |
---|
[6d48919] | 366 | if event is not None: |
---|
| 367 | event.Skip() |
---|
[49ab5d7] | 368 | |
---|
[91f151a] | 369 | def on_click_cancel(self, event): |
---|
| 370 | """ |
---|
[6137b150] | 371 | reset the current aperture to its initial values |
---|
[91f151a] | 372 | """ |
---|
| 373 | self.reset_aperture() |
---|
| 374 | self.set_values() |
---|
| 375 | if self.manager is not None: |
---|
[2f732b0] | 376 | self.manager.set_aperture(self._aperture) |
---|
[6d48919] | 377 | if event is not None: |
---|
| 378 | event.Skip() |
---|