Example #1
0
 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)
Example #2
0
 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()
Example #3
0
 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)
Example #4
0
 def __init__(self, controller, size=23):
     gtk.EventBox.__init__(self)
     self.initVars()
     ###
     self.size = size
     self.controller = controller
     CustomizableCalObj.initVars(self)
     self.build()
Example #5
0
 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()
Example #6
0
    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)
Example #7
0
	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()
Example #8
0
 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
Example #9
0
 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()
Example #10
0
 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
Example #11
0
 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()
Example #12
0
 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()
Example #13
0
 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)
Example #14
0
	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)
Example #15
0
 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
Example #16
0
	def onConfigChange(self, *a, **kw):
		CustomizableCalObj.onConfigChange(self, *a, **kw)
		self.updateTextWidth()
		self.updateTypeParamsWidget()
Example #17
0
 def appendItem(self, item):
     CustomizableCalObj.appendItem(self, item)
     gtk.Toolbar.insert(self, item, -1)
     if item.enable:
         item.show()
Example #18
0
 def onDateChange(self, *a, **kw):
     CustomizableCalObj.onDateChange(self, *a, **kw)
     self.queue_draw()
Example #19
0
 def appendItem(self, item):
     CustomizableCalObj.appendItem(self, item)
     gtk.Toolbar.insert(self, item, -1)
     if item.enable:
         item.show()
Example #20
0
	def onDateChange(self, *a, **kw):
		CustomizableCalObj.onDateChange(self, *a, **kw)
		self.queue_draw()
Example #21
0
	def onDateChange(self, *a, **kw):
		CustomizableCalObj.onDateChange(self, *a, **kw)
		self.setText(ui.cell.pluginsText)
Example #22
0
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     self.updateTextWidth()
     self.updateTypeParamsWidget()
Example #23
0
 def onDateChange(self, *a, **kw):
     CustomizableCalObj.onDateChange(self, *a, **kw)
     self.setText(ui.cell.pluginsText)
Example #24
0
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     if self.customizeWidth:
         self.setWidthWidget(self.getWidthValue())
Example #25
0
 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
Example #26
0
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     self.updateData()
     self.queue_draw()
Example #27
0
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     self.shownCals = ui.shownCals
     self.updateTextWidth()
Example #28
0
	def onConfigChange(self, *a, **kw):
		CustomizableCalObj.onConfigChange(self, *a, **kw)
		if self.customizeWidth:
			self.setWidthWidget(self.getWidthValue())