def __init__(self): wal.MainWindow.__init__(self) self.set_size(SIZE) self.check1 = wal.Checkbox(self, 'Regular checkbox', onclick=self.on_click) self.pack(self.check1) self.check2 = wal.Checkbox(self, 'Right checkbox', right=True) self.pack(self.check2) self.check3 = wal.NumCheckbox(self, 'Numeric checkbox', onclick=self.on_click3) self.pack(self.check3)
def __init__(self, parent, dlg, new_stroke): self.dlg = dlg self.app = dlg.app self.stroke = new_stroke wal.VPanel.__init__(self, parent) self.pack((30, 30)) p = wal.HPanel(self) p.pack(wal.Label(p, _('Stroke width:')), padding=5) self.width_spin = UnitSpin(self.app, p, self.stroke[1], step=0.1) p.pack(self.width_spin) p.pack(StaticUnitLabel(self.app, p), padding=5) self.pack(p) self.pack((20, 20)) p = wal.HPanel(self) p.pack(wal.Label(p, _('Dashes:')), padding=5) self.dashes = DashChoice(p, self.stroke[3]) p.pack(self.dashes) txt = _('Edit dash pattern') p.pack(wal.ImageButton(p, icons.PD_EDIT, tooltip=txt, flat=False, onclick=self.edit_dash), padding=5) self.pack(p) grid = wal.GridPanel(self, vgap=15, hgap=15) caps_p = wal.LabeledPanel(grid, _('Caps:')) self.caps = CapChoice(caps_p, self.stroke[4]) caps_p.pack(self.caps, align_center=False, padding_all=10) grid.pack(caps_p) join_p = wal.LabeledPanel(grid, _('Join:')) self.join = JoinChoice(join_p, self.stroke[5]) join_p.pack(self.join, align_center=False, padding_all=10) grid.pack(join_p) self.pack(grid, padding_all=10) p = wal.HPanel(self) p.pack(wal.Label(p, _('Miter limit:')), padding=5) self.miter_limit = wal.FloatSpin(p, self.stroke[6], range_val=(0.0, 1000.0), digits=5) p.pack(self.miter_limit) self.pack(p) p = wal.HPanel(self) self.behind = wal.NumCheckbox(p, _('Behind fill'), self.stroke[7]) p.pack(self.behind) p.pack((30, 10)) self.scalable = wal.NumCheckbox(p, _('Scalable stroke'), self.stroke[8]) p.pack(self.scalable) self.pack(p, padding=10)
def __init__(self, parent, dlg, new_stroke): self.dlg = dlg self.app = dlg.app self.stroke = new_stroke wal.VPanel.__init__(self, parent) hp = wal.HPanel(self) width_p = wal.LabeledPanel(hp, _('Width:')) p = wal.HPanel(width_p) self.width_spin = UnitSpin(self.app, p, self.stroke[1], step=0.1) p.pack(self.width_spin) p.pack((5, 5)) p.pack(StaticUnitLabel(self.app, p)) width_p.pack(p, padding_all=5) hp.pack(width_p, fill=True) hp.pack((5, 5)) arrow_p = wal.LabeledPanel(hp, _('Markers:')) p = wal.HPanel(arrow_p) end, start = [], [] if self.stroke[9]: end, start = self.stroke[9] self.end_arrow = ArrowChoice(p, arrow=end, end=True) self.end_arrow.set_arrow(end) p.pack(self.end_arrow) p.pack((5, 5)) self.start_arrow = ArrowChoice(p, arrow=start) self.start_arrow.set_arrow(start) p.pack(self.start_arrow) arrow_p.pack(p) hp.pack(arrow_p, expand=True, fill=True) self.pack(hp, fill=True, padding_all=10) p = wal.HPanel(self) p.pack(wal.Label(p, _('Dashes:')), padding=5) self.dashes = DashChoice(p, self.stroke[3]) p.pack(self.dashes) txt = _('Edit dash pattern') p.pack(wal.ImageButton(p, icons.PD_EDIT, art_size=wal.SIZE_16, tooltip=txt, flat=False, onclick=self.edit_dash), padding=5) self.pack(p) grid = wal.GridPanel(self, rows=1, cols=3, vgap=15, hgap=15) grid.add_growable_col(2) caps_p = wal.LabeledPanel(grid, _('Caps:')) self.caps = CapChoice(caps_p, self.stroke[4]) caps_p.pack(self.caps, align_center=False, padding_all=10) grid.pack(caps_p) join_p = wal.LabeledPanel(grid, _('Join:')) self.join = JoinChoice(join_p, self.stroke[5]) join_p.pack(self.join, align_center=False, padding_all=10) grid.pack(join_p) opt_p = wal.LabeledPanel(grid, _('Options:')) p = wal.HPanel(opt_p) p.pack(wal.Label(p, _('Miter limit:')), padding=5) self.miter_limit = wal.FloatSpin(p, self.stroke[6], range_val=(0.0, 1000.0), digits=5) p.pack(self.miter_limit) opt_p.pack(p, align_center=False, padding_all=10) p = wal.VPanel(opt_p) self.behind = wal.NumCheckbox(p, _('Behind fill'), self.stroke[7]) p.pack(self.behind, align_center=False) self.scalable = wal.NumCheckbox(p, _('Scalable stroke'), self.stroke[8]) p.pack(self.scalable, align_center=False, padding=10) opt_p.pack(p, align_center=False, padding_all=10) grid.pack(opt_p, fill=True) self.pack(grid, padding_all=10, fill=True) self.layout()