Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, wx.ID_OK, label='Ok')
self.datepicker = Classes.DatePickerCtrl(self, style=Constants.WX_DP_DROPDOWN)
vertical_container = wx.BoxSizer(wx.VERTICAL)
vertical_container.AddSpacer(10)
vertical_container.Add(wx_util.h1(self, label='Select a Date'), 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(10)
vertical_container.Add(self.datepicker, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(10)
button_sizer = wx.BoxSizer(wx.HORIZONTAL)
button_sizer.AddStretchSpacer(1)
button_sizer.Add(self.ok_button, 0)
vertical_container.Add(button_sizer, 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(20)
self.SetSizerAndFit(vertical_container)
self.Bind(wx.EVT_BUTTON, self.OnOkButton, self.ok_button)
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, wx.ID_OK, label=_('Ok'))
self.datepicker = Classes.DatePickerCtrl(self, style=Constants.WX_DP_DROPDOWN)
vertical_container = wx.BoxSizer(wx.VERTICAL)
vertical_container.AddSpacer(10)
vertical_container.Add(wx_util.h1(self, label=_('Select a Date')), 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(10)
vertical_container.Add(self.datepicker, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(10)
button_sizer = wx.BoxSizer(wx.HORIZONTAL)
button_sizer.AddStretchSpacer(1)
button_sizer.Add(self.ok_button, 0)
vertical_container.Add(button_sizer, 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(20)
self.SetSizerAndFit(vertical_container)
self.Bind(wx.EVT_BUTTON, self.OnOkButton, self.ok_button)
def _do_layout(self):
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.head_panel, 0, wx.EXPAND)
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
if self.layout_type == layouts.COLUMN:
self.config_panel = layouts.ColumnLayout(self)
else:
self.config_panel = layouts.FlatLayout(self)
sizer.Add(self.config_panel, 1, wx.EXPAND)
sizer.Add(self.runtime_display, 1, wx.EXPAND)
self.runtime_display.Hide()
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
sizer.Add(self.foot_panel, 0, wx.EXPAND)
self.SetSizer(sizer)
self.sizer = sizer
def layout(self, num_columns):
STD_LAYOUT = (0, wx.LEFT | wx.RIGHT | wx.EXPAND, PADDING)
if self.title:
self.container.Add(wx_util.h0(self, self.title), 0, wx.LEFT | wx.RIGHT, PADDING)
self.container.AddSpacer(30)
if self.widgets:
self.container.Add(wx_util.h1(self, self.section_name), 0, wx.LEFT | wx.RIGHT, PADDING)
self.container.AddSpacer(5)
self.container.Add(wx_util.horizontal_rule(self), *STD_LAYOUT)
self.container.AddSpacer(20)
self.create_component_grid(self.container, self.widgets, cols=num_columns)
self.container.AddSpacer(10)
def arrange(self, *args, **kwargs):
wx_util.make_bold(self.label)
wx_util.withColor(self.label, self._options['label_color'])
wx_util.withColor(self.help_text, self._options['help_color'])
wx_util.withColor(self.error, self._options['error_color'])
self.error.Hide()
self.help_text.SetMinSize((0,-1))
layout = wx.BoxSizer(wx.VERTICAL)
if self._options.get('show_label', True):
layout.Add(self.label, 0, wx.EXPAND)
else:
layout.AddStretchSpacer(1)
layout.AddSpacer(2)
if self.help_text and self._options.get('show_help', True):