715 event.Skip() |
715 event.Skip() |
716 |
716 |
717 def SelectTab(self, tab): |
717 def SelectTab(self, tab): |
718 for notebook in [self.LeftNoteBook, self.BottomNoteBook, self.RightNoteBook]: |
718 for notebook in [self.LeftNoteBook, self.BottomNoteBook, self.RightNoteBook]: |
719 idx = notebook.GetPageIndex(tab) |
719 idx = notebook.GetPageIndex(tab) |
720 if idx != wx.NOT_FOUND: |
720 if idx != wx.NOT_FOUND and idx != notebook.GetSelection(): |
721 notebook.SetSelection(idx) |
721 notebook.SetSelection(idx) |
722 return |
722 return |
723 |
723 |
724 #------------------------------------------------------------------------------- |
724 #------------------------------------------------------------------------------- |
725 # Saving and restoring frame organization functions |
725 # Saving and restoring frame organization functions |
877 event.Skip() |
877 event.Skip() |
878 else: |
878 else: |
879 event.Veto() |
879 event.Veto() |
880 |
880 |
881 |
881 |
882 def GetCopyBuffer(self): |
882 def GetCopyBuffer(self, primary_selection=False): |
883 data = None |
883 data = None |
|
884 if primary_selection: |
|
885 if wx.Platform != '__WXMSW__': |
|
886 wx.TheClipboard.UsePrimarySelection(primary_selection) |
|
887 else: |
|
888 return data |
884 if wx.TheClipboard.Open(): |
889 if wx.TheClipboard.Open(): |
885 dataobj = wx.TextDataObject() |
890 dataobj = wx.TextDataObject() |
886 if wx.TheClipboard.GetData(dataobj): |
891 if wx.TheClipboard.GetData(dataobj): |
887 data = dataobj.GetText() |
892 data = dataobj.GetText() |
888 wx.TheClipboard.Close() |
893 wx.TheClipboard.Close() |
889 return data |
894 return data |
890 |
895 |
891 def SetCopyBuffer(self, text): |
896 def SetCopyBuffer(self, text, primary_selection=False): |
|
897 if primary_selection: |
|
898 if wx.Platform != '__WXMSW__': |
|
899 wx.TheClipboard.UsePrimarySelection(primary_selection) |
|
900 else: |
|
901 return |
892 if wx.TheClipboard.Open(): |
902 if wx.TheClipboard.Open(): |
893 data = wx.TextDataObject() |
903 data = wx.TextDataObject() |
894 data.SetText(text) |
904 data.SetText(text) |
895 wx.TheClipboard.SetData(data) |
905 wx.TheClipboard.SetData(data) |
896 wx.TheClipboard.Flush() |
906 wx.TheClipboard.Flush() |