Changeset 2310d69 in sasview for guiframe/gui_manager.py


Ignore:
Timestamp:
Jun 11, 2008 2:10:48 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
4101eea
Parents:
de9483d
Message:

Improved context menu functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_manager.py

    rcbb2e40 r2310d69  
    6464 
    6565        ## Next available ID for wx gui events  
     66        #TODO:  No longer used - remove all calls to this  
    6667        self.next_id = 20000 
     68 
     69        # Default locations 
     70        self._default_save_location = os.getcwd()         
    6771 
    6872        ## Default welcome panel 
     
    199203                              CenterPane(). 
    200204                              BestSize(wx.Size(900,800)). 
    201                               MinSize(wx.Size(900,800)). 
     205                              MinSize(wx.Size(800,700)). 
    202206                              Show()) 
    203207 
     
    216220                                          CenterPane(). 
    217221                                          BestSize(wx.Size(600,600)). 
    218                                           MinSize(wx.Size(600,600)). 
     222                                          MinSize(wx.Size(200,200)). 
    219223                                          Hide()) 
    220224                 
     
    235239                                  #Show(). 
    236240                                  BestSize(wx.Size(400,400)). 
    237                                   MinSize(wx.Size(100,100))) 
    238                  
    239          
    240     def get_context_menu(self): 
     241                                  MinSize(wx.Size(300,200))) 
     242                 
     243         
     244    def get_context_menu(self, graph=None): 
    241245        """ 
    242246            Get the context menu items made available  
     
    247251        for item in self.plugins: 
    248252            if hasattr(item, "get_context_menu"): 
    249                 menu_list.extend(item.get_context_menu()) 
     253                menu_list.extend(item.get_context_menu(graph)) 
    250254             
    251255        return menu_list 
     
    533537        #TODO: clean this up 
    534538        from data_loader import choose_data_file 
    535         return choose_data_file(self) 
     539        path = choose_data_file(self, self._default_save_location) 
     540        if not path==None: 
     541            try: 
     542                self._default_save_location = os.path.dirname(path) 
     543            except: 
     544                pass 
     545        return path 
     546     
     547    def load_ascii_1D(self, path): 
     548        from data_loader import load_ascii_1D 
     549        return load_ascii_1D(path) 
    536550                   
    537551class DefaultPanel(wx.Panel): 
Note: See TracChangeset for help on using the changeset viewer.