Changeset ae84427 in sasview for fittingview/src/sans/perspectives/fitting/basepage.py
- Timestamp:
- Apr 20, 2013 7:14:41 PM (12 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:
- ba152f1
- Parents:
- d4895dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
rcb270ad2 rae84427 713 713 msg = menu.GetHelpString(event.GetId()) 714 714 msg += " reloaded" 715 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))715 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 716 716 self.Show(False) 717 717 name = menu.GetLabel(event.GetId()) … … 746 746 if self.parent != None: 747 747 self._default_save_location = \ 748 self. parent.parent._default_save_location748 self._manager.parent._default_save_location 749 749 dlg = wx.FileDialog(self, "Choose a file", self._default_save_location, 750 750 self.window_caption, "*.fitv", wx.SAVE) … … 753 753 path = dlg.GetPath() 754 754 self._default_save_location = os.path.dirname(path) 755 self. parent.parent._default_save_location =\755 self._manager.parent._default_save_location =\ 756 756 self._default_save_location 757 757 else: … … 803 803 msg += ": No valid parameter values to paste from the clipboard..." 804 804 infor = "error" 805 wx.PostEvent(self. parent.parent,805 wx.PostEvent(self._manager.parent, 806 806 StatusEvent(status=msg, info=infor)) 807 807 raise 808 808 # inform msg to wx 809 wx.PostEvent(self. parent.parent,809 wx.PostEvent(self._manager.parent, 810 810 StatusEvent(status=msg, info=infor)) 811 811 … … 843 843 ## post help message for the selected model 844 844 msg += " Saved! right click on this page to retrieve this model" 845 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))845 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 846 846 847 847 id = wx.NewId() 848 848 self.popUpMenu.Append(id, name, str(msg)) 849 849 wx.EVT_MENU(self, id, self.onResetModel) 850 wx.PostEvent(self. parent.parent,850 wx.PostEvent(self._manager.parent, 851 851 AppendBookmarkEvent(title=name, 852 852 hint=str(msg), … … 877 877 try: 878 878 if path == None: 879 wx.PostEvent(self. parent.parent,879 wx.PostEvent(self._manager.parent, 880 880 StatusEvent(status= \ 881 881 " Selected Distribution was not loaded: %s" % path)) … … 1490 1490 if self.parent != None: 1491 1491 self._default_save_location = \ 1492 self. parent.parent.get_save_location()1492 self._manager.parent.get_save_location() 1493 1493 dlg = wx.FileDialog(self, "Choose a weight file", 1494 1494 self._default_save_location, "", … … 1702 1702 msg = "Cannot Plot or Fit :Must select a " 1703 1703 msg += " model or Fitting range is not valid!!! " 1704 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))1704 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 1705 1705 1706 1706 try: … … 2081 2081 except: 2082 2082 msg = "%s\n" % (sys.exc_value) 2083 wx.PostEvent(self. parent.parent,2083 wx.PostEvent(self._manager.parent, 2084 2084 StatusEvent(status=msg, info="error")) 2085 2085 self._populate_box(self.formfactorbox, m_list) … … 2188 2188 #Clear msg if previously shown. 2189 2189 msg = "" 2190 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2190 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2191 2191 # Flag to register when a parameter has changed. 2192 2192 is_modified = False … … 2223 2223 else: 2224 2224 msg = "Cannot Plot :No npts in that Qrange!!! " 2225 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2225 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2226 2226 else: 2227 2227 tcrtl.SetBackgroundColour("pink") 2228 2228 msg = "Model Error:wrong value entered!!!" 2229 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2229 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2230 2230 self.save_current_state() 2231 2231 event = PageInfoEvent(page=self) … … 2367 2367 qmax_ctrl.Refresh() 2368 2368 msg = "Invalid Q range: Q min must be smaller than Q max" 2369 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2369 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2370 2370 return False 2371 2371 return True … … 2399 2399 msg = "Npts of Data Error :" 2400 2400 msg += "No or too little npts of %s." % data.name 2401 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2401 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2402 2402 self.fitrange = False 2403 2403 flag = False … … 2434 2434 msg = "Npts of Data Error :" 2435 2435 msg += "No or too little npts of %s." % data.name 2436 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2436 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2437 2437 self.fitrange = False 2438 2438 flag = False … … 2485 2485 except: 2486 2486 msg = "Wrong Fit parameter range entered " 2487 wx.PostEvent(self. parent.parent,2487 wx.PostEvent(self._manager.parent, 2488 2488 StatusEvent(status=msg)) 2489 2489 raise ValueError, msg … … 2502 2502 except: 2503 2503 msg = "Wrong Fit parameter range entered " 2504 wx.PostEvent(self. parent.parent,2504 wx.PostEvent(self._manager.parent, 2505 2505 StatusEvent(status=msg)) 2506 2506 raise ValueError, msg … … 2511 2511 msg = "Wrong Fit range entered for parameter " 2512 2512 msg += "name %s of model %s " % (name, self.model.name) 2513 wx.PostEvent(self. parent.parent,2513 wx.PostEvent(self._manager.parent, 2514 2514 StatusEvent(status=msg)) 2515 2515 … … 2533 2533 item[2].SetBackgroundColour("pink") 2534 2534 msg = "Wrong Fit parameter value entered " 2535 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2535 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2536 2536 2537 2537 return is_modified … … 2763 2763 # Focus on Fit button so that users can see the pinky box 2764 2764 self.btFit.SetFocus() 2765 wx.PostEvent(self. parent.parent,2765 wx.PostEvent(self._manager.parent, 2766 2766 StatusEvent(status=msg, info="error")) 2767 2767 … … 2785 2785 return 2786 2786 self._default_save_location = os.path.dirname(path) 2787 if self. parent!= None:2788 self. parent.parent._default_save_location =\2787 if self._manager != None: 2788 self._manager.parent._default_save_location =\ 2789 2789 self._default_save_location 2790 2790 … … 2800 2800 # Tell the user that we are about to apply the distribution 2801 2801 msg = "Applying loaded %s distribution: %s" % (name, path) 2802 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2802 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2803 2803 self._set_array_disp_model(name=name, disp=disp, 2804 2804 values=values, weights=weights) … … 2947 2947 if flag == False: 2948 2948 msg = "Cannot Plot :Must enter a number!!! " 2949 wx.PostEvent(self. parent.parent, StatusEvent(status=msg))2949 wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 2950 2950 else: 2951 2951 # set relative text ctrs. … … 2983 2983 res_item = None 2984 2984 # call gui_manager 2985 gui_manager = self. parent.parent2985 gui_manager = self._manager.parent 2986 2986 # loops through the panels [dic] 2987 2987 for _, item2 in gui_manager.plot_panels.iteritems():
Note: See TracChangeset
for help on using the changeset viewer.