def __init__(self, event): ## FIXME common.WidgetClass.__init__(self, event) ################ hbox = gtk.HBox() pack(hbox, gtk.Label(_('Month'))) self.monthCombo = MonthComboBox() self.monthCombo.build(event.mode) pack(hbox, self.monthCombo) pack(hbox, gtk.Label(''), 1, 1) #pack(self, hbox) ### #hbox = gtk.HBox() pack(hbox, gtk.Label(_('Day'))) self.daySpin = DaySpinButton() pack(hbox, self.daySpin) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ### hbox = gtk.HBox() self.startYearCheck = gtk.CheckButton(_('Start Year')) pack(hbox, self.startYearCheck) self.startYearSpin = YearSpinButton() pack(hbox, self.startYearSpin) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) self.startYearCheck.connect('clicked', self.startYearCheckClicked) #### self.notificationBox = common.NotificationBox(event) pack(self, self.notificationBox)
def __init__(self, event, autoCheck=True): common.WidgetClass.__init__(self, event) ################ self.autoCheck = autoCheck ###### self.ruleAddBox = gtk.HBox() self.warnLabel = gtk.Label() self.warnLabel.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(-1, 0, 0)) self.warnLabel.set_alignment(0, 0.5) #self.warnLabel.set_visible(False)## FIXME ########### self.rulesExp = gtk.Expander(_('Rules')) self.rulesExp.set_expanded(True) self.rulesBox = gtk.VBox() self.rulesExp.add(self.rulesBox) pack(self, self.rulesExp) ### pack(self, self.ruleAddBox) pack(self, self.warnLabel) ### self.notificationBox = common.NotificationBox(event) pack(self, self.notificationBox) ########### self.addRuleModel = gtk.ListStore(str, str) self.addRuleCombo = gtk.ComboBox(self.addRuleModel) ### cell = gtk.CellRendererText() pack(self.addRuleCombo, cell, True) self.addRuleCombo.add_attribute(cell, 'text', 1) ### pack(self.ruleAddBox, gtk.Label(_('Add Rule') + ':')) pack(self.ruleAddBox, self.addRuleCombo) pack(self.ruleAddBox, gtk.Label(''), 1, 1) self.ruleAddButton = gtk.Button(stock=gtk.STOCK_ADD) if ui.autoLocale: self.ruleAddButton.set_label(_('_Add')) self.ruleAddButton.set_image( gtk.image_new_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_BUTTON)) pack(self.ruleAddBox, self.ruleAddButton) ############# #self.filesBox = common.FilesBox(self.event) #pack(self, self.filesBox) ############# self.addRuleCombo.connect('changed', self.addRuleComboChanged) self.ruleAddButton.connect('clicked', self.addClicked)
def __init__(self, event): ## FIXME common.WidgetClass.__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)
def __init__(self, event):## FIXME gtk.VBox.__init__(self) self.event = event assert event.parent.name == 'universityTerm' ## FIXME sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) ##### if not event.parent.courses: showError(event.parent.noCourseError) raise RuntimeError('No courses added') self.courseIds = [] self.courseNames = [] combo = gtk.combo_box_new_text() for course in event.parent.courses: self.courseIds.append(course[0]) self.courseNames.append(course[1]) combo.append_text(course[1]) #combo.connect('changed', self.updateSummary) self.courseCombo = combo ## hbox = gtk.HBox() label = gtk.Label(_('Course')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) pack(hbox, combo) ## pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Date')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.dateInput = DateButton() pack(hbox, self.dateInput) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Time')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) ## self.dayTimeStartCombo = HourMinuteButton() self.dayTimeEndCombo = HourMinuteButton() ## #self.dayTimeStartCombo.get_child().set_direction(gtk.TEXT_DIR_LTR) #self.dayTimeEndCombo.get_child().set_direction(gtk.TEXT_DIR_LTR) ## pack(hbox, self.dayTimeStartCombo) pack(hbox, gtk.Label(' ' + _('to') + ' ')) pack(hbox, self.dayTimeEndCombo) pack(self, hbox) ########### #hbox = gtk.HBox() #label = gtk.Label(_('Summary')) #label.set_alignment(0, 0.5) #sizeGroup.add_widget(label) #pack(hbox, label) #self.summaryEntry = gtk.Entry() #pack(hbox, self.summaryEntry, 1, 1) #pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Description')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.descriptionInput = TextFrame() pack(hbox, self.descriptionInput, 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Icon')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.iconSelect = IconSelectButton() #print(join(pixDir, self.icon)) pack(hbox, self.iconSelect) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ###### self.notificationBox = common.NotificationBox(event) pack(self, self.notificationBox) ###### #self.filesBox = common.FilesBox(self.event) #pack(self, self.filesBox) ###### self.courseCombo.set_active(0)