Changeset 2310d69 in sasview


Ignore:
Timestamp:
Jun 11, 2008 12: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

Location:
guiframe
Files:
3 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): 
  • guiframe/local_perspectives/plotting/plotting.py

    r278cc25 r2310d69  
    118118         
    119119        slicerpop.AppendSeparator() 
    120         item_list = self.parent.get_context_menu() 
     120        item_list = self.parent.get_context_menu(self.graph) 
    121121        if not item_list==None: 
    122122            for item in item_list: 
     
    131131        slicerpop.AppendSeparator() 
    132132         
     133        #id = wx.NewId() 
     134        #slicerpop.Append(id, '&Toggle Linear/Log scale') 
     135        #wx.EVT_MENU(self, id, self._onToggleScale) 
     136 
    133137        id = wx.NewId() 
    134         slicerpop.Append(id, '&Toggle Linear/Log scale') 
    135         wx.EVT_MENU(self, id, self._onToggleScale) 
     138        slicerpop.Append(id, '&Change scale') 
     139        wx.EVT_MENU(self, id, self._onProperties) 
    136140 
    137141        pos = event.GetPosition() 
  • guiframe/release_notes.txt

    r7afdc14 r2310d69  
    66Documentation to come... 
    77 
    8 1- Version 0.1.0 
     81- Version 0.1.1 
    99 
    1010        - Release date: 5/28/2008 
     11 
     12        - Changes: 
     13                * the Plugin.get_context_menu(graph) now takes a Graph object 
    1114 
    1215Dependencies: 
     
    3134          for additionally installed plug-ins. 
    3235        - Fix the damned images directory folder... 
     36        - Allow user to remove a plottable from a graph (from code!) 
     37        - Allow perspectives to recognize their own plots and add context menu items. 
     38        - Catch error when trying to show log of negative or zero plots... update status bar. 
    3339         
Note: See TracChangeset for help on using the changeset viewer.