Ignore:
Timestamp:
Jun 27, 2011 4:43:40 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:
2c6b224
Parents:
904193cd
Message:

added copy and paste menu in the menubar and toolbar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/basepage.py

    r37e0e5d r07c8630  
    531531        return new_state   
    532532     
     533    def on_copy(self, event): 
     534        """ 
     535        Copy Parameter values to the clipboad 
     536        """ 
     537        flag = self.get_copy() 
     538        if event != None: 
     539            event.Skip() 
     540        # messages depending on the flag 
     541        self._copy_info(flag) 
     542         
     543    def on_paste(self, event): 
     544        """ 
     545        Paste Parameter values to the panel if possible 
     546        """ 
     547        flag = self.get_paste() 
     548        if event != None: 
     549            event.Skip() 
     550        # messages depending on the flag 
     551        self._copy_info(flag) 
     552         
     553    def _copy_info(self, flag): 
     554        """ 
     555        Send event dpemding on flag 
     556         
     557        : Param flag: flag that distinguish event 
     558        """ 
     559        # messages depending on the flag 
     560        if flag == None: 
     561            msg = " Parameter values are copied to the clipboard..." 
     562            infor = 'warning' 
     563        elif flag: 
     564            msg = " Parameter values are pasted from the clipboad..." 
     565            infor = "warning" 
     566        else: 
     567            msg = "Error was occured " 
     568            msg += ": No valid parameter values to paste from the clipboard..." 
     569            infor = "error" 
     570        # inform msg to wx 
     571        wx.PostEvent( self.parent.parent,  
     572                      StatusEvent(status= msg, info=infor)) 
     573         
    533574    def _get_time_stamp(self): 
    534575        """ 
Note: See TracChangeset for help on using the changeset viewer.