def build(self): self.panel.pack(wal.PLine(self.panel), fill=True) self.splitter = wal.Splitter(self.panel, hidden=True) self.panel.pack(self.splitter, expand=True, fill=True) self.tree_container = wal.VPanel(self.splitter) if not PREFS_DATA: items = [] for class_ in PREFS_APP: item = class_(self.app, self, None) item.hide() items.append(item) PREFS_DATA.append(items) self.tree = wal.PrefsList(self.tree_container, data=PREFS_DATA[0], on_select=self.on_select) self.tree_container.pack(self.tree, fill=True, expand=True) cont = wal.VPanel(self.splitter) self.container = wal.HPanel(cont) self.container.pack(wal.PLine(self.container), fill=True) self.container.pack(wal.SplitterSash(self.container, self.splitter), fill=True) cont.pack(self.container, fill=True, expand=True) sash_pos = config.prefs_sash_pos self.splitter.split_vertically(self.tree_container, cont, sash_pos) self.splitter.set_min_size(sash_pos) self.panel.pack(wal.PLine(self.panel), fill=True)
def build(self): self.splitter = wal.Splitter(self.panel) self.panel.pack(self.splitter, expand=True, fill=True) self.tree_container = wal.VPanel(self.splitter) if not PREFS_DATA: PREFS_DATA.append(PrefsAppItem(PREFS_APP)) # PREFS_DATA.append(PrefsDocItem(PREFS_DOC)) for item in PREFS_DATA: item.init_prefs(self.app, self) self.tree = wal.TreeWidget(self.tree_container, data=PREFS_DATA, on_select=self.on_select, border=False) self.tree_container.pack(self.tree, fill=True, expand=True) cont = wal.VPanel(self.splitter) cont.pack(wal.PLine(cont), fill=True) self.container = wal.VPanel(cont) cont.pack(self.container, fill=True, expand=True) cont.pack(wal.PLine(cont), fill=True) sash_pos = config.prefs_sash_pos self.splitter.split_vertically(self.tree_container, cont, sash_pos) self.splitter.set_min_size(sash_pos) if not wal.IS_MSW: self.tree.set_indent(5) self.tree.expand_all()
def build(self): self.panel.pack(wal.PLine(self.panel), fill=True) self.lc = wal.ReportList(self.panel, on_select=self.update, on_activate=self.on_ok) self.panel.pack(self.lc, expand=True, fill=True) self.panel.pack(wal.PLine(self.panel), fill=True)
def build(self): prnpanel = wal.VPanel(self) # --- Control panels prnpanel.pack(wal.PLine(prnpanel), fill=True) prnpanel.pack(PrinterPanel(prnpanel, self, self.printsys), fill=True) prnpanel.pack(PrintModePanel(prnpanel, self.printer), fill=True) prnpanel.pack(PageRangePanel(prnpanel, self.printout), fill=True) prnpanel.pack(CopiesPanel(prnpanel, self.printer, self.printout), fill=True) # --- Control panels end self.pack(prnpanel, fill=True) self.pack(wal.PLine(self), fill=True) cont = wal.VPanel(self) cont.pack(wal.PLine(cont), fill=True) r_grid = wal.GridPanel(cont) cv_grid = wal.GridPanel(r_grid) self.canvas = PreviewCanvas(cv_grid, self, self.printer, self.printout) units = self.printout.get_units() corner = PreviewCorner(r_grid) hruler = PreviewRuler(r_grid, self.canvas, units) hruler.set_bg(wal.WHITE) vruler = PreviewRuler(r_grid, self.canvas, units, False) vruler.set_bg(wal.WHITE) tb = PreviewToolbar(cont, self, self.canvas, self.printer) vscroll = wal.ScrollBar(cv_grid, onscroll=self.canvas._scrolling) hscroll = wal.ScrollBar(cv_grid, False, onscroll=self.canvas._scrolling) self.canvas.set_ctrls(hscroll, vscroll, hruler, vruler, tb.pager) cont.pack(tb, fill=True) cont.pack(wal.PLine(cont), fill=True) cv_grid.add_growable_col(0) cv_grid.add_growable_row(0) cv_grid.pack(self.canvas, fill=True) cv_grid.pack(vscroll, fill=True) cv_grid.pack(hscroll, fill=True) cv_grid.pack((1, 1)) r_grid.add_growable_col(1) r_grid.add_growable_row(1) r_grid.pack(corner) r_grid.pack(hruler, fill=True) r_grid.pack(vruler, fill=True) r_grid.pack(cv_grid, fill=True) cont.pack(r_grid, fill=True, expand=True) self.pack(cont, fill=True, expand=True) prn_events.connect(prn_events.PRINTER_CHANGED, self.printer_changed) prn_events.connect(prn_events.PRINTOUT_MODIFIED, self.printout_modified) prn_events.connect(prn_events.PRINTER_MODIFIED, self.printer_modified)
def __init__(self): wal.MainWindow.__init__(self) self.set_size(SIZE) self.pack((10, 10)) self.pack(wal.PLine(self), fill=True)
def __init__(self, app, parent): self.app = app wal.HPanel.__init__(self, parent) self.pack(wal.PLine(self), fill=True) self.container = wal.VPanel(self) self.pack(self.container, expand=True, fill=True) self.tabs = PlgTabsPanel(app, self) self.pack(self.tabs, fill=True) self.layout()
def __init__(self, app, parent): self.app = app self.parent = parent self.insp = self.app.insp self.actions = self.app.actions wal.HPanel.__init__(self, parent) self.build() self.pack(wal.PLine(self), fill=True, padding=3) self.hide()
def __init__(self, app, parent): self.app = app wal.HPanel.__init__(self, parent) self.pack(get_bmp(self.panel, icons.PD_MOUSE_MONITOR), padding_all=3) self.pointer_txt = wal.Label(self.panel, text=' ', fontsize=FONTSIZE[0]) self.pointer_txt.set_min_width(130 if wal.IS_MAC else 100) self.pack(self.pointer_txt) self.pack(wal.PLine(self.panel), fill=True, padding=3) 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, parent): wal.HPanel.__init__(self, parent) icon = get_icon(icons.PD_ZOOM, size=wal.SIZE_16) self.pack(wal.Bitmap(self, icon, on_left_click=self.show_menu)) self.label = wal.Label(self, '10000%', fontsize=FONTSIZE[0]) self.label.set_min_width(70 if wal.IS_MAC else 55) self.label.set_tooltip(_('Zoom level')) self.pack(self.label, padding=2) self.pack(wal.PLine(self.panel), fill=True, padding=3) self.zoom_menu = ZoomMenu(parent.mw)
def build(self): self.toolbar = ConsoleToolbar(self, self) self.pack(self.toolbar, fill=True) hpanel = wal.HPanel(self) self.pack(hpanel, fill=True, expand=True) self.lpanel = wal.VPanel(hpanel) self.lpanel.set_bg(LEFT_PANEL) self.lpanel.pack((26, 26)) hpanel.pack(self.lpanel, fill=True) hpanel.pack(wal.PLine(hpanel, SEP), fill=True) self.entry = wal.Entry(hpanel, '', multiline=True, editable=False, richtext=True, no_border=True) self.entry.set_bg(BG_COLOR) hpanel.pack(self.entry, fill=True, expand=True) self.log_path = os.path.join(self.app.appdata.app_config_dir, 'sk1.log') self.load_logs(self.log_path)
def __init__(self, app, parent): self.app = app actions = app.actions wal.HPanel.__init__(self, parent) action_id = pdids.ID_SNAP_TO_GRID tooltip_txt = get_tooltip_text(action_id) icons_dict = { True: [icons.PD_SNAP_TO_GRID_ON, tooltip_txt], False: [icons.PD_SNAP_TO_GRID_OFF, tooltip_txt] } sw = ActionImageSwitch(self, actions[action_id], icons_dict) self.pack(sw, padding=2) action_id = pdids.ID_SNAP_TO_GUIDE tooltip_txt = get_tooltip_text(action_id) icons_dict = { True: [icons.PD_SNAP_TO_GUIDE_ON, tooltip_txt], False: [icons.PD_SNAP_TO_GUIDE_OFF, tooltip_txt] } sw = ActionImageSwitch(self, actions[action_id], icons_dict) self.pack(sw, padding=2) action_id = pdids.ID_SNAP_TO_OBJ tooltip_txt = get_tooltip_text(action_id) icons_dict = { True: [icons.PD_SNAP_TO_OBJ_ON, tooltip_txt], False: [icons.PD_SNAP_TO_OBJ_OFF, tooltip_txt] } sw = ActionImageSwitch(self, actions[action_id], icons_dict) self.pack(sw, padding=2) action_id = pdids.ID_SNAP_TO_PAGE tooltip_txt = get_tooltip_text(action_id) icons_dict = { True: [icons.PD_SNAP_TO_PAGE_ON, tooltip_txt], False: [icons.PD_SNAP_TO_PAGE_OFF, tooltip_txt] } sw = ActionImageSwitch(self, actions[action_id], icons_dict) self.pack(sw, padding=2) self.pack(wal.PLine(self.panel), fill=True, padding=5)
def __init__(self, app, parent): self.app = app self.mw = parent wal.VPanel.__init__(self, parent) self.ctxpanel = AppCtxPanel(self.app, self) self.doc_tabs = DocTabPanel(app, self, config.ui_style != appconst.GUI_CLASSIC) if config.ui_style == appconst.GUI_CLASSIC: if not wal.IS_MAC: self.pack(wal.HLine(self), fill=True) self.pack(self.ctxpanel, fill=True) self.pack(self.doc_tabs, fill=True) if config.ui_style == appconst.GUI_TABBED: self.pack(self.doc_tabs, fill=True) self.pack(self.ctxpanel, fill=True) self.pack(wal.PLine(self), fill=True) # ===== Main part hpanel = wal.HPanel(self) self.pack(hpanel, expand=True, fill=True) # ----- Tools self.tools = AppTools(self.app, hpanel) hpanel.pack(self.tools, fill=True, padding_all=2) hpanel.pack(wal.PLine(hpanel), fill=True) self.splitter = wal.Splitter(hpanel, hidden=True) # ----- Doc Area self.grid_panel = wal.GridPanel(self.splitter) self.grid_panel.add_growable_col(1) self.grid_panel.add_growable_row(1) self.corner = RulerSurface(self.app, self.grid_panel) self.grid_panel.add(self.corner) self.hruler = HRulerSurface(self.app, self.grid_panel) self.grid_panel.pack(self.hruler, fill=True) self.vruler = VRulerSurface(self.app, self.grid_panel) self.grid_panel.pack(self.vruler, fill=True) int_grid = wal.GridPanel(self.grid_panel) int_grid.add_growable_col(0) int_grid.add_growable_row(0) self.canvas = CanvasSurface(self.app, int_grid) int_grid.pack(self.canvas, fill=True) self.vscroll = wal.ScrollBar(int_grid) int_grid.pack(self.vscroll, fill=True) self.hscroll = wal.ScrollBar(int_grid, vertical=False) int_grid.pack(self.hscroll, fill=True) self.viewer = wal.VPanel(int_grid) int_grid.pack(self.viewer, fill=True) self.canvas.set_scrolls(self.hscroll, self.vscroll) self.grid_panel.pack(int_grid, fill=True) # ----- Doc Area End self.plg_area = PlgArea(self.app, self.splitter) self.app.mdiarea = self self.app.plg_area = self.plg_area self.splitter.split_vertically(self.grid_panel, 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.PLine(self.vp_panel), fill=True) 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.PLine(self.hp_panel), fill=True) hpalette_panel = AppHPalette(self.hp_panel, self.app) self.hp_panel.pack(hpalette_panel, fill=True, padding=2) self.pack(self.hp_panel, fill=True) self.change_palette() # ----- Status bar self.pack(wal.PLine(self), fill=True) self.statusbar = AppStatusbar(self) self.pack(self.statusbar, fill=True) self.layout() events.connect(events.CONFIG_MODIFIED, self.config_update)
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, padding_all=2) hpanel.pack(wal.PLine(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.PLine(self.vp_panel), fill=True) 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, start_padding=2) if config.palette_orientation == uc2const.HORIZONTAL: self.vp_panel.hide() # ----- Horizontal Palette panel self.hp_panel = wal.VPanel(self) self.hp_panel.pack(wal.PLine(self.hp_panel), fill=True) hpalette_panel = AppHPalette(self.hp_panel, self.app) self.hp_panel.pack(hpalette_panel, fill=True, padding=2) self.pack(self.hp_panel, fill=True) self.change_palette() # ----- Status bar self.pack(wal.PLine(self), fill=True) self.statusbar = AppStatusbar(self) self.pack(self.statusbar, fill=True, padding=2) self.layout() events.connect(events.CONFIG_MODIFIED, self.config_update)