- Timestamp:
- Feb 14, 2011 3:13:15 PM (14 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:
- 982e953
- Parents:
- cb69775
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
rcadd049e r20b228a0 13 13 from sans.guiframe.events import PanelOnFocusEvent 14 14 from sans.guiframe.events import StatusEvent 15 from sans.guiframe.events import AppendBookmarkEvent 15 16 import pagestate 16 17 from pagestate import PageState … … 155 156 self.popUpMenu.AppendItem(self._keep) 156 157 self._keep.Enable(True) 158 self._set_bookmark_flag(False) 159 self._set_save_flag(False) 157 160 wx.EVT_MENU(self, id, self.on_bookmark) 158 161 self.popUpMenu.AppendSeparator() … … 168 171 ## drawing Initial dispersion parameters sizer 169 172 self.set_dispers_sizer() 170 self._set_save_flag(True)173 171 174 ## layout 172 175 self.set_layout() … … 594 597 Reset model state 595 598 """ 599 menu = event.GetEventObject() 596 600 ## post help message for the selected model 597 msg = self.popUpMenu.GetHelpString(event.GetId())601 msg = menu.GetHelpString(event.GetId()) 598 602 msg +=" reloaded" 599 wx.PostEvent(self.parent.parent, StatusEvent(status = msg))600 601 name = self.popUpMenu.GetLabel(event.GetId())603 wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 604 605 name = menu.GetLabel(event.GetId()) 602 606 self._on_select_model_helper() 603 607 … … 626 630 return new_state 627 631 632 def _get_time_stamp(self): 633 """ 634 return time and date stings 635 """ 636 # date and time 637 year, month, day,hour,minute,second,tda,ty,tm_isdst= time.localtime() 638 current_time= str(hour)+":"+str(minute)+":"+str(second) 639 current_date= str( month)+"/"+str(day)+"/"+str(year) 640 return current_time, current_date 641 628 642 def on_bookmark(self, event): 629 643 """ … … 638 652 ##Add model state on context menu 639 653 self.number_saved_state += 1 654 current_time, current_date = self._get_time_stamp() 640 655 #name= self.model.name+"[%g]"%self.number_saved_state 641 name= self.model.__class__.__name__+"[%g]"%self.number_saved_state 656 name = "Fitting: %g]" % self.number_saved_state 657 name += self.model.__class__.__name__ 658 name += "bookmarked at %s on %s" % (current_time, current_date) 642 659 self.saved_states[name]= new_state 643 660 644 661 ## Add item in the context menu 645 646 year, month, day,hour,minute,second,tda,ty,tm_isdst= time.localtime() 647 my_time= str(hour)+" : "+str(minute)+" : "+str(second)+" " 648 date= str( month)+"|"+str(day)+"|"+str(year) 649 msg= "Model saved at %s on %s"%(my_time, date) 662 msg = "Model saved at %s on %s"%(current_time, current_date) 650 663 ## post help message for the selected model 651 664 msg +=" Saved! right click on this page to retrieve this model" 652 665 wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 653 666 654 id = wx.NewId() 655 self.popUpMenu.Append(id,name,str(msg)) 656 wx.EVT_MENU(self, id, self.onResetModel) 667 #id = wx.NewId() 668 #self.popUpMenu.Append(id,name,str(msg)) 669 #wx.EVT_MENU(self, id, self.onResetModel) 670 wx.PostEvent(self.parent.parent, 671 AppendBookmarkEvent(title=name, 672 hint=str(msg), handler=self.onResetModel)) 657 673 658 674 def old_on_bookmark(self, event):
Note: See TracChangeset
for help on using the changeset viewer.