[Commits] (jed) Finished 2.5 namespace migration. Chandler now runs
under wxWidgets 2.5.1.3.
commits at osafoundation.org
commits at osafoundation.org
Tue Mar 30 13:18:32 PST 2004
Commit by: jed
Modified files:
osaf/chandler/Chandler/parcels/OSAF/views/main/SideBar.py 1.4 1.4.2.1
osaf/chandler/Chandler/parcels/OSAF/views/demo/Demo.py 1.1 1.1.2.1
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Views.py 1.17.2.1 1.17.2.2
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Styles.py 1.2 1.2.2.1
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Node.py 1.3 1.3.2.1
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py 1.7.2.1 1.7.2.2
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/MenuBlocks.py 1.6.2.1 1.6.2.2
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py 1.14.2.1 1.14.2.2
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py 1.69.2.1 1.69.2.2
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py 1.19.2.1 1.19.2.2
osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/DialogAction.py 1.8 1.8.2.1
osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/Action.py 1.17 1.17.2.1
osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py 1.5 1.5.2.1
osaf/chandler/Chandler/application/SplashScreen.py 1.11 1.11.2.1
osaf/chandler/Chandler/application/SimpleCanvas.py 1.19 1.19.2.1
osaf/chandler/Chandler/application/Application.py 1.211.2.1 1.211.2.2
Log message:
Finished 2.5 namespace migration. Chandler now runs under wxWidgets 2.5.1.3.
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/views/main/SideBar.py.diff?r1=text&tr1=1.4&r2=text&tr2=1.4.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/views/demo/Demo.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.1.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Views.py.diff?r1=text&tr1=1.17.2.1&r2=text&tr2=1.17.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Styles.py.diff?r1=text&tr1=1.2&r2=text&tr2=1.2.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Node.py.diff?r1=text&tr1=1.3&r2=text&tr2=1.3.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py.diff?r1=text&tr1=1.7.2.1&r2=text&tr2=1.7.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/MenuBlocks.py.diff?r1=text&tr1=1.6.2.1&r2=text&tr2=1.6.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.14.2.1&r2=text&tr2=1.14.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py.diff?r1=text&tr1=1.69.2.1&r2=text&tr2=1.69.2.2
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.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/parcels/OSAF/framework/agents/schema/DialogAction.py.diff?r1=text&tr1=1.8&r2=text&tr2=1.8.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/Action.py.diff?r1=text&tr1=1.17&r2=text&tr2=1.17.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py.diff?r1=text&tr1=1.5&r2=text&tr2=1.5.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/application/SplashScreen.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.11.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/application/SimpleCanvas.py.diff?r1=text&tr1=1.19&r2=text&tr2=1.19.2.1
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/application/Application.py.diff?r1=text&tr1=1.211.2.1&r2=text&tr2=1.211.2.2
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Views.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Views.py:1.17.2.1 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Views.py:1.17.2.2
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Views.py:1.17.2.1 Tue Mar 23 13:16:59 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Views.py Tue Mar 30 13:17:53 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.17.2.1 $"
-__date__ = "$Date: 2004/03/23 21:16:59 $"
+__version__ = "$Revision: 1.17.2.2 $"
+__date__ = "$Date: 2004/03/30 21:17:53 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -9,9 +9,7 @@
from ContainerBlocks import *
from MenuBlocks import MenuEntry
from OSAF.framework.notifications.Notification import Notification
-from wxPython.wx import *
-from wxPython.html import *
-
+import wx
import OSAF.framework.utils.imports.OutlookContacts as OutlookContacts
import OSAF.contentmodel.tests.GenerateItems as GenerateItems
@@ -89,7 +87,7 @@
assert (False)
def getFocusBlock (self):
- focusWindow = wxWindow_FindFocus()
+ focusWindow = wx.Window_FindFocus()
while (focusWindow):
try:
UUID = focusWindow.counterpartUUID
Index: osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/Action.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/Action.py:1.17 osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/Action.py:1.17.2.1
--- osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/Action.py:1.17 Tue Nov 25 10:19:23 2003
+++ osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/Action.py Tue Mar 30 13:17:56 2004
@@ -1,10 +1,10 @@
-__revision__ = "$Revision: 1.17 $"
-__date__ = "$Date: 2003/11/25 18:19:23 $"
+__revision__ = "$Revision: 1.17.2.1 $"
+__date__ = "$Date: 2004/03/30 21:17:56 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import application.Globals as Globals
-from wxPython.wx import *
+import wx
from repository.item.Item import Item
import os, os.path, time
@@ -135,12 +135,13 @@
if action.NeedsConfirmation():
message = self._GetPermissionMessage(action, agent)
- confirmDialog = wxMessageDialog(Globals.wxMainFrame, message, _("Confirm Action"), wxYES_NO | wxICON_QUESTION)
+ # @@@ 25Issue - we no longer use wxMainFrame
+ confirmDialog = wx.MessageDialog(Globals.wxMainFrame, message, _("Confirm Action"), wx.YES_NO | wx.ICON_QUESTION)
result = confirmDialog.ShowModal()
confirmDialog.Destroy()
- if result != wxID_YES:
+ if result != wx.ID_YES:
return False
return action.Execute(agent, notification)
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.69.2.1 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.1 Tue Mar 23 13:16:59 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py Tue Mar 30 13:17:55 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.69.2.1 $"
-__date__ = "$Date: 2004/03/23 21:16:59 $"
+__version__ = "$Revision: 1.69.2.2 $"
+__date__ = "$Date: 2004/03/30 21:17:55 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -8,21 +8,21 @@
from Node import Node
from Styles import Font
from repository.util.UUID import UUID
-from wxPython.wx import *
+import wx
class BoxContainer(RectangularChild):
def renderOneBlock (self, parent, parentWindow):
if self.orientationEnum == 'Horizontal':
- orientation = wxHORIZONTAL
+ orientation = wx.HORIZONTAL
else:
- orientation = wxVERTICAL
+ orientation = wx.VERTICAL
- sizer = wxBoxSizer(orientation)
+ sizer = wx.BoxSizer(orientation)
sizer.SetMinSize((self.minimumSize.width, self.minimumSize.height))
if self.parentBlock:
- panel = wxPanel(parentWindow, -1)
+ panel = wx.Panel(parentWindow, -1)
panel.SetSizer(sizer)
self.parentBlock.addToContainer(parent, panel,
self.stretchFactor,
@@ -50,8 +50,8 @@
class EmbeddedContainer(RectangularChild):
def renderOneBlock (self, parent, parentWindow):
- sizer = wxBoxSizer(wxHORIZONTAL)
- panel = wxPanel(parentWindow, -1)
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ panel = wx.Panel(parentWindow, -1)
panel.SetSizer(sizer)
self.parentBlock.addToContainer(parent,
panel,
@@ -128,11 +128,11 @@
Globals.notificationManager.Unsubscribe(id)
-class wxSplitWindow(wxSplitterWindow):
+class wxSplitWindow(wx.SplitterWindow):
def __init__(self, *arguments, **keywords):
- wxSplitterWindow.__init__ (self, *arguments, **keywords)
- EVT_SPLITTER_SASH_POS_CHANGED(self, self.GetId(), self.OnSplitChanged)
+ wx.SplitterWindow.__init__ (self, *arguments, **keywords)
+ wx.EVT_SPLITTER_SASH_POS_CHANGED(self, self.GetId(), self.OnSplitChanged)
"""
Setting minimum pane size prevents unsplitting a window by double-clicking
"""
@@ -144,9 +144,9 @@
width, height = self.GetSizeTuple()
position = float (event.GetSashPosition())
splitMode = self.GetSplitMode()
- if splitMode == wxSPLIT_HORIZONTAL:
+ if splitMode == wx.SPLIT_HORIZONTAL:
counterpart.splitPercentage = position / height
- elif splitMode == wxSPLIT_VERTICAL:
+ elif splitMode == wx.SPLIT_VERTICAL:
counterpart.splitPercentage = position / width
def OnSize(self, event):
@@ -169,7 +169,7 @@
def renderOneBlock (self, parent, parentWindow):
splitWindow = wxSplitWindow(parentWindow,
Block.getwxID(self),
- wxDefaultPosition,
+ wx.DefaultPosition,
(self.size.width, self.size.height),
style=self.Calculate_wxStyle(parentWindow))
self.parentBlock.addToContainer(parent, splitWindow, self.stretchFactor,
@@ -178,18 +178,18 @@
Wire up onSize after __init__ has been called, otherwise it will
call onSize
"""
- EVT_SIZE(splitWindow, splitWindow.OnSize)
+ wx.EVT_SIZE(splitWindow, splitWindow.OnSize)
return splitWindow, splitWindow, splitWindow
def Calculate_wxStyle (self, parentWindow):
- style = wxSP_LIVE_UPDATE
+ style = wx.SP_LIVE_UPDATE
parent = self.parentBlock
while isinstance (parent, EmbeddedContainer):
parent = parent.parentBlock
if isinstance (parent, SplitWindow):
- style |= wxSP_3DSASH
+ style |= wx.SP_3DSASH
else:
- style |= wxSP_3D
+ style |= wx.SP_3D
return style
def addToContainer(self, parent, child, weight, flag, border, append=True):
@@ -241,16 +241,16 @@
if self.tabPosEnum == "Top":
style = 0
elif self.tabPosEnum == "Bottom":
- style = wxNB_BOTTOM
+ style = wx.NB_BOTTOM
elif self.tabPosEnum == "Left":
- style = wxNB_LEFT
+ style = wx.NB_LEFT
elif self.tabPosEnum == "Right":
- style = wxNB_RIGHT
+ style = wx.NB_RIGHT
elif __debug__:
assert (False)
- tabbedContainer = wxNotebook(parentWindow, id,
- wxDefaultPosition,
+ tabbedContainer = wx.Notebook(parentWindow, id,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height),
style = style)
self.parentBlock.addToContainer(parent, tabbedContainer, self.stretchFactor,
@@ -285,7 +285,7 @@
class Toolbar(RectangularChild):
def renderOneBlock (self, parent, parentWindow):
- toolbar = Globals.wxApplication.mainFrame.CreateToolBar(wxTB_HORIZONTAL)
+ toolbar = Globals.wxApplication.mainFrame.CreateToolBar(wx.TB_HORIZONTAL)
toolbar.SetToolBitmapSize((self.toolSize.width, self.toolSize.height))
return toolbar, None, None
Index: osaf/chandler/Chandler/parcels/OSAF/views/demo/Demo.py
diff -u osaf/chandler/Chandler/parcels/OSAF/views/demo/Demo.py:1.1 osaf/chandler/Chandler/parcels/OSAF/views/demo/Demo.py:1.1.2.1
--- osaf/chandler/Chandler/parcels/OSAF/views/demo/Demo.py:1.1 Thu Feb 12 18:16:40 2004
+++ osaf/chandler/Chandler/parcels/OSAF/views/demo/Demo.py Tue Mar 30 13:17:52 2004
@@ -1,10 +1,9 @@
-__version__ = "$Revision: 1.1 $"
-__date__ = "$Date: 2004/02/13 02:16:40 $"
+__version__ = "$Revision: 1.1.2.1 $"
+__date__ = "$Date: 2004/03/30 21:17:52 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import application.Globals as Globals
-
import OSAF.framework.blocks.ContainerBlocks as ContainerBlocks
class DemoTabs(ContainerBlocks.TabbedContainer):
Index: osaf/chandler/Chandler/parcels/OSAF/views/main/SideBar.py
diff -u osaf/chandler/Chandler/parcels/OSAF/views/main/SideBar.py:1.4 osaf/chandler/Chandler/parcels/OSAF/views/main/SideBar.py:1.4.2.1
--- osaf/chandler/Chandler/parcels/OSAF/views/main/SideBar.py:1.4 Wed Mar 10 01:18:28 2004
+++ osaf/chandler/Chandler/parcels/OSAF/views/main/SideBar.py Tue Mar 30 13:17:51 2004
@@ -1,11 +1,10 @@
-__version__ = "$Revision: 1.4 $"
-__date__ = "$Date: 2004/03/10 09:18:28 $"
+__version__ = "$Revision: 1.4.2.1 $"
+__date__ = "$Date: 2004/03/30 21:17:51 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import application.Globals as Globals
import OSAF.framework.blocks.ControlBlocks as ControlBlocks
-from wxPython.wx import *
class SideBar(ControlBlocks.Tree):
Index: osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py:1.5 osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py:1.5.2.1
--- osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py:1.5 Mon Feb 16 08:30:51 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/agents/AgentControl.py Tue Mar 30 13:17:57 2004
@@ -1,15 +1,15 @@
-__revision__ = "$Revision: 1.5 $"
-__date__ = "$Date: 2004/02/16 16:30:51 $"
+__revision__ = "$Revision: 1.5.2.1 $"
+__date__ = "$Date: 2004/03/30 21:17:57 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import application.Globals as Globals
-from wxPython.wx import *
+import wx
import os
__all__ = ['wxAgentControl']
-class wxAgentControl(wxPyControl):
+class wxAgentControl(wx.PyControl):
""" The widget associated with agents """
def __getAgentItem(self):
@@ -18,9 +18,9 @@
agent = property(__getAgentItem)
def __init__(self, agentID):
- wxPyControl.__init__(self, self._GetToolBar(),
- -1, wxDefaultPosition, wxSize(32,32),
- wxNO_BORDER, wxDefaultValidator, 'wxAgentControl')
+ wx.PyControl.__init__(self, self._GetToolBar(),
+ -1, wx.DefaultPosition, wx.Size(32,32),
+ wx.NO_BORDER, wx.DefaultValidator, 'wxAgentControl')
self.agentID = agentID
self.image = AgentImage()
@@ -32,7 +32,7 @@
EVT_MOUSE_EVENTS(self, self._OnMouseEvent)
# start a timer to redraw us every so often
- #self.timer = wxTimer(self, 1)
+ #self.timer = wx.Timer(self, 1)
#EVT_TIMER(self, 1, self._OnTimer)
#self.timer.Start(1000)
@@ -52,7 +52,7 @@
# XXX This should paint an image based on the current status
# of the agent
(width, height) = self.GetClientSizeTuple()
- dc = wxPaintDC(self)
+ dc = wx.PaintDC(self)
dc.BeginDrawing()
dc.Clear()
self.image.Draw(dc, self.status)
@@ -68,6 +68,7 @@
return False
def _GetToolBar(self):
+ # @@@ 25Issue - we no longer use wxMainFrame
return Globals.wxApplication.wxMainFrame.navigationBar
def _GetStatus(self):
@@ -87,7 +88,7 @@
def LoadImage(self, path):
if self.imageCache.has_key(path):
return self.imageCache[path]
- self.imageCache[path] = wxImage(path)
+ self.imageCache[path] = wx.Image(path)
return self.imageCache[path]
_imageLoader = AgentImageLoader()
@@ -106,7 +107,7 @@
shapes = ['headshape', 'hat', 'eyes']
for i in shapes:
- bitmap = wxBitmapFromImage(self.images[i])
+ bitmap = wx.BitmapFromImage(self.images[i])
dc.DrawBitmap(bitmap, 0, 0, True)
# bitmap = wxBitmapFromImage(self.images[status])
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Styles.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Styles.py:1.2 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Styles.py:1.2.2.1
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Styles.py:1.2 Fri Feb 6 15:39:30 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Styles.py Tue Mar 30 13:17:53 2004
@@ -1,5 +1,11 @@
+__version__ = "$Revision: 1.2.2.1 $"
+__date__ = "$Date: 2004/03/30 21:17:53 $"
+__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
+__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
+
from repository.item.Item import Item
-from wxPython.wx import *
+import wx
+
class Style(Item):
@@ -13,20 +19,20 @@
super (CharacterStyle, self).__init__ ( *arguments, **keywords)
-class Font(wxFont):
+class Font(wx.Font):
def __init__(self, characterStyle):
- family = wxDEFAULT
+ family = wx.DEFAULT
size = 12
- style = wxNORMAL
- underline = FALSE
- weight = wxNORMAL
+ style = wx.NORMAL
+ underline = False
+ weight = wx.NORMAL
if characterStyle:
if characterStyle.fontFamily == "SerifFont":
- family = wxROMAN
+ family = wx.ROMAN
elif characterStyle.fontFamily == "SanSerifFont":
- family = wxSWISS
+ family = wx.SWISS
elif characterStyle.fontFamily == "FixedPitchFont":
- family = wxMODERN
+ family = wx.MODERN
assert (size > 0)
size = int (characterStyle.fontSize + 0.5) #round to integer
@@ -34,15 +40,15 @@
for theStyle in characterStyle.fontStyle.split():
lowerStyle = theStyle.lower()
if lowerStyle == "bold":
- weight = wxBOLD
+ weight = wx.BOLD
elif lowerStyle == "light":
- weight = wxLIGHT
+ weight = wx.LIGHT
elif lowerStyle == "italic":
- style = wxITALIC
+ style = wx.ITALIC
elif lowerStyle == "underline":
- underline = TRUE
+ underline = True
- wxFont.__init__ (self,
+ wx.Font.__init__ (self,
size,
family,
style,
Index: osaf/chandler/Chandler/application/Application.py
diff -u osaf/chandler/Chandler/application/Application.py:1.211.2.1 osaf/chandler/Chandler/application/Application.py:1.211.2.2
--- osaf/chandler/Chandler/application/Application.py:1.211.2.1 Tue Mar 23 13:17:00 2004
+++ osaf/chandler/Chandler/application/Application.py Tue Mar 30 13:18:00 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.211.2.1 $"
-__date__ = "$Date: 2004/03/23 21:17:00 $"
+__version__ = "$Revision: 1.211.2.2 $"
+__date__ = "$Date: 2004/03/30 21:18:00 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -309,7 +309,7 @@
block = Block.wxIDToObject (wxID)
args = {}
- if event.GetEventType() == wx.EVT_UPDATE_UI:
+ if event.GetEventType() == wx.EVT_UPDATE_UI.evtType[0]:
args['UpdateUI'] = True
try:
@@ -320,11 +320,11 @@
then we'd better have a block event for it, otherwise
we can't post the event.
"""
- assert event.GetEventType() == wx.EVT_UPDATE_UI
+ assert event.GetEventType() == wx.EVT_UPDATE_UI.evtType[0]
pass
else:
block.Post (blockEvent, args)
- if event.GetEventType() == wx.EVT_UPDATE_UI:
+ if event.GetEventType() == wx.EVT_UPDATE_UI.evtType[0]:
try:
event.Check (args ['Check'])
except KeyError:
@@ -391,7 +391,7 @@
import wx.py
self.crustFrame = wx.py.crust.CrustFrame()
self.crustFrame.SetSize((700,700))
- self.crustFrame.Show(wx.TRUE)
+ self.crustFrame.Show(True)
self.crustFrame.shell.interp.locals['chandler'] = self
wx.EVT_CLOSE(self.crustFrame, self.onCloseDebuggerWindow)
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py:1.19.2.1 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py:1.19.2.2
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py:1.19.2.1 Tue Mar 23 13:16:59 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py Tue Mar 30 13:17:55 2004
@@ -1,7 +1,12 @@
+__version__ = "$Revision: 1.19.2.2 $"
+__date__ = "$Date: 2004/03/30 21:17:55 $"
+__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
+__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
+
import application.Globals as Globals
from repository.item.Item import Item
from OSAF.framework.notifications.schema.Event import Event
-from wxPython.wx import *
+import wx
import logging
@@ -38,10 +43,10 @@
You should usually override renderOneBlock in your Block subclass
to create a platform specific counterpart for the block. The three
objects returned are:
- - The platform specific counterpart created, e.g. wxPanel
+ - The platform specific counterpart created, e.g. wx.Panel
- The platform specific counterpart for the Block's parent block
- The platform specific parent of the counterpart created, e.g.
- wxPanel's platform specific parent.
+ wx.Panel's platform specific parent.
We need to occasionally return all these arguments because our
blocks containers are included in our hierarchy of Blocks, where as
wxWindows sizers are not included in their hiearchy of windows.
@@ -171,27 +176,27 @@
class RectangularChild(ContainerChild):
def Calculate_wxFlag (self):
if self.alignmentEnum == 'grow':
- flag = wxGROW
+ flag = wx.GROW
elif self.alignmentEnum == 'growConstrainAspectRatio':
- flag = wxSHAPED
+ flag = wx.SHAPED
elif self.alignmentEnum == 'alignCenter':
- flag = wxALIGN_CENTER
+ flag = wx.ALIGN_CENTER
elif self.alignmentEnum == 'alignTopCenter':
- flag = wxALIGN_TOP
+ flag = wx.ALIGN_TOP
elif self.alignmentEnum == 'alignMiddleLeft':
- flag = wxALIGN_LEFT
+ flag = wx.ALIGN_LEFT
elif self.alignmentEnum == 'alignBottomCenter':
- flag = wxALIGN_BOTTOM
+ flag = wx.ALIGN_BOTTOM
elif self.alignmentEnum == 'alignMiddleRight':
- flag = wxALIGN_RIGHT
+ flag = wx.ALIGN_RIGHT
elif self.alignmentEnum == 'alignTopLeft':
- flag = wxALIGN_TOP | wxALIGN_LEFT
+ flag = wx.ALIGN_TOP | wx.ALIGN_LEFT
elif self.alignmentEnum == 'alignTopRight':
- flag = wxALIGN_TOP | wxALIGN_RIGHT
+ flag = wx.ALIGN_TOP | wx.ALIGN_RIGHT
elif self.alignmentEnum == 'alignBottomLeft':
- flag = wxALIGN_BOTTOM | wxALIGN_LEFT
+ flag = wx.ALIGN_BOTTOM | wx.ALIGN_LEFT
elif self.alignmentEnum == 'alignBottomRight':
- flag = wxALIGN_BOTTOM | wxALIGN_RIGHT
+ flag = wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT
return flag
def Calculate_wxBorder (self):
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Node.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Node.py:1.3 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Node.py:1.3.2.1
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Node.py:1.3 Mon Feb 16 08:30:49 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Node.py Tue Mar 30 13:17:53 2004
@@ -1,5 +1,11 @@
+__version__ = "$Revision: 1.3.2.1 $"
+__date__ = "$Date: 2004/03/30 21:17:53 $"
+__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
+__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
+
import application.Globals as Globals
from repository.item.Item import Item
+
class BadURL(Exception):
pass
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py:1.7.2.1 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.1 Tue Mar 23 13:16:59 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py Tue Mar 30 13:17:53 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.7.2.1 $"
-__date__ = "$Date: 2004/03/23 21:16:59 $"
+__version__ = "$Revision: 1.7.2.2 $"
+__date__ = "$Date: 2004/03/30 21:17:53 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -9,18 +9,18 @@
from ControlBlocks import *
from Node import *
from repository.util.UUID import UUID
-from wxPython.wx import *
+import wx
-class wxBookmark(wxStaticText):
+class wxBookmark(wx.StaticText):
"""
Under construction
"""
def __init__(self, parent, text, onClickMethod, userData, id=-1):
- wxStaticText.__init__(self, parent, id, text)
+ wx.StaticText.__init__(self, parent, id, text)
self.onClickMethod = onClickMethod
self.userData = userData
- EVT_LEFT_DOWN(self, self.onClick)
+ wx.EVT_LEFT_DOWN(self, self.onClick)
def onClick(self, event):
self.onClickMethod(self.userData)
@@ -35,8 +35,8 @@
self.bookmarksPath = None
def renderOneBlock(self, parent, parentWindow):
- panel = wxPanel(parentWindow, -1)
- sizer = wxBoxSizer(wxHORIZONTAL)
+ panel = wx.Panel(parentWindow, -1)
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.SetMinSize((self.minimumSize.width, self.minimumSize.height))
self.addBookmarks(panel, sizer)
panel.SetSizerAndFit(sizer)
@@ -52,10 +52,10 @@
self.addBookmark(parent, sizer, child.getItemDisplayName(), child.GetPath())
def addBookmark(self, parent, sizer, title, path):
- sizer.Add((10, 0), 0, wxEXPAND)
+ sizer.Add((10, 0), 0, wx.EXPAND)
bookmark = wxBookmark(parent, title, self.bookmarkPressed, path)
sizer.Add(bookmark, 0)
- sizer.Add((10, 0), 0, wxEXPAND)
+ sizer.Add((10, 0), 0, wx.EXPAND)
def bookmarkPressed(self, text):
item = Node.GetItemFromPath(text, '//parcels/OSAF/views/main/URLRoot')
@@ -114,9 +114,9 @@
try:
item = Node.GetItemFromPath(url, '//parcels/OSAF/views/main/URLRoot')
except BadURL:
- dialog = wxMessageDialog(None, 'The url "' + str(url) + '" does not exist',
+ dialog = wx.MessageDialog(None, 'The url "' + str(url) + '" does not exist',
'Chandler',
- style=wxOK|wxCENTRE)
+ style=wx.OK|wx.CENTRE)
dialog.ShowModal()
else:
self.Post (Globals.repository.find('//parcels/OSAF/framework/blocks/Events/SelectionChanged'),
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/MenuBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/MenuBlocks.py:1.6.2.1 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/MenuBlocks.py:1.6.2.2
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/MenuBlocks.py:1.6.2.1 Tue Mar 23 13:16:59 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/MenuBlocks.py Tue Mar 30 13:17:53 2004
@@ -1,6 +1,11 @@
+__version__ = "$Revision: 1.6.2.2 $"
+__date__ = "$Date: 2004/03/30 21:17:53 $"
+__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
+__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
+
import application.Globals as Globals
from Block import Block
-from wxPython.wx import *
+import wx
class MenuEntry(Block):
@@ -84,7 +89,7 @@
if frame:
menuBar = frame.GetMenuBar()
if not menuBar:
- menuBar = wxMenuBar()
+ menuBar = wx.MenuBar()
frame.SetMenuBar(menuBar)
"""
The actual work of setting the menus is done by installMenu
@@ -128,14 +133,14 @@
Returns a list of wxMenuItems in wxMenuObject, which can
be either a menu or menubar
"""
- if isinstance (wxMenuObject, wxMenuBar):
+ if isinstance (wxMenuObject, wx.MenuBar):
menuList = []
for index in xrange (wxMenuObject.GetMenuCount()):
menuList.append (wxMenuObject.GetMenu (index))
else:
- if isinstance (wxMenuObject, wxMenuItem):
+ if isinstance (wxMenuObject, wx.MenuItem):
wxMenuObject = wxMenuObject.GetSubMenu()
- assert isinstance (wxMenuObject, wxMenu)
+ assert isinstance (wxMenuObject, wx.Menu)
menuList = wxMenuObject.GetMenuItems()
return menuList
@@ -145,13 +150,13 @@
"""
Deletes an item from a wxMenuObject, where wxMenuObject can
be either a menu or menubar. Unfortunately, wxWindows requires
- that you pass the oldItem whenever wxMenuObject is a wxMenu.
+ that you pass the oldItem whenever wxMenuObject is a wx.Menu.
"""
- if isinstance (wxMenuObject, wxMenu):
+ if isinstance (wxMenuObject, wx.Menu):
wxMenuObject.DestroyItem (oldItem)
pass
else:
- assert isinstance (wxMenuObject, wxMenuBar)
+ assert isinstance (wxMenuObject, wx.MenuBar)
oldMenu = wxMenuObject.Remove (index)
oldMenu.Destroy()
deleteItem = classmethod (deleteItem)
@@ -161,15 +166,15 @@
Gets the title of the item at index in wxMenuObject, where
wxMenuObject can be either a menu or menubar. Unfortunately,
wxWindows requires that you pass the oldItem whenever
- wxMenuObject is a wxMenu.
+ wxMenuObject is a wx.Menu.
"""
title = None
if item:
- if isinstance (wxMenuObject, wxMenu):
+ if isinstance (wxMenuObject, wx.Menu):
id = item.GetId()
title = wxMenuObject.GetLabel (id)
else:
- assert isinstance (wxMenuObject, wxMenuBar)
+ assert isinstance (wxMenuObject, wx.MenuBar)
title = wxMenuObject.GetLabelTop (index)
return title
getItemTitle = classmethod (getItemTitle)
@@ -178,10 +183,10 @@
"""
Sets an item in wxMenuObject, which can be either a menu or
menubar with a new item. Unfortunately, wxWindows requires that
- you pass the oldItem whenever wxMenuObject is a wxMenu and
+ you pass the oldItem whenever wxMenuObject is a wx.Menu and
you're replacing the item.
"""
- if isinstance (wxMenuObject, wxMenuBar):
+ if isinstance (wxMenuObject, wx.MenuBar):
itemsInMenu = wxMenuObject.GetMenuCount()
assert (index <= itemsInMenu)
if index < itemsInMenu:
@@ -192,15 +197,15 @@
success = wxMenuObject.Append (newItem, self.title)
assert success
else:
- if isinstance (wxMenuObject, wxMenuItem):
+ if isinstance (wxMenuObject, wx.MenuItem):
wxMenuObject = wxMenuObject.GetSubMenu()
- assert isinstance (wxMenuObject, wxMenu)
+ assert isinstance (wxMenuObject, wx.Menu)
itemsInMenu = wxMenuObject.GetMenuItemCount()
assert (index <= itemsInMenu)
if index < itemsInMenu:
self.deleteItem (wxMenuObject, index, oldItem)
- if isinstance (newItem, wxMenuItem):
+ if isinstance (newItem, wx.MenuItem):
success = wxMenuObject.InsertItem (index, newItem)
assert success
else:
@@ -210,8 +215,8 @@
class MenuItem (MenuEntry):
def renderMenuEntry(self, wxMenuObject, index, oldItem):
if self.menuItemKind == "Separator":
- id = wxID_SEPARATOR
- kind = wxITEM_SEPARATOR
+ id = wx.ID_SEPARATOR
+ kind = wx.ITEM_SEPARATOR
else:
"""
Menu items must have an event, otherwise they can't cause any action,
@@ -220,11 +225,11 @@
assert self.hasAttributeValue('event')
id = Block.getwxID(self)
if self.menuItemKind == "Normal":
- kind = wxITEM_NORMAL
+ kind = wx.ITEM_NORMAL
elif self.menuItemKind == "Check":
- kind = wxITEM_CHECK
+ kind = wx.ITEM_CHECK
elif self.menuItemKind == "Radio":
- kind = wxITEM_RADIO
+ kind = wx.ITEM_RADIO
else:
assert (False)
if oldItem == None or oldItem.GetId() != id or oldItem.GetKind() != kind:
@@ -232,13 +237,13 @@
if len(self.accel) > 0:
title = title + "\tCtrl+" + self.accel
- if isinstance (wxMenuObject, wxMenu):
- newItem = wxMenuItem (wxMenuObject, id, title, self.helpString, kind)
+ if isinstance (wxMenuObject, wx.Menu):
+ newItem = wx.MenuItem (wxMenuObject, id, title, self.helpString, kind)
else:
- assert isinstance (wxMenuObject, wxMenuItem)
+ assert isinstance (wxMenuObject, wx.MenuItem)
submenu = wxMenuObject.GetSubMenu()
assert submenu
- newItem = wxMenuItem (None, id, title, self.helpString, kind, submenu)
+ newItem = wx.MenuItem (None, id, title, self.helpString, kind, submenu)
return newItem
return oldItem
@@ -247,7 +252,7 @@
def renderMenuEntry(self, wxMenuObject, index, oldItem):
title = self.getItemTitle (wxMenuObject, index, oldItem)
if title != self.title:
- return wxMenu()
+ return wx.Menu()
return oldItem
Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py:1.14.2.1 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.1 Tue Mar 23 13:16:59 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py Tue Mar 30 13:17:53 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.14.2.1 $"
-__date__ = "$Date: 2004/03/23 21:16:59 $"
+__version__ = "$Revision: 1.14.2.2 $"
+__date__ = "$Date: 2004/03/30 21:17:53 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -10,9 +10,9 @@
from ContainerBlocks import *
from Styles import Font
from repository.util.UUID import UUID
-from wxPython.wx import *
-from wxPython.gizmos import *
-from wxPython.html import *
+import wx
+import wx.html
+import wx.gizmos
import webbrowser # for opening external links
class Button(RectangularChild):
@@ -23,28 +23,28 @@
id = 0
if self.buttonKind == "Text":
- button = wxButton(parentWindow, id, self.title,
- wxDefaultPosition,
+ button = wx.Button(parentWindow, id, self.title,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height))
elif self.buttonKind == "Image":
- image = wxImage(self.icon, wxBITMAP_TYPE_PNG)
+ image = wx.Image(self.icon, wx.BITMAP_TYPE_PNG)
bitmap = image.ConvertToBitmap()
- button = wxBitmapButton(parentWindow, id, bitmap,
- wxDefaultPosition,
+ button = wx.BitmapButton(parentWindow, id, bitmap,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height))
elif self.buttonKind == "Toggle":
- if wxPlatform == '__WXMAC__': # @@@ Toggle buttons are not supported under OSX
- button = wxButton(parentWindow, id, self.title,
- wxDefaultPosition,
+ if wx.Platform == '__WXMAC__': # @@@ Toggle buttons are not supported under OSX
+ button = wx.Button(parentWindow, id, self.title,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height))
else:
- button = wxToggleButton(parentWindow, id, self.title,
- wxDefaultPosition,
+ button = wx.ToggleButton(parentWindow, id, self.title,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height))
elif __debug__:
assert False, "unknown buttonKind"
- EVT_BUTTON(parentWindow, id, self.buttonPressed)
+ wx.EVT_BUTTON(parentWindow, id, self.buttonPressed)
self.parentBlock.addToContainer(parent, button, self.stretchFactor,
self.Calculate_wxFlag(), self.Calculate_wxBorder())
return button, None, None
@@ -60,8 +60,8 @@
class Choice(RectangularChild):
def renderOneBlock(self, parent, parentWindow):
- choice = wxChoice(parentWindow, -1,
- wxDefaultPosition,
+ choice = wx.Choice(parentWindow, -1,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height),
self.choices)
self.parentBlock.addToContainer(parent, choice, self.stretchFactor,
@@ -71,8 +71,8 @@
class ComboBox(RectangularChild):
def renderOneBlock(self, parent, parentWindow):
- comboBox = wxComboBox(parentWindow, -1, self.selection,
- wxDefaultPosition,
+ comboBox = wx.ComboBox(parentWindow, -1, self.selection,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height),
self.choices)
self.parentBlock.addToContainer(parent, comboBox, self.stretchFactor,
@@ -80,10 +80,10 @@
return comboBox, None, None
-class wxEditText(wxTextCtrl):
+class wxEditText(wx.TextCtrl):
def __init__(self, *arguments, **keywords):
- wxTextCtrl.__init__ (self, *arguments, **keywords)
- EVT_TEXT_ENTER(self, self.GetId(), self.OnEnterPressed)
+ wx.TextCtrl.__init__ (self, *arguments, **keywords)
+ wx.EVT_TEXT_ENTER(self, self.GetId(), self.OnEnterPressed)
def OnEnterPressed(self, event):
counterpart = Globals.repository.find (self.counterpartUUID)
@@ -95,27 +95,27 @@
def renderOneBlock(self, parent, parentWindow):
style = 0
if self.textAlignmentEnum == "Left":
- style |= wxTE_LEFT
+ style |= wx.TE_LEFT
elif self.textAlignmentEnum == "Center":
- style |= wxTE_CENTRE
+ style |= wx.TE_CENTRE
elif self.textAlignmentEnum == "Right":
- style |= wxTE_RIGHT
+ style |= wx.TE_RIGHT
if self.lineStyleEnum == "MultiLine":
- style |= wxTE_MULTILINE
+ style |= wx.TE_MULTILINE
else:
- style |= wxTE_PROCESS_ENTER
+ style |= wx.TE_PROCESS_ENTER
if self.textStyleEnum == "RichText":
- style |= wxTE_RICH2
+ style |= wx.TE_RICH2
if self.readOnly:
- style |= wxTE_READONLY
+ style |= wx.TE_READONLY
editText = wxEditText (parentWindow,
-1,
"",
- wxDefaultPosition,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height),
style=style, name=self._name)
@@ -129,7 +129,7 @@
-class wxHTML(wxHtmlWindow):
+class wxHTML(wx.html.HtmlWindow):
def OnLinkClicked(self, link):
webbrowser.open(link.GetHref())
@@ -137,7 +137,7 @@
def renderOneBlock (self, parent, parentWindow):
htmlWindow = wxHTML(parentWindow,
Block.getwxID(self),
- wxDefaultPosition,
+ wx.DefaultPosition,
(self.minimumSize.width,
self.minimumSize.height))
if self.url:
@@ -170,12 +170,12 @@
return counterpart.contentSpec.len()
-class wxListBlock(wxListCtrl):
+class wxListBlock(wx.ListCtrl):
def __init__(self, *arguments, **keywords):
- wxListCtrl.__init__(self, *arguments, **keywords)
- EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.On_wxSelectionChanged)
- EVT_IDLE(self, self.OnIdle)
- EVT_SIZE(self, self.OnSize)
+ 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.scheduleUpdate = False
self.lastUpdateTime = 0
@@ -285,7 +285,7 @@
return list, None, None
def Calculate_wxStyle (self):
- style = wxLC_REPORT|wxLC_VIRTUAL|wxSUNKEN_BORDER|wxLC_EDIT_LABELS
+ style = wx.LC_REPORT|wx.LC_VIRTUAL|wx.SUNKEN_BORDER|wx.LC_EDIT_LABELS
return style
def NeedsUpdate(self):
@@ -303,14 +303,14 @@
class RadioBox(RectangularChild):
def renderOneBlock(self, parent, parentWindow):
if self.radioAlignEnum == "Across":
- dimension = wxRA_SPECIFY_COLS
+ dimension = wx.RA_SPECIFY_COLS
elif self.radioAlignEnum == "Down":
- dimension = wxRA_SPECIFY_ROWS
+ dimension = wx.RA_SPECIFY_ROWS
elif __debug__:
assert False, "unknown radioAlignEnum"
- radioBox = wxRadioBox(parentWindow, -1, self.title,
- wxDefaultPosition,
+ radioBox = wx.RadioBox(parentWindow, -1, self.title,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height),
self.choices, self.itemsPerLine, dimension)
self.parentBlock.addToContainer(parent, radioBox, self.stretchFactor,
@@ -326,16 +326,16 @@
class StaticText(RectangularChild):
def renderOneBlock (self, parent, parentWindow):
if self.textAlignmentEnum == "Left":
- style = wxALIGN_LEFT
+ style = wx.ALIGN_LEFT
elif self.textAlignmentEnum == "Center":
- style = wxALIGN_CENTRE
+ style = wx.ALIGN_CENTRE
elif self.textAlignmentEnum == "Right":
- style = wxALIGN_RIGHT
+ style = wx.ALIGN_RIGHT
- staticText = wxStaticText (parentWindow,
+ staticText = wx.StaticText (parentWindow,
-1,
self.title,
- wxDefaultPosition,
+ wx.DefaultPosition,
(self.minimumSize.width, self.minimumSize.height),
style)
@@ -367,10 +367,10 @@
toolbar = Globals.repository.find(wxToolbar.counterpartUUID)
id = Block.getwxID(self)
if self.toolbarItemKind == 'Button':
- bitmap = wxImage (self.bitmap, wxBITMAP_TYPE_PNG).ConvertToBitmap()
+ bitmap = wx.Image (self.bitmap, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
tool = wxToolbar.AddSimpleTool (id, bitmap,
self.title, self.statusMessage)
- EVT_TOOL(parentWindow, id, toolbar.toolPressed)
+ wx.EVT_TOOL(parentWindow, id, toolbar.toolPressed)
elif self.toolbarItemKind == 'Separator':
wxToolbar.AddSeparator()
elif self.toolbarItemKind == 'Check':
@@ -378,13 +378,13 @@
elif self.toolbarItemKind == 'Radio':
pass
elif self.toolbarItemKind == 'Text':
- tool = wxTextCtrl (wxToolbar, id, "",
- wxDefaultPosition,
- wxSize(300,-1),
- wxTE_PROCESS_ENTER)
+ tool = wx.TextCtrl (wxToolbar, id, "",
+ wx.DefaultPosition,
+ wx.Size(300,-1),
+ wx.TE_PROCESS_ENTER)
tool.SetName(self.title)
wxToolbar.AddControl (tool)
- EVT_TEXT_ENTER(tool, id, toolbar.toolEnterPressed)
+ wx.EVT_TEXT_ENTER(tool, id, toolbar.toolEnterPressed)
elif __debug__:
assert False, "unknown toolbarItemKind"
@@ -395,12 +395,12 @@
class wxTreeAndList:
def __init__(self, *arguments, **keywords):
- EVT_TREE_ITEM_EXPANDING(self, self.GetId(), self.OnExpanding)
- EVT_TREE_ITEM_COLLAPSING(self, self.GetId(), self.OnCollapsing)
- EVT_LIST_COL_END_DRAG(self, self.GetId(), self.OnColumnDrag)
- EVT_TREE_SEL_CHANGED(self, self.GetId(), self.On_wxSelectionChanged)
- EVT_IDLE(self, self.OnIdle)
- EVT_SIZE(self, self.OnSize)
+ 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.scheduleUpdate = False
self.lastUpdateTime = 0
@@ -420,7 +420,7 @@
def OnSize(self, event):
if not Globals.wxApplication.insideSynchronizeFramework:
size = event.GetSize()
- if isinstance (self, wxTreeListCtrl):
+ if isinstance (self, wx.gizmos.TreeListCtrl):
widthMinusLastColumn = 0
assert self.GetColumnCount() > 0, "We're assuming that there is at least one column"
for column in range (self.GetColumnCount() - 1):
@@ -429,7 +429,7 @@
if lastColumnWidth > 0:
self.SetColumnWidth (self.GetColumnCount() - 1, lastColumnWidth)
else:
- assert isinstance (self, wxTreeCtrl), "We're assuming the only other choice is a wxTree"
+ assert isinstance (self, wx.TreeCtrl), "We're assuming the only other choice is a wx.Tree"
self.SetSize (size)
event.Skip()
@@ -445,14 +445,14 @@
counterpart = Globals.repository.find (self.counterpartUUID)
- parentUUID = self.GetPyData (parentId)
+ parentUUID = self.GetItemData(parentId).GetData()
for child in self.ElementChildren (Globals.repository [parentUUID]):
cellValues = self.ElementCellValues (child)
childNodeId = self.AppendItem (parentId,
cellValues.pop(0),
-1,
-1,
- wxTreeItemData (child.getUUID()))
+ wx.TreeItemData (child.getUUID()))
index = 1
for value in cellValues:
self.SetItemText (childNodeId, value, index)
@@ -469,7 +469,7 @@
state of the opened tree
"""
try:
- del counterpart.openedContainers [self.GetPyData(id)]
+ del counterpart.openedContainers [self.GetItemData(id).GetData()]
except AttributeError:
pass
self.CollapseAndReset (id)
@@ -487,7 +487,7 @@
if not Globals.wxApplication.insideSynchronizeFramework:
counterpart = Globals.repository.find (self.counterpartUUID)
- itemUUID = self.GetPyData(self.GetSelection())
+ itemUUID = self.GetItemData(self.GetSelection()).GetData()
selection = Globals.repository.find (itemUUID)
if counterpart.selection != selection:
counterpart.selection = selection
@@ -498,7 +498,7 @@
def wxSynchronizeFramework(self):
def ExpandContainer (self, openedContainers, id):
try:
- expand = openedContainers [self.GetPyData(id)]
+ expand = openedContainers [self.GetItemData(id).GetData()]
except KeyError:
return
@@ -518,12 +518,12 @@
try:
counterpart.columnHeadings
except AttributeError:
- pass # A wxTreeCtrl won't use columnHeadings
+ pass # A wx.TreeCtrl won't use columnHeadings
else:
for index in xrange(self.GetColumnCount()):
self.RemoveColumn (0)
- info = wxTreeListColumnInfo()
+ info = wx.gizmos.TreeListColumnInfo()
for index in range (len(counterpart.columnHeadings)):
info.SetText (counterpart.columnHeadings[index])
info.SetWidth (counterpart.columnWidths[index])
@@ -538,7 +538,7 @@
rootNodeId = self.AddRoot (cellValues.pop(0),
-1,
-1,
- wxTreeItemData (root.getUUID()))
+ wx.TreeItemData (root.getUUID()))
self.SetItemHasChildren (rootNodeId, self.ElementHasChildren (root))
self.LoadChildren(rootNodeId)
ExpandContainer (self, counterpart.openedContainers, self.GetRootItem ())
@@ -578,7 +578,7 @@
itemUUID = item.getUUID()
child, cookie = self.GetFirstChild (id)
while child.IsOk():
- if self.GetPyData(child) == itemUUID:
+ if self.GetItemData(child).GetData() == itemUUID:
return child
child = self.GetNextSibling (child)
assert False, "Didn't find the item in the tree"
@@ -591,15 +591,15 @@
self.ScrollTo (id)
-class wxTree(wxTreeCtrl, wxTreeAndList):
+class wxTree(wx.TreeCtrl, wxTreeAndList):
def __init__(self, *arguments, **keywords):
- wxTreeCtrl.__init__ (self, *arguments, **keywords)
+ wx.TreeCtrl.__init__ (self, *arguments, **keywords)
wxTreeAndList.__init__ (self, *arguments, **keywords)
-class wxTreeList(wxTreeListCtrl, wxTreeAndList):
+class wxTreeList(wx.gizmos.TreeListCtrl, wxTreeAndList):
def __init__(self, *arguments, **keywords):
- wxTreeListCtrl.__init__ (self, *arguments, **keywords)
+ wx.gizmos.TreeListCtrl.__init__ (self, *arguments, **keywords)
wxTreeAndList.__init__ (self, *arguments, **keywords)
@@ -632,19 +632,19 @@
wxCounterpart.GoToItem (notification.GetData()['item'])
def Calculate_wxStyle (self):
- style = wxTR_DEFAULT_STYLE|wxNO_BORDER
+ style = wx.TR_DEFAULT_STYLE|wx.NO_BORDER
if self.hideRoot:
- style |= wxTR_HIDE_ROOT
+ style |= wx.TR_HIDE_ROOT
if self.noLines:
- style |= wxTR_NO_LINES
+ style |= wx.TR_NO_LINES
if self.useButtons:
- style |= wxTR_HAS_BUTTONS
+ style |= wx.TR_HAS_BUTTONS
else:
- style |= wxTR_NO_BUTTONS
+ style |= wx.TR_NO_BUTTONS
return style
-class wxItemDetail(wxHtmlWindow):
+class wxItemDetail(wx.html.HtmlWindow):
def OnLinkClicked(self, wx_linkinfo):
"""
Clicking on an item changes the selection (post notification).
@@ -674,7 +674,7 @@
def renderOneBlock (self, parent, parentWindow):
htmlWindow = wxItemDetail(parentWindow,
Block.getwxID(self),
- wxDefaultPosition,
+ wx.DefaultPosition,
(self.minimumSize.width,
self.minimumSize.height))
Index: osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/DialogAction.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/DialogAction.py:1.8 osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/DialogAction.py:1.8.2.1
--- osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/DialogAction.py:1.8 Tue Nov 25 10:19:23 2003
+++ osaf/chandler/Chandler/parcels/OSAF/framework/agents/schema/DialogAction.py Tue Mar 30 13:17:56 2004
@@ -1,12 +1,13 @@
-__revision__ = "$Revision: 1.8 $"
-__date__ = "$Date: 2003/11/25 18:19:23 $"
+__revision__ = "$Revision: 1.8.2.1 $"
+__date__ = "$Date: 2004/03/30 21:17:56 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import application.Globals as Globals
-from wxPython.wx import *
+import wx
from Action import Action
+
"""
The DialogAction class is a subclass of Action that displays a dialog using text derived from
a template and the passed in data object
@@ -40,13 +41,14 @@
message = self._SubstituteAttributes(template, notification.GetData())
if self.NeedsConfirmation():
- confirmDialog = wxMessageDialog(Globals.wxMainFrame, message, _("Confirm Action"), wxYES_NO | wxICON_QUESTION)
+ # @@@ 25Issue we no longer have wxMainFrame
+ confirmDialog = wx.MessageDialog(Globals.wxMainFrame, message, _("Confirm Action"), wx.YES_NO | wx.ICON_QUESTION)
result = confirmDialog.ShowModal()
confirmDialog.Destroy()
# FIXME: need to execute sub-action when the result is yes
else:
- wxMessageBox(message)
+ wx.MessageBox(message)
return True
Index: osaf/chandler/Chandler/application/SplashScreen.py
diff -u osaf/chandler/Chandler/application/SplashScreen.py:1.11 osaf/chandler/Chandler/application/SplashScreen.py:1.11.2.1
--- osaf/chandler/Chandler/application/SplashScreen.py:1.11 Tue Sep 9 14:50:30 2003
+++ osaf/chandler/Chandler/application/SplashScreen.py Tue Mar 30 13:18:00 2004
@@ -1,15 +1,15 @@
-__version__ = "$Revision: 1.11 $"
-__date__ = "$Date: 2003/09/09 21:50:30 $"
+__version__ = "$Revision: 1.11.2.1 $"
+__date__ = "$Date: 2004/03/30 21:18:00 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
-
import os
import webbrowser
-from wxPython.wx import *
-from wxPython.html import *
+import wx
+import wx.html
+
-class SplashScreen(wxDialog):
+class SplashScreen(wx.Dialog):
"""
This class implements an HTML informational screen presented to the user.
Common uses are for splash screens or 'About' pages.
@@ -21,10 +21,10 @@
Sets up the splash screen and starts its timer.
"""
if isModal:
- style= wxFRAME_FLOAT_ON_PARENT|wxDEFAULT_FRAME_STYLE
+ style= wx.FRAME_FLOAT_ON_PARENT|wx.DEFAULT_FRAME_STYLE
else:
- style = wxDEFAULT_FRAME_STYLE
- wxDialog.__init__(self, parent, -1, title, style=style)
+ style = wx.DEFAULT_FRAME_STYLE
+ wx.Dialog.__init__(self, parent, -1, title, style=style)
defaultWindowWidth = 700
maxWindowHeight = 600
self.isModal = isModal
@@ -58,16 +58,16 @@
else:
self.Destroy()
-class HTMLPanel(wxHtmlWindow):
+class HTMLPanel(wx.html.HtmlWindow):
"""
Displays the html message.
"""
def __init__(self, parent, pageLocation, size):
"""
- Sets up the wxHtmlWindow and loads the proper page to be displayed.
+ Sets up the wx.html.HtmlWindow and loads the proper page to be displayed.
"""
- wxHtmlWindow.__init__(self, parent, size=size,
- style=wxHW_SCROLLBAR_AUTO)
+ wx.html.HtmlWindow.__init__(self, parent, size=size,
+ style=wx.HW_SCROLLBAR_AUTO)
self.parent = parent
self.LoadPage(pageLocation)
@@ -78,7 +78,7 @@
splash screen.
"""
self.linked = false
- wxHtmlWindow.base_OnCellClicked(self, cell, x, y, event)
+ wx.html.HtmlWindow.base_OnCellClicked(self, cell, x, y, event)
if not self.linked:
self.parent.Close()
@@ -90,7 +90,7 @@
self.linked = true
webbrowser.open(link.GetHref())
-class SplashTimer(wxTimer):
+class SplashTimer(wx.Timer):
"""
A timer that keeps track of how long the splash screen has been
displayed.
@@ -99,7 +99,7 @@
"""
Sets up the timer.
"""
- wxTimer.__init__(self)
+ wx.Timer.__init__(self)
self.window = window
def Notify(self):
Index: osaf/chandler/Chandler/application/SimpleCanvas.py
diff -u osaf/chandler/Chandler/application/SimpleCanvas.py:1.19 osaf/chandler/Chandler/application/SimpleCanvas.py:1.19.2.1
--- osaf/chandler/Chandler/application/SimpleCanvas.py:1.19 Mon Feb 16 08:30:53 2004
+++ osaf/chandler/Chandler/application/SimpleCanvas.py Tue Mar 30 13:18:00 2004
@@ -1,24 +1,23 @@
-__version__ = "$Revision: 1.19 $"
-__date__ = "$Date: 2004/02/16 16:30:53 $"
+__version__ = "$Revision: 1.19.2.1 $"
+__date__ = "$Date: 2004/03/30 21:18:00 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
-
-from wxPython.wx import *
+import wx
import time
-class wxCanvasDragImage(wxFrame):
+class wxCanvasDragImage(wx.Frame):
"""
- A class similar to wxDragImage except that it uses a shaped frame
+ A class similar to wx.DragImage except that it uses a shaped frame
to display the image, and that it is always full screen.
"""
def __init__(self, bitmap):
- wxFrame.__init__(self, None, -1, "",
- style = wxFRAME_SHAPED
- | wxSIMPLE_BORDER
- | wxFRAME_NO_TASKBAR
- | wxSTAY_ON_TOP)
+ wx.Frame.__init__(self, None, -1, "",
+ style = wx.FRAME_SHAPED
+ | wx.SIMPLE_BORDER
+ | wx.FRAME_NO_TASKBAR
+ | wx.STAY_ON_TOP)
self.bmp = bitmap
w, h = self.bmp.GetWidth(), self.bmp.GetHeight()
self.SetClientSize( (w, h) )
@@ -27,7 +26,7 @@
EVT_PAINT(self, self.OnPaint)
- if wxPlatform == "__WXGTK__":
+ 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.
@@ -38,17 +37,17 @@
def SetWindowShape(self, evt=None, hotspot=None):
# Use the bitmap's mask to determine the region
- rgn = wxRegionFromBitmap(self.bmp)
+ rgn = wx.RegionFromBitmap(self.bmp)
if hotspot is not None:
# punch a hole in the region at the hotspot to allow mouse events
# through to the window below
- rect = wxRect(hotspot.x-1, hotspot.y-1, 3, 3)
+ rect = wx.Rect(hotspot.x-1, hotspot.y-1, 3, 3)
rgn.SubtractRect(rect)
self.SetShape(rgn)
def BeginDrag(self, hotspot, window, *ignoreOthers):
- self.hotspot = wxPoint(hotspot[0], hotspot[1])
- if wxPlatform != "__WXGTK__":
+ self.hotspot = wx.Point(hotspot[0], hotspot[1])
+ if wx.Platform != "__WXGTK__":
self.SetWindowShape(hotspot = self.hotspot)
self.window = window
if self.window:
@@ -66,7 +65,7 @@
Move the image to a new location on screen. The pt parameter
is a point in client coordinants relative to the window
specifed in BeginDrag. (Only for compatibility with
- wxDragImage, otherwise I would just use screen coordinants...)
+ wx.DragImage, otherwise I would just use screen coordinants...)
"""
pt2 = pt
if self.window:
@@ -74,31 +73,31 @@
self.SetPosition(pt2 - self.hotspot)
def Show(self):
- wxFrame.Show(self)
+ wx.Frame.Show(self)
self.Update()
def OnPaint(self, evt):
- dc = wxPaintDC(self)
+ dc = wx.PaintDC(self)
dc.DrawBitmap(self.bmp, 0,0, True)
-class wxCanvasDropSource (wxDropSource):
+class wxCanvasDropSource (wx.DropSource):
def __init__(self, drawableObject, dataObject):
- wxDropSource.__init__(self, drawableObject.canvas)
+ wx.DropSource.__init__(self, drawableObject.canvas)
self.drawableObject = drawableObject
self.SetData (dataObject)
def GiveFeedback (self, effect):
- windowX, windowY = wxGetMousePosition()
- self.drawableObject.Show (effect != wxDragMove)
+ windowX, windowY = wx.GetMousePosition()
+ self.drawableObject.Show (effect != wx.DragMove)
x, y = self.drawableObject.canvas.ScreenToClientXY (windowX, windowY)
self.drawableObject.dragImage.Move((x, y))
return False
-class wxCanvasDropTarget (wxPyDropTarget):
+class wxCanvasDropTarget (wx.PyDropTarget):
def __init__(self, canvas, dropTargetDataObject):
- wxPyDropTarget.__init__(self)
+ wx.PyDropTarget.__init__(self)
self.canvas = canvas
self.data = dropTargetDataObject
self.SetDataObject (dropTargetDataObject)
@@ -113,11 +112,11 @@
return result
-class wxSimpleDrawableObject (wxEvtHandler):
+class wxSimpleDrawableObject (wx.EvtHandler):
def __init__(self, canvas):
- wxEvtHandler.__init__ (self)
+ wx.EvtHandler.__init__ (self)
- self.bounds = wxRect ()
+ self.bounds = wx.Rect ()
self.canvas = canvas
self.visible = True
self.selected = False
@@ -181,52 +180,52 @@
"""
Create the dragImage and begin dragging over the full screen
"""
- offscreenBuffer = wxEmptyBitmap (self.bounds.GetWidth(), self.bounds.GetHeight())
- memoryDC = wxMemoryDC()
+ offscreenBuffer = wx.EmptyBitmap (self.bounds.GetWidth(), self.bounds.GetHeight())
+ memoryDC = wx.MemoryDC()
memoryDC.SelectObject (offscreenBuffer)
memoryDC.BeginDrawing()
self.Draw (memoryDC)
- maskBitmap = wxEmptyBitmap (self.bounds.GetWidth(), self.bounds.GetHeight(), 1)
+ maskBitmap = wx.EmptyBitmap (self.bounds.GetWidth(), self.bounds.GetHeight(), 1)
memoryDC.SelectObject (maskBitmap)
- memoryDC.SetBackground (wxBLACK_BRUSH)
+ memoryDC.SetBackground (wx.BLACK_BRUSH)
memoryDC.Clear()
self.DrawMask (memoryDC)
memoryDC.EndDrawing()
- memoryDC.SelectObject (wxNullBitmap)
+ memoryDC.SelectObject (wx.NullBitmap)
- if wxPlatform == "__WXMAC__": # workaround for wxMac bug
- offscreenBuffer.SetMask (wxMaskColour(maskBitmap, wxBLACK))
+ if wx.Platform == "__WXMAC__": # workaround for wxMac bug
+ offscreenBuffer.SetMask (wx.MaskColour(maskBitmap, wx.BLACK))
else:
- offscreenBuffer.SetMask (wxMask(maskBitmap))
+ offscreenBuffer.SetMask (wx.Mask(maskBitmap))
"""
Create the dragImage and begin dragging
"""
- if wxPlatform == "__WXGTK__":
+ if wx.Platform == "__WXGTK__":
# The "hole punching" trick dosen't work on wxGTK, move the hostspot
# to be just outside the image
x, y = -1, -1
- self.dragImage = wxCanvasDragImage (offscreenBuffer)
+ self.dragImage = wx.CanvasDragImage (offscreenBuffer)
- self.dragImage.BeginDrag(wxPoint (x,y), self.canvas, True)
+ self.dragImage.BeginDrag(wx.Point (x,y), self.canvas, True)
self.dragImage.Move (self.ConvertToCanvasDeviceCoordinates (x, y))
self.dragImage.Show()
"""
We need to keep a reference to the dataObject, rather than create
- it in the construction because wxCanvasDropSource doesn't own the
+ it in the construction because wx.CanvasDropSource doesn't own the
data so the garbage collector will delete it.
"""
dataObject = self.ConvertDrawableObjectToDataObject(x, y)
- dropSource = wxCanvasDropSource (self, dataObject)
+ dropSource = wx.CanvasDropSource (self, dataObject)
self.canvas.internalDnDItem = self
- result = dropSource.DoDragDrop (wxDrag_AllowMove)
+ result = dropSource.DoDragDrop (wx.Drag_AllowMove)
self.canvas.internalDnDItem = None
self.dragImage.Hide()
self.dragImage.EndDrag()
@@ -285,10 +284,10 @@
self.canvas.RefreshScrolledRect (self.bounds);
-class wxSimpleCanvas (wxScrolledWindow):
+class wxSimpleCanvas (wx.ScrolledWindow):
def __init__ (self, *_args, **_kwargs):
- wxScrolledWindow.__init__ (self, *_args, **_kwargs)
+ wx.ScrolledWindow.__init__ (self, *_args, **_kwargs)
def __del__(self):
for item in self.zOrderedDrawableObjects:
@@ -297,8 +296,8 @@
def OnInit (self, dropTargetDataObject):
"""
We have an extra OnInit in addition to the __init__, which you must
- remember to call. This is necessary because of how wxSimpleCanvases are
- stored in XRC, but treated like wxScrolledWindows
+ remember to call. This is necessary because of how wx.SimpleCanvases are
+ stored in XRC, but treated like wx.ScrolledWindows
"""
self.autoCreateDistance = 0
self.zOrderedDrawableObjects = []
@@ -306,24 +305,24 @@
EVT_PAINT (self, self.OnPaint)
EVT_ERASE_BACKGROUND (self, self.OnEraseBackground)
EVT_MOUSE_EVENTS (self, self.OnMouseEvent)
- self.SetDropTarget (wxCanvasDropTarget (self, dropTargetDataObject))
+ self.SetDropTarget (wx.CanvasDropTarget (self, dropTargetDataObject))
def RefreshScrolledRect (self, rect):
position = rect.GetPosition()
x, y = self.CalcScrolledPosition (position.x, position.y)
- self.RefreshRect (wxRect (x, y, rect.GetWidth(), rect.GetHeight()));
+ self.RefreshRect (wx.Rect (x, y, rect.GetWidth(), rect.GetHeight()));
def OnPaint (self, event):
"""
- wxBufferedDC doesn't work here since it doesn't handle scrolled windows
+ wx.BufferedDC doesn't work here since it doesn't handle scrolled windows
and always allocates a buffer the size of the client area. So instead we'll
- allocate a wxMemoryDC, draw into it then blit it to our paintDC.
- Eventually, if we're printing, we should bypass the wxMemoryDC.
+ allocate a wx.MemoryDC, draw into it then blit it to our paintDC.
+ Eventually, if we're printing, we should bypass the wx.MemoryDC.
The updateRegion is not in scrolled coordinates.
"""
scrollWindowOriginX, scrollWindowOriginY = self.CalcUnscrolledPosition (0, 0)
- paintDC = wxPaintDC (self)
+ paintDC = wx.PaintDC (self)
self.PrepareDC (paintDC)
"""
@@ -335,8 +334,8 @@
bufferWidth = updateRect.GetWidth()
bufferHeight = updateRect.GetHeight()
- memoryDC = wxMemoryDC()
- offscreenBuffer = wxEmptyBitmap (bufferWidth, bufferHeight)
+ memoryDC = wx.MemoryDC()
+ offscreenBuffer = wx.EmptyBitmap (bufferWidth, bufferHeight)
memoryDC.SelectObject (offscreenBuffer)
memoryDC.SetDeviceOrigin (-bufferX, -bufferY)
@@ -351,7 +350,7 @@
paintDC,
bufferX,
bufferY,
- wxSRC_INVERT)
+ wx.SRC_INVERT)
time.sleep(1)
success = paintDC.Blit (bufferX,
bufferY,
@@ -360,7 +359,7 @@
paintDC,
bufferX,
bufferY,
- wxSRC_INVERT)
+ wx.SRC_INVERT)
memoryDC.BeginDrawing()
@@ -390,12 +389,12 @@
objectWidth = drawableObject.bounds.GetWidth()
objectHeight = drawableObject.bounds.GetHeight()
- bounds = wxRect (objectX - scrollWindowOriginX,
+ bounds = wx.Rect (objectX - scrollWindowOriginX,
objectY - scrollWindowOriginY,
objectWidth,
objectHeight)
- if updateRegion.ContainsRect (bounds) != wxOutRegion and drawableObject.visible:
+ if updateRegion.ContainsRect (bounds) != wx.OutRegion and drawableObject.visible:
dc.SetDeviceOrigin (objectX + dcOriginX, objectY + dcOriginY)
drawableObject.Draw (dc)
dc.SetDeviceOrigin (dcOriginX, dcOriginY)
@@ -421,7 +420,7 @@
if self.autoCreateDistance != 0:
if event.ButtonDown() and self.CreateHitTest (x, y):
- self.dragStart = wxPoint (x, y)
+ self.dragStart = wx.Point (x, y)
self.CaptureMouse()
return True
elif hasattr (self, 'dragStart'):
@@ -455,7 +454,7 @@
else:
top = y
height = -deltaY
- dragRect = wxRect (left, top, width, height)
+ dragRect = wx.Rect (left, top, width, height)
if not hasattr (self, 'dragCreateDrawableObject'):
if (deltaX * deltaX) + (deltaY * deltaY) > (self.autoCreateDistance * self.autoCreateDistance):
@@ -465,7 +464,7 @@
"""
self.dragCreateDrawableObject = self.CreateNewDrawableObject (dragRect,
self.dragStart,
- wxPoint (x, y))
+ wx.Point (x, y))
# if we weren't allowed to create one, give up
if self.dragCreateDrawableObject == None:
return True
@@ -479,7 +478,7 @@
if self.dragCreateDrawableObject != None:
self.dragCreateDrawableObject.SizeDrag (dragRect,
self.dragStart,
- wxPoint (x, y))
+ wx.Point (x, y))
elif event.ButtonUp():
del self.dragStart
@@ -493,8 +492,8 @@
"""
Handle default behavior of copy and move
"""
- if result == wxDragMove or result == wxDragCopy:
- if (self.internalDnDItem != None) and (result == wxDragMove):
+ if result == wx.DragMove or result == wx.DragCopy:
+ if (self.internalDnDItem != None) and (result == wx.DragMove):
assert (self.zOrderedDrawableObjects.count (self.internalDnDItem) == 1)
drawableObject = self.ConvertDataObjectToDrawableObject (dataObject, x, y, True)
More information about the Commits
mailing list