示例#1
0
 def __init__(self, wcal, index, mode, params, sgroupLabel, sgroupFont):
     from scal3.ui_gtk.mywidgets import MyFontButton
     gtk.HBox.__init__(self)
     self.wcal = wcal
     self._parent = wcal
     self.index = index
     self.mode = mode
     ######
     module, ok = calTypes[mode]
     if not ok:
         raise RuntimeError("cal type %r not found" % mode)
     label = gtk.Label(_(module.desc) + "  ")
     label.set_alignment(0, 0.5)
     pack(self, label)
     sgroupLabel.add_widget(label)
     ###
     self.fontCheck = gtk.CheckButton(_("Font"))
     pack(self, gtk.Label(""), 1, 1)
     pack(self, self.fontCheck)
     ###
     self.fontb = MyFontButton(wcal)
     pack(self, self.fontb)
     sgroupFont.add_widget(self.fontb)
     ####
     self.set(params)
     ####
     self.fontCheck.connect("clicked", self.onChange)
     self.fontb.connect("font-set", self.onChange)
示例#2
0
 def __init__(self, cal, index, mode, params, sgroupLabel):
     from scal3.ui_gtk.mywidgets.multi_spin.float_num import FloatSpinButton
     from scal3.ui_gtk.mywidgets import MyFontButton, MyColorButton
     gtk.Frame.__init__(self)
     self.cal = cal
     self.index = index
     self.mode = mode
     ####
     module, ok = calTypes[mode]
     if not ok:
         raise RuntimeError("cal type %r not found" % mode)
     ####
     self.set_label(_(module.desc))
     ####
     vbox = gtk.VBox()
     self.add(vbox)
     ###
     hbox = gtk.HBox()
     label = gtk.Label(_("Position") + ": ")
     pack(hbox, label)
     sgroupLabel.add_widget(label)
     spin = FloatSpinButton(-99, 99, 1)
     self.spinX = spin
     pack(hbox, spin)
     pack(hbox, gtk.Label(""), 1, 1)
     spin = FloatSpinButton(-99, 99, 1)
     self.spinY = spin
     pack(hbox, spin)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(vbox, hbox)
     ####
     hbox = gtk.HBox()
     label = gtk.Label(_("Font") + ": ")
     pack(hbox, label)
     sgroupLabel.add_widget(label)
     ##
     fontb = MyFontButton(cal)
     self.fontb = fontb
     ##
     colorb = MyColorButton()
     self.colorb = colorb
     ##
     pack(hbox, colorb)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(hbox, fontb)
     pack(vbox, hbox)
     ####
     self.set(params)
     ####
     self.spinX.connect("changed", self.onChange)
     self.spinY.connect("changed", self.onChange)
     fontb.connect("font-set", self.onChange)
     colorb.connect("color-set", self.onChange)
示例#3
0
文件: weekCal.py 项目: ilius/starcal
class WcalTypeParamBox(gtk.HBox):
	def __init__(self, wcal, index, mode, params, sgroupLabel, sgroupFont):
		from scal3.ui_gtk.mywidgets import MyFontButton
		gtk.HBox.__init__(self)
		self.wcal = wcal
		self._parent = wcal
		self.index = index
		self.mode = mode
		######
		module, ok = calTypes[mode]
		if not ok:
			raise RuntimeError("cal type %r not found" % mode)
		label = gtk.Label(_(module.desc) + "  ")
		label.set_alignment(0, 0.5)
		pack(self, label)
		sgroupLabel.add_widget(label)
		###
		self.fontCheck = gtk.CheckButton(_("Font"))
		pack(self, gtk.Label(""), 1, 1)
		pack(self, self.fontCheck)
		###
		self.fontb = MyFontButton(wcal)
		pack(self, self.fontb)
		sgroupFont.add_widget(self.fontb)
		####
		self.set(params)
		####
		self.fontCheck.connect("clicked", self.onChange)
		self.fontb.connect("font-set", self.onChange)

	def get(self):
		return {
			"font": (
				self.fontb.get_font_name()
				if self.fontCheck.get_active()
				else None
			),
		}

	def set(self, data):
		font = data["font"]
		self.fontCheck.set_active(bool(font))
		if not font:
			font = ui.getFont()
		self.fontb.set_font_name(font)

	def onChange(self, obj=None, event=None):
		ui.wcalTypeParams[self.index] = self.get()
		self.wcal.queue_draw()
示例#4
0
文件: weekCal.py 项目: ilius/starcal
	def __init__(self, wcal, index, mode, params, sgroupLabel, sgroupFont):
		from scal3.ui_gtk.mywidgets import MyFontButton
		gtk.HBox.__init__(self)
		self.wcal = wcal
		self._parent = wcal
		self.index = index
		self.mode = mode
		######
		module, ok = calTypes[mode]
		if not ok:
			raise RuntimeError("cal type %r not found" % mode)
		label = gtk.Label(_(module.desc) + "  ")
		label.set_alignment(0, 0.5)
		pack(self, label)
		sgroupLabel.add_widget(label)
		###
		self.fontCheck = gtk.CheckButton(_("Font"))
		pack(self, gtk.Label(""), 1, 1)
		pack(self, self.fontCheck)
		###
		self.fontb = MyFontButton(wcal)
		pack(self, self.fontb)
		sgroupFont.add_widget(self.fontb)
		####
		self.set(params)
		####
		self.fontCheck.connect("clicked", self.onChange)
		self.fontb.connect("font-set", self.onChange)
示例#5
0
 def __init__(self, module, varName, parent):
     from scal3.ui_gtk.mywidgets import MyFontButton
     self.module = module
     self.varName = varName
     w = MyFontButton(parent)
     self._widget = w
     self.get = w.get_font_name  ## FIXME
     self.set = w.set_font_name  ## FIXME
示例#6
0
class WcalTypeParamBox(gtk.HBox):
    def __init__(self, wcal, index, mode, params, sgroupLabel, sgroupFont):
        from scal3.ui_gtk.mywidgets import MyFontButton
        gtk.HBox.__init__(self)
        self.wcal = wcal
        self._parent = wcal
        self.index = index
        self.mode = mode
        ######
        module, ok = calTypes[mode]
        if not ok:
            raise RuntimeError("cal type %r not found" % mode)
        label = gtk.Label(_(module.desc) + "  ")
        label.set_alignment(0, 0.5)
        pack(self, label)
        sgroupLabel.add_widget(label)
        ###
        self.fontCheck = gtk.CheckButton(_("Font"))
        pack(self, gtk.Label(""), 1, 1)
        pack(self, self.fontCheck)
        ###
        self.fontb = MyFontButton(wcal)
        pack(self, self.fontb)
        sgroupFont.add_widget(self.fontb)
        ####
        self.set(params)
        ####
        self.fontCheck.connect("clicked", self.onChange)
        self.fontb.connect("font-set", self.onChange)

    def get(self):
        return {
            "font": (self.fontb.get_font_name()
                     if self.fontCheck.get_active() else None),
        }

    def set(self, data):
        font = data["font"]
        self.fontCheck.set_active(bool(font))
        if not font:
            font = ui.getFont()
        self.fontb.set_font_name(font)

    def onChange(self, obj=None, event=None):
        ui.wcalTypeParams[self.index] = self.get()
        self.wcal.queue_draw()
示例#7
0
文件: dayCal.py 项目: ilius/starcal
 def __init__(self, cal, index, mode, params, sgroupLabel, sgroupFont):
     from scal3.ui_gtk.mywidgets.multi_spin.float_num import FloatSpinButton
     from scal3.ui_gtk.mywidgets import MyFontButton, MyColorButton
     gtk.HBox.__init__(self)
     self.cal = cal
     self.index = index
     self.mode = mode
     ######
     module, ok = calTypes[mode]
     if not ok:
         raise RuntimeError("cal type %r not found" % mode)
     label = gtk.Label(_(module.desc) + "  ")
     label.set_alignment(0, 0.5)
     pack(self, label)
     sgroupLabel.add_widget(label)
     ###
     pack(self, gtk.Label(""), 1, 1)
     pack(self, gtk.Label(_("position")))
     ###
     spin = FloatSpinButton(-999, 999, 1)
     self.spinX = spin
     pack(self, spin)
     ###
     spin = FloatSpinButton(-999, 999, 1)
     self.spinY = spin
     pack(self, spin)
     ####
     pack(self, gtk.Label(""), 1, 1)
     ###
     fontb = MyFontButton(cal)
     self.fontb = fontb
     pack(self, fontb)
     sgroupFont.add_widget(fontb)
     ####
     colorb = MyColorButton()
     self.colorb = colorb
     pack(self, colorb)
     ####
     self.set(params)
     ####
     self.spinX.connect("changed", self.onChange)
     self.spinY.connect("changed", self.onChange)
     fontb.connect("font-set", self.onChange)
     colorb.connect("color-set", self.onChange)
示例#8
0
文件: dayCal.py 项目: ilius/starcal
	def __init__(self, cal, index, mode, params, sgroupLabel, sgroupFont):
		from scal3.ui_gtk.mywidgets.multi_spin.float_num import FloatSpinButton
		from scal3.ui_gtk.mywidgets import MyFontButton, MyColorButton
		gtk.HBox.__init__(self)
		self.cal = cal
		self.index = index
		self.mode = mode
		######
		module, ok = calTypes[mode]
		if not ok:
			raise RuntimeError("cal type %r not found" % mode)
		label = gtk.Label(_(module.desc) + "  ")
		label.set_alignment(0, 0.5)
		pack(self, label)
		sgroupLabel.add_widget(label)
		###
		pack(self, gtk.Label(""), 1, 1)
		pack(self, gtk.Label(_("position")))
		###
		spin = FloatSpinButton(-999, 999, 1)
		self.spinX = spin
		pack(self, spin)
		###
		spin = FloatSpinButton(-999, 999, 1)
		self.spinY = spin
		pack(self, spin)
		####
		pack(self, gtk.Label(""), 1, 1)
		###
		fontb = MyFontButton(cal)
		self.fontb = fontb
		pack(self, fontb)
		sgroupFont.add_widget(fontb)
		####
		colorb = MyColorButton()
		self.colorb = colorb
		pack(self, colorb)
		####
		self.set(params)
		####
		self.spinX.connect("changed", self.onChange)
		self.spinY.connect("changed", self.onChange)
		fontb.connect("font-set", self.onChange)
		colorb.connect("color-set", self.onChange)
示例#9
0
 def __init__(self, cal, index, mode, params, sgroupLabel, sgroupFont):
     from scal3.ui_gtk.mywidgets.multi_spin.float_num import FloatSpinButton
     from scal3.ui_gtk.mywidgets import MyFontButton, MyColorButton
     gtk.HBox.__init__(self)
     self.cal = cal
     self.index = index
     self.mode = mode
     ######
     label = gtk.Label(_(calTypes[mode].desc) + '  ')
     label.set_alignment(0, 0.5)
     pack(self, label)
     sgroupLabel.add_widget(label)
     ###
     pack(self, gtk.Label(''), 1, 1)
     pack(self, gtk.Label(_('position')))
     ###
     spin = FloatSpinButton(-999, 999, 1)
     self.spinX = spin
     pack(self, spin)
     ###
     spin = FloatSpinButton(-999, 999, 1)
     self.spinY = spin
     pack(self, spin)
     ####
     pack(self, gtk.Label(''), 1, 1)
     ###
     fontb = MyFontButton(cal)
     self.fontb = fontb
     pack(self, fontb)
     sgroupFont.add_widget(fontb)
     ####
     colorb = MyColorButton()
     self.colorb = colorb
     pack(self, colorb)
     ####
     self.set(params)
     ####
     self.spinX.connect('changed', self.onChange)
     self.spinY.connect('changed', self.onChange)
     fontb.connect('font-set', self.onChange)
     colorb.connect('color-set', self.onChange)
示例#10
0
 def __init__(self, cal, index, mode, params, sgroupLabel, sgroupFont):
     from scal3.ui_gtk.mywidgets.multi_spin.float_num import FloatSpinButton
     from scal3.ui_gtk.mywidgets import MyFontButton, MyColorButton
     gtk.HBox.__init__(self)
     self.cal = cal
     self.index = index
     self.mode = mode
     ######
     label = gtk.Label(_(calTypes[mode].desc)+'  ')
     label.set_alignment(0, 0.5)
     pack(self, label)
     sgroupLabel.add_widget(label)
     ###
     pack(self, gtk.Label(''), 1, 1)
     pack(self, gtk.Label(_('position')))
     ###
     spin = FloatSpinButton(-999, 999, 1)
     self.spinX = spin
     pack(self, spin)
     ###
     spin = FloatSpinButton(-999, 999, 1)
     self.spinY = spin
     pack(self, spin)
     ####
     pack(self, gtk.Label(''), 1, 1)
     ###
     fontb = MyFontButton(cal)
     self.fontb = fontb
     pack(self, fontb)
     sgroupFont.add_widget(fontb)
     ####
     colorb = MyColorButton()
     self.colorb = colorb
     pack(self, colorb)
     ####
     self.set(params)
     ####
     self.spinX.connect('changed', self.onChange)
     self.spinY.connect('changed', self.onChange)
     fontb.connect('font-set', self.onChange)
     colorb.connect('color-set', self.onChange)
示例#11
0
class WcalTypeParamBox(gtk.HBox):
    def __init__(self, wcal, index, mode, params, sgroupLabel, sgroupFont):
        from scal3.ui_gtk.mywidgets import MyFontButton
        gtk.HBox.__init__(self)
        self.wcal = wcal
        self.index = index
        self.mode = mode
        ######
        label = gtk.Label(_(calTypes[mode].desc) + '  ')
        label.set_alignment(0, 0.5)
        pack(self, label)
        sgroupLabel.add_widget(label)
        ###
        self.fontCheck = gtk.CheckButton(_('Font'))
        pack(self, gtk.Label(''), 1, 1)
        pack(self, self.fontCheck)
        ###
        self.fontb = MyFontButton(wcal)
        pack(self, self.fontb)
        sgroupFont.add_widget(self.fontb)
        ####
        self.set(params)
        ####
        self.fontCheck.connect('clicked', self.onChange)
        self.fontb.connect('font-set', self.onChange)

    get = lambda self: {
        'font':
        self.fontb.get_font_name() if self.fontCheck.get_active() else None,
    }

    def set(self, data):
        font = data['font']
        self.fontCheck.set_active(bool(font))
        if not font:
            font = ui.getFont()
        self.fontb.set_font_name(font)

    def onChange(self, obj=None, event=None):
        ui.wcalTypeParams[self.index] = self.get()
        self.wcal.queue_draw()
示例#12
0
class WcalTypeParamBox(gtk.HBox):
	def __init__(self, wcal, index, mode, params, sgroupLabel, sgroupFont):
		from scal3.ui_gtk.mywidgets import MyFontButton
		gtk.HBox.__init__(self)
		self.wcal = wcal
		self.index = index
		self.mode = mode
		######
		label = gtk.Label(_(calTypes[mode].desc)+'  ')
		label.set_alignment(0, 0.5)
		pack(self, label)
		sgroupLabel.add_widget(label)
		###
		self.fontCheck = gtk.CheckButton(_('Font'))
		pack(self, gtk.Label(''), 1, 1)
		pack(self, self.fontCheck)
		###
		self.fontb = MyFontButton(wcal)
		pack(self, self.fontb)
		sgroupFont.add_widget(self.fontb)
		####
		self.set(params)
		####
		self.fontCheck.connect('clicked', self.onChange)
		self.fontb.connect('font-set', self.onChange)
	get = lambda self: {
		'font': self.fontb.get_font_name() if self.fontCheck.get_active() else None,
	}
	def set(self, data):
		font = data['font']
		self.fontCheck.set_active(bool(font))
		if not font:
			font = ui.getFont()
		self.fontb.set_font_name(font)
	def onChange(self, obj=None, event=None):
		ui.wcalTypeParams[self.index] = self.get()
		self.wcal.queue_draw()
示例#13
0
	def __init__(self, wcal, index, mode, params, sgroupLabel, sgroupFont):
		from scal3.ui_gtk.mywidgets import MyFontButton
		gtk.HBox.__init__(self)
		self.wcal = wcal
		self.index = index
		self.mode = mode
		######
		label = gtk.Label(_(calTypes[mode].desc)+'  ')
		label.set_alignment(0, 0.5)
		pack(self, label)
		sgroupLabel.add_widget(label)
		###
		self.fontCheck = gtk.CheckButton(_('Font'))
		pack(self, gtk.Label(''), 1, 1)
		pack(self, self.fontCheck)
		###
		self.fontb = MyFontButton(wcal)
		pack(self, self.fontb)
		sgroupFont.add_widget(self.fontb)
		####
		self.set(params)
		####
		self.fontCheck.connect('clicked', self.onChange)
		self.fontb.connect('font-set', self.onChange)