def OnExplDouble(self, event): event.GetId() itm = self.explorer.GetSelection() msg = event.EventObject.GetItemText(itm) ttl = str(event.EventObject.GetItemPyData(itm)) if itm.IsOk(): if ttl == u'Repo': for i in range(self.frame.nbook.GetPageCount()): if self.frame.nbook.GetPage(i).Tag == u"Repo": self.frame.nbook.SetSelection(i) self.frame.nbook.GetPage(i).UpdateView(None) return pg = ObjRepo.RepositoryPanel(self) self.frame.AddTab(pg, pg.Title, active=True) sm = ed_style.StyleMgr( ed_style.StyleMgr.GetStyleSheet(self.frame.style)) pg.UpdateColors(sm) elif ttl == u'layer': for i in range(self.frame.nbook.GetPageCount()): if self.frame.nbook.GetPage( i).Tag == 'Graph' and self.frame.nbook.GetPageText( i) == msg: self.frame.nbook.SetSelection(i) return pg = GraphPanel(msg, self.frame) self.frame.AddTab(pg, msg, active=True) sm = ed_style.StyleMgr( ed_style.StyleMgr.GetStyleSheet(self.frame.style)) pg.UpdateColors(sm) elif ttl.startswith('EngineCod'): self.frame.CreateTextWindow(ttl[10:], activate=True) elif ttl.startswith('ReportCod'): self.frame.CreateTextWindow(ttl[10:], EditorPanel.ED_TypeReport, activate=True)
def OnImageLib(self, event): event.GetId() for i in range(self.nbook.GetPageCount()): if self.nbook.GetPage(i).Tag == u"ImgView": self.nbook.SetSelection(i) return pg = ImgView.ImgPanel(self) sm = ed_style.StyleMgr(ed_style.StyleMgr.GetStyleSheet(self.style)) pg.UpdateColors(sm) self.AddTab(pg, pg.Title, active=True)
def OnRepoView(self, evt): evt.GetId() for i in range(self.frame.nbook.GetPageCount()): if self.frame.nbook.GetPage(i).Tag == 'RepoView': self.frame.nbook.SetSelection(i) return pg = RepoView(self) self.frame.AddTab(pg, pg.Title, active=True) sm = ed_style.StyleMgr( ed_style.StyleMgr.GetStyleSheet(self.frame.style)) pg.UpdateColors(sm)
def _OpenShapeEditor(self, spath): nbook = wx.GetApp().TopWindow.nbook for i in range(nbook.GetPageCount()) : if nbook.GetPage(i).Tag == u"Text" and spath == nbook.GetPage(i).GetFileName(): nbook.SetSelection(i) return pg = ShapeEditor.ShapeEdPanel(self) #pg.tx.UpdateAllStyles(self.style) pg.UpdateColors(ed_style.StyleMgr(ed_style.StyleMgr.GetStyleSheet(self.style))) pg.tx.LoadFile(spath) ttl = pg.tx.GetTitleString() wx.GetApp().TopWindow.AddTab(pg, ttl, active=True) pass
def OnConsole(self, event): event.GetId() frame = wx.GetApp().TopWindow pane = frame._mgr.GetPane("hgconsole") if not pane.IsOk(): win = HgConsole(frame) frame._mgr.AddPane(win, aui.AuiPaneInfo().Name("hgconsole").Caption(_("HG console")). Dockable(False).Float().CloseButton(True).MaximizeButton(True)) pane = frame._mgr.GetPane("hgconsole") pane.Float().Show() if pane.floating_pos == wx.DefaultPosition: pane.FloatingPosition(frame.GetStartPosition()) sm = ed_style.StyleMgr(ed_style.StyleMgr.GetStyleSheet(frame.style)) pane.window.UpdateColors(sm) frame._mgr.Update()
def UpdateColors(self, style): #self.shell.SetShellTheme(style) self.style = style sm = ed_style.StyleMgr(ed_style.StyleMgr.GetStyleSheet(style)) for idx in xrange(self.nbook.GetPageCount()): self.nbook.GetPage(idx).UpdateColors(sm) # set logger window colors self.logger.UpdateColors(sm) # set explorer colors self.explorer.UpdateColors(sm) #self.explorer.SetHilightFocusColour() #self.explorer.SetHilightNonFocusColour() self.explorer.Refresh() # set properties colors self.propgrid.UpdateColors(sm) pane = self._mgr.GetPane("hgconsole") if pane.IsOk(): pane.window.UpdateColors(sm)
def CreateTextWindow(self, fname, ftype=ScEditor.EditorPanel.ED_TypeScript, activate=False): if not os.path.exists(fname): fname = os.path.join(os.path.curdir, fname) open(fname, 'w').close() for i in range(self.nbook.GetPageCount()): if self.nbook.GetPage( i).Tag == u"Text" and fname == self.nbook.GetPage( i).GetFileName(): self.nbook.SetSelection(i) return pg = ScEditor.EditorPanel(ftype, self) pg.tx.LoadFile(fname) pg.tx.SaveFile(fname) ttl = pg.tx.GetTitleString() self.AddTab(pg, ttl, active=activate) sm = ed_style.StyleMgr(ed_style.StyleMgr.GetStyleSheet(self.style)) pg.UpdateColors(sm)