示例#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)
示例#2
0
文件: weekcal.py 项目: Noori/starcal
 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()
示例#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)
示例#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()
示例#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()
示例#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)
示例#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()
示例#8
0
文件: cal_base.py 项目: Noori/starcal
 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
示例#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()
示例#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
示例#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()
示例#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()
示例#13
0
文件: starcal2.py 项目: Noori/starcal
 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)
示例#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)
示例#15
0
文件: weekcal.py 项目: Noori/starcal
 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
示例#16
0
	def onConfigChange(self, *a, **kw):
		CustomizableCalObj.onConfigChange(self, *a, **kw)
		self.updateTextWidth()
		self.updateTypeParamsWidget()
示例#17
0
 def appendItem(self, item):
     CustomizableCalObj.appendItem(self, item)
     gtk.Toolbar.insert(self, item, -1)
     if item.enable:
         item.show()
示例#18
0
 def onDateChange(self, *a, **kw):
     CustomizableCalObj.onDateChange(self, *a, **kw)
     self.queue_draw()
示例#19
0
 def appendItem(self, item):
     CustomizableCalObj.appendItem(self, item)
     gtk.Toolbar.insert(self, item, -1)
     if item.enable:
         item.show()
示例#20
0
	def onDateChange(self, *a, **kw):
		CustomizableCalObj.onDateChange(self, *a, **kw)
		self.queue_draw()
示例#21
0
	def onDateChange(self, *a, **kw):
		CustomizableCalObj.onDateChange(self, *a, **kw)
		self.setText(ui.cell.pluginsText)
示例#22
0
文件: monthcal.py 项目: Noori/starcal
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     self.updateTextWidth()
     self.updateTypeParamsWidget()
示例#23
0
 def onDateChange(self, *a, **kw):
     CustomizableCalObj.onDateChange(self, *a, **kw)
     self.setText(ui.cell.pluginsText)
示例#24
0
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     if self.customizeWidth:
         self.setWidthWidget(self.getWidthValue())
示例#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
示例#26
0
文件: weekcal.py 项目: Noori/starcal
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     self.updateData()
     self.queue_draw()
示例#27
0
 def onConfigChange(self, *a, **kw):
     CustomizableCalObj.onConfigChange(self, *a, **kw)
     self.shownCals = ui.shownCals
     self.updateTextWidth()
示例#28
0
	def onConfigChange(self, *a, **kw):
		CustomizableCalObj.onConfigChange(self, *a, **kw)
		if self.customizeWidth:
			self.setWidthWidget(self.getWidthValue())