Пример #1
0
 def __init__(self, event):  ## FIXME
     common.WidgetClass.__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)
Пример #2
0
	def __init__(self):
		gtk.Dialog.__init__(self, title=_('Select Date...'))
		self.set_has_separator(False)
		#self.set_skip_taskbar_hint(True)
		self.connect('delete-event', self.hideMe)
		self.mode = calTypes.primary
		###### Reciving dropped day!
		self.drag_dest_set(gdk.MODIFIER_MASK,\
			(('a', 0, 0),), gdk.ACTION_COPY)
		self.drag_dest_add_text_targets()
		self.connect('drag-data-received', self.dragRec)
		######
		hb0 = gtk.HBox(spacing=4)
		pack(hb0, gtk.Label(_('Date Mode')))
		combo = CalTypeCombo()
		combo.set_active(self.mode)
		pack(hb0, combo)
		pack(self.vbox, hb0)
		#######################
		hbox = gtk.HBox(spacing=5)
		rb1 = gtk.RadioButton()
		rb1.num = 1
		pack(hbox, rb1)
		self.ymdBox = YearMonthDayBox()
		pack(hbox, self.ymdBox)
		pack(self.vbox, hbox)
		########
		hb2 = gtk.HBox(spacing=4)
		pack(hb2, gtk.Label('yyyy/mm/dd'))
		dateInput = DateButtonOption(hist_size=16)
		pack(hb2, dateInput)
		rb2 = gtk.RadioButton()
		rb2.num = 2
		rb2.set_group(rb1)
		hb2i = gtk.HBox(spacing=5)
		pack(hb2i, rb2)
		pack(hb2i, hb2)
		pack(self.vbox, hb2i)
		#######
		dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), 2, self.hideMe)
		dialog_add_button(self, gtk.STOCK_OK, _('_OK'), 1, self.ok)
		#######
		self.comboMode = combo
		self.dateInput = dateInput
		self.radio1 = rb1
		self.radio2 = rb2
		self.hbox2 = hb2
		#######
		combo.connect ('changed', self.comboModeChanged)
		rb1.connect_after('clicked', self.radioChanged)
		rb2.connect_after('clicked', self.radioChanged)
		dateInput.connect('activate', self.ok)
		self.radioChanged()
		#######
		self.vbox.show_all()