本文整理汇总了Python中wx.DatePickerCtrl方法的典型用法代码示例。如果您正苦于以下问题:Python wx.DatePickerCtrl方法的具体用法?Python wx.DatePickerCtrl怎么用?Python wx.DatePickerCtrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.DatePickerCtrl方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
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 = wx.DatePickerCtrl(self, style=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)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, label='Ok')
self.datepicker = wx.DatePickerCtrl(self, style=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)
示例3: create_widget
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
def create_widget(self):
# TODO add all the other parameters for the DatePickerCtrl initial date
self.widget = DatePickerCtrl(self.parent_window.widget, self.id, style=self.style)
# handle compatibility:
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
def __init__(self, *args, **kwargs):
#kwargs["size"] = (0,0)
wx.DatePickerCtrl.__init__(self, *args, **kwargs)
self.SetValue(None)
示例5: SetValue
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
def SetValue(self, value):
if value:
dt = wx.DateTime()
dt.Set(value.day, value.month-1, value.year)
else:
dt = wx.DateTime.Today()
wx.DatePickerCtrl.SetValue(self, dt)
示例6: GetValue
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
def GetValue(self):
"Get the value from the editor"
dt = wx.DatePickerCtrl.GetValue(self)
if dt.IsOk():
return datetime.date(dt.Year, dt.Month+1, dt.Day)
else:
return None
#----------------------------------------------------------------------------
示例7: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
def createControls(self):
self.DrawButton = wx.Button(self,-1,"Draw/Recalc")
self.SaveVarioButton = wx.Button(self,-1,"Save data")
self.dateLabel = wx.StaticText(self, label="Insert time range:")
self.startdateLabel = wx.StaticText(self, label="Start date:")
self.startDatePicker = wx.DatePickerCtrl(self, dt=wx.DateTimeFromTimeT(time.mktime(datetime.strptime("2011-10-22","%Y-%m-%d").timetuple())))
self.enddateLabel = wx.StaticText(self, label="End date:")
self.endDatePicker = wx.DatePickerCtrl(self, dt=wx.DateTimeFromTimeT(time.mktime(datetime.strptime("2011-10-22","%Y-%m-%d").timetuple())))
self.instLabel = wx.StaticText(self, label="Select variometer:")
self.resolutionLabel = wx.StaticText(self, label="Select resolution:")
self.scalarLabel = wx.StaticText(self, label="Select F source:")
self.scalarReviewedLabel = wx.StaticText(self, label="only reviewed!")
self.varioComboBox = wx.ComboBox(self, choices=self.varios,
style=wx.CB_DROPDOWN, value=self.varios[0])
self.overrideAutoBaselineButton = wx.Button(self,-1,"Manual base.")
self.baselinefileTextCtrl = wx.TextCtrl(self, value="--")
self.baselinefileTextCtrl.Disable()
self.scalarComboBox = wx.ComboBox(self, choices=self.scalars,
style=wx.CB_DROPDOWN, value=self.scalars[0])
self.resolutionComboBox = wx.ComboBox(self, choices=self.resolution,
style=wx.CB_DROPDOWN, value=self.resolution[0])
self.datatypeLabel = wx.StaticText(self, label="Select datatype:")
self.datatypeComboBox = wx.ComboBox(self, choices=self.datatype,
style=wx.CB_DROPDOWN, value=self.datatype[1])
self.drawRadioBox = wx.RadioBox(self,
label="Select vector components",
choices=self.comp, majorDimension=3, style=wx.RA_SPECIFY_COLS)
self.addoptLabel = wx.StaticText(self, label="Optional graphs:")
self.baselinecorrCheckBox = wx.CheckBox(self,label="Baseline corr.")
self.fCheckBox = wx.CheckBox(self,label="Plot F")
self.dfCheckBox = wx.CheckBox(self,label="calculate dF")
self.dfCheckBox.Disable()
self.tCheckBox = wx.CheckBox(self,label="Plot T")
self.showFlaggedCheckBox = wx.CheckBox(self,
label="show flagged")
self.curdateTextCtrl = wx.TextCtrl(self, value="--")
self.curdateTextCtrl.Disable()
self.prevdateTextCtrl = wx.TextCtrl(self, value="--")
self.prevdateTextCtrl.Disable()
self.GetGraphMarksButton = wx.Button(self,-1,"Get marks")
self.flagSingleButton = wx.Button(self,-1,"Flag date")
self.flagRangeButton = wx.Button(self,-1,"Flag range")
self.curselecteddateLabel = wx.StaticText(self, label="Current sel.")
self.prevselecteddateLabel = wx.StaticText(self, label="Previous sel.")
self.dfIniTextCtrl = wx.TextCtrl(self, value="dF(ini): 0 nT")
self.dfCurTextCtrl = wx.TextCtrl(self, value="dF(cur): --")
self.dfIniTextCtrl.Disable()
self.dfCurTextCtrl.Disable()
示例8: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DatePickerCtrl [as 别名]
def createControls(self):
self.lineLabel1 = wx.StaticText(self, label=" ")
self.lineLabel2 = wx.StaticText(self, label=" ")
self.lineLabel3 = wx.StaticText(self, label=" ")
self.lineLabel4 = wx.StaticText(self, label=" ")
self.pathLabel = wx.StaticText(self, label="Path/Source:")
self.pathTextCtrl = wx.TextCtrl(self, value="")
self.fileLabel = wx.StaticText(self, label="File/Table:")
self.fileTextCtrl = wx.TextCtrl(self, value="*")
self.startdateLabel = wx.StaticText(self, label="Start date:")
self.startDatePicker = wxDatePickerCtrl(self, style=wxDP_DEFAULT)
# the following line produces error in my win xp installation
self.startTimePicker = wx.TextCtrl(self, value="00:00:00")
self.enddateLabel = wx.StaticText(self, label="End date:")
self.endDatePicker = wxDatePickerCtrl(self, style=wxDP_DEFAULT)
self.endTimePicker = wx.TextCtrl(self, value=datetime.now().strftime('%X'))
self.trimStreamButton = wx.Button(self,-1,"Trim timerange",size=(160,30))
self.plotOptionsLabel = wx.StaticText(self, label="Plotting options:")
#self.flagOptionsLabel = wx.StaticText(self, label="Flagging methods:")
self.selectKeysButton = wx.Button(self,-1,"Select Columns",size=(160,30))
self.dropKeysButton = wx.Button(self,-1,"Drop Columns",size=(160,30))
self.extractValuesButton = wx.Button(self,-1,"Extract Values",size=(160,30))
self.restoreButton = wx.Button(self,-1,"Restore data",size=(160,30))
self.changePlotButton = wx.Button(self,-1,"Plot Options",size=(160,30))
self.dailyMeansButton = wx.Button(self,-1,"Daily Means",size=(160,30))
self.applyBCButton = wx.Button(self,-1,"Baseline Corr",size=(160,30))
self.getGapsButton = wx.Button(self,-1,"Get gaps",size=(160,30))
#self.flagOutlierButton = wx.Button(self,-1,"Flag Outlier",size=(160,30))
#self.flagRangeButton = wx.Button(self,-1,"Flag Range",size=(160,30))
#self.flagMinButton = wx.Button(self,-1,"Flag Minimum",size=(160,30))
#self.flagMaxButton = wx.Button(self,-1,"Flag Maximum",size=(160,30))
#self.xCheckBox = wx.CheckBox(self,label="X ")
#self.yCheckBox = wx.CheckBox(self,label="Y ")
#self.zCheckBox = wx.CheckBox(self,label="Z ")
#self.fCheckBox = wx.CheckBox(self,label="F ")
#self.FlagIDText = wx.StaticText(self,label="Select Min/Max Flag ID:")
#self.FlagIDComboBox = wx.ComboBox(self, choices=self.flagidlist,
# style=wx.CB_DROPDOWN, value=self.flagidlist[3],size=(160,-1))
#self.flagSelectionButton = wx.Button(self,-1,"Flag Selection",size=(160,30))
#self.flagDropButton = wx.Button(self,-1,"Drop flagged",size=(160,30))
#self.flagLoadButton = wx.Button(self,-1,"Load flags",size=(160,30))
#self.flagSaveButton = wx.Button(self,-1,"Save flags",size=(160,30))
#self.flagClearButton = wx.Button(self,-1,"Clear flags",size=(160,30))
self.compRadioBox = wx.RadioBox(self,
label="Select components",
choices=self.comp, majorDimension=3, style=wx.RA_SPECIFY_COLS)
self.symbolRadioBox = wx.RadioBox(self,
label="Select symbols",
choices=self.symbol, majorDimension=2, style=wx.RA_SPECIFY_COLS)
self.annotateCheckBox = wx.CheckBox(self,label="annotate")
self.errorBarsCheckBox = wx.CheckBox(self,label="error bars")
self.confinexCheckBox = wx.CheckBox(self,
label="confine time")
self.compRadioBox.Disable()
self.symbolRadioBox.Disable()
#self.dailyMeansButton.SetFont(wx.Font(14, wx.SWISS, wx.NORMAL, wx.NORMAL))