def onDateChange(self, *a, **kw): CustomizableCalObj.onDateChange(self, *a, **kw) for i, label in enumerate(self.labelBox.get_children()): text = ui.cell.format(ud.dateFormatBin, label.mode) if i == 0: text = '<b>%s</b>' % text label.set_label(text)
def initVars(self, *a, **ka): CustomizableCalObj.initVars(self, *a, **ka) if not self.optionsWidget: self.optionsWidget = gtk.VBox() #### if self.customizeWidth: value = self.getWidthValue() self.setWidthWidget(value) ### hbox = gtk.HBox() pack(hbox, gtk.Label(_('Width'))) spin = IntSpinButton(0, 999) pack(hbox, spin) spin.set_value(value) spin.connect('changed', self.widthSpinChanged) pack(self.optionsWidget, hbox) #### if self.customizeFont: hbox = gtk.HBox() pack(hbox, gtk.Label(_('Font Family'))) combo = FontFamilyCombo(hasAuto=True) combo.set_value(self.getFontValue()) pack(hbox, combo) combo.connect('changed', self.fontFamilyComboChanged) pack(self.optionsWidget, hbox) #### self.optionsWidget.show_all()
def onDateChange(self, *a, **kw): CustomizableCalObj.onDateChange(self, *a, **kw) for i, label in enumerate(self.labelBox.get_children()): text = ui.cell.format(ud.dateFormatBin, label.mode) if i==0: text = '<b>%s</b>'%text label.set_label(text)
def __init__(self, controller, size=23): gtk.EventBox.__init__(self) self.initVars() ### self.size = size self.controller = controller CustomizableCalObj.initVars(self) self.build()
def __init__(self, controller, size=23): gtk.EventBox.__init__(self) self.initVars() ### self.size = size self.controller = controller CustomizableCalObj.initVars(self) self.build() ### self.show_all()
def onDateChange(self, *a, **kw): from scal2.season import getSeasonNamePercentFromJd CustomizableCalObj.onDateChange(self, *a, **kw) name, frac = getSeasonNamePercentFromJd(ui.cell.jd) if rtl: percent = "%d%%" % (frac * 100) else: percent = "%%%d" % (frac * 100) self.set_text(_(name) + " - " + textNumEncode(percent, changeDot=True)) self.set_fraction(frac)
def onConfigChange(self, *a, **kw): CustomizableCalObj.onConfigChange(self, *a, **kw) ##### for child in self.get_children(): child.destroy() ### monthLabels = [] mode = calTypes.primary ## box = YearLabelButtonBox(mode) pack(self, box) self.appendItem(box.label) ## pack(self, gtk.VSeparator(), 1, 1) ## box = MonthLabelButtonBox(mode) pack(self, box) self.appendItem(box.label) monthLabels.append(box.label) #### for i, mode in list(enumerate(calTypes.active))[1:]: pack(self, gtk.VSeparator(), 1, 1) label = YearLabel(mode) pack(self, label) self.appendItem(label) ############### label = gtk.Label('') label.set_property('width-request', 5) pack(self, label) ############### label = MonthLabel(mode) pack(self, label) monthLabels.append(label) self.appendItem(label) #### ## updateTextWidth lay = newTextLayout(self) for label in monthLabels: wm = 0 for m in range(12): name = getMonthName(label.mode, m) if ui.boldYmLabel: lay.set_markup('<b>%s</b>'%name) else: lay.set_text(name) ## OR lay.set_markup w = lay.get_pixel_size()[0] if w > wm: wm = w label.set_property('width-request', wm) ##### self.show_all() ##### self.onDateChange()
def keyPress(self, arg, event): CustomizableCalObj.keyPress(self, arg, event) kname = gdk.keyval_name(event.keyval).lower() if kname in ('space', 'home', 't'): self.goToday() elif kname=='menu': self.emit('popup-menu-cell', event.time, *self.getCellPos()) elif kname=='i': self.emit('day-info') else: return False return True
def keyPress(self, arg, gevent): CustomizableCalObj.keyPress(self, arg, gevent) kname = gdk.keyval_name(gevent.keyval).lower() if kname in ('space', 'home', 't'): self.goToday() elif kname == 'menu': self.emit('popup-cell-menu', gevent.time, *self.getCellPos()) elif kname == 'i': self.emit('day-info') else: return False return True
def onConfigChange(self, *a, **kw): CustomizableCalObj.onConfigChange(self, *a, **kw) ### for label in self.labelBox.get_children(): label.destroy() ### for mode in calTypes.active: label = DateLabel(None) label.mode = mode self.labelBox.pack_start(label, 1, 0, 0) self.show_all() ### self.onDateChange()
def onConfigChange(self, *a, **kw): CustomizableCalObj.onConfigChange(self, *a, **kw) ### for label in self.labelBox.get_children(): label.destroy() ### for mode in calTypes.active: label = DateLabel(None) label.mode = mode pack(self.labelBox, label, 1) self.show_all() ### self.onDateChange()
def onDateChange(self, *a, **kw): CustomizableCalObj.onDateChange(self, *a, **kw) name, frac = getSeasonNamePercentFromJd(ui.cell.jd) if rtl: percent = '%d%%'%(frac*100) else: percent = '%%%d'%(frac*100) self.set_text( _(name) + ' - ' + locale_man.textNumEncode( percent, changeDot=True, ) ) self.set_fraction(frac)
def onDateChange(self, *a, **kw): from scal2.season import getSeasonNamePercentFromJd CustomizableCalObj.onDateChange(self, *a, **kw) name, frac = getSeasonNamePercentFromJd(ui.cell.jd) if rtl: percent = '%d%%'%(frac*100) else: percent = '%%%d'%(frac*100) self.set_text( _(name) + ' - ' + textNumEncode( percent, changeDot=True, ) ) self.set_fraction(frac)
def confStr(self): text = CustomizableCalObj.confStr(self) if self.customizeWidth: text += 'ui.%s = %r\n'%( self.getWidthAttr(), self.getWidthValue(), ) if self.customizeFont: text += 'ui.%s = %r\n'%( self.getFontAttr(), self.getFontValue(), ) return text
def onConfigChange(self, *a, **kw): CustomizableCalObj.onConfigChange(self, *a, **kw) self.updateTextWidth() self.updateTypeParamsWidget()
def appendItem(self, item): CustomizableCalObj.appendItem(self, item) gtk.Toolbar.insert(self, item, -1) if item.enable: item.show()
def onDateChange(self, *a, **kw): CustomizableCalObj.onDateChange(self, *a, **kw) self.queue_draw()
def onDateChange(self, *a, **kw): CustomizableCalObj.onDateChange(self, *a, **kw) self.setText(ui.cell.pluginsText)
def onConfigChange(self, *a, **kw): CustomizableCalObj.onConfigChange(self, *a, **kw) if self.customizeWidth: self.setWidthWidget(self.getWidthValue())
def confStr(self): text = CustomizableCalObj.confStr(self) text += 'ui.mcalHeight=%r\n'%ui.mcalHeight text += 'ui.mcalLeftMargin=%r\n'%ui.mcalLeftMargin text += 'ui.mcalTopMargin=%r\n'%ui.mcalTopMargin return text
def onConfigChange(self, *a, **kw): CustomizableCalObj.onConfigChange(self, *a, **kw) self.updateData() self.queue_draw()
def onConfigChange(self, *a, **kw): CustomizableCalObj.onConfigChange(self, *a, **kw) self.shownCals = ui.shownCals self.updateTextWidth()