def build_toolbar(self): self.tb = self.mw.CreateToolBar(wal.TBFLAGS) icon_size = config.toolbar_icon_size self.tb.SetToolBitmapSize(config.toolbar_size) if wal.is_mac(): for items in BUTTONS: if not items is None: if len(items) == 1: action = self.mw.app.actions[items[0]] button = MacTB_ActionButton(self.tb, action) else: actions = [] for item in items: actions.append(self.mw.app.actions[item]) button = MacTB_ActionNestedButtons(self.tb, actions) self.tb.AddControl(button) else: for items in BUTTONS: if items is None: self.tb.AddSeparator() else: for item in items: action = self.mw.app.actions[item] aid = action.action_id label_txt = action.get_tooltip_text() hlp_txt = action.get_descr_text() bmp = action.get_icon(icon_size, wal.ART_TOOLBAR) if not bmp: continue self.tb.AddLabelTool(aid, label_txt, bmp, shortHelp=hlp_txt) action.register_as_tool(self.tb) self.tb.Realize()
def create_artprovider(): if is_msw(): provider = WinArtProvider() elif is_mac(): provider = MacArtProvider() else: provider = LinuxArtProvider() wx.ArtProvider_Push(provider) return provider
def __init__(self, app, parent): self.app = app wal.HPanel.__init__(self, parent) self.pack(get_bmp(self.panel, icons.PD_MOUSE_MONITOR)) width = 100 if wal.is_mac(): width = 130 self.pointer_txt = wal.Label(self.panel, text=' ', fontsize=FONTSIZE[0]) self.pointer_txt.SetMinSize((width, -1)) self.pack(self.pointer_txt) self.pack(wal.VLine(self.panel), fill=True, padding=2) events.connect(events.MOUSE_STATUS, self.set_value) events.connect(events.NO_DOCS, self.hide_monitor) events.connect(events.DOC_CHANGED, self.doc_changed)
def __init__(self, app, parent): self.app = app self.mw = parent self.docareas = [] wal.VPanel.__init__(self, parent) if not wal.is_mac(): self.pack(wal.HLine(self), fill=True) #----- Context panel self.ctxpanel = AppCtxPanel(self.app, self) self.pack(self.ctxpanel, fill=True, padding=1) #----- Doc tabs self.dtp = DocTabsPanel(self) self.doc_tabs = self.dtp.doc_tabs self.pack(self.dtp, fill=True) hpanel = wal.HPanel(self) self.pack(hpanel, expand=True, fill=True) #----- Tools self.tools = AppTools(self.app, hpanel) hpanel.pack(self.tools, fill=True) hpanel.pack(wal.VLine(hpanel), fill=True) self.splitter = wal.Splitter(hpanel) self.doc_keeper = wal.VPanel(self.splitter) self.doc_keeper.SetBackgroundColour(wal.WHITE) self.plg_area = PlgArea(self.app, self.splitter) self.app.mdiarea = self self.app.plg_area = self.plg_area self.splitter.split_vertically(self.doc_keeper, self.plg_area) self.splitter.set_min_size(200) self.splitter.set_sash_gravity(1.0) self.splitter.unsplit() hpanel.pack(self.splitter, expand=True, fill=True) #----- Vertical Palette panel self.vp_panel = wal.HPanel(hpanel) self.vp_panel.pack(wal.VLine(self.vp_panel), fill=True, start_padding=2) vpalette_panel = AppVPalette(self.vp_panel, self.app) self.vp_panel.pack(vpalette_panel, fill=True, padding=2) hpanel.pack(self.vp_panel, fill=True) if config.palette_orientation == uc2const.HORIZONTAL: self.vp_panel.hide() #----- Horizontal Palette panel self.hp_panel = wal.VPanel(self) self.hp_panel.pack(wal.HLine(self.hp_panel), fill=True, padding=2) hpalette_panel = AppHPalette(self.hp_panel, self.app) self.hp_panel.pack(hpalette_panel, fill=True) self.pack(self.hp_panel, fill=True) self.change_palette() #----- Status bar self.pack(wal.HLine(self), fill=True, start_padding=2) self.statusbar = AppStatusbar(self) self.pack(self.statusbar, fill=True, padding=2) self.layout() events.connect(events.CONFIG_MODIFIED, self.config_update)