def __init__(self, toplevel, parent=None, id=-1): wx.Panel.__init__(self, parent, id, style=wx.WANTS_CHARS | wx.CLIP_CHILDREN | wx.NO_FULL_REPAINT_ON_RESIZE) self.toplevel = toplevel self.SetAutoLayout(True) self.toolbar = toolbar.ToolBar(self, -1) from gamera.gui import gamera_icons self.tree = RuleEngineRunnerTree(toplevel, self) self.toolbar.AddSimpleTool(10, gamera_icons.getIconUndoBitmap(), "Undo", self.tree._OnUndo) self.toolbar.AddSeparator() self.toolbar.AddSimpleTool(11, gamera_icons.getIconRefreshBitmap(), "Reload code", self.tree._OnReloadCode) self.toolbar.AddSeparator() self.toolbar.AddSimpleTool(12, gamera_icons.getIconSelectAddedBitmap(), "Select added glyphs", self.tree._OnSelectAdded) self.toolbar.AddSimpleTool(13, gamera_icons.getIconSelectRemovedBitmap(), "Select removed glyphs", self.tree._OnSelectRemoved) lc = wx.LayoutConstraints() lc.top.SameAs(self, wx.Top, 0) lc.left.SameAs(self, wx.Left, 0) lc.right.SameAs(self, wx.Right, 0) lc.height.AsIs() self.toolbar.SetAutoLayout(True) self.toolbar.SetConstraints(lc) lc = wx.LayoutConstraints() lc.top.Below(self.toolbar, 0) lc.left.SameAs(self, wx.Left, 0) lc.right.SameAs(self, wx.Right, 0) lc.bottom.SameAs(self, wx.Bottom, 0) self.tree.SetAutoLayout(True) self.tree.SetConstraints(lc) self.Layout()
def __init__(self, toplevel, parent = None, id = -1): wx.Panel.__init__( self, parent, id, style=wx.WANTS_CHARS|wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE) self.toplevel = toplevel self.SetAutoLayout(True) self.toolbar = toolbar.ToolBar(self, -1) from gamera.gui import gamera_icons self.tree = RuleEngineRunnerTree(toplevel, self) self.toolbar.AddSimpleTool( 10, gamera_icons.getIconUndoBitmap(), "Undo", self.tree._OnUndo) self.toolbar.AddSeparator() self.toolbar.AddSimpleTool( 11, gamera_icons.getIconRefreshBitmap(), "Reload code", self.tree._OnReloadCode) self.toolbar.AddSeparator() self.toolbar.AddSimpleTool( 12, gamera_icons.getIconSelectAddedBitmap(), "Select added glyphs", self.tree._OnSelectAdded) self.toolbar.AddSimpleTool( 13, gamera_icons.getIconSelectRemovedBitmap(), "Select removed glyphs", self.tree._OnSelectRemoved) lc = wx.LayoutConstraints() lc.top.SameAs(self, wx.Top, 0) lc.left.SameAs(self, wx.Left, 0) lc.right.SameAs(self, wx.Right, 0) lc.height.AsIs() self.toolbar.SetAutoLayout(True) self.toolbar.SetConstraints(lc) lc = wx.LayoutConstraints() lc.top.Below(self.toolbar, 0) lc.left.SameAs(self, wx.Left, 0) lc.right.SameAs(self, wx.Right, 0) lc.bottom.SameAs(self, wx.Bottom, 0) self.tree.SetAutoLayout(True) self.tree.SetConstraints(lc) self.Layout()