def __init__(self, parent, ID=wx.ID_ANY, items=[], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.VSCROLL, name=wx.PanelNameStr): BorderedPanel.__init__(self, parent, ID, pos, size, name=name) self.SetBackgroundColour(u'white') pnl_bg = ScrolledPanel(self, pnlid.BACKGROUND, style=style|wx.TAB_TRAVERSAL|wx.BORDER_NONE) pnl_bg.SetBackgroundColour(self.GetBackgroundColour()) pnl_bg.SetScrollbars(20, 20, 50, 50) # *** Event Handling *** # self.Bind(wx.EVT_CHECKBOX, self.OnCheckItem) # *** Layout *** # lyt_bg = BoxSizer(wx.VERTICAL) pnl_bg.SetSizer(lyt_bg) pnl_bg.SetAutoLayout(True) lyt_main = BoxSizer(wx.VERTICAL) lyt_main.Add(pnl_bg, 1, wx.EXPAND) self.SetSizer(lyt_main) self.SetAutoLayout(True) self.Layout() # *** Post-Layout Actions *** # if items: self.AddItems(items)
def __init__(self, parent, ID=wx.ID_ANY, items=[], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.VSCROLL, name=wx.PanelNameStr): BorderedPanel.__init__(self, parent, ID, pos, size, name=name) self.SetBackgroundColour(u'white') pnl_bg = ScrolledPanel(self, pnlid.BACKGROUND, style=style|wx.TAB_TRAVERSAL|wx.BORDER_NONE) pnl_bg.SetBackgroundColour(self.GetBackgroundColour()) pnl_bg.SetScrollbars(20, 20, 50, 50) # *** Event Handling *** # self.Bind(wx.EVT_CHECKBOX, self.OnCheckItem) # *** Layout *** # lyt_bg = BoxSizer(wx.VERTICAL) pnl_bg.SetSizer(lyt_bg) pnl_bg.SetAutoLayout(True) lyt_main = BoxSizer(wx.VERTICAL) lyt_main.Add(pnl_bg, 1, wx.EXPAND) self.SetSizer(lyt_main) self.SetAutoLayout(True) self.Layout() # *** Post-Layout Actions *** # if items: self.AddItems(items)
def __init__(self, parent, win_id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_ICON, validator=wx.DefaultValidator, name=wx.ListCtrlNameStr, defaultValue=None, required=False, outLabel=None): BorderedPanel.__init__(self, parent, win_id, pos, size, name=name) if isinstance(self, EssentialField): self.MainCtrl = ListCtrlBaseESS(self, style=style, validator=validator, defaultValue=defaultValue, required=required, outLabel=outLabel) else: self.MainCtrl = ListCtrlBase(self, style=style, validator=validator, defaultValue=defaultValue, required=required, outLabel=outLabel) # Match panel background color to list control self.SetBackgroundColour(self.MainCtrl.GetBackgroundColour()) self.layout_V1 = BoxSizer(wx.VERTICAL) self.layout_V1.Add(self.MainCtrl, 1, wx.EXPAND) self.SetAutoLayout(True) self.SetSizer(self.layout_V1) self.Layout() if wx.MAJOR_VERSION == 3 and wx.MINOR_VERSION == 0: wx.EVT_SIZE(self, self.OnResize)
def __init__(self, parent, win_id=wx.ID_ANY, value=wx.EmptyString, defaultValue=wx.EmptyString, monospace=False, button=MT_NO_BTN, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name=wx.TextCtrlNameStr, required=False, outLabel=None): BorderedPanel.__init__(self, parent, win_id, pos, size, name=name) self.MainCtrl = TextAreaML(self, value=value, defaultValue=defaultValue, style=style|wx.BORDER_NONE, required=required, outLabel=outLabel) # For setting color of disabled panel self.clr_disabled = self.GetBackgroundColour() self.clr_enabled = self.MainCtrl.GetBackgroundColour() # Match panel color to text control self.SetBackgroundColour(self.MainCtrl.GetBackgroundColour()) # *** Layout *** # lyt_main = BoxSizer(wx.HORIZONTAL) lyt_main.Add(self.MainCtrl, 1, wx.EXPAND|wx.ALL, 2) self.SetAutoLayout(True) self.SetSizer(lyt_main) self.Layout() # *** Post-layout Actions *** # if monospace: self.SetMonospaced(button)
def __init__(self, parent, win_id=wx.ID_ANY, value=wx.EmptyString, defaultValue=wx.EmptyString, monospace=False, button=MT_NO_BTN, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name=wx.TextCtrlNameStr, required=False, outLabel=None): BorderedPanel.__init__(self, parent, win_id, pos, size, name=name) self.MainCtrl = TextAreaML(self, value=value, defaultValue=defaultValue, style=style|wx.BORDER_NONE, required=required, outLabel=outLabel) # For setting color of disabled panel self.clr_disabled = self.GetBackgroundColour() self.clr_enabled = self.MainCtrl.GetBackgroundColour() # Match panel color to text control self.SetBackgroundColour(self.MainCtrl.GetBackgroundColour()) # *** Layout *** # lyt_main = BoxSizer(wx.HORIZONTAL) lyt_main.Add(self.MainCtrl, 1, wx.EXPAND|wx.ALL, 2) self.SetAutoLayout(True) self.SetSizer(lyt_main) self.Layout() # *** Post-layout Actions *** # if monospace: self.SetMonospaced(button)
def __init__(self, parent, defaultPath, win_id=-1, defaultType=CheckBox, defaultValue=True, customType=PathCtrl, name=u'file_output_target', pathIds=[]): BorderedPanel.__init__(self, parent, win_id, name=name) id_default = wx.ID_ANY id_custom = wx.ID_ANY if pathIds: if isinstance(pathIds, int): id_default = pathIds else: id_default = pathIds[0] if len(pathIds) > 1: id_custom = pathIds[1] self.PathDefault = defaultType(self, id_default, defaultPath, defaultValue=defaultValue) self.PathCustom = customType(self, id_custom) # *** Event Handing *** # self.PathDefault.Bind(wx.EVT_CHECKBOX, self.OnSelectTarget) # *** Layout *** # lyt_main = BoxSizer(wx.VERTICAL) lyt_main.AddSpacer(5) lyt_main.Add(self.PathDefault, 0, lyt.PAD_LR, 5) lyt_main.AddSpacer(5) lyt_main.Add(self.PathCustom, 0, wx.EXPAND | lyt.PAD_LR, 5) lyt_main.AddSpacer(5) self.SetAutoLayout(True) self.SetSizer(lyt_main) self.Layout() # *** Post Layout/Event Actions *** # self.PathDefault.SetChecked(self.PathDefault.GetDefaultValue())
def __init__(self, parent, winId=wx.ID_ANY, name=u'menubar'): BorderedPanel.__init__(self, parent, winId, name=name) self.Padding = 5 # *** Event Handling *** # self.Bind(wx.EVT_LEFT_DOWN, self.OnSelect) # *** Layout *** # lyt_main = BoxSizer(wx.HORIZONTAL) self.SetAutoLayout(True) self.SetSizer(lyt_main)
def __init__(self, parent, winId=wx.ID_ANY, name=u'menubar'): BorderedPanel.__init__(self, parent, winId, name=name) self.Padding = 5 # *** Event Handling *** # self.Bind(wx.EVT_LEFT_DOWN, self.OnSelect) # *** Layout *** # lyt_main = BoxSizer(wx.HORIZONTAL) self.SetAutoLayout(True) self.SetSizer(lyt_main)
def __init__(self, parent, w_id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TAB_TRAVERSAL, name=u'DirTreePnl'): BorderedPanel.__init__(self, parent, w_id, pos, size, style, name) self.DirTree = DirectoryTree(self) # Give easy access of instance to parent parent.DirTree = self.DirTree # *** Layout *** # lyt_main = BoxSizer(wx.VERTICAL) lyt_main.Add(self.DirTree, 1, wx.EXPAND) self.SetAutoLayout(True) self.SetSizer(lyt_main) self.Layout()
def __init__(self, parent, w_id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TAB_TRAVERSAL, name=u'DirTreePnl'): BorderedPanel.__init__(self, parent, w_id, pos, size, style, name) self.DirTree = DirectoryTree(self) # Give easy access of instance to parent parent.DirTree = self.DirTree # *** Layout *** # lyt_main = BoxSizer(wx.VERTICAL) lyt_main.Add(self.DirTree, 1, wx.EXPAND) self.SetAutoLayout(True) self.SetSizer(lyt_main) self.Layout()
def __init__(self, parent, defaultPath, win_id=-1, defaultType=CheckBox, defaultValue=True, customType=PathCtrl, name=u'file_output_target', pathIds=[]): BorderedPanel.__init__(self, parent, win_id, name=name) id_default = wx.ID_ANY id_custom = wx.ID_ANY if pathIds: if isinstance(pathIds, int): id_default = pathIds else: id_default = pathIds[0] if len(pathIds) > 1: id_custom = pathIds[1] self.PathDefault = defaultType(self, id_default, defaultPath, defaultValue=defaultValue) self.PathCustom = customType(self, id_custom) # *** Event Handing *** # self.PathDefault.Bind(wx.EVT_CHECKBOX, self.OnSelectTarget) # *** Layout *** # lyt_main = BoxSizer(wx.VERTICAL) lyt_main.AddSpacer(5) lyt_main.Add(self.PathDefault, 0, lyt.PAD_LR, 5) lyt_main.AddSpacer(5) lyt_main.Add(self.PathCustom, 0, wx.EXPAND|lyt.PAD_LR, 5) lyt_main.AddSpacer(5) self.SetAutoLayout(True) self.SetSizer(lyt_main) self.Layout() # *** Post Layout/Event Actions *** # self.PathDefault.SetChecked(self.PathDefault.GetDefaultValue())
def __init__(self, parent, win_id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_ICON, validator=wx.DefaultValidator, name=wx.ListCtrlNameStr, defaultValue=None, required=False, outLabel=None): BorderedPanel.__init__(self, parent, win_id, pos, size, name=name) if isinstance(self, EssentialField): self.MainCtrl = ListCtrlBaseESS(self, style=style, validator=validator, defaultValue=defaultValue, required=required, outLabel=outLabel) else: self.MainCtrl = ListCtrlBase(self, style=style, validator=validator, defaultValue=defaultValue, required=required, outLabel=outLabel) # Match panel background color to list control self.SetBackgroundColour(self.MainCtrl.GetBackgroundColour()) self.layout_V1 = BoxSizer(wx.VERTICAL) self.layout_V1.Add(self.MainCtrl, 1, wx.EXPAND) self.SetAutoLayout(True) self.SetSizer(self.layout_V1) self.Layout() if wx.MAJOR_VERSION == 3 and wx.MINOR_VERSION == 0: wx.EVT_SIZE(self, self.OnResize)
def __init__(self, parent, win_id=wx.ID_ANY): BorderedPanel.__init__(self, parent, win_id) txt_key = wx.StaticText(self, label=GT(u'Key')) txt_value = wx.StaticText(self, label=GT(u'Value')) ti_key = TextAreaESS(self, inputid.KEY) ti_value = TextAreaESS(self, inputid.VALUE) # *** Layout *** # lyt_input = wx.FlexGridSizer() lyt_input.SetRows(2) lyt_input.SetCols(2) lyt_input.AddGrowableCol(1) lyt_input.Add(txt_key, 0, wx.LEFT|wx.TOP, 5) lyt_input.Add(txt_value, 0, wx.LEFT|wx.TOP, 5) lyt_input.Add(ti_key, 0, wx.LEFT|wx.BOTTOM, 5) lyt_input.Add(ti_value, 1, wx.EXPAND|wx.LEFT|wx.BOTTOM, 5)
def __init__(self, parent, win_id=wx.ID_ANY): BorderedPanel.__init__(self, parent, win_id) txt_key = wx.StaticText(self, label=GT(u'Key')) txt_value = wx.StaticText(self, label=GT(u'Value')) ti_key = TextAreaESS(self, inputid.KEY) ti_value = TextAreaESS(self, inputid.VALUE) # *** Layout *** # lyt_input = wx.FlexGridSizer() lyt_input.SetRows(2) lyt_input.SetCols(2) lyt_input.AddGrowableCol(1) lyt_input.Add(txt_key, 0, wx.LEFT | wx.TOP, 5) lyt_input.Add(txt_value, 0, wx.LEFT | wx.TOP, 5) lyt_input.Add(ti_key, 0, wx.LEFT | wx.BOTTOM, 5) lyt_input.Add(ti_value, 1, wx.EXPAND | wx.LEFT | wx.BOTTOM, 5)
def __init__(self, parent): BorderedPanel.__init__(self, parent)
def __init__(self, parent): BorderedPanel.__init__(self, parent)