258 parent=prnt, pos=wx.Point(0, 0), size=wx.Size(1000, 600), |
258 parent=prnt, pos=wx.Point(0, 0), size=wx.Size(1000, 600), |
259 style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN, title=u'Beremiz') |
259 style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN, title=u'Beremiz') |
260 self._init_utils() |
260 self._init_utils() |
261 self.SetClientSize(wx.Size(1000, 600)) |
261 self.SetClientSize(wx.Size(1000, 600)) |
262 self.SetMenuBar(self.menuBar1) |
262 self.SetMenuBar(self.menuBar1) |
|
263 self.Bind(wx.EVT_ACTIVATE, self.OnFrameActivated) |
263 |
264 |
264 self.MainSplitter = wx.SplitterWindow(id=ID_BEREMIZMAINSPLITTER, |
265 self.MainSplitter = wx.SplitterWindow(id=ID_BEREMIZMAINSPLITTER, |
265 name='MainSplitter', parent=self, point=wx.Point(0, 0), |
266 name='MainSplitter', parent=self, point=wx.Point(0, 0), |
266 size=wx.Size(0, 0), style=wx.SP_3D) |
267 size=wx.Size(0, 0), style=wx.SP_3D) |
267 self.MainSplitter.SetNeedUpdating(True) |
268 self.MainSplitter.SetNeedUpdating(True) |
330 self.PluginTree.SelectItem(self.PluginTree.GetRootItem()) |
331 self.PluginTree.SelectItem(self.PluginTree.GetRootItem()) |
331 |
332 |
332 self.RefreshPluginParams() |
333 self.RefreshPluginParams() |
333 self.RefreshButtons() |
334 self.RefreshButtons() |
334 self.RefreshMainMenu() |
335 self.RefreshMainMenu() |
335 |
336 |
|
337 def OnFrameActivated(self, event): |
|
338 if not event.GetActive(): |
|
339 self.PluginRoot.RefreshPluginsBlockLists() |
|
340 |
336 def RefreshButtons(self): |
341 def RefreshButtons(self): |
337 if self.PluginRoot.HasProjectOpened(): |
342 if self.PluginRoot.HasProjectOpened(): |
338 self.PluginChilds.Enable(True) |
343 self.PluginChilds.Enable(True) |
339 self.AddButton.Enable(True) |
344 self.AddButton.Enable(True) |
340 self.DeleteButton.Enable(True) |
345 self.DeleteButton.Enable(True) |
491 button = wx.Button(id=id, label=name, name=name, parent=self.ParamsPanel, |
496 button = wx.Button(id=id, label=name, name=name, parent=self.ParamsPanel, |
492 pos=wx.Point(0, 0), style=wx.BU_EXACTFIT) |
497 pos=wx.Point(0, 0), style=wx.BU_EXACTFIT) |
493 button.Bind(wx.EVT_BUTTON, self.GetButtonCallBackFunction(plugin, method), id=id) |
498 button.Bind(wx.EVT_BUTTON, self.GetButtonCallBackFunction(plugin, method), id=id) |
494 boxsizer.AddWindow(button, 0, border=5, flag=wx.GROW|wx.RIGHT) |
499 boxsizer.AddWindow(button, 0, border=5, flag=wx.GROW|wx.RIGHT) |
495 self.ParamsPanelMainSizer.Layout() |
500 self.ParamsPanelMainSizer.Layout() |
|
501 self.ParamsPanel.SetClientSize(self.ParamsPanel.GetClientSize()) |
496 |
502 |
497 # Refresh PluginChilds |
503 # Refresh PluginChilds |
498 self.PluginChilds.Clear() |
504 self.PluginChilds.Clear() |
499 if len(plugin.PlugChildsTypes) > 0: |
505 if len(plugin.PlugChildsTypes) > 0: |
500 self.PluginChilds.Append("") |
506 self.PluginChilds.Append("") |
573 for staticbox in staticboxes: |
579 for staticbox in staticboxes: |
574 staticbox.Destroy() |
580 staticbox.Destroy() |
575 |
581 |
576 def RefreshSizerElement(self, sizer, elements, path, clean = True): |
582 def RefreshSizerElement(self, sizer, elements, path, clean = True): |
577 if clean: |
583 if clean: |
578 if wx.VERSION >= (2, 7, 0): |
584 sizer.Clear(True) |
579 sizer.Clear(True) |
|
580 else: |
|
581 self.ClearSizer(sizer) |
|
582 first = True |
585 first = True |
583 for element_infos in elements: |
586 for element_infos in elements: |
584 if path: |
587 if path: |
585 element_path = "%s.%s"%(path, element_infos["name"]) |
588 element_path = "%s.%s"%(path, element_infos["name"]) |
586 else: |
589 else: |