[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/forms/src/uidrivers/wx UIdriver.py
From: |
Jason Cater |
Subject: |
gnue/forms/src/uidrivers/wx UIdriver.py |
Date: |
Tue, 26 Feb 2002 19:24:33 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/02/26 19:24:33
Modified files:
forms/src/uidrivers/wx: UIdriver.py
Log message:
fixed printing of control codes via keyboard input; added debugging
code to clipboard routines
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/uidrivers/wx/UIdriver.py.diff?tr1=1.153&tr2=1.154&r1=text&r2=text
Patches:
Index: gnue/forms/src/uidrivers/wx/UIdriver.py
diff -c gnue/forms/src/uidrivers/wx/UIdriver.py:1.153
gnue/forms/src/uidrivers/wx/UIdriver.py:1.154
*** gnue/forms/src/uidrivers/wx/UIdriver.py:1.153 Fri Feb 22 20:08:16 2002
--- gnue/forms/src/uidrivers/wx/UIdriver.py Tue Feb 26 19:24:32 2002
***************
*** 186,193 ****
self.widgetWidth = self.charWidth # The pixel width of a 1 char
widget (for things like buttons)
self.widgetHeight = self.charHeight + 3 # The pixel height of a 1 char
widget (for things like buttons)
! self.textWidth = self.charWidth # The pixel width of text inside
a widget
! self.textHeight = self.charHeight # The pixel height of text inside
a widget
global _charWidth
_charWidth = self.charWidth # Used by the mouse handler to
compute char offset into widget
--- 186,193 ----
self.widgetWidth = self.charWidth # The pixel width of a 1 char
widget (for things like buttons)
self.widgetHeight = self.charHeight + 3 # The pixel height of a 1 char
widget (for things like buttons)
! self.textWidth = self.charWidth # The pixel width of text inside
a widget
! self.textHeight = self.charHeight # The pixel height of text inside
a widget
global _charWidth
_charWidth = self.charWidth # Used by the mouse handler to
compute char offset into widget
***************
*** 437,464 ****
#
def getClipboardContents(self, event):
! data = wxTextDataObject()
! wxTheClipboard.Open()
! success = wxTheClipboard.GetData(data)
! wxTheClipboard.Close()
if success:
value = data.GetText()
else:
value = None
! GDebug.printMesg(5, "Getting clipboard '%s'" % value)
event.__result__ = value
def setClipboardContents(self, event):
! print "Setting clipboard '%s'" % event.text
! wxTheClipboard.Open()
! value = wxTheClipboard.SetData(wxTextDataObject(event.text))
! wxTheClipboard.Close()
#############################################################################
--- 437,471 ----
#
def getClipboardContents(self, event):
! if wxTheClipboard.Open():
! data = wxTextDataObject()
! success = wxTheClipboard.GetData(data)
! wxTheClipboard.Close()
! else:
! success = 0
! GDebug.printMesg(5,'Unable to open clipboard for read')
if success:
value = data.GetText()
else:
+ GDebug.printMesg(5,'Unable to obtain clipboard contents. Defaulting to
Empty.')
value = None
! GDebug.printMesg(5, "Getting clipboard value '%s'" % value)
event.__result__ = value
def setClipboardContents(self, event):
! GDebug.printMesg(5,"Setting clipboard '%s'" % event.text)
! if wxTheClipboard.Open():
! value = wxTheClipboard.SetData(wxTextDataObject(event.text))
! GDebug.printMesg(10,"Set Clipboard Status: %s" % value)
! wxTheClipboard.Close()
+ else:
+ GDebug.printMesg(5,'Unable to open clipboard for write')
#############################################################################
***************
*** 941,947 ****
event.ControlDown(),
event.AltDown())
! # TODO : Broken for the moment, this should probably be form driven
#if command == 'JUMPRECORD':
# self.promptForRecordNumber()
--- 948,954 ----
event.ControlDown(),
event.AltDown())
! # TODO : Broken for the moment, this should probably be form driven
#if command == 'JUMPRECORD':
# self.promptForRecordNumber()
***************
*** 950,961 ****
else:
try:
! action = GFEvent('requestKEYPRESS', chr(event.KeyCode()),
! text=chr(event.KeyCode()),
code=event.KeyCode())
except ValueError:
pass #event.Skip()
!
if action:
self._eventProcessor(action)
--- 957,970 ----
else:
try:
! char = chr(event.KeyCode())
! if char in string.printable or char == "\n":
! action = GFEvent('requestKEYPRESS', char,
! text=char,
code=event.KeyCode())
except ValueError:
pass #event.Skip()
!
if action:
self._eventProcessor(action)