Changeset f7bead2 in sasview
- Timestamp:
- Apr 4, 2014 11:49:57 AM (11 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- eacf6a8c
- Parents:
- f87dc4c
- Location:
- src/sans/guiframe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sans/guiframe/gui_manager.py
rf309303 rf7bead2 1451 1451 Build a panel to allow to edit Mask 1452 1452 """ 1453 1454 1453 from sans.guiframe.startup_configuration \ 1455 1454 import StartupConfiguration as ConfDialog 1456 1455 1457 self.panel = ConfDialog(parent=self, gui=self.__gui_style) 1458 self.panel.ShowModal() 1459 1460 1456 dialog = ConfDialog(parent=self, gui=self.__gui_style) 1457 result = dialog.ShowModal() 1458 if result == wx.ID_OK: 1459 dialog.write_custom_config() 1460 # post event for info 1461 wx.PostEvent(self, StatusEvent(status="Wrote custom configuration", info='info')) 1462 dialog.Destroy() 1463 1461 1464 def _add_menu_application(self): 1462 1465 """ -
src/sans/guiframe/startup_configuration.py
r5777106 rf7bead2 93 93 note_txt.SetForegroundColour("black") 94 94 hbox = wx.BoxSizer(wx.HORIZONTAL) 95 cancelButton = wx.Button(self, -1, 'Cancel', size=(70, 25))96 hbox.Add(cancelButton, 1, wx.RIGHT, 5)97 c ancelButton.Bind(wx.EVT_BUTTON, self.OnCancel)98 okButton = wx.Button(self, -1, 'OK', size=(70, 25))95 96 okButton = wx.Button(self, wx.ID_OK, 'Set', size=(70, 25)) 97 closeButton = wx.Button(self,wx.ID_CANCEL, 'Cancel', size=(70, 25)) 98 hbox.Add(closeButton, 1, wx.RIGHT, 5) 99 99 hbox.Add(okButton, 1, wx.RIGHT, 5) 100 okButton.Bind(wx.EVT_BUTTON, self.OnClose) 101 vbox.Add(panel) 102 103 vbox.Add(hbox, 1, wx.ALIGN_CENTER | wx.RIGHT | wx.BOTTOM, 5) 100 vbox.Add(panel, 1, wx.ALIGN_CENTER | wx.BOTTOM, 5) 101 vbox.Add(hbox, 1, wx.ALIGN_CENTER | wx.BOTTOM, 5) 104 102 # set sizer 105 103 self.SetSizer(vbox) … … 192 190 self.return_string = self.current_string 193 191 return self.return_string 194 195 def OnCancel(self, event): 196 """ 197 Close event 198 """ 199 # clear event 200 event.Skip() 201 self.return_string = {} 202 self.Destroy() 203 204 def OnClose(self, event): 205 """ 206 Close event 207 """ 208 # clear event 209 event.Skip() 192 193 def write_custom_config(self): 194 """ 195 Write custom configuration 196 """ 210 197 fname = os.path.join(self.path, 'custom_config.py') 211 198 self.write_string(fname, self.return_string) 212 self.Destroy()213 199 214 200 def write_string(self, fname, strings):
Note: See TracChangeset
for help on using the changeset viewer.