- Timestamp:
- May 13, 2011 5:00:46 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:
- 000b025
- Parents:
- a03d419
- Location:
- guiframe
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_panel.py
ra03d419 re26d0db 24 24 from sans.guiframe.events import EVT_DELETE_PLOTPANEL 25 25 from sans.guiframe.events import NewLoadDataEvent 26 from sans.guiframe.events import NewPlotEvent 26 27 from sans.guiframe.gui_style import GUIFRAME 27 28 from DataLoader.loader import Loader … … 155 156 156 157 self.sizer2 = wx.BoxSizer(wx.VERTICAL) 157 self.sizer3 = wx.FlexGridSizer( 6, 2, 0, 0)158 self.sizer3 = wx.FlexGridSizer(7, 2, 0, 0) 158 159 self.sizer4 = wx.BoxSizer(wx.HORIZONTAL) 159 160 self.sizer5 = wx.BoxSizer(wx.VERTICAL) … … 270 271 self.bt_freeze.SetToolTipString("To trigger freeze a theory") 271 272 wx.EVT_BUTTON(self, self.bt_freeze.GetId(), self.on_freeze) 273 #hide plot 274 self.bt_close_plot = wx.Button(self, wx.NewId(), "Close Plot", 275 size=(BUTTON_WIDTH, -1)) 276 self.bt_freeze.SetToolTipString("Close the plot panel on focus") 277 wx.EVT_BUTTON(self, self.bt_close_plot.GetId(), self.on_close_plot) 272 278 273 279 self.cb_plotpanel = wx.ComboBox(self, -1, size=(CBOX_WIDTH, -1), … … 287 293 ((10, 10)), 288 294 (self.bt_freeze), 295 ((10, 10)), 296 (self.bt_close_plot), 289 297 ((10, 10))]) 290 298 … … 296 304 self.enable_append() 297 305 self.enable_freeze() 306 self.enable_remove_plot() 298 307 299 308 def layout_batch(self): … … 613 622 item, _, _ = value 614 623 if item.IsChecked(): 615 self.tree_ctrl.Delete(item) 624 try: 625 self.tree_ctrl.Delete(item) 626 except: 627 pass 616 628 theory_key.append(key) 629 617 630 #Remove data and related theory references 618 631 for key in data_key: … … 624 637 for t_key, theory_dict in self.list_cb_theory.iteritems(): 625 638 if key in theory_dict: 639 for key, value in theory_dict.iteritems(): 640 item, _, _ = value 641 if item.IsChecked(): 642 try: 643 self.tree_ctrl_theory.Delete(item) 644 except: 645 pass 626 646 del theory_dict[key] 647 627 648 628 649 self.parent.remove_data(data_id=data_to_remove, … … 630 651 self.enable_remove() 631 652 self.enable_freeze() 653 self.enable_remove_plot() 632 654 633 655 def on_import(self, event=None): … … 659 681 theory_id=theory_id, 660 682 append=False) 683 self.enable_remove_plot() 661 684 662 685 def on_close_page(self, event=None): … … 707 730 break 708 731 self.enable_append() 732 self.enable_remove_plot() 709 733 710 734 def _on_perspective_selection(self, event=None): … … 718 742 perspective.on_perspective(event=None) 719 743 720 def _on_plot_selection(self, event =None):744 def _on_plot_selection(self, event=None): 721 745 """ 722 746 On source combobox selection … … 732 756 panel = combo.GetClientData(selection) 733 757 self.parent.on_set_plot_focus(panel) 758 759 def on_close_plot(self, event): 760 """ 761 clseo the panel on focus 762 """ 763 self.enable_append() 764 selection = self.cb_plotpanel.GetSelection() 765 if self.cb_plotpanel.GetValue() != 'None': 766 panel = self.cb_plotpanel.GetClientData(selection) 767 if self.parent is not None and panel is not None: 768 wx.PostEvent(self.parent, 769 NewPlotEvent(group_id=panel.group_id, 770 action="delete")) 771 self.enable_remove_plot() 772 773 def enable_remove_plot(self): 774 """ 775 enable remove plot button if there is a plot panel on focus 776 """ 777 if self.cb_plotpanel.GetCount() == 0: 778 self.bt_close_plot.Disable() 779 else: 780 self.bt_close_plot.Enable() 734 781 735 782 def enable_remove(self): … … 847 894 #self.bt_remove.Hide() 848 895 self.bt_add.Hide() 896 849 897 850 898 -
guiframe/gui_manager.py
ra03d419 re26d0db 1180 1180 self._mgr.Update() 1181 1181 return 1182 if ID in self.panels.keys():1183 del self.panels[ID]1184 if ID in self.plot_panels.keys():1185 del self.plot_panels[ID]1186 if self._data_panel is not None:1187 ind = self._data_panel.cb_plotpanel.FindString(str(caption))1188 if ind != wx.NOT_FOUND:1189 self._data_panel.cb_plotpanel.Delete(ind)1190 1191 self._mgr.Update()1192 1193 1182 1194 1183 def clear_panel(self): … … 1761 1750 else delete theory 1762 1751 """ 1752 temp = data_id + theory_id 1763 1753 for plug in self.plugins: 1764 plug.delete_data( data_id)1754 plug.delete_data(temp) 1765 1755 total_plot_list = [] 1766 1756 data_list, _ = self._data_manager.get_by_id(data_id) -
guiframe/local_perspectives/data_loader/data_loader.py
ra03d419 re26d0db 67 67 self._load_folder)) 68 68 return menu_list 69 70 def unused_populate_menu(self, parent): 71 """ 72 """ 73 # Add menu data 74 self._data_menu = wx.Menu() 75 #menu for data files 76 data_file_id = wx.NewId() 77 data_file_hint = "load one or more data in the application" 78 self._data_menu.Append(data_file_id, 79 '&Load Data File(s)', data_file_hint) 80 wx.EVT_MENU(self.parent, data_file_id, self.load_data) 81 gui_style = self.parent.get_style() 82 style = gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 83 style1 = gui_style & GUIFRAME.DATALOADER_ON 84 if style == GUIFRAME.MULTIPLE_APPLICATIONS: 85 #menu for data from folder 86 data_folder_id = wx.NewId() 87 data_folder_hint = "load multiple data in the application" 88 self._data_menu.Append(data_folder_id, 89 '&Load Data Folder', data_folder_hint) 90 wx.EVT_MENU(self.parent, data_folder_id, self._load_folder) 91 92 return [(self._data_menu, 'Data')] 69 93 70 94 71 def load_data(self, event): -
guiframe/local_perspectives/plotting/plotting.py
r13a63ab re26d0db 245 245 if group_id in self.plot_panels.keys(): 246 246 panel = self.plot_panels[group_id] 247 uid = panel.uid 247 248 wx.PostEvent(self.parent, 248 249 DeletePlotPanelEvent(name=panel.window_caption, … … 251 252 self.delete_menu_item(panel.window_caption, panel.uid) 252 253 del self.plot_panels[group_id] 254 self.parent.delete_panel(uid) 253 255 return True 254 256 return False
Note: See TracChangeset
for help on using the changeset viewer.