Bugs with windows fixed
authorlbessard
Fri, 21 Dec 2007 17:25:53 +0100
changeset 83 ad4dafe7bfee
parent 82 d7b4dd1f543f
child 84 8bc2669828e9
Bugs with windows fixed
Beremiz.py
plugins/__init__.py
--- a/Beremiz.py	Thu Dec 20 16:36:14 2007 +0100
+++ b/Beremiz.py	Fri Dec 21 17:25:53 2007 +0100
@@ -347,6 +347,7 @@
         else:
             self.AUIManager = wx.aui.AuiManager(self)
             self.AUIManager.SetDockSizeConstraint(0.5, 0.5)
+            self.Panes = {}
             
             self.PluginTree = CT.CustomTreeCtrl(id=ID_BEREMIZPLUGINTREE,
               name='PluginTree', parent=self, pos=wx.Point(0, 0),
@@ -548,7 +549,7 @@
                 else:
                     item = self.PluginTree.AppendItem(root, "")
                 
-                if wx.Platform != '__WXMSW__':
+                if wx.Platform != '__WXMSW__' or wx.VERSION >= (2, 8, 0):
                     item, root_cookie = self.PluginTree.GetNextChild(root, root_cookie)
             self.GenerateTreeBranch(item, values)
             item, root_cookie = self.PluginTree.GetNextChild(root, root_cookie)
@@ -643,10 +644,15 @@
     def RefreshPluginToolBar(self):
         if wx.VERSION < (2, 8, 0):
             self.ClearSizer(self.MenuSizer)
+        else:
+            if "ToolBar" in self.Panes:
+                self.AUIManager.DetachPane(self.Panes["ToolBar"])
+                self.Panes["ToolBar"].Destroy()
         if self.PluginRoot.HasOpenedProject() and len(self.PluginRoot.PluginMethods) > 0:
             if wx.VERSION > (2, 8, 0):
                 toolbar = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
                     wx.TB_FLAT | wx.TB_NODIVIDER | wx.NO_BORDER | wx.TB_TEXT)
+                toolbar.SetToolBitmapSize(wx.Size(48, 48))
             else:
                 boxsizer = wx.BoxSizer(wx.HORIZONTAL)
             for plugin_infos in self.PluginRoot.PluginMethods:
@@ -682,6 +688,7 @@
                 self.RightGridSizer.Layout()
             else:
                 toolbar.Realize()
+                self.Panes["ToolBar"] = toolbar
                 self.AUIManager.AddPane(toolbar, wx.aui.AuiPaneInfo().
                       Name("ToolBar").Caption("Toolbar").
                       ToolbarPane().Top().
--- a/plugins/__init__.py	Thu Dec 20 16:36:14 2007 +0100
+++ b/plugins/__init__.py	Fri Dec 21 17:25:53 2007 +0100
@@ -2,4 +2,4 @@
 
 _base_path = path.split(__file__)[0]
 
-__all__ = [name for name in listdir(_base_path) if path.isdir(path.join(_base_path, name)) and name != "CVS" or name.endswith(".py") and not name.startswith("__")]
+__all__ = [name for name in listdir(_base_path) if path.isdir(path.join(_base_path, name)) and name.upper() != "CVS" or name.endswith(".py") and not name.startswith("__")]