IDEFrame.py
changeset 1015 50bb7cc12a84
parent 1010 44c3cafef436
child 1019 e5686874eaef
--- a/IDEFrame.py	Fri Mar 29 14:23:18 2013 +0900
+++ b/IDEFrame.py	Fri Apr 05 00:05:40 2013 +0200
@@ -717,7 +717,7 @@
     def SelectTab(self, tab):
         for notebook in [self.LeftNoteBook, self.BottomNoteBook, self.RightNoteBook]:
             idx = notebook.GetPageIndex(tab)
-            if idx != wx.NOT_FOUND:
+            if idx != wx.NOT_FOUND and idx != notebook.GetSelection():
                 notebook.SetSelection(idx)
                 return
 
@@ -879,8 +879,13 @@
                 event.Veto()
         
 
-    def GetCopyBuffer(self):
+    def GetCopyBuffer(self, primary_selection=False):
         data = None
+        if primary_selection:
+            if wx.Platform != '__WXMSW__':
+                wx.TheClipboard.UsePrimarySelection(primary_selection)
+            else:
+                return data
         if wx.TheClipboard.Open():
             dataobj = wx.TextDataObject()
             if wx.TheClipboard.GetData(dataobj):
@@ -888,7 +893,12 @@
             wx.TheClipboard.Close()
         return data
         
-    def SetCopyBuffer(self, text):
+    def SetCopyBuffer(self, text, primary_selection=False):
+        if primary_selection:
+            if wx.Platform != '__WXMSW__':
+                wx.TheClipboard.UsePrimarySelection(primary_selection)
+            else:
+                return
         if wx.TheClipboard.Open():
             data = wx.TextDataObject()
             data.SetText(text)