[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/forms/src/uidrivers/wx UIdriver.py
From: |
James Thompson |
Subject: |
gnue/forms/src/uidrivers/wx UIdriver.py |
Date: |
Thu, 31 Oct 2002 17:58:37 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: James Thompson <address@hidden> 02/10/31 17:58:37
Modified files:
forms/src/uidrivers/wx: UIdriver.py
Log message:
Mouse focus to specific character now works in multiline
text boxes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/uidrivers/wx/UIdriver.py.diff?tr1=1.200&tr2=1.201&r1=text&r2=text
Patches:
Index: gnue/forms/src/uidrivers/wx/UIdriver.py
diff -c gnue/forms/src/uidrivers/wx/UIdriver.py:1.200
gnue/forms/src/uidrivers/wx/UIdriver.py:1.201
*** gnue/forms/src/uidrivers/wx/UIdriver.py:1.200 Wed Oct 30 08:57:57 2002
--- gnue/forms/src/uidrivers/wx/UIdriver.py Thu Oct 31 17:58:37 2002
***************
*** 47,52 ****
--- 47,53 ----
_LOOPTRAP = 0
_PROMPTFORRECORD = None
_charWidth = 0
+ _charHeight = 0
_IdToWxObj = {}
_IdToGFObj = {}
_IdToUIObj = {}
***************
*** 231,238 ****
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
self.menu_sb_space=4 # the extra spaces needed by the menu, toolbar and
statusbar
--- 232,240 ----
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, _charHeight
_charWidth = self.charWidth # Used by the mouse handler to
compute char offset into widget
+ _charHeight = self.charHeight #
self.menu_sb_space=4 # the extra spaces needed by the menu, toolbar and
statusbar
***************
*** 1040,1065 ****
eventList = [wxEVT_LEFT_DOWN]
uiBaseEvtHandler.__init__(self, eventList, eventProcessor)
def _processEvent(self,event):
! global _charWidth
object = _eventObjTowxWindow(event)
- # compute the location of the character in the widget
- x,y = event.GetPositionTuple()
- cursorPosition = x/_charWidth
-
- # Move to proper object
id = object.GetId()
gfObject = _IdToGFObj[id]
screenWidget = _IdToWxObj[id]
count = _IdToUIObj[id].widgets.index(screenWidget)
! self._eventProcessor(events.Event('requestFOCUS',gfObject))
! self._eventProcessor(events.Event('requestJUMPRECORD',count -
gfObject._visibleIndex))
!
self._eventProcessor(events.Event('requestCURSORMOVE',position=cursorPosition))
# if gfObject._type == 'GFButton':
# self._eventProcessor(events.Event('fireTRIGGER',gfObject.trigger))
! event.Skip()
#
# keyboardEvtHandler
--- 1042,1092 ----
eventList = [wxEVT_LEFT_DOWN]
uiBaseEvtHandler.__init__(self, eventList, eventProcessor)
+ #
+ # The putzing about with the event timestamp is to
+ # allow us to process mouse click events twice.
+ # The mouse handler is called before the cursor
+ # position is updated so GetInsertionPoint returns
+ # the position from the widget losing focus.
+ # setting the timestamp to zero is a flag to prevent
+ # infinate loops and allow us to avoid process that does
+ # not need done twice.
+
def _processEvent(self,event):
! global _charWidth,_charHeight
object = _eventObjTowxWindow(event)
id = object.GetId()
gfObject = _IdToGFObj[id]
screenWidget = _IdToWxObj[id]
count = _IdToUIObj[id].widgets.index(screenWidget)
!
! if event.GetTimestamp():
! self._eventProcessor(events.Event('requestFOCUS',gfObject))
! self._eventProcessor(events.Event('requestJUMPRECORD',count -
gfObject._visibleIndex))
!
! if isinstance(screenWidget,wxTextCtrl):
! event.SetTimestamp(0)
! self.AddPendingEvent(event)
!
! else:
! textObject= wxPyTypeCast(object, 'wxTextCtrl')
! cursorPosition = textObject.GetInsertionPoint()
!
self._eventProcessor(events.Event('requestCURSORMOVE',position=cursorPosition))
!
! event.Skip()
! # if isinstance(screenWidget,wxTextCtrl):
! # event.SetTimestamp(0)
! # self.AddPendingEvent(event)
! #else:
! # textObject= wxPyTypeCast(object, 'wxTextCtrl')
! # cursorPosition = textObject.GetInsertionPoint()
! # print cursorPosition
!
# if gfObject._type == 'GFButton':
# self._eventProcessor(events.Event('fireTRIGGER',gfObject.trigger))
!
#
# keyboardEvtHandler
- gnue/forms/src/uidrivers/wx UIdriver.py, Jason Cater, 2002/10/07
- gnue/forms/src/uidrivers/wx UIdriver.py, Jason Cater, 2002/10/07
- gnue/forms/src/uidrivers/wx UIdriver.py, Jason Cater, 2002/10/08
- gnue/forms/src/uidrivers/wx UIdriver.py, Jason Cater, 2002/10/09
- gnue/forms/src/uidrivers/wx UIdriver.py, Arturas Kriukovas, 2002/10/15
- gnue/forms/src/uidrivers/wx UIdriver.py, James Thompson, 2002/10/30
- gnue/forms/src/uidrivers/wx UIdriver.py,
James Thompson <=