[Commits] (jed) Moved to 2.5 style for binding events.

commits at osafoundation.org commits at osafoundation.org
Tue Mar 30 14:10:01 PST 2004


Commit by: jed
Modified files:
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py 1.7.2.2 1.7.2.3
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py 1.14.2.2 1.14.2.3
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py 1.69.2.2 1.69.2.3
osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py 1.5.2.1 1.5.2.2
osaf/chandler/Chandler/application/SplashScreen.py 1.11.2.1 1.11.2.2
osaf/chandler/Chandler/application/SimpleCanvas.py 1.19.2.1 1.19.2.2
osaf/chandler/Chandler/application/Application.py 1.211.2.2 1.211.2.3

Log message:
Moved to 2.5 style for binding events.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py.diff?r1=text&tr1=1.7.2.2&r2=text&tr2=1.7.2.3
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.14.2.2&r2=text&tr2=1.14.2.3
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py.diff?r1=text&tr1=1.69.2.2&r2=text&tr2=1.69.2.3
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py.diff?r1=text&tr1=1.5.2.1&r2=text&tr2=1.5.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/application/SplashScreen.py.diff?r1=text&tr1=1.11.2.1&r2=text&tr2=1.11.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/application/SimpleCanvas.py.diff?r1=text&tr1=1.19.2.1&r2=text&tr2=1.19.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/application/Application.py.diff?r1=text&tr1=1.211.2.2&r2=text&tr2=1.211.2.3

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py:1.7.2.2 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py:1.7.2.3
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py:1.7.2.2	Tue Mar 30 13:17:53 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py	Tue Mar 30 14:09:29 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.7.2.2 $"
-__date__ = "$Date: 2004/03/30 21:17:53 $"
+__version__ = "$Revision: 1.7.2.3 $"
+__date__ = "$Date: 2004/03/30 22:09:29 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -20,7 +20,7 @@
         wx.StaticText.__init__(self, parent, id, text)
         self.onClickMethod = onClickMethod
         self.userData = userData
-        wx.EVT_LEFT_DOWN(self, self.onClick)
+        self.Bind(wx.EVT_LEFT_DOWN, self.onClick)
         
     def onClick(self, event):
         self.onClickMethod(self.userData)

Index: osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py:1.5.2.1 osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py:1.5.2.2
--- osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py:1.5.2.1	Tue Mar 30 13:17:57 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py	Tue Mar 30 14:09:30 2004
@@ -1,5 +1,5 @@
-__revision__  = "$Revision: 1.5.2.1 $"
-__date__      = "$Date: 2004/03/30 21:17:57 $"
+__revision__  = "$Revision: 1.5.2.2 $"
+__date__      = "$Date: 2004/03/30 22:09:30 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -28,12 +28,12 @@
 
         self.SetToolTipString(self.agent.GetName())
 
-        EVT_PAINT(self, self._OnPaint)
-        EVT_MOUSE_EVENTS(self, self._OnMouseEvent)
+        self.Bind(wx.EVT_PAINT, self._OnPaint)
+        self.Bind(wx.EVT_MOUSE_EVENTS, self._OnMouseEvent)
 
         # start a timer to redraw us every so often
         #self.timer = wx.Timer(self, 1)
-        #EVT_TIMER(self, 1, self._OnTimer)
+        #self.Bind(wx.EVT_TIME, self._OnTimer, id=1)
         #self.timer.Start(1000)
 
     def AddToToolBar(self):

Index: osaf/chandler/Chandler/application/SplashScreen.py
diff -u osaf/chandler/Chandler/application/SplashScreen.py:1.11.2.1 osaf/chandler/Chandler/application/SplashScreen.py:1.11.2.2
--- osaf/chandler/Chandler/application/SplashScreen.py:1.11.2.1	Tue Mar 30 13:18:00 2004
+++ osaf/chandler/Chandler/application/SplashScreen.py	Tue Mar 30 14:09:30 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.11.2.1 $"
-__date__ = "$Date: 2004/03/30 21:18:00 $"
+__version__ = "$Revision: 1.11.2.2 $"
+__date__ = "$Date: 2004/03/30 22:09:30 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -45,7 +45,7 @@
         else:
             self.timer = None
             
-        EVT_CLOSE(self, self.OnCloseWindow)
+        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
         
     def OnCloseWindow(self, event):
         """

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py:1.14.2.2 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py:1.14.2.3
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py:1.14.2.2	Tue Mar 30 13:17:53 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py	Tue Mar 30 14:09:29 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.14.2.2 $"
-__date__ = "$Date: 2004/03/30 21:17:53 $"
+__version__ = "$Revision: 1.14.2.3 $"
+__date__ = "$Date: 2004/03/30 22:09:29 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -44,7 +44,7 @@
         elif __debug__:
             assert False, "unknown buttonKind"
 
-        wx.EVT_BUTTON(parentWindow, id, self.buttonPressed)
+        parentWindow.Bind(wx.EVT_BUTTON, self.buttonPressed, id=id)
         self.parentBlock.addToContainer(parent, button, self.stretchFactor,
                                         self.Calculate_wxFlag(), self.Calculate_wxBorder())
         return button, None, None
@@ -83,7 +83,7 @@
 class wxEditText(wx.TextCtrl):
     def __init__(self, *arguments, **keywords):
         wx.TextCtrl.__init__ (self, *arguments, **keywords)
-        wx.EVT_TEXT_ENTER(self, self.GetId(), self.OnEnterPressed)
+        self.Bind(wx.EVT_TEXT_ENTER, self.OnEnterPressed, id=self.GetId())
 
     def OnEnterPressed(self, event):
         counterpart = Globals.repository.find (self.counterpartUUID)
@@ -173,9 +173,9 @@
 class wxListBlock(wx.ListCtrl):
     def __init__(self, *arguments, **keywords):
         wx.ListCtrl.__init__(self, *arguments, **keywords)
-        wx.EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.On_wxSelectionChanged)
-        wx.EVT_IDLE(self, self.OnIdle)
-        wx.EVT_SIZE(self, self.OnSize)
+        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.On_wxSelectionChanged, id=self.GetId())
+        self.Bind(wx.EVT_IDLE, self.OnIdle)
+        self.Bind(wx.EVT_SIZE, self.OnSize)
         self.scheduleUpdate = False
         self.lastUpdateTime = 0
 
@@ -370,7 +370,7 @@
             bitmap = wx.Image (self.bitmap, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
             tool = wxToolbar.AddSimpleTool (id, bitmap, 
                                             self.title, self.statusMessage)
-            wx.EVT_TOOL(parentWindow, id, toolbar.toolPressed)
+            parentWindow.Bind(wx.EVT_TOOL, toolbar.toolPressed, id=id)
         elif self.toolbarItemKind == 'Separator':
             wxToolbar.AddSeparator()
         elif self.toolbarItemKind == 'Check':
@@ -384,7 +384,7 @@
                                wx.TE_PROCESS_ENTER)
             tool.SetName(self.title)
             wxToolbar.AddControl (tool)
-            wx.EVT_TEXT_ENTER(tool, id, toolbar.toolEnterPressed)
+            tool.Bind(wx.EVT_TEXT_ENTER, toolbar.toolEnterPressed, id=id)
         elif __debug__:
             assert False, "unknown toolbarItemKind"
 
@@ -395,12 +395,12 @@
 
 class wxTreeAndList:
     def __init__(self, *arguments, **keywords):
-        wx.EVT_TREE_ITEM_EXPANDING(self, self.GetId(), self.OnExpanding)
-        wx.EVT_TREE_ITEM_COLLAPSING(self, self.GetId(), self.OnCollapsing)
-        wx.EVT_LIST_COL_END_DRAG(self, self.GetId(), self.OnColumnDrag)
-        wx.EVT_TREE_SEL_CHANGED(self, self.GetId(), self.On_wxSelectionChanged)
-        wx.EVT_IDLE(self, self.OnIdle)
-        wx.EVT_SIZE(self, self.OnSize)
+        self.Bind(wx.EVT_TREE_ITEM_EXPANDING, self.OnExpanding, id=self.GetId())
+        self.Bind(wx.EVT_TREE_ITEM_COLLAPSING, self.OnCollapsing, id=self.GetId())
+        self.Bind(wx.EVT_LIST_COL_END_DRAG, self.OnColumnDrag, id=self.GetId())
+        self.Bind(wx.EVT_TREE_SEL_CHANGED, self.On_wxSelectionChanged, id=self.GetId())
+        self.Bind(wx.EVT_IDLE, self.OnIdle)
+        self.Bind(wx.EVT_SIZE, self.OnSize)
         self.scheduleUpdate = False
         self.lastUpdateTime = 0
 

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.69.2.2 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.69.2.3
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.69.2.2	Tue Mar 30 13:17:55 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py	Tue Mar 30 14:09:29 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.69.2.2 $"
-__date__ = "$Date: 2004/03/30 21:17:55 $"
+__version__ = "$Revision: 1.69.2.3 $"
+__date__ = "$Date: 2004/03/30 22:09:29 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -132,7 +132,7 @@
 
     def __init__(self, *arguments, **keywords):
         wx.SplitterWindow.__init__ (self, *arguments, **keywords)
-        wx.EVT_SPLITTER_SASH_POS_CHANGED(self, self.GetId(), self.OnSplitChanged)
+        self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnSplitChanged, id=self.GetId())
         """
           Setting minimum pane size prevents unsplitting a window by double-clicking
         """
@@ -178,7 +178,7 @@
           Wire up onSize after __init__ has been called, otherwise it will
         call onSize
         """
-        wx.EVT_SIZE(splitWindow, splitWindow.OnSize)
+        splitWindow.Bind(wx.EVT_SIZE, splitWindow.OnSize)
         return splitWindow, splitWindow, splitWindow
                 
     def Calculate_wxStyle (self, parentWindow):

Index: osaf/chandler/Chandler/application/SimpleCanvas.py
diff -u osaf/chandler/Chandler/application/SimpleCanvas.py:1.19.2.1 osaf/chandler/Chandler/application/SimpleCanvas.py:1.19.2.2
--- osaf/chandler/Chandler/application/SimpleCanvas.py:1.19.2.1	Tue Mar 30 13:18:00 2004
+++ osaf/chandler/Chandler/application/SimpleCanvas.py	Tue Mar 30 14:09:30 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.19.2.1 $"
-__date__ = "$Date: 2004/03/30 21:18:00 $"
+__version__ = "$Revision: 1.19.2.2 $"
+__date__ = "$Date: 2004/03/30 22:09:30 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -24,13 +24,13 @@
         self.hotspot = None
         self.window = None
 
-        EVT_PAINT(self, self.OnPaint)
+        self.Bind(wx.EVT_PAINT, self.OnPaint)
 
         if wx.Platform == "__WXGTK__":
             # wxGTK requires that the window be created before you can
             # set its shape, so delay the call to SetWindowShape until
             # this event.
-            EVT_WINDOW_CREATE(self, self.SetWindowShape)
+            self.Bind(wx.EVT_WINDOW_CREATE, self.SetWindowShape)
         else:
             # On wxMSW and wxMac the window has already been created, so go for it.
             self.SetWindowShape()
@@ -121,7 +121,7 @@
         self.visible = True
         self.selected = False
         self.dragStartPos = None
-        EVT_MOUSE_EVENTS (self, self.OnMouseEvent)
+        self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvent)
 
     def MoveTo (self, x, y):
         self.canvas.RefreshScrolledRect (self.bounds);
@@ -302,9 +302,9 @@
         self.autoCreateDistance = 0
         self.zOrderedDrawableObjects = []
         self.internalDnDItem = None
-        EVT_PAINT (self, self.OnPaint)
-        EVT_ERASE_BACKGROUND (self, self.OnEraseBackground)
-        EVT_MOUSE_EVENTS (self, self.OnMouseEvent)
+        self.Bind(wx.EVT_PAINT, self.OnPaint)
+        self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
+        self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvents)
         self.SetDropTarget (wx.CanvasDropTarget (self, dropTargetDataObject))
 
     def RefreshScrolledRect (self, rect):

Index: osaf/chandler/Chandler/application/Application.py
diff -u osaf/chandler/Chandler/application/Application.py:1.211.2.2 osaf/chandler/Chandler/application/Application.py:1.211.2.3
--- osaf/chandler/Chandler/application/Application.py:1.211.2.2	Tue Mar 30 13:18:00 2004
+++ osaf/chandler/Chandler/application/Application.py	Tue Mar 30 14:09:31 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.211.2.2 $"
-__date__ = "$Date: 2004/03/30 21:18:00 $"
+__version__ = "$Revision: 1.211.2.3 $"
+__date__ = "$Date: 2004/03/30 22:09:31 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -11,14 +11,12 @@
 import repository.parcel.LoadParcels as LoadParcels
 from repository.persistence.XMLRepository import XMLRepository
 
+
 """
   Event used to post callbacks on the UI thread
 """
 wxEVT_MAIN_THREAD_CALLBACK = wx.NewEventType()
-
-def EVT_MAIN_THREAD_CALLBACK(win, func):
-    win.Connect(-1, -1, wxEVT_MAIN_THREAD_CALLBACK, func)
-
+EVT_MAIN_THREAD_CALLBACK = wx.PyEventBinder(wxEVT_MAIN_THREAD_CALLBACK, 0)
 
 def repositoryCallback(uuid, notification, reason, **kwds):
     if notification == 'History':
@@ -80,7 +78,7 @@
     def __init__(self, *arguments, **keywords):
         wx.Frame.__init__ (self, *arguments, **keywords)
         self.SetBackgroundColour (wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
-        wx.EVT_CLOSE(self, self.OnClose)
+        self.Bind(wx.EVT_CLOSE, self.OnClose)
 
     def OnClose(self, event):
         """
@@ -88,7 +86,7 @@
         application the mainFrame windows doesn't get destroyed, so
         we'll remove the handler
         """
-        wx.EVT_IDLE(Globals.wxApplication, None)
+        Globals.wxApplication.Bind(wx.EVT_IDLE, None)
         """
           When we quit, as each wxWidget window is torn down our handlers that
         track changes to the selection are called, and we don't want to count
@@ -242,10 +240,10 @@
         Globals.agentManager = AgentManager()
         Globals.agentManager.Startup()
 
-        wx.EVT_MENU(self, -1, self.OnCommand)
-        wx.EVT_UPDATE_UI(self, -1, self.OnCommand)
+        self.Bind(wx.EVT_MENU, self.OnCommand, id=-1)
+        self.Bind(wx.EVT_UPDATE_UI, self.OnCommand, id=-1)
         self.focus = None
-        wx.EVT_IDLE(self, self.OnIdle)
+        self.Bind(wx.EVT_IDLE, self.OnIdle)
 
         from OSAF.framework.blocks.Views import View
         """
@@ -263,7 +261,7 @@
             Globals.mainView = mainView
             self.menuParent = None
             self.mainFrame.counterpartUUID = mainView.getUUID()
-            wx.EVT_SIZE(self.mainFrame, self.mainFrame.OnSize)
+            self.mainFrame.Bind(wx.EVT_SIZE, self.mainFrame.OnSize)
 
             GlobalEvents = Globals.repository.find('//parcels/OSAF/framework/blocks/Events/GlobalEvents')
             """
@@ -393,7 +391,7 @@
             self.crustFrame.SetSize((700,700))
             self.crustFrame.Show(True)
             self.crustFrame.shell.interp.locals['chandler'] = self
-            wx.EVT_CLOSE(self.crustFrame, self.onCloseDebuggerWindow)
+            self.crustFrame.Bind(wx.EVT_CLOSE, self.OnCloseDebuggerWindow)
 
         def onCloseDebuggerWindow(self, event):
             self.crustFrame.Destroy()



More information about the Commits mailing list