Changeset 951a2f5 in sasview for fittingview/src
- Timestamp:
- Sep 28, 2011 2:50:19 PM (13 years ago)
- 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:
- 817991b
- Parents:
- 079072e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
rc572e5e r951a2f5 153 153 ## dictionary of saved state 154 154 self.saved_states = {} 155 # clipbord str state 156 self.clipboard_str_state = None 155 157 ## Create context menu for page 156 158 self.popUpMenu = wx.Menu() … … 675 677 676 678 # messages depending on the flag 677 self._copy_info(None)679 #self._copy_info(None) 678 680 679 681 def on_paste(self, event): … … 2816 2818 event.Skip() 2817 2819 2818 2819 def get_copy(self): 2820 def get_copy(self): 2821 """ 2822 Get copy params to clipboard 2823 """ 2824 content = self.get_copy_params() 2825 flag = self.set_clipboard(content) 2826 self._copy_info(flag) 2827 return flag 2828 2829 def get_copy_params(self): 2820 2830 """ 2821 2831 Get the string copies of the param names and values in the tap … … 2844 2854 self.orientation_params) 2845 2855 content += string 2846 2856 return content 2857 else: 2858 return False 2859 2860 def set_clipboard(self, content=None): 2861 """ 2862 Put the string to the clipboard 2863 """ 2864 if not content: 2865 return False 2847 2866 if wx.TheClipboard.Open(): 2848 2867 wx.TheClipboard.SetData(wx.TextDataObject(str(content))) … … 2851 2870 text = data.GetText() 2852 2871 wx.TheClipboard.Close() 2853 2872 return True 2854 2873 return None 2855 2874 … … 2879 2898 2880 2899 return content 2881 2882 def get_paste(self): 2900 2901 def get_clipboard(self): 2902 """ 2903 Get strings in the clipboard 2904 """ 2905 text = "" 2906 # Get text from the clip board 2907 if wx.TheClipboard.Open(): 2908 if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): 2909 data = wx.TextDataObject() 2910 # get wx dataobject 2911 success = wx.TheClipboard.GetData(data) 2912 # get text 2913 text = data.GetText() 2914 # close clipboard 2915 wx.TheClipboard.Close() 2916 2917 return text 2918 2919 def get_paste(self): 2920 """ 2921 Paste params from the clipboard 2922 """ 2923 text = self.get_clipboard() 2924 2925 return self.get_paste_from_clipboard(text) 2926 2927 def get_paste_from_clipboard(self, text=''): 2883 2928 """ 2884 2929 Get the string copies of the param names and values in the tap 2885 2930 """ 2886 context = {} 2887 text = "" 2888 2889 # Get text from the clip board 2890 if wx.TheClipboard.Open(): 2891 if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): 2892 data = wx.TextDataObject() 2893 # get wx dataobject 2894 success = wx.TheClipboard.GetData(data) 2895 # get text 2896 text = data.GetText() 2897 # close clipboard 2898 wx.TheClipboard.Close() 2899 2931 context = {} 2900 2932 # put the text into dictionary 2901 2933 lines = text.split(':')
Note: See TracChangeset
for help on using the changeset viewer.