[Commits] (jed) Removed getParentBlock (Bug#1321).

commits at osafoundation.org commits at osafoundation.org
Wed Mar 10 01:28:51 PST 2004


Commit by: jed
Modified files:
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py 1.18 1.19
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py 1.13 1.14
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py 1.6 1.7
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py 1.68 1.69

Log message:
Removed getParentBlock (Bug#1321).


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py.diff?r1=text&tr1=1.18&r2=text&tr2=1.19
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.13&r2=text&tr2=1.14
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py.diff?r1=text&tr1=1.6&r2=text&tr2=1.7
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py.diff?r1=text&tr1=1.68&r2=text&tr2=1.69

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.68 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.69
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.68	Wed Mar 10 01:18:30 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py	Wed Mar 10 01:28:20 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.68 $"
-__date__ = "$Date: 2004/03/10 09:18:30 $"
+__version__ = "$Revision: 1.69 $"
+__date__ = "$Date: 2004/03/10 09:28:20 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -24,7 +24,7 @@
         if self.parentBlock: 
             panel = wxPanel(parentWindow, -1)
             panel.SetSizer(sizer)
-            self.getParentBlock(parentWindow).addToContainer(parent, panel, 
+            self.parentBlock.addToContainer(parent, panel, 
                                                              self.stretchFactor, 
                                                              self.Calculate_wxFlag(), 
                                                              self.Calculate_wxBorder())
@@ -53,11 +53,11 @@
         sizer = wxBoxSizer(wxHORIZONTAL)
         panel = wxPanel(parentWindow, -1)
         panel.SetSizer(sizer)
-        self.getParentBlock(parentWindow).addToContainer(parent,
-                                                         panel,
-                                                         self.stretchFactor,
-                                                         self.Calculate_wxFlag(),
-                                                         self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent,
+                                        panel,
+                                        self.stretchFactor,
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
         try:
             newChild = self.contentSpec.data[0]
         except IndexError:
@@ -170,8 +170,8 @@
                                     wxDefaultPosition,
                                     (self.size.width, self.size.height),
                                     style=self.Calculate_wxStyle(parentWindow))
-        self.getParentBlock(parentWindow).addToContainer(parent, splitWindow, self.stretchFactor, 
-                              self.Calculate_wxFlag(), self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent, splitWindow, self.stretchFactor, 
+                                        self.Calculate_wxFlag(), self.Calculate_wxBorder())
         """
           Wire up onSize after __init__ has been called, otherwise it will
         call onSize
@@ -181,9 +181,9 @@
                 
     def Calculate_wxStyle (self, parentWindow):
         style = wxSP_LIVE_UPDATE|wxNO_FULL_REPAINT_ON_RESIZE
-        parent = self.getParentBlock(parentWindow)
+        parent = self.parentBlock
         while isinstance (parent, EmbeddedContainer):
-            parent = parent.getParentBlock(Globals.association[parent.getUUID()])
+            parent = parent.parentBlock
         if isinstance (parent, SplitWindow):
             style |= wxSP_3DSASH
         else:
@@ -251,7 +251,7 @@
                                     wxDefaultPosition,
                                     (self.minimumSize.width, self.minimumSize.height),
                                      style = style)
-        self.getParentBlock(parentWindow).addToContainer(parent, tabbedContainer, self.stretchFactor, 
+        self.parentBlock.addToContainer(parent, tabbedContainer, self.stretchFactor, 
                               self.Calculate_wxFlag(), self.Calculate_wxBorder())
         return tabbedContainer, tabbedContainer, tabbedContainer
 

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py:1.18 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py:1.19
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py:1.18	Wed Mar  3 15:38:25 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Block.py	Wed Mar 10 01:28:20 2004
@@ -132,11 +132,6 @@
             self.handleChildren(window)
         return window, parent, parentWindow
                 
-    def getParentBlock(self, parentWindow):
-        if self.parentBlock:
-            return self.parentBlock
-        return Globals.repository.find (parentWindow.counterpartUUID)
-
     def addToContainer(self, parent, child, id, flag, border):
         pass
     

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py:1.13 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py:1.14
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py:1.13	Wed Mar  3 15:38:25 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ControlBlocks.py	Wed Mar 10 01:28:20 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.13 $"
-__date__ = "$Date: 2004/03/03 23:38:25 $"
+__version__ = "$Revision: 1.14 $"
+__date__ = "$Date: 2004/03/10 09:28:20 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -45,8 +45,8 @@
             assert False, "unknown buttonKind"
 
         EVT_BUTTON(parentWindow, id, self.buttonPressed)
-        self.getParentBlock(parentWindow).addToContainer(parent, button, self.stretchFactor,
-                              self.Calculate_wxFlag(), self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent, button, self.stretchFactor,
+                                        self.Calculate_wxFlag(), self.Calculate_wxBorder())
         return button, None, None
 
     def buttonPressed(self, event):
@@ -64,8 +64,8 @@
                               wxDefaultPosition,
                               (self.minimumSize.width, self.minimumSize.height),
                               self.choices)
-        self.getParentBlock(parentWindow).addToContainer(parent, choice, self.stretchFactor, 
-                              self.Calculate_wxFlag(), self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent, choice, self.stretchFactor, 
+                                        self.Calculate_wxFlag(), self.Calculate_wxBorder())
         return choice, None, None
 
 
@@ -75,8 +75,8 @@
                               wxDefaultPosition,
                               (self.minimumSize.width, self.minimumSize.height),
                               self.choices)
-        self.getParentBlock(parentWindow).addToContainer(parent, comboBox, self.stretchFactor, 
-                              self.Calculate_wxFlag(), self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent, comboBox, self.stretchFactor, 
+                                        self.Calculate_wxFlag(), self.Calculate_wxBorder())
         return comboBox, None, None
 
 
@@ -120,11 +120,11 @@
                                style=style, name=self._name)
 
         editText.SetFont(Font (self.characterStyle))
-        self.getParentBlock(parentWindow).addToContainer(parent,
-                                                         editText,
-                                                         self.stretchFactor, 
-                                                         self.Calculate_wxFlag(),
-                                                         self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent,
+                                        editText,
+                                        self.stretchFactor, 
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
         return editText, None, None
 
 
@@ -143,12 +143,11 @@
         if self.url:
             htmlWindow.LoadPage(self.url)
 
-        parentBlock = self.getParentBlock(parentWindow)
-        parentBlock.addToContainer(parent,
-                                   htmlWindow,
-                                   self.stretchFactor,
-                                   self.Calculate_wxFlag(),
-                                   self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent,
+                                        htmlWindow,
+                                        self.stretchFactor,
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
         return htmlWindow, None, None
 
  
@@ -267,11 +266,11 @@
         list = wxListBlock(parentWindow,
                            Block.getwxID(self),
                            style=self.Calculate_wxStyle())
-        self.getParentBlock(parentWindow).addToContainer(parent,
-                                                         list,
-                                                         self.stretchFactor,
-                                                         self.Calculate_wxFlag(),
-                                                         self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent,
+                                        list,
+                                        self.stretchFactor,
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
         return list, None, None
 
     def Calculate_wxStyle (self):
@@ -296,8 +295,8 @@
                               wxDefaultPosition, 
                               (self.minimumSize.width, self.minimumSize.height),
                               self.choices, self.itemsPerLine, dimension)
-        self.getParentBlock(parentWindow).addToContainer(parent, radioBox, self.stretchFactor, 
-                              self.Calculate_wxFlag(), self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent, radioBox, self.stretchFactor, 
+                                        self.Calculate_wxFlag(), self.Calculate_wxBorder())
         return radioBox, None, None
 
 
@@ -323,10 +322,10 @@
                                    style)
 
         staticText.SetFont(Font (self.characterStyle))
-        self.getParentBlock(parentWindow).addToContainer(parent, staticText,
-                                                         self.stretchFactor,
-                                                         self.Calculate_wxFlag(),
-                                                         self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent, staticText,
+                                        self.stretchFactor,
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
         return staticText, None, None
 
 
@@ -593,11 +592,11 @@
                 tree = wxTree (parentWindow, Block.getwxID(self), style = self.Calculate_wxStyle())
             else:
                 tree = wxTreeList (parentWindow, Block.getwxID(self), style = self.Calculate_wxStyle())
-        self.getParentBlock(parentWindow).addToContainer(parent,
-                                                         tree,
-                                                         self.stretchFactor,
-                                                         self.Calculate_wxFlag(),
-                                                         self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent,
+                                        tree,
+                                        self.stretchFactor,
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
         return tree, None, None
 
     def OnSelectionChangedEvent (self, notification):
@@ -648,13 +647,13 @@
                                   (self.minimumSize.width,
                                    self.minimumSize.height))
         
-        parentBlock = self.getParentBlock(parentWindow)
-        parentBlock.addToContainer(parent,
-                                   htmlWindow,
-                                   self.stretchFactor,
-                                   self.Calculate_wxFlag(),
-                                   self.Calculate_wxBorder())
-
+        
+        self.parentBlock.addToContainer(parent,
+                                        htmlWindow,
+                                        self.stretchFactor,
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
+        
         return htmlWindow, None, None
 
     def getHTMLText(self, item):

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py:1.6 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py:1.7
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py:1.6	Wed Mar 10 01:18:30 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/NavigationBlocks.py	Wed Mar 10 01:28:20 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.6 $"
-__date__ = "$Date: 2004/03/10 09:18:30 $"
+__version__ = "$Revision: 1.7 $"
+__date__ = "$Date: 2004/03/10 09:28:20 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -40,10 +40,10 @@
         sizer.SetMinSize((self.minimumSize.width, self.minimumSize.height))
         self.addBookmarks(panel, sizer)
         panel.SetSizerAndFit(sizer)
-        self.getParentBlock(parentWindow).addToContainer(parent, panel,
-                                                         self.stretchFactor,
-                                                         self.Calculate_wxFlag(),
-                                                         self.Calculate_wxBorder())
+        self.parentBlock.addToContainer(parent, panel,
+                                        self.stretchFactor,
+                                        self.Calculate_wxFlag(),
+                                        self.Calculate_wxBorder())
         self.showOrHideBookmarksBar(panel)
         return panel, None, None
     



More information about the Commits mailing list