當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.DatePickerCtrl方法代碼示例

本文整理匯總了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) 
開發者ID:ME-ICA,項目名稱:me-ica,代碼行數:26,代碼來源:calender_dialog.py

示例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) 
開發者ID:lrq3000,項目名稱:pyFileFixity,代碼行數:26,代碼來源:calender_dialog.py

示例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: 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:7,代碼來源:datepicker_ctrl.py

示例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) 
開發者ID:JackonYang,項目名稱:bookhub,代碼行數:6,代碼來源:CellEditor.py

示例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) 
開發者ID:JackonYang,項目名稱:bookhub,代碼行數:9,代碼來源:CellEditor.py

示例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

#---------------------------------------------------------------------------- 
開發者ID:JackonYang,項目名稱:bookhub,代碼行數:11,代碼來源:CellEditor.py

示例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() 
開發者ID:geomagpy,項目名稱:magpy,代碼行數:50,代碼來源:developpage.py

示例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)) 
開發者ID:geomagpy,項目名稱:magpy,代碼行數:59,代碼來源:streampage.py


注:本文中的wx.DatePickerCtrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。