Changeset 37c36d9 in sasview


Ignore:
Timestamp:
Sep 3, 2011 5:17:11 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
53cf669
Parents:
dc51a7f
Message:

added capability of modifying the Graph window caption

Location:
sansguiframe/src/sans/guiframe
Files:
3 edited

Legend:

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

    rd9c5777 r37c36d9  
    23512351            self.cpanel_on_focus.on_reset(event) 
    23522352             
     2353    def on_change_caption(self, name, old_caption, new_caption):      
     2354        """ 
     2355        Change the panel caption 
     2356         
     2357        :param name: window_name of the pane 
     2358        :param old_caption: current caption [string] 
     2359        :param new_caption: new caption [string] 
     2360        """ 
     2361        # wx.aui.AuiPaneInfo 
     2362        pane_info = self.get_paneinfo(name)  
     2363        # New Caption 
     2364        pane_info.Caption(new_caption) 
     2365        # update the data_panel.cb_plotpanel 
     2366        if 'data_panel' in self.panels.keys(): 
     2367            # remove from data_panel combobox 
     2368            data_panel = self.panels["data_panel"] 
     2369            if data_panel.cb_plotpanel is not None: 
     2370                pos = data_panel.cb_plotpanel.FindString(str(old_caption))  
     2371                if pos != wx.NOT_FOUND: 
     2372                    data_panel.cb_plotpanel.SetString(pos, new_caption) 
     2373                    data_panel.cb_plotpanel.SetStringSelection(new_caption) 
     2374        # update window Show menu 
     2375        if self._window_menu != None: 
     2376            for item in self._window_menu.GetMenuItems(): 
     2377                pos = self._window_menu.FindItem(old_caption) 
     2378                if self._window_menu.GetLabel(pos) == str(old_caption): 
     2379                    self._window_menu.SetLabel(pos, new_caption) 
     2380                break 
     2381        # update aui manager 
     2382        self._mgr.Update() 
     2383         
     2384    def get_paneinfo(self, name): 
     2385        """ 
     2386        Get pane Caption from window_name 
     2387         
     2388        :param name: window_name in AuiPaneInfo 
     2389        : return: AuiPaneInfo of the name 
     2390        """ 
     2391        return self._mgr.GetPane(name)  
     2392     
    23532393    def enable_undo(self): 
    23542394        """ 
     
    25072547            except: 
    25082548                pass 
    2509         #print self.callback,self.schedule,self.schedule_full_draw_list 
    25102549         
    25112550        # Draw all panels         
  • sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py

    rdc51a7f r37c36d9  
    5050    window_name = "plotpanel" 
    5151    ## Title to appear on top of the window 
    52     window_caption = "Plot Panel" 
     52    window_caption = "Graph" 
    5353    ## Flag to tell the GUI manager that this panel is not 
    5454    #  tied to any perspective 
     
    458458        self._slicerpop.AppendSeparator() 
    459459        id = wx.NewId() 
    460         self._slicerpop.Append(id, '&Reset Graph') 
     460        self._slicerpop.Append(id, '&Reset Range') 
    461461        wx.EVT_MENU(self, id, self.onResetGraph)   
    462462        try: 
     
    466466            pos_x, pos_y = self.toolbar.GetPositionTuple() 
    467467            pos = (pos_x, pos_y + 5) 
    468  
     468             
     469        self._slicerpop.AppendSeparator() 
     470        id = wx.NewId() 
     471        self._slicerpop.Append(id, '&Window Title') 
     472        wx.EVT_MENU(self, id, self.onChangeCaption) 
     473         
    469474        self.PopupMenu(self._slicerpop, pos) 
    470475         
  • sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py

    rdc51a7f r37c36d9  
    390390            pos = (pos_x, pos_y + 5) 
    391391        self.PopupMenu(slicerpop, pos) 
     392         
     393        slicerpop.AppendSeparator() 
     394        id = wx.NewId() 
     395        slicerpop.Append(id, '&Window Title') 
     396        wx.EVT_MENU(self, id, self.onChangeCaption) 
     397         
     398        self.PopupMenu(self._slicerpop, pos) 
    392399             
    393400    def onEditLabels(self, event): 
Note: See TracChangeset for help on using the changeset viewer.