本文整理汇总了Python中scal2.ui_gtk.mywidgets.multi_spin_button.DateButton类的典型用法代码示例。如果您正苦于以下问题:Python DateButton类的具体用法?Python DateButton怎么用?Python DateButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DateButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, saveIcsFunc, defaultFileName):
self.saveIcsFunc = saveIcsFunc
gtk.Dialog.__init__(self, title=_('Export to %s')%'iCalendar', parent=None)
self.set_has_separator(False)
########
hbox = gtk.HBox(spacing=2)
hbox.pack_start(gtk.Label(_('From')+' '), 0, 0)
self.startDateInput = DateButton()
hbox.pack_start(self.startDateInput, 0, 0)
hbox.pack_start(gtk.Label(' '+_('To')+' '), 0, 0)
self.endDateInput = DateButton()
hbox.pack_start(self.endDateInput, 0, 0)
self.vbox.pack_start(hbox, 0, 0)
####
(year, month, day) = ui.todayCell.dates[core.primaryMode]
self.startDateInput.set_value((year, 1, 1))
self.endDateInput.set_value((year+1, 1, 1))
########
self.fcw = gtk.FileChooserWidget(action=gtk.FILE_CHOOSER_ACTION_SAVE)
self.vbox.pack_start(self.fcw, 1, 1)
self.vbox.show_all()
##
dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), 1, self.onDelete)
dialog_add_button(self, gtk.STOCK_SAVE, _('_Save'), 2, self.save)
##
self.connect('delete-event', self.onDelete)
try:
self.fcw.set_current_folder(core.deskDir)
except AttributeError:## PyGTK < 2.4
pass
if not defaultFileName.endswith('.ics'):
defaultFileName += '.ics'
self.fcw.set_current_name(defaultFileName)
示例2: GroupWidget
class GroupWidget(BaseGroupWidget):
def __init__(self, group):
BaseGroupWidget.__init__(self, group)
####
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
hbox.pack_start(label, 0, 0)
self.sizeGroup.add_widget(label)
self.startDateInput = DateButton()
hbox.pack_start(self.startDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
###
hbox = gtk.HBox()
label = gtk.Label(_('End'))
label.set_alignment(0, 0.5)
hbox.pack_start(label, 0, 0)
self.sizeGroup.add_widget(label)
self.endDateInput = DateButton()
hbox.pack_start(self.endDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
def updateWidget(self):
BaseGroupWidget.updateWidget(self)
self.startDateInput.set_value(jd_to(self.group.startJd, self.group.mode))
self.endDateInput.set_value(jd_to(self.group.endJd, self.group.mode))
def updateVars(self):
BaseGroupWidget.updateVars(self)
self.group.startJd = self.startDateInput.get_jd(self.group.mode)
self.group.endJd = self.endDateInput.get_jd(self.group.mode)
def modeComboChanged(self, obj=None):
newMode = self.modeCombo.get_active()
self.startDateInput.changeMode(self.group.mode, newMode)
self.endDateInput.changeMode(self.group.mode, newMode)
self.group.mode = newMode
示例3: EventWidget
class EventWidget(common.EventWidget):
def __init__(self, event):
common.EventWidget.__init__(self, event)
###
hbox = gtk.HBox()
pack(hbox, gtk.Label(_("Date")))
self.dateInput = DateButton()
pack(hbox, self.dateInput)
pack(self, hbox)
#############
# self.filesBox = common.FilesBox(self.event)
# pack(self, self.filesBox)
def updateWidget(self):
common.EventWidget.updateWidget(self)
self.dateInput.set_value(self.event.getDate())
def updateVars(self):
common.EventWidget.updateVars(self)
self.event.setDate(*self.dateInput.get_value())
def modeComboChanged(self, obj=None): ## overwrite method from common.EventWidget
newMode = self.modeCombo.get_active()
self.dateInput.changeMode(self.event.mode, newMode)
self.event.mode = newMode
示例4: __init__
def __init__(self, event):## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
try:
seperated = event.parent.showSeperatedYmdInputs
except AttributeError:
seperated = False
if seperated:
self.startDateInput = YearMonthDayBox()
self.endDateInput = YearMonthDayBox()
else:
self.startDateInput = DateButton()
self.endDateInput = DateButton()
######
hbox = gtk.HBox()
label = gtk.Label(_('Start')+': ')
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
hbox.pack_start(self.startDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
######
hbox = gtk.HBox()
label = gtk.Label(_('End')+': ')
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
hbox.pack_start(self.endDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
示例5: __init__
def __init__(self, event):## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.startDateInput = DateButton()
hbox.pack_start(self.startDateInput, 0, 0)
###
hbox.pack_start(gtk.Label(''), 1, 1)
self.pack_start(hbox, 0, 0)
######
hbox = gtk.HBox()
label = gtk.Label(_('Repeat Every '))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.weeksSpin = IntSpinButton(1, 99999)
hbox.pack_start(self.weeksSpin, 0, 0)
hbox.pack_start(gtk.Label(' '+_(' Weeks')), 0, 0)
###
hbox.pack_start(gtk.Label(''), 1, 1)
self.pack_start(hbox, 0, 0)
######
hbox = gtk.HBox()
label = gtk.Label(_('End'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.endDateInput = DateButton()
hbox.pack_start(self.endDateInput, 0, 0)
###
hbox.pack_start(gtk.Label(''), 1, 1)
self.pack_start(hbox, 0, 0)
#########
hbox = gtk.HBox()
label = gtk.Label(_('Time'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
##
self.dayTimeStartInput = HourMinuteButton()
self.dayTimeEndInput = HourMinuteButton()
##
hbox.pack_start(self.dayTimeStartInput, 0, 0)
hbox.pack_start(gtk.Label(' ' + _('to') + ' '), 0, 0)
hbox.pack_start(self.dayTimeEndInput, 0, 0)
self.pack_start(hbox, 0, 0)
示例6: EventWidget
class EventWidget(common.EventWidget):
def __init__(self, event): ## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
try:
seperated = event.parent.showSeperatedYmdInputs
except AttributeError:
seperated = False
if seperated:
self.startDateInput = YearMonthDayBox()
self.endDateInput = YearMonthDayBox()
else:
self.startDateInput = DateButton()
self.endDateInput = DateButton()
######
hbox = gtk.HBox()
label = gtk.Label(_("Start") + ": ")
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
pack(hbox, label)
pack(hbox, self.startDateInput)
pack(self, hbox)
######
hbox = gtk.HBox()
label = gtk.Label(_("End") + ": ")
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
pack(hbox, label)
pack(hbox, self.endDateInput)
pack(self, hbox)
#############
# self.filesBox = common.FilesBox(self.event)
# pack(self, self.filesBox)
def updateWidget(self):
common.EventWidget.updateWidget(self)
self.startDateInput.set_value(self.event["start"].date)
self.endDateInput.set_value(self.event["end"].date)
def updateVars(self): ## FIXME
common.EventWidget.updateVars(self)
self.event["start"].setDate(self.startDateInput.get_value())
self.event["end"].setDate(self.endDateInput.get_value())
def modeComboChanged(self, obj=None): ## overwrite method from common.EventWidget
newMode = self.modeCombo.get_active()
self.startDateInput.changeMode(self.event.mode, newMode)
self.endDateInput.changeMode(self.event.mode, newMode)
self.event.mode = newMode
示例7: __init__
def __init__(self, event):
common.EventWidget.__init__(self, event)
###
hbox = gtk.HBox()
hbox.pack_start(gtk.Label(_('Date')), 0, 0)
self.dateInput = DateButton()
hbox.pack_start(self.dateInput, 0, 0)
self.pack_start(hbox, 0, 0)
示例8: __init__
def __init__(self, event):
common.EventWidget.__init__(self, event)
###
hbox = gtk.HBox()
pack(hbox, gtk.Label(_("Date")))
self.dateInput = DateButton()
pack(hbox, self.dateInput)
pack(self, hbox)
示例9: __init__
def __init__(self, event):## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.startDateInput = DateButton()
hbox.pack_start(self.startDateInput, 0, 0)
##
hbox.pack_start(gtk.Label(' '+_('Time')), 0, 0)
self.startTimeInput = TimeButton()
hbox.pack_start(self.startTimeInput, 0, 0)
##
self.pack_start(hbox, 0, 0)
######
hbox = gtk.HBox()
self.endTypeCombo = gtk.combo_box_new_text()
for item in ('Duration', 'End'):
self.endTypeCombo.append_text(_(item))
self.endTypeCombo.connect('changed', self.endTypeComboChanged)
sizeGroup.add_widget(self.endTypeCombo)
hbox.pack_start(self.endTypeCombo, 0, 0)
####
self.durationBox = common.DurationInputBox()
hbox.pack_start(self.durationBox, 1, 1)
####
self.endDateHbox = gtk.HBox()
self.endDateInput = DateButton()
self.endDateHbox.pack_start(self.endDateInput, 0, 0)
##
self.endDateHbox.pack_start(gtk.Label(' '+_('Time')), 0, 0)
self.endTimeInput = TimeButton()
self.endDateHbox.pack_start(self.endTimeInput, 0, 0)
##
hbox.pack_start(self.endDateHbox, 1, 1)
####
hbox.pack_start(gtk.Label(''), 1, 1)
self.pack_start(hbox, 0, 0)
#############
self.notificationBox = common.NotificationBox(event)
self.pack_start(self.notificationBox, 0, 0)
示例10: __init__
def __init__(self, event): ## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
hbox = gtk.HBox()
label = gtk.Label(_("Start"))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
pack(hbox, label)
self.startDateInput = DateButton()
pack(hbox, self.startDateInput)
##
pack(hbox, gtk.Label(" " + _("Time")))
self.startTimeInput = TimeButton()
pack(hbox, self.startTimeInput)
##
pack(self, hbox)
######
hbox = gtk.HBox()
self.endTypeCombo = gtk.combo_box_new_text()
for item in ("Duration", "End"):
self.endTypeCombo.append_text(_(item))
self.endTypeCombo.connect("changed", self.endTypeComboChanged)
sizeGroup.add_widget(self.endTypeCombo)
pack(hbox, self.endTypeCombo)
####
self.durationBox = common.DurationInputBox()
pack(hbox, self.durationBox, 1, 1)
####
self.endDateHbox = gtk.HBox()
self.endDateInput = DateButton()
pack(self.endDateHbox, self.endDateInput)
##
pack(self.endDateHbox, gtk.Label(" " + _("Time")))
self.endTimeInput = TimeButton()
pack(self.endDateHbox, self.endTimeInput)
##
pack(hbox, self.endDateHbox, 1, 1)
####
pack(hbox, gtk.Label(""), 1, 1)
pack(self, hbox)
#############
self.notificationBox = common.NotificationBox(event)
pack(self, self.notificationBox)
示例11: __init__
def __init__(self, group):
BaseGroupWidget.__init__(self, group)
####
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
hbox.pack_start(label, 0, 0)
self.sizeGroup.add_widget(label)
self.startDateInput = DateButton()
hbox.pack_start(self.startDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
###
hbox = gtk.HBox()
label = gtk.Label(_('End'))
label.set_alignment(0, 0.5)
hbox.pack_start(label, 0, 0)
self.sizeGroup.add_widget(label)
self.endDateInput = DateButton()
hbox.pack_start(self.endDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
示例12: __init__
def __init__(self, rule):
self.rule = rule
###
gtk.HBox.__init__(self)
###
self.dateInput = DateButton()
self.pack_start(self.dateInput, 0, 0)
###
self.pack_start(gtk.Label(' '+_('Time')), 0, 0)
self.timeInput = TimeButton()
self.pack_start(self.timeInput, 0, 0)
示例13: __init__
def __init__(self, rule):
self.rule = rule
###
gtk.HBox.__init__(self)
###
self.dateInput = DateButton()
pack(self, self.dateInput)
###
pack(self, gtk.Label(' '+_('Time')))
self.timeInput = TimeButton()
pack(self, self.timeInput)
示例14: __init__
def __init__(self, event):## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
pack(hbox, label)
self.startDateInput = DateButton()
pack(hbox, self.startDateInput)
##
pack(self, hbox)
######
hbox = gtk.HBox()
self.endTypeCombo = gtk.combo_box_new_text()
for item in ('Duration', 'End'):
self.endTypeCombo.append_text(_(item))
self.endTypeCombo.connect('changed', self.endTypeComboChanged)
sizeGroup.add_widget(self.endTypeCombo)
pack(hbox, self.endTypeCombo)
####
self.durationBox = gtk.HBox()
self.durationSpin = IntSpinButton(1, 999)
pack(self.durationBox, self.durationSpin)
pack(self.durationBox, gtk.Label(_(' days')))
pack(hbox, self.durationBox)
####
self.endDateInput = DateButton()
pack(hbox, self.endDateInput)
####
pack(hbox, gtk.Label(''), 1, 1)
pack(self, hbox)
#############
self.notificationBox = common.NotificationBox(event)
pack(self, self.notificationBox)
示例15: __init__
def __init__(self, event): ## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
hbox = gtk.HBox()
label = gtk.Label(_("Start"))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.startDateInput = DateButton()
hbox.pack_start(self.startDateInput, 0, 0)
##
self.pack_start(hbox, 0, 0)
######
hbox = gtk.HBox()
self.endTypeCombo = gtk.combo_box_new_text()
for item in ("Duration", "End"):
self.endTypeCombo.append_text(_(item))
self.endTypeCombo.connect("changed", self.endTypeComboChanged)
sizeGroup.add_widget(self.endTypeCombo)
hbox.pack_start(self.endTypeCombo, 0, 0)
####
self.durationBox = gtk.HBox()
self.durationSpin = IntSpinButton(1, 999)
self.durationBox.pack_start(self.durationSpin, 0, 0)
self.durationBox.pack_start(gtk.Label(_(" days")), 0, 0)
hbox.pack_start(self.durationBox, 0, 0)
####
self.endDateInput = DateButton()
hbox.pack_start(self.endDateInput, 0, 0)
####
hbox.pack_start(gtk.Label(""), 1, 1)
self.pack_start(hbox, 0, 0)
#############
self.notificationBox = common.NotificationBox(event)
self.pack_start(self.notificationBox, 0, 0)