def __init__(self, parent, title, node, data): super(HistoryWindow, self).__init__(parent, title=title, style=wx.DEFAULT_DIALOG_STYLE) # Set Frame Icon if wx.Platform == '__WXMAC__': self._accel = wx.AcceleratorTable([(wx.ACCEL_CMD, ord('W'), wx.ID_CLOSE)]) else: self._accel = wx.AcceleratorTable([(wx.ACCEL_CTRL, ord('W'), wx.ID_CLOSE)]) self.SetAcceleratorTable(self._accel) util.SetWindowIcon(self) # Attributes statbar = eclib.ProgressStatusBar(self) statbar.SetStatusWidths([-1, 125]) self.SetStatusBar(statbar) self._ctrls = HistoryPane(self, node, data) # Layout self._DoLayout() self.SetInitialSize() self.SetAutoLayout(True) # Event Handlers self.Bind(wx.EVT_CLOSE, self.OnClose) self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu) self.Bind(wx.EVT_MENU, lambda evt: self.Close(), id=wx.ID_CLOSE)
def __DoLayout(self): sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.panel, 1, wx.EXPAND) self.SetSizer(sizer) # NOTE: must use SB_FLAT style # TODO: fix this in control to enforce this req. statb = eclib.ProgressStatusBar(self, style=wx.SB_FLAT) statb.SetRange(1024) self.SetStatusBar(statb)
def __init__(self, parent, id=wx.ID_ANY, title=u'', size=wx.DefaultSize): wx.Frame.__init__(self, parent, title=title, size=size, style=wx.DEFAULT_FRAME_STYLE) util.SetWindowIcon(self) # Attributes bstyle = eclib.SEGBOOK_STYLE_NO_DIVIDERS | eclib.SEGBOOK_STYLE_LABELS self._nb = eclib.SegmentBook(self, style=bstyle) self._cfg_pg = ConfigPanel(self._nb, style=wx.BORDER_SUNKEN) self._dl_pg = DownloadPanel(self._nb) self._inst_pg = InstallPanel(self._nb) self._imglst = list() # Setup self._imglst.append(MakeThemeTool(ed_glob.ID_PREF)) self._imglst.append(MakeThemeTool(ed_glob.ID_WEB)) self._imglst.append(MakeThemeTool(ed_glob.ID_PACKAGE)) bmp = wx.ArtProvider.GetBitmap(wx.ART_ERROR, wx.ART_TOOLBAR, (32, 32)) self._imglst.append(bmp) bmp = wx.ArtProvider.GetBitmap(str(ed_glob.ID_PREF), wx.ART_TOOLBAR, (32, 32)) self._imglst.append(bmp) self._nb.SetImageList(self._imglst) self._nb.SetUsePyImageList(True) self._nb.AddPage(self._cfg_pg, _("Configure"), img_id=IMG_CONFIG) self._nb.AddPage(self._dl_pg, _("Download"), img_id=IMG_DOWNLOAD) self._nb.AddPage(self._inst_pg, _("Install"), img_id=IMG_INSTALL) # Check for plugins with error conditions and if any are found # Add the error page. pmgr = wx.GetApp().GetPluginManager() if len(pmgr.GetIncompatible()): self._nb.AddPage(ConfigPanel(self._nb, style=wx.BORDER_SUNKEN, mode=MODE_ERROR), _("Errors"), img_id=IMG_ERROR) # Layout sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self._nb, 1, wx.EXPAND) self.SetSizer(sizer) self.SetStatusBar(eclib.ProgressStatusBar(self, style=wx.SB_FLAT)) self.SetInitialSize(size) # Event Handlers self.Bind(eclib.EVT_SB_PAGE_CHANGING, self.OnPageChanging) self.Bind(wx.EVT_CLOSE, self.OnClose)
def __init__(self, parent, id=wx.ID_ANY, title=u'', size=wx.DefaultSize): super(PluginDialog, self).__init__(parent, title=title, size=size, style=wx.DEFAULT_FRAME_STYLE) util.SetWindowIcon(self) # Attributes bstyle = eclib.SEGBOOK_STYLE_NO_DIVIDERS | eclib.SEGBOOK_STYLE_LABELS self._nb = eclib.SegmentBook(self, style=bstyle) self._cfg_pg = ConfigPanel(self._nb, style=wx.BORDER_SUNKEN) self._dl_pg = DownloadPanel(self._nb) self._inst_pg = InstallPanel(self._nb) self._imglst = list() # Setup self.__InitImageList() self._nb.AddPage(self._cfg_pg, _("Configure"), img_id=IMG_CONFIG) self._nb.AddPage(self._dl_pg, _("Download"), img_id=IMG_DOWNLOAD) self._nb.AddPage(self._inst_pg, _("Install"), img_id=IMG_INSTALL) # Check for plugins with error conditions and if any are found # Add the error page. pmgr = wx.GetApp().GetPluginManager() if len(pmgr.GetIncompatible()): self._nb.AddPage(ConfigPanel(self._nb, style=wx.NO_BORDER, mode=MODE_ERROR), _("Errors"), img_id=IMG_ERROR) # Layout sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self._nb, 1, wx.EXPAND) self.SetSizer(sizer) self.SetStatusBar(eclib.ProgressStatusBar(self, style=wx.SB_FLAT)) self.SetInitialSize(size) # Event Handlers self.Bind(eclib.EVT_SB_PAGE_CHANGING, self.OnPageChanging) self.Bind(wx.EVT_CLOSE, self.OnClose) self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy, self) # Message Handlers ed_msg.Subscribe(self.OnThemeChange, ed_msg.EDMSG_THEME_CHANGED)