本文整理汇总了Python中scal3.ui_gtk.mywidgets.multi_spin.date.DateButton.get_jd方法的典型用法代码示例。如果您正苦于以下问题:Python DateButton.get_jd方法的具体用法?Python DateButton.get_jd怎么用?Python DateButton.get_jd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scal3.ui_gtk.mywidgets.multi_spin.date.DateButton
的用法示例。
在下文中一共展示了DateButton.get_jd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WidgetClass
# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.date import DateButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.date.DateButton import get_jd [as 别名]
class WidgetClass(BaseWidgetClass):
def __init__(self, group):
BaseWidgetClass.__init__(self, group)
####
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
pack(hbox, label)
self.sizeGroup.add_widget(label)
self.startDateInput = DateButton()
pack(hbox, self.startDateInput)
pack(self, hbox)
###
hbox = gtk.HBox()
label = gtk.Label(_('End'))
label.set_alignment(0, 0.5)
pack(hbox, label)
self.sizeGroup.add_widget(label)
self.endDateInput = DateButton()
pack(hbox, self.endDateInput)
pack(self, hbox)
######
exp = gtk.Expander()
exp.set_label(_('Online Service'))
vbox = gtk.VBox()
exp.add(vbox)
sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL)
##
hbox = gtk.HBox()
label = gtk.Label(_('Account'))
label.set_alignment(0, 0.5)
pack(hbox, label)
sizeGroup.add_widget(label) ## FIXME
self.accountCombo = AccountCombo()
pack(hbox, self.accountCombo)
pack(vbox, hbox)
##
hbox = gtk.HBox()
label = gtk.Label(_('Remote Group'))
label.set_alignment(0, 0.5)
pack(hbox, label)
sizeGroup.add_widget(label) ## FIXME
accountGroupBox = AccountGroupBox(self.accountCombo)
pack(hbox, accountGroupBox, 1, 1)
pack(vbox, hbox)
self.accountGroupCombo = accountGroupBox.combo
##
pack(self, exp)
def updateWidget(self):
BaseWidgetClass.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))
###
if self.group.remoteIds:
aid, gid = self.group.remoteIds
else:
aid, gid = None, None
self.accountCombo.set_active(aid)
self.accountGroupCombo.set_active(gid)
def updateVars(self):
BaseWidgetClass.updateVars(self)
self.group.startJd = self.startDateInput.get_jd(self.group.mode)
self.group.endJd = self.endDateInput.get_jd(self.group.mode)
###
aid = self.accountCombo.get_active()
if aid:
gid = self.accountGroupCombo.get_active()
self.group.remoteIds = aid, gid
else:
self.group.remoteIds = None
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