You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(45) |
May
(185) |
Jun
|
Jul
(36) |
Aug
(205) |
Sep
(98) |
Oct
(107) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(2) |
Mar
(19) |
Apr
(26) |
May
(18) |
Jun
|
Jul
(12) |
Aug
(16) |
Sep
(22) |
Oct
(7) |
Nov
(11) |
Dec
(74) |
2006 |
Jan
(14) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(14) |
Jun
(5) |
Jul
(20) |
Aug
(10) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
(1) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(14) |
Aug
|
Sep
|
Oct
(6) |
Nov
(1) |
Dec
|
From: Kevin A. <ka...@us...> - 2004-04-27 22:03:14
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17350 Added Files: twistedModel.py Log Message: added TwistedApplication subclass for writing Twisted GUI apps added twistedEchoClient sample --- NEW FILE: twistedModel.py --- """ __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2004/04/27 22:03:05 $" """ """ Adapted from Uwe C. Schroeder's cookbook entry "Using wxPython with Twisted Python" http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/181780 """ import wx import model from twisted.internet import reactor class TwistedApplication(model.Application): def OnInit(self): model.Application.OnInit(self) reactor.startRunning() wx.EVT_TIMER(self, 999999, self.OnTimer) self.twistedTimer = wx.Timer(self, 999999) self.twistedTimer.Start(250, False) return True def OnTimer(self, event): reactor.runUntilCurrent() reactor.doIteration(0) def OnExit(self): # need to stop the timer for cleanup purposes self.twistedTimer.Stop() self.twistedTimer = None reactor.stop() |
From: Kevin A. <ka...@us...> - 2004-04-27 21:51:14
|
Update of /cvsroot/pythoncard/PythonCard/samples/twistedEchoClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15082/twistedEchoClient Log Message: Directory /cvsroot/pythoncard/PythonCard/samples/twistedEchoClient added to the repository |
From: Kevin A. <ka...@us...> - 2004-04-27 19:28:39
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13978 Modified Files: widget.py Log Message: added redraw method as a standard way of doing Refresh/Update Index: widget.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/widget.py,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** widget.py 25 Apr 2004 06:26:34 -0000 1.117 --- widget.py 27 Apr 2004 19:28:27 -0000 1.118 *************** *** 199,202 **** --- 199,207 ---- return self.GetBackgroundColour() + def redraw(self): + """Force an immediate redraw without waiting for an event handler to finish.""" + self.Refresh() + self.Update() + # KEA 2004-04-16 # if a subclass overrides any of the methods below then it needs to |
From: Kevin A. <ka...@us...> - 2004-04-27 18:14:46
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29907/components Modified Files: statictext.py Log Message: added Update call to _setText for immediate updates Index: statictext.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/statictext.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** statictext.py 21 Apr 2004 03:45:00 -0000 1.14 --- statictext.py 27 Apr 2004 18:14:38 -0000 1.15 *************** *** 54,60 **** raise 'invalid StaticText.alignment value: ', aString ! def _setText( self, aString ) : ! self.SetLabel( aString ) self.Refresh() def _getAlignment( self ) : --- 54,61 ---- raise 'invalid StaticText.alignment value: ', aString ! def _setText( self, aString): ! self.SetLabel(aString) self.Refresh() + self.Update() def _getAlignment( self ) : |
From: Kevin A. <ka...@us...> - 2004-04-27 17:22:39
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18724 Modified Files: event.py Log Message: bye bye EventMap, I comment thee out Index: event.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/event.py,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** event.py 27 Apr 2004 16:30:50 -0000 1.54 --- event.py 27 Apr 2004 17:22:28 -0000 1.55 *************** *** 157,162 **** def getName( self ) : ! global eventMap ! return eventMap.classToName( self.__class__ ) def sendTo( self, aOwner, aHandler ) : --- 157,163 ---- def getName( self ) : ! return self.name ! ## global eventMap ! ## return eventMap.classToName( self.__class__ ) def sendTo( self, aOwner, aHandler ) : *************** *** 551,662 **** ! class EventMap : ! """ ! Maps Event classes to handler names for use in user code, and vice-versa. ! """ ! def __init__( self ) : ! ! self._table = [ ! GainFocusEvent, ! LoseFocusEvent, ! MouseClickEvent, ! MouseDownEvent, ! MouseUpEvent, ! MouseDoubleClickEvent, ! MouseContextDownEvent, ! MouseContextUpEvent, ! MouseContextDoubleClickEvent, ! MouseMiddleDownEvent, ! MouseMiddleUpEvent, ! MouseMiddleDoubleClickEvent, ! MouseEnterEvent, ! MouseLeaveEvent, ! MouseMoveEvent, ! MouseDragEvent, ! CommandEvent, ! KeyPressEvent, ! KeyDownEvent, ! KeyUpEvent, ! TextUpdateEvent, ! TextEnterEvent, ! SelectEvent, ! MoveEvent, ! SizeEvent, ! CloseEvent, ! ActivateEvent, ! DeactivateEvent, ! MinimizeEvent, ! MaximizeEvent, ! IdleEvent, ! TimerEvent, ! ! #System Events ! CloseFieldEvent, ! ! #Background initialization ! InitializationEvent, ! ! # KEA 2004-04-26 ! # should the event map be updated as a component ! # module is loaded so that say a Button adds ! # its component-specific events to the EventMap ! # just like it registers itself with the registry? ! # Button events? ! ButtonMouseClickEvent, ! ! # Calendar events ! CalendarMouseDoubleClickEvent, ! CalendarChangedEvent, ! CalendarDayEvent, ! CalendarMonthEvent, ! CalendarYearEvent, ! CalendarWeekDayHeaderEvent, ! ! # Tree and MultiColumnList events ! MouseContextClickEvent, ! ItemFocusedEvent, ! ItemActivatedEvent, ! ItemExpandedEvent, ! ItemExpandingEvent, ! SelectionChangedEvent, ! SelectionChangingEvent, ! ListColumnClickEvent, ! ! IEHtmlTitleChangeEvent, ! IEHtmlStatusTextChangeEvent, ! IEHtmlDocumentCompleteEvent, ! ] ! ! self._classToNameMap = {} ! self._nameToClassMap = {} ! self._createClassToNameMap() ! self._createNameToClassMap() ! ! def _findEventClasses( self ) : ! """ ! Find all of the subclasses of Event in ! this module and put them in an array. ! """ ! for item in __dict__.itervalues(): ! if isinstance(item, types.ClassType): ! if issubclass(item, Event): ! self._table.append(item) ! ! def _createClassToNameMap( self ) : ! for clazz in self._table : ! self._classToNameMap[ clazz ] = clazz.name ! ! def _createNameToClassMap( self ) : ! for clazz in self._table : ! self._nameToClassMap[ clazz.name ] = clazz ! ! def classToName( self, aEventClass ) : ! return self._classToNameMap[ aEventClass ] ! ! def nameToClass( self, aName ) : ! return self._nameToClassMap[ aName ] ! ! def __repr__( self ) : ! return str( self._classToNameMap ) + '\n\n' + str( self._nameToClassMap ) queue = None --- 552,663 ---- ! ##class EventMap : ! ## """ ! ## Maps Event classes to handler names for use in user code, and vice-versa. ! ## """ ! ## def __init__( self ) : ! ## ! ## self._table = [ ! ## GainFocusEvent, ! ## LoseFocusEvent, ! ## MouseClickEvent, ! ## MouseDownEvent, ! ## MouseUpEvent, ! ## MouseDoubleClickEvent, ! ## MouseContextDownEvent, ! ## MouseContextUpEvent, ! ## MouseContextDoubleClickEvent, ! ## MouseMiddleDownEvent, ! ## MouseMiddleUpEvent, ! ## MouseMiddleDoubleClickEvent, ! ## MouseEnterEvent, ! ## MouseLeaveEvent, ! ## MouseMoveEvent, ! ## MouseDragEvent, ! ## CommandEvent, ! ## KeyPressEvent, ! ## KeyDownEvent, ! ## KeyUpEvent, ! ## TextUpdateEvent, ! ## TextEnterEvent, ! ## SelectEvent, ! ## MoveEvent, ! ## SizeEvent, ! ## CloseEvent, ! ## ActivateEvent, ! ## DeactivateEvent, ! ## MinimizeEvent, ! ## MaximizeEvent, ! ## IdleEvent, ! ## TimerEvent, ! ## ! ## #System Events ! ## CloseFieldEvent, ! ## ! ## #Background initialization ! ## InitializationEvent, ! ## ! ## # KEA 2004-04-26 ! ## # should the event map be updated as a component ! ## # module is loaded so that say a Button adds ! ## # its component-specific events to the EventMap ! ## # just like it registers itself with the registry? ! ## # Button events? ! ## ButtonMouseClickEvent, ! ## ! ## # Calendar events ! ## CalendarMouseDoubleClickEvent, ! ## CalendarChangedEvent, ! ## CalendarDayEvent, ! ## CalendarMonthEvent, ! ## CalendarYearEvent, ! ## CalendarWeekDayHeaderEvent, ! ## ! ## # Tree and MultiColumnList events ! ## MouseContextClickEvent, ! ## ItemFocusedEvent, ! ## ItemActivatedEvent, ! ## ItemExpandedEvent, ! ## ItemExpandingEvent, ! ## SelectionChangedEvent, ! ## SelectionChangingEvent, ! ## ListColumnClickEvent, ! ## ! ## IEHtmlTitleChangeEvent, ! ## IEHtmlStatusTextChangeEvent, ! ## IEHtmlDocumentCompleteEvent, ! ## ] ! ## ! ## self._classToNameMap = {} ! ## self._nameToClassMap = {} ! ## self._createClassToNameMap() ! ## self._createNameToClassMap() ! ## ! ## def _findEventClasses( self ) : ! ## """ ! ## Find all of the subclasses of Event in ! ## this module and put them in an array. ! ## """ ! ## for item in __dict__.itervalues(): ! ## if isinstance(item, types.ClassType): ! ## if issubclass(item, Event): ! ## self._table.append(item) ! ## ! ## def _createClassToNameMap( self ) : ! ## for clazz in self._table : ! ## self._classToNameMap[ clazz ] = clazz.name ! ## ! ## def _createNameToClassMap( self ) : ! ## for clazz in self._table : ! ## self._nameToClassMap[ clazz.name ] = clazz ! ## ! ## def classToName( self, aEventClass ) : ! ## return self._classToNameMap[ aEventClass ] ! ## ! ## def nameToClass( self, aName ) : ! ## return self._nameToClassMap[ aName ] ! ## ! ## def __repr__( self ) : ! ## return str( self._classToNameMap ) + '\n\n' + str( self._nameToClassMap ) queue = None *************** *** 697,703 **** # Module Initialization ! # RDS: A nasty global - I'm a BAD MONKEY! ! ! eventMap = EventMap() --- 698,704 ---- # Module Initialization ! ### RDS: A nasty global - I'm a BAD MONKEY! ! ## ! ##eventMap = EventMap() |
From: Kevin A. <ka...@us...> - 2004-04-27 17:22:39
|
Update of /cvsroot/pythoncard/PythonCard/samples/testevents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18724/samples/testevents Modified Files: testevents.py Log Message: bye bye EventMap, I comment thee out Index: testevents.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testevents/testevents.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** testevents.py 27 Apr 2004 06:07:48 -0000 1.15 --- testevents.py 27 Apr 2004 17:22:29 -0000 1.16 *************** *** 35,38 **** --- 35,40 ---- def on_close(self, event): print "close", event.target.name + self.fldTimer.stop() + self.btnTimer.stop() event.skip() |
From: Kevin A. <ka...@us...> - 2004-04-27 16:30:59
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6321 Modified Files: event.py Log Message: not sure Index: event.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/event.py,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** event.py 27 Apr 2004 02:43:33 -0000 1.53 --- event.py 27 Apr 2004 16:30:50 -0000 1.54 *************** *** 801,807 **** nativeEvent = None if handler: ! #handler._function = None ! #handler = None ! pass --- 801,805 ---- nativeEvent = None if handler: ! handler = None |
From: Kevin A. <ka...@us...> - 2004-04-27 06:07:57
|
Update of /cvsroot/pythoncard/PythonCard/samples/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639/samples/widgets Modified Files: widgets.py Log Message: removed findId, getIDbyName, getObjectByName replaced findLocalHandler with dictionary lookup Index: widgets.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/widgets/widgets.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** widgets.py 25 Apr 2004 03:03:45 -0000 1.35 --- widgets.py 27 Apr 2004 06:07:48 -0000 1.36 *************** *** 29,34 **** background. Compare the method of changing the attribute state in on_chkEnabled_mouseClick ! versus on_chkVisible_mouseClick. I'm using the new findAllComponents method ! to get a list of all the widgets at once. """ --- 29,34 ---- background. Compare the method of changing the attribute state in on_chkEnabled_mouseClick ! versus on_chkVisible_mouseClick. I'm using self.components.itervalues() ! to iterate over a list of all the widgets at once. """ |
From: Kevin A. <ka...@us...> - 2004-04-27 06:07:56
|
Update of /cvsroot/pythoncard/PythonCard/samples/testevents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639/samples/testevents Modified Files: testevents.py Log Message: removed findId, getIDbyName, getObjectByName replaced findLocalHandler with dictionary lookup Index: testevents.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testevents/testevents.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** testevents.py 27 Apr 2004 02:43:33 -0000 1.14 --- testevents.py 27 Apr 2004 06:07:48 -0000 1.15 *************** *** 23,26 **** --- 23,27 ---- self.btnTimer.start(3 * 1000) # 3 seconds self.components.btn.setFocus() + print " has focus:", self.findFocus().name def on_activate(self, event): *************** *** 104,107 **** --- 105,112 ---- event.skip() + def on_textUpdate(self, event): + print "textUpdate", event.target.name + event.skip() + def on_mouseDown(self, event): print "mouseDown", event.target.name |
From: Kevin A. <ka...@us...> - 2004-04-27 06:07:56
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12639 Modified Files: model.py Log Message: removed findId, getIDbyName, getObjectByName replaced findLocalHandler with dictionary lookup Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** model.py 27 Apr 2004 01:40:29 -0000 1.159 --- model.py 27 Apr 2004 06:07:48 -0000 1.160 *************** *** 250,257 **** # moved colourdb initialization to work with wxPython 2.5 # which requires a wxApp instance to exist before using colourdb - ###colourdb.updateColourDB() # KEA 2001-07-27 wx.InitAllImageHandlers() wx.App.__init__(self, 0) ! colourdb.updateColourDB() # KEA 2001-07-27 --- 250,256 ---- # moved colourdb initialization to work with wxPython 2.5 # which requires a wxApp instance to exist before using colourdb wx.InitAllImageHandlers() wx.App.__init__(self, 0) ! colourdb.updateColourDB() *************** *** 264,268 **** position, size, parentApp=self) - #self.pw.displayComponents(self._iterator.getCurrentBackground().findAllComponents()) self.pw.displayComponents(bg.components) self.pw.Show(self._showProperties) --- 263,266 ---- *************** *** 403,415 **** """ return isinstance(aObject, types.FunctionType) and aObject.__name__.split('_')[0] == 'on' - - # KEA 2001-09-07 - # I don't see much benefit to caching the handler list, it seems - # like it would be much simpler to parse the dictionary each time - # which will have a slight drop in efficiency, but greatly simplifies - # the code, since the handlers dictionary goes away and doesn't need - # to be kept in sync - # I made the change to findLocalHandler below, but left the old _handler - # code in until we know we don't need it def _addHandler(self, aMethod): --- 401,404 ---- *************** *** 443,459 **** either a Handler is found, or None is returned. """ ! handler = self.findLocalHandler( aString ) ! if handler is not None : return handler # We couldn't find a handler, so look in our parent. ! if self._parentScript is not None : handler = self._parentScript.findHandler( aString ) # have we found a Handler yet? ! if handler is not None : return handler --- 432,455 ---- either a Handler is found, or None is returned. """ ! # KEA 2004-04-26 ! # findHandler is actually called for each event dispatch ! # depending on the level of dynamic code we think we're going ! # to have it might be simpler to just statically bind when ! # the component is created ! if False: ! print "findHandler", aString, self ! handler = self._handlers.get(aString, None) ! if handler: return handler # We couldn't find a handler, so look in our parent. ! if self._parentScript: handler = self._parentScript.findHandler( aString ) # have we found a Handler yet? ! if handler: return handler *************** *** 469,474 **** #else: aString = words[0] + '_' + self.getName() + '_' + words[len(words) - 1] ! temp = self.findLocalHandler( aString ) ! if temp is not None: return temp else: --- 465,470 ---- #else: aString = words[0] + '_' + self.getName() + '_' + words[len(words) - 1] ! temp = self._handlers.get(aString, None) ! if temp: return temp else: *************** *** 476,514 **** # on_mouseClick, on_initialize aString = words[0] + '_' + words[len(words) - 1] ! return self.findLocalHandler( aString ) ! ! def findLocalHandler( self, aString ) : ! """ ! Look for a Handler in our list of Handlers only. ! KEA 2001-09-07 ! This version doesn't use a _handlers dictionary anymore ! it dynamically searches the current dictionary. ! I left the old _handlers initialization above in case ! we need to go back to it. ! """ ! """ ! aClass = self.__class__ ! for key in aClass.__dict__.keys() : ! value = aClass.__dict__[ key ] ! if isinstance(value, types.FunctionType): ! if self._isHandler( value ) : ! if value.__name__ == aString : ! return Handler( value.__name__, value ) ! ! """ - """ - for key in self._handlers.keys() : - handler = self._handlers[ key ] - if handler.getName() == aString : - return handler - return None - """ - # KEA 2001-11-29 this should be equivelant to the above loop - if aString in self._handlers: - return self._handlers[aString] - else: - return None - class Stack( event.Changeable, Scriptable ) : --- 472,477 ---- # on_mouseClick, on_initialize aString = words[0] + '_' + words[len(words) - 1] ! return self._handlers.get(aString, None) class Stack( event.Changeable, Scriptable ) : *************** *** 943,963 **** def _bindWindowEvents( self ) : wx.EVT_WINDOW_DESTROY(self, self.OnDestroy) - - def findId( self, targetPath ) : - # Find the widget that matches the name - # identified in targetPath. - return self.getIDbyName( targetPath ) - - def getIDbyName( self, widgetName ) : - try: - return self.components[ widgetName ].GetId() - except: - return -1 - - def getObjectByName( self, widgetName ) : - try: - return self.components[ widgetName ] - except: - return -1 # def postEvent( self, aEvent ) : --- 906,909 ---- *************** *** 1011,1014 **** --- 957,968 ---- self.close(True) + # KEA 2004-04-26 + # why do we need the methods below?! + # what is the use case for them? + # findComponentsByClass has some value + # but any app that needs it can easily do the method itself + # I blew away the same methods in CustomDialog + # getComponent, getComponents, findAllComponents, findComponentsByClass + # RDS = new API def getComponent( self, path ) : *************** *** 1047,1061 **** # we may want to put this someplace else, but we do need access # to the componenet list ! def findFocus( self ): ! widgetWX = wx.Window_FindFocus() # the wxPython widget that has focus if widgetWX is None: return None else: ! id = widgetWX.GetId() ! components = self.findAllComponents() ! for widget in components: ! if id == widget.GetId(): return widget ! return None # is this even possible? focus in another window maybe? # KEA 2004-03-17 --- 1001,1015 ---- # we may want to put this someplace else, but we do need access # to the componenet list ! def findFocus(self): ! # the wxPython widget that has focus ! widgetWX = wx.Window_FindFocus() if widgetWX is None: return None else: ! for widget in self.components.itervalues(): ! if widgetWX == widget: return widget ! # is this even possible? focus in another window maybe? ! return None # KEA 2004-03-17 *************** *** 1210,1268 **** pass - - def findId( self, targetPath ) : - # Find the widget that matches the name - # identified in targetPath. - return self.getIDbyName( targetPath ) - - - def getIDbyName( self, widgetName ) : - try: - return self.components[ widgetName ].GetId() - except: - return -1 - - def getObjectByName( self, widgetName ) : - try: - return self.components[ widgetName ] - except: - return -1 - - - def findAllComponents( self ) : - """ - Return a copy of the list of Components in this - Background. We're not just returning - self.components.values because we don't want - someone to inadvertently whack the internal list - of Components. - """ - components = [] - for component in self.components.itervalues() : - components.append( component ) - return components - - def findComponentsByClass( self, aComponentClass ) : - """ - Return a list of Component's that are instances - of the specified Component class. - """ - components = [] - for component in self.components.itervalues() : - if isinstance( component, aComponentClass ) : - components.append( component ) - return components - # KEA 2001-07-31 # we may want to put this someplace else, but we do need access # to the componenet list ! def findFocus( self ): ! widgetWX = wx.Window_FindFocus() # the wxPython widget that has focus ! id = widgetWX.GetId() ! components = self.findAllComponents() ! for widget in components: ! if id == widget.GetId(): return widget ! return None # is this even possible? focus in another window maybe? # these shouldn't be necessary --- 1164,1178 ---- pass # KEA 2001-07-31 # we may want to put this someplace else, but we do need access # to the componenet list ! def findFocus(self): ! # the wxPython widget that has focus ! widgetWX = wx.Window_FindFocus() ! for widget in self.components.itervalues(): ! if widgetWx == widget: return widget ! # is this even possible? focus in another window maybe? ! return None # these shouldn't be necessary |
From: Kevin A. <ka...@us...> - 2004-04-27 02:43:42
|
Update of /cvsroot/pythoncard/PythonCard/samples/testevents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15027/samples/testevents Modified Files: testevents.py testevents.rsrc.py Log Message: ButtonMouseClickEvent test added button driven by command to testevents sample Index: testevents.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testevents/testevents.rsrc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testevents.rsrc.py 7 Apr 2004 00:04:00 -0000 1.1 --- testevents.rsrc.py 27 Apr 2004 02:43:33 -0000 1.2 *************** *** 8,12 **** 'name':'bgMin', 'title':'Minimal PythonCard Application', ! 'size':( 300, 100 ), 'menubar': --- 8,12 ---- 'name':'bgMin', 'title':'Minimal PythonCard Application', ! 'size':( 300, 120 ), 'menubar': *************** *** 35,38 **** --- 35,43 ---- 'position':(150, 0), 'label':'btn' }, + { 'type':'Button', + 'name':'cmdBtn', + 'position':(150, 30), + 'label':'cmdBtn', + 'command':'setText' }, ] } Index: testevents.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testevents/testevents.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** testevents.py 25 Apr 2004 22:37:21 -0000 1.13 --- testevents.py 27 Apr 2004 02:43:33 -0000 1.14 *************** *** 116,119 **** --- 116,124 ---- event.skip() + def on_setText_command(self, event): + print "setText command", event.target.name + self.components.fld.text = "After setText" + event.skip() + def on_menuFileExit_select(self, event): self.close() |
From: Kevin A. <ka...@us...> - 2004-04-27 02:43:42
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15027/components Modified Files: button.py Log Message: ButtonMouseClickEvent test added button driven by command to testevents sample Index: button.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/button.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** button.py 21 Apr 2004 03:45:00 -0000 1.24 --- button.py 27 Apr 2004 02:43:33 -0000 1.25 *************** *** 8,15 **** from PythonCard import event, widget class ButtonSpec(widget.WidgetSpec): def __init__(self): ! events = [event.MouseClickEvent] attributes = { 'label':{'presence':'mandatory'}, --- 8,19 ---- from PythonCard import event, widget + ButtonEvents = [event.ButtonMouseClickEvent] class ButtonSpec(widget.WidgetSpec): def __init__(self): ! # KEA 2004-04-26 ! # test to use new event classes ! events = ButtonEvents ! ## events = [event.MouseClickEvent] attributes = { 'label':{'presence':'mandatory'}, *************** *** 83,88 **** def bindEvent(self, aEventClass): parent = self._component._parent ! if aEventClass is event.MouseClickEvent: ! wx.EVT_BUTTON(parent, self._component.GetId(), self._dispatch) def _dispatch(self, aWxEvent): --- 87,97 ---- def bindEvent(self, aEventClass): parent = self._component._parent ! # KEA 2004-04-26 ! # test to use new event classes ! if aEventClass is event.ButtonMouseClickEvent: ! event.ButtonMouseClickEvent.bindFunction(parent, self._component.GetId(), self._dispatch) ! ! ## if aEventClass is event.MouseClickEvent: ! ## wx.EVT_BUTTON(parent, self._component.GetId(), self._dispatch) def _dispatch(self, aWxEvent): *************** *** 96,105 **** evt = None ! if aWxEvent.GetEventType() == wx.wxEVT_COMMAND_BUTTON_CLICKED: ! if component._getCommand() is not None: ! evt = event.CommandEvent(component._getCommand(), component) ! evt.setNativeEvent(aWxEvent) ! else: ! evt = self._createEvent(event.MouseClickEvent, aWxEvent) if evt is not None: --- 105,138 ---- evt = None ! # KEA 2004-04-26 ! # test to use new event classes ! # this is a generic loop which because there is only ! # one event class in ButtonEvents is a little long-winded ! # as soon as we find a match we break out of the loop ! # if ButtonEvents was called ComponentSpecificEvents ! # or something generic then maybe this loop would be the same for ! # all components? ! # if we had a mapping of ids to event classes ! # then you could just use a try/except block and get the class ! # directly from the ButtonEvents list ! # eventClass = ButtonEvents[indexToClassMapping(eventType)] ! eventType = aWxEvent.GetEventType() ! for eventClass in ButtonEvents: ! if eventType == eventClass.id: ! if eventClass.command: ! if component._getCommand() is not None: ! evt = event.CommandEvent(component._getCommand(), component) ! evt.setNativeEvent(aWxEvent) ! else: ! evt = self._createEvent(eventClass, aWxEvent) ! else: ! evt = self._createEvent(eventClass, aWxEvent) ! break ! ## if aWxEvent.GetEventType() == wx.wxEVT_COMMAND_BUTTON_CLICKED: ! ## if component._getCommand() is not None: ! ## evt = event.CommandEvent(component._getCommand(), component) ! ## evt.setNativeEvent(aWxEvent) ! ## else: ! ## evt = self._createEvent(event.MouseClickEvent, aWxEvent) if evt is not None: |
From: Kevin A. <ka...@us...> - 2004-04-27 02:43:41
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15027 Modified Files: event.py Log Message: ButtonMouseClickEvent test added button driven by command to testevents sample Index: event.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/event.py,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** event.py 27 Apr 2004 01:43:54 -0000 1.52 --- event.py 27 Apr 2004 02:43:33 -0000 1.53 *************** *** 396,399 **** --- 396,404 ---- name = 'mouseClick' + class ButtonMouseClickEvent( Event ) : + name = 'mouseClick' + bindFunction = wx.EVT_BUTTON + id = wx.wxEVT_COMMAND_BUTTON_CLICKED + command = True class MouseDoubleClickEvent( Event ) : *************** *** 591,594 **** --- 596,607 ---- #Background initialization InitializationEvent, + + # KEA 2004-04-26 + # should the event map be updated as a component + # module is loaded so that say a Button adds + # its component-specific events to the EventMap + # just like it registers itself with the registry? + # Button events? + ButtonMouseClickEvent, # Calendar events |
From: Kevin A. <ka...@us...> - 2004-04-27 01:44:03
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5815 Modified Files: event.py Log Message: added if 0 to prevent createEvent debug print Index: event.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/event.py,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** event.py 27 Apr 2004 01:40:29 -0000 1.51 --- event.py 27 Apr 2004 01:43:54 -0000 1.52 *************** *** 1009,1013 **** # which is part of the _dispatch method above def _createEvent( self, aEventClass, aWxEvent ) : ! print "_createEvent", aEventClass evt = aEventClass( self._component ) evt.setNativeEvent( aWxEvent ) --- 1009,1014 ---- # which is part of the _dispatch method above def _createEvent( self, aEventClass, aWxEvent ) : ! if 0: ! print "DefaultEventBinding._createEvent", aEventClass evt = aEventClass( self._component ) evt.setNativeEvent( aWxEvent ) |
From: Kevin A. <ka...@us...> - 2004-04-27 01:40:38
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5327 Modified Files: event.py model.py Log Message: more temp memory leak code Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** model.py 26 Apr 2004 17:24:59 -0000 1.158 --- model.py 27 Apr 2004 01:40:29 -0000 1.159 *************** *** 708,711 **** --- 708,712 ---- evt._nativeEvent.target = evt._nativeEvent.eventObject = None evt._nativeEvent = None + evt._source = evt.target = None if 0: print evt Index: event.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/event.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** event.py 26 Apr 2004 17:24:59 -0000 1.50 --- event.py 27 Apr 2004 01:40:29 -0000 1.51 *************** *** 132,136 **** def __init__( self, aSource ) : ! self._source = aSource self._used = 0 # KEA 2002-03-07 --- 132,136 ---- def __init__( self, aSource ) : ! self._source = self.target = aSource self._used = 0 # KEA 2002-03-07 *************** *** 138,143 **** # add target manually since this is a custom event # and doesn't go through normal dispatch. ! self.target = self._source ! self.eventObject = self.target def getUsed( self ) : --- 138,145 ---- # add target manually since this is a custom event # and doesn't go through normal dispatch. ! ! # KEA 2004-04-26 ! # this isn't ever used ! #self.eventObject = self.target def getUsed( self ) : *************** *** 777,782 **** # Broadcast an EventAdapter that carries an Event, and a flag # indicating whether the Event was used or not. ! ! self._notifyEventListeners( EventAdapter(self, aEvent, used)) --- 779,794 ---- # Broadcast an EventAdapter that carries an Event, and a flag # indicating whether the Event was used or not. ! adapter = EventAdapter(self, aEvent, used) ! self._notifyEventListeners(adapter) ! # KEA 2004-04-26 ! # remove reference to event after notifying the listeners ! if 0: ! print "_notify", adapter.dispatched ! adapter.dispatched = None ! nativeEvent = None ! if handler: ! #handler._function = None ! #handler = None ! pass *************** *** 965,968 **** --- 977,983 ---- evt = self.wxEventIdMap[eventType](self._component) if evt.__class__ is MouseMoveEvent: + # KEA 2004-04-26 + # probably need t do the same kind of cleanup as below + # here before reassigning evt if aWxEvent.Dragging(): evt = MouseDragEvent(self._component) *************** *** 976,979 **** --- 991,998 ---- evt._nativeEvent.target = evt._nativeEvent.eventObject = None evt._nativeEvent = None + evt._source = evt.target = None + if 0: + print "self._component", self._component + self._component = None if 0: print evt |
From: Kevin A. <ka...@us...> - 2004-04-26 20:56:06
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11090 Modified Files: resource.py Log Message: changed __import__ to use globals() instead of locals() for the 2nd arg to remove the psyco warning per Armin Rigo's suggestion Index: resource.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/resource.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** resource.py 17 Apr 2004 14:22:26 -0000 1.4 --- resource.py 26 Apr 2004 20:55:56 -0000 1.5 *************** *** 20,28 **** try: #exec("from appcomponents import " + moduleName) ! __import__(APP_COMPONENTS_PACKAGE + '.' + moduleName, globals(), locals(), [APP_COMPONENTS_PACKAGE]) except ImportError, e: try: #exec("from components import " + moduleName) ! __import__(COMPONENTS_PACKAGE + '.' + moduleName, globals(), locals(), [COMPONENTS_PACKAGE]) except ImportError, e: log.error(e) --- 20,28 ---- try: #exec("from appcomponents import " + moduleName) ! __import__(APP_COMPONENTS_PACKAGE + '.' + moduleName, globals(), globals(), [APP_COMPONENTS_PACKAGE]) except ImportError, e: try: #exec("from components import " + moduleName) ! __import__(COMPONENTS_PACKAGE + '.' + moduleName, globals(), globals(), [COMPONENTS_PACKAGE]) except ImportError, e: log.error(e) |
From: Kevin A. <ka...@us...> - 2004-04-26 17:25:07
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30443 Modified Files: event.py model.py Log Message: temporary additions for tracking and fixing memory leak, see KEA 2004-04-26 Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** model.py 26 Apr 2004 00:07:15 -0000 1.157 --- model.py 26 Apr 2004 17:24:59 -0000 1.158 *************** *** 664,669 **** try: # All events should have GetEventObject(). ! aWxEvent.target = aWxEvent.GetEventObject() ! aWxEvent.eventObject = aWxEvent.target except: pass --- 664,668 ---- try: # All events should have GetEventObject(). ! aWxEvent.target = aWxEvent.eventObject = aWxEvent.GetEventObject() except: pass *************** *** 703,706 **** --- 702,715 ---- if not evt.getUsed(): aWxEvent.Skip() + + # KEA 2004-04-26 + # attempt to remove circular references + # to cleanup background event memory leaks + evt._nativeEvent.target = evt._nativeEvent.eventObject = None + evt._nativeEvent = None + if 0: + print evt + evt = None + #print " ", str(self.GetParent()).split(';')[0] #print " ", evt.getUsed(), str(aWxEvent.GetSkipped()).split(';')[0] Index: event.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/event.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** event.py 26 Apr 2004 00:07:13 -0000 1.49 --- event.py 26 Apr 2004 17:24:59 -0000 1.50 *************** *** 856,860 **** # Make a copy of the event class list so we can # strip out the mouse event classes. ! widgetClasses = [] widgetClasses = widgetClasses + aEventClassList --- 856,862 ---- # Make a copy of the event class list so we can # strip out the mouse event classes. ! # KEA 2004-0-26 ! if 0: ! print "_bindMouseEvents", self widgetClasses = [] widgetClasses = widgetClasses + aEventClassList *************** *** 898,911 **** # for some reason wx.TimerEvent does not contain the event target # so we have to set it ourselves ! aWxEvent.target = self._component ! aWxEvent.eventObject = aWxEvent.target else: try: # all events should have GetEventObject() # except of course for wx.TimerEvent above - aWxEvent.target = aWxEvent.GetEventObject() # KEA 2004-04-25 # should we remove this redundant identifier? ! aWxEvent.eventObject = aWxEvent.target except: pass --- 900,911 ---- # for some reason wx.TimerEvent does not contain the event target # so we have to set it ourselves ! aWxEvent.target = aWxEvent.eventObject = self._component else: try: # all events should have GetEventObject() # except of course for wx.TimerEvent above # KEA 2004-04-25 # should we remove this redundant identifier? ! aWxEvent.target = aWxEvent.eventObject = self._component except: pass *************** *** 970,978 **** --- 970,994 ---- self._component._notifyEventListeners(evt) aWxEvent.Skip() + + # KEA 2004-04-26 + # attempt to remove circular references + # to cleanup background event memory leaks + evt._nativeEvent.target = evt._nativeEvent.eventObject = None + evt._nativeEvent = None + if 0: + print evt + evt = None + return True else : return False + # KEA 2004-04-26 + # some event types use _createEvent and others don't + # sometimes the line below is used + # evt = self.wxEventIdMap[eventType](self._component) + # which is part of the _dispatch method above def _createEvent( self, aEventClass, aWxEvent ) : + print "_createEvent", aEventClass evt = aEventClass( self._component ) evt.setNativeEvent( aWxEvent ) *************** *** 980,982 **** ! \ No newline at end of file --- 996,998 ---- ! |
From: Kevin A. <ka...@us...> - 2004-04-26 04:16:10
|
Update of /cvsroot/pythoncard/PythonCard/samples/doodle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7173/samples/doodle Modified Files: doodle.py doodle.rsrc.py Log Message: changed doodle to use on_exit_command Index: doodle.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/doodle/doodle.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** doodle.py 24 Apr 2004 21:09:18 -0000 1.25 --- doodle.py 26 Apr 2004 04:16:02 -0000 1.26 *************** *** 93,99 **** self.components.bufOff.clear() - def on_menuFileExit_select(self, event): - self.close() - if __name__ == '__main__': --- 93,96 ---- Index: doodle.rsrc.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/doodle/doodle.rsrc.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** doodle.rsrc.py 28 May 2002 00:34:21 -0000 1.9 --- doodle.rsrc.py 26 Apr 2004 04:16:02 -0000 1.10 *************** *** 29,33 **** { 'type':'MenuItem', 'name':'menuFileExit', ! 'label':'E&xit\tAlt+X' } ] }, { 'type':'Menu', 'name':'menuEdit', --- 29,34 ---- { 'type':'MenuItem', 'name':'menuFileExit', ! 'label':'E&xit\tAlt+X', ! 'command':'exit' } ] }, { 'type':'Menu', 'name':'menuEdit', |