Ignore:
Timestamp:
Apr 23, 2012 10:00:49 AM (12 years ago)
Author:
Robert Whitley <robert.whitley@…>
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:
2ee5c61
Parents:
3553ad2
Message:

Refs #36. Delete should be cross button and hide should be a toolbar button.

Clean up some warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/gui_manager.py

    r5cc6d20 r6e75ed0  
    427427            if count >= 2: 
    428428                column_names_line = line 
    429                 first_data_index = index 
    430429                break  
    431430            
     
    460459        fd.write(str(details)) 
    461460        for col_name  in data.keys(): 
    462              fd.write(str(col_name)) 
    463              fd.write(separator) 
     461            fd.write(str(col_name)) 
     462            fd.write(separator) 
    464463        fd.write('\n') 
    465464        max_list = [len(value) for value in data.values()] 
     
    904903        # Show a default panel with some help information 
    905904        # It also sets the size of the application windows 
    906         #TODO: Use this for slpash screen 
     905        #TODO: Use this for splash screen 
    907906        if self.defaultPanel is None: 
    908907            self.defaultPanel = DefaultPanel(self, -1, style=wx.RAISED_BORDER) 
     
    10281027        return menu_list 
    10291028         
     1029         
     1030    def on_panel_close(self, event): 
     1031        """ 
     1032        Gets called when the close event for a panel runs. 
     1033        This will check which panel has been closed and 
     1034        delete it. 
     1035        """ 
     1036        panel = event.GetPane() 
     1037        for ID in self.plot_panels.keys(): 
     1038            if self.plot_panels[ID].window_name == panel.name: 
     1039                self.delete_panel(ID) 
     1040                break 
     1041     
     1042     
    10301043    def popup_panel(self, p): 
    10311044        """ 
     
    10451058            windowcaption = 'Graph'#p.window_caption 
    10461059        windowname = p.window_name 
    1047         """ 
    1048         count = 0 
    1049         for item in self.panels: 
    1050             if self.panels[item].window_name.startswith(p.window_name)\ 
    1051                or self._mgr.GetPane(p.window_name).IsOk():  
    1052                 count += 1 
    1053          
    1054         if count > 0: 
    1055             windowname += str(count+1) 
    1056         """ 
     1060 
    10571061        # Append nummber 
    10581062        captions = self._get_plotpanel_captions() 
     
    10671071        if p.window_caption.split()[0] not in NOT_SO_GRAPH_LIST: 
    10681072            p.window_caption = caption  
    1069         #p.window_caption = windowcaption+ str(self.graph_num) 
    10701073        p.window_name = windowname + str(self.graph_num) 
    10711074         
     
    11001103             
    11011104            self._popup_floating_panel(p) 
    1102    
     1105         
     1106        # Register for closing of panels 
     1107        self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_panel_close) 
    11031108        # Register for showing/hiding the panel 
    11041109        wx.EVT_MENU(self, ID, self.on_view) 
     
    14751480        """ 
    14761481         
    1477          # File menu 
     1482        # File menu 
    14781483        self._file_menu = wx.Menu() 
    14791484        #append item from plugin under menu file if necessary 
     
    17421747            if self._mgr.GetPane(self.panels[ID].window_name).IsShown(): 
    17431748                self._mgr.GetPane(self.panels[ID].window_name).Hide() 
     1749                item = self._plotting_plugin.menu.FindItemById(uid) 
     1750                item.Check(False) 
    17441751                if self._data_panel is not None and \ 
    17451752                            ID in self.plot_panels.keys(): 
     
    17691776            panel.Close() 
    17701777            if panel in self.schedule_full_draw_list: 
    1771                self.schedule_full_draw_list.remove(panel)  
     1778                self.schedule_full_draw_list.remove(panel)  
    17721779             
    17731780            #delete uid number not str(uid) 
     
    18391846            path = os.path.abspath(path) 
    18401847            if not os.path.isfile(path) and not os.path.isdir(path): 
    1841                return 
     1848                return 
    18421849             
    18431850            if os.path.isdir(path): 
     
    20542061                logging.error(msg) 
    20552062        except: 
    2056            msg = "Error occurred while saving: " 
    2057            msg += "To save, at leat one application panel " 
    2058            msg += "should have a data set.." 
    2059            wx.PostEvent(self, StatusEvent(status=msg))     
     2063            msg = "Error occurred while saving: " 
     2064            msg += "To save, at leat one application panel " 
     2065            msg += "should have a data set.." 
     2066            wx.PostEvent(self, StatusEvent(status=msg))     
    20602067                     
    20612068    def on_save_helper(self, doc, reader, panel, path): 
     
    34973504    app = ViewApp(0) 
    34983505    app.MainLoop() 
    3499  
    3500               
Note: See TracChangeset for help on using the changeset viewer.