def __init__(self, parent, app, cms, onleftclick=None, onrightclick=None, onmin=None, onmax=None): self.app = app self.cms = cms self.onleftclick = onleftclick self.onrightclick = onrightclick self.onmin = onmin self.onmax = onmax VPanel.__init__(self, parent) self.set_palette(app.palettes.palette_in_use.model.colors) self.cell_width = config.palette_vcell_width self.cell_height = config.palette_vcell_height self.pack((self.cell_width, self.cell_height)) self.tooltipwin = PaletteToolTip(self) self.Bind(wx.EVT_PAINT, self._on_paint, self) self.Bind(wx.EVT_SIZE, self._on_resize, self) self.Bind(wx.EVT_MOUSEWHEEL, self._on_scroll, self) self.Bind(wx.EVT_MOTION, self._on_move, self) if onrightclick: self.Bind(wx.EVT_RIGHT_UP, self._on_right_click, self) if onleftclick: self.Bind(wx.EVT_LEFT_UP, self._on_left_click, self) self.timer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self._on_timer) self.SetDoubleBuffered(True) events.connect(events.CONFIG_MODIFIED, self.config_update) events.connect(events.CMS_CHANGED, self.refresh)
def __init__(self, parent, active=0, onchange=None): self.active = active self.toggles = [None, None, None, None] self.onchange = onchange VPanel.__init__(self, parent) row1 = wx.BoxSizer(HORIZONTAL) self.box.Add(row1) icons_dict = {True:[icons.CTX_ROUNDED_RECT2_ON, '', ], False:[icons.CTX_ROUNDED_RECT2_OFF, '', ], } tgl = BitmapToggle(self, False, icons_dict, self.changed) self.toggles[1] = tgl row1.Add(tgl) icons_dict = {True:[icons.CTX_ROUNDED_RECT3_ON, '', ], False:[icons.CTX_ROUNDED_RECT3_OFF, '', ], } tgl = BitmapToggle(self, False, icons_dict, self.changed) self.toggles[2] = tgl row1.Add(tgl) row2 = wx.BoxSizer(HORIZONTAL) self.box.Add(row2, 0) icons_dict = {True:[icons.CTX_ROUNDED_RECT1_ON, '', ], False:[icons.CTX_ROUNDED_RECT1_OFF, '', ], } tgl = BitmapToggle(self, False, icons_dict, self.changed) self.toggles[0] = tgl row2.Add(tgl) icons_dict = {True:[icons.CTX_ROUNDED_RECT4_ON, '', ], False:[icons.CTX_ROUNDED_RECT4_OFF, '', ], } tgl = BitmapToggle(self, False, icons_dict, self.changed) self.toggles[3] = tgl row2.Add(tgl) self.toggles[self.active].set_active(True)
def __init__(self, app, parent): self.app = app VPanel.__init__(self, parent) self.tabs_bg = TabsBgPanel(self) self.add(self.tabs_bg, 1, ALL | EXPAND) self.plg_tabs = PlgTabs(self.tabs_bg, self.update_panel) self.tabs_bg.add(self.plg_tabs, 0, ALL | EXPAND) self.plg_tabs.SetPosition((0, 0))
def __init__(self, parent, plg, active=True): self.plg = plg self.parent = parent self.active = active self.text = self.plg.name self.icon = self.plg.icon if not self.icon: self.icon = wx.ArtProvider.GetBitmap(icons.PLUGIN_ICON) self.close_but = wx.ArtProvider.GetBitmap(icons.PD_CLOSE_BUTTON_ACTIVE) self.inactive_close_but = wx.ArtProvider.GetBitmap(icons.PD_CLOSE_BUTTON) VPanel.__init__(self, parent) self.add((TAB_WIDTH, self.get_best_height())) self.Bind(wx.EVT_PAINT, self._on_paint, self) self.Bind(wx.EVT_MOTION, self._on_move, self) self.Bind(wx.EVT_LEFT_DOWN, self._on_left_down, self) self.Bind(wx.EVT_LEFT_UP, self._on_left_up, self) self.Bind(wx.EVT_LEAVE_WINDOW, self._on_win_leave, self)
def __init__(self, presenter, parent): self.presenter = presenter VPanel.__init__(self, parent) self.SetBackgroundColour(wx.Colour(255, 255, 255)) #----- First row row_hbox = wx.BoxSizer(HORIZONTAL) self.corner = RulerCorner(presenter, self) row_hbox.Add(self.corner) self.hruler = Ruler(presenter, self, HORIZONTAL) row_hbox.Add(self.hruler, 1, EXPAND) self.box.Add(row_hbox, 0, EXPAND) #----- Second row row_hbox = wx.BoxSizer(HORIZONTAL) self.vruler = Ruler(presenter, self, VERTICAL) row_hbox.Add(self.vruler, 0, EXPAND) vbox = wx.BoxSizer(VERTICAL) hbox = wx.BoxSizer(HORIZONTAL) vbox.Add(hbox, 1, EXPAND) self.canvas = AppCanvas(presenter, self) hbox.Add(self.canvas, 1, EXPAND) self.vscroll = wx.ScrollBar(self, wx.ID_ANY, style=wx.SB_VERTICAL) hbox.Add(self.vscroll, 0, EXPAND) #----- Bottom row bottom_hbox = wx.BoxSizer(HORIZONTAL) bottom_vbox = wx.BoxSizer(VERTICAL) self.hscroll = wx.ScrollBar(self, wx.ID_ANY, style=wx.SB_HORIZONTAL) bottom_hbox.Add(self.hscroll, 1, EXPAND) self.bottom_corner = VPanel(self) size = self.vscroll.GetSize()[0] self.viewer = DocViewer(presenter, self, (size, size)) self.bottom_corner.add(self.viewer) bottom_hbox.Add(self.bottom_corner) vbox.Add(bottom_hbox, 0, EXPAND) row_hbox.Add(vbox, 1, EXPAND) self.box.Add(row_hbox, 1, EXPAND) self.canvas._set_scrolls(self.hscroll, self.vscroll)
def __init__(self, parent): VPanel.__init__(self, parent) create_artprovider() self.build()
def __init__(self, presenter, parent, size=(5, 5)): self.presenter = presenter self.size = size VPanel.__init__(self, parent) self.add(size)
def __init__(self, parent): VPanel.__init__(self, parent) self.Bind(wx.EVT_PAINT, self._on_paint, self)
def __init__(self, parent, callback=None): VPanel.__init__(self, parent) self.callback = callback self.plg_tabs = [] self.add((PANEL_WIDTH, PANEL_MARGIN)) self.Bind(wx.EVT_PAINT, self._on_paint, self)
def __init__(self, parent): VPanel.__init__(self, parent) self.build()