diff orpg/chat/chatwnd.py @ 92:68c7bd272f27 beta

Traipse Beta 'OpenRPG' {090919-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: Adds menu changes to draw attention to important updates, errors, or other events. (image info coming soon) Traipse URL is not included in the repos tab and is set as default. Fixes Copy for Windows and Linux (finally!!) users. Fixes incomplete update to Grid and List nodes. Fixes incomplete update to Chat Commands. Fixes problems with Remote Image Upload. Fixes Drop and Drag of Minis to Map. CherryPy can now use any image in the webfiles/ folder and sub-folders. CherryPy can now Drop and Drag Minis to the Map. Minor changes to Update Manager's GUI. Expert recommendation warning added to Revision Update. Step down compatibility with open_rpg & component added to orpgCore. Using majority of 'Grumpy' network folder to correct server lag.
author sirebral
date Sat, 19 Sep 2009 06:50:43 -0500
parents 2fa8bd6785a5
children 65c1604e7949 7ed4979cc1cf
line wrap: on
line diff
--- a/orpg/chat/chatwnd.py	Wed Sep 09 17:12:59 2009 -0500
+++ b/orpg/chat/chatwnd.py	Sat Sep 19 06:50:43 2009 -0500
@@ -72,7 +72,8 @@
 from orpg.tools.orpg_settings import settings
 from orpg.orpgCore import component
 from orpg.tools.orpg_log import logger
-from orpg.tools.decorators import debugging
+from orpg.tools.decorators import debugging
+
 NEWCHAT = False
 try:
     import wx.webview
@@ -175,11 +176,11 @@
         self.menu.AppendItem(item)
 
     @debugging
-    def OnM_EditCopy(self, evt):
-        wx.TheClipboard.Open()
-        wx.TheClipboard.Clear()
-        wx.TheClipboard.SetData(wx.TextDataObject(self.SelectionToText()))
-        wx.TheClipboard.Close()
+    def OnM_EditCopy(self, evt):
+        wx.TheClipboard.UsePrimarySelection(False)
+        wx.TheClipboard.Open()
+        wx.TheClipboard.SetData(wx.TextDataObject(self.SelectionToText()))
+        wx.TheClipboard.Close()
 
     @debugging
     def scroll_down(self):
@@ -289,8 +290,11 @@
             wx.CallAfter(self.parent.set_chat_text_focus, None)
 
         @debugging
-        def OnM_EditCopy(self, evt):
-            self.Copy()
+        def OnM_EditCopy(self, evt):
+            wx.TheClipboard.UsePrimarySelection(False)
+            wx.TheClipboard.Open()
+            wx.TheClipboard.SetData(wx.TextDataObject(self.SelectionToText()))
+            wx.TheClipboard.Close()
 
         #Cutom Methods
         @debugging
@@ -874,15 +878,10 @@
         self.Bind(wx.EVT_BUTTON, self.lock_scroll, self.scroll_lock)
         self.chattxt.Bind(wx.EVT_MOUSEWHEEL, self.chatwnd.mouse_wheel)
         self.chattxt.Bind(wx.EVT_CHAR, self.chattxt.OnChar)
-        self.chattxt.Bind(wx.EVT_TEXT_COPY, self.textCopy)
+        self.chattxt.Bind(wx.EVT_TEXT_COPY, self.chatwnd.OnM_EditCopy)
     # def build_ctrls - end
 
     @debugging
-    def textCopy(self, event):
-        if self.chattxt.GetStringSelection() == '': self.chatwnd.OnM_EditCopy(None)
-        else: self.chatwnd.Copy()
-
-    @debugging
     def build_bar(self):
         self.toolbar_sizer = wx.BoxSizer(wx.HORIZONTAL)
         self.scroll_lock = None