Пример #1
0
	def optionsWidgetCreate(self):
		from scal2.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
		from scal2.ui_gtk.pref_utils import CheckPrefItem, ColorPrefItem
		if self.optionsWidget:
			return
		self.optionsWidget = gtk.VBox()
		####
		hbox = gtk.HBox()
		spin = IntSpinButton(1, 9999)
		spin.set_value(ui.mcalHeight)
		spin.connect('changed', self.heightSpinChanged)
		pack(hbox, gtk.Label(_('Height')))
		pack(hbox, spin)
		pack(self.optionsWidget, hbox)
		####
		hbox = gtk.HBox(spacing=3)
		##
		pack(hbox, gtk.Label(_('Left Margin')))
		spin = IntSpinButton(0, 99)
		spin.set_value(ui.mcalLeftMargin)
		spin.connect('changed', self.leftMarginSpinChanged)
		pack(hbox, spin)
		##
		pack(hbox, gtk.Label(_('Top')))
		spin = IntSpinButton(0, 99)
		spin.set_value(ui.mcalTopMargin)
		spin.connect('changed', self.topMarginSpinChanged)
		pack(hbox, spin)
		##
		pack(hbox, gtk.Label(''), 1, 1)
		pack(self.optionsWidget, hbox)
		########
		hbox = gtk.HBox(spacing=3)
		####
		item = CheckPrefItem(ui, 'mcalGrid', _('Grid'))
		item.updateWidget()
		gridCheck = item._widget
		pack(hbox, gridCheck)
		gridCheck.item = item
		####
		colorItem = ColorPrefItem(ui, 'mcalGridColor', True)
		colorItem.updateWidget()
		pack(hbox, colorItem._widget)
		gridCheck.colorb = colorItem._widget
		gridCheck.connect('clicked', self.gridCheckClicked)
		colorItem._widget.item = colorItem
		colorItem._widget.connect('color-set', self.gridColorChanged)
		colorItem._widget.set_sensitive(ui.mcalGrid)
		####
		pack(self.optionsWidget, hbox)
		########
		frame = gtk.Frame(_('Calendars'))
		self.typeParamsVbox = gtk.VBox()
		frame.add(self.typeParamsVbox)
		frame.show_all()
		pack(self.optionsWidget, frame)
		self.optionsWidget.show_all()
		self.updateTypeParamsWidget()## FIXME
Пример #2
0
 def optionsWidgetCreate(self):
     from scal2.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
     from scal2.ui_gtk.mywidgets.multi_spin.float_num import FloatSpinButton
     from scal2.ui_gtk.pref_utils import CheckPrefItem, ColorPrefItem
     if self.optionsWidget:
         return
     ColumnBase.optionsWidgetCreate(self)
     #####
     hbox = gtk.HBox()
     spin = IntSpinButton(1, 9999)
     spin.set_value(ui.wcalHeight)
     spin.connect('changed', self.heightSpinChanged)
     pack(hbox, gtk.Label(_('Height')))
     pack(hbox, spin)
     pack(self.optionsWidget, hbox)
     ###
     hbox = gtk.HBox()
     spin = FloatSpinButton(0.01, 1, 2)
     spin.set_value(ui.wcalTextSizeScale)
     spin.connect('changed', self.textSizeScaleSpinChanged)
     pack(hbox, gtk.Label(_('Text Size Scale')))
     pack(hbox, spin)
     pack(self.optionsWidget, hbox)
     ########
     hbox = gtk.HBox(spacing=3)
     ####
     item = CheckPrefItem(ui, 'wcalGrid', _('Grid'))
     item.updateWidget()
     gridCheck = item._widget
     pack(hbox, gridCheck)
     gridCheck.item = item
     ####
     colorItem = ColorPrefItem(ui, 'wcalGridColor', True)
     colorItem.updateWidget()
     pack(hbox, colorItem._widget)
     gridCheck.colorb = colorItem._widget
     gridCheck.connect('clicked', self.gridCheckClicked)
     colorItem._widget.item = colorItem
     colorItem._widget.connect('color-set', self.gridColorChanged)
     colorItem._widget.set_sensitive(ui.wcalGrid)
     ####
     pack(self.optionsWidget, hbox)
     ###
     self.optionsWidget.show_all()
Пример #3
0
	def optionsWidgetCreate(self):
		from scal2.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
		from scal2.ui_gtk.mywidgets.multi_spin.float_num import FloatSpinButton
		from scal2.ui_gtk.pref_utils import CheckPrefItem, ColorPrefItem
		if self.optionsWidget:
			return
		ColumnBase.optionsWidgetCreate(self)
		#####
		hbox = gtk.HBox()
		spin = IntSpinButton(1, 9999)
		spin.set_value(ui.wcalHeight)
		spin.connect('changed', self.heightSpinChanged)
		pack(hbox, gtk.Label(_('Height')))
		pack(hbox, spin)
		pack(self.optionsWidget, hbox)
		###
		hbox = gtk.HBox()
		spin = FloatSpinButton(0.01, 1, 2)
		spin.set_value(ui.wcalTextSizeScale)
		spin.connect('changed', self.textSizeScaleSpinChanged)
		pack(hbox, gtk.Label(_('Text Size Scale')))
		pack(hbox, spin)
		pack(self.optionsWidget, hbox)
		########
		hbox = gtk.HBox(spacing=3)
		####
		item = CheckPrefItem(ui, 'wcalGrid', _('Grid'))
		item.updateWidget()
		gridCheck = item._widget
		pack(hbox, gridCheck)
		gridCheck.item = item
		####
		colorItem = ColorPrefItem(ui, 'wcalGridColor', True)
		colorItem.updateWidget()
		pack(hbox, colorItem._widget)
		gridCheck.colorb = colorItem._widget
		gridCheck.connect('clicked', self.gridCheckClicked)
		colorItem._widget.item = colorItem
		colorItem._widget.connect('color-set', self.gridColorChanged)
		colorItem._widget.set_sensitive(ui.wcalGrid)
		####
		pack(self.optionsWidget, hbox)
		###
		self.optionsWidget.show_all()
Пример #4
0
	def optionsWidgetCreate(self):
		from scal2.ui_gtk.pref_utils import LiveColorPrefItem, LiveCheckPrefItem, \
			CheckPrefItem, ColorPrefItem, LiveCheckColorPrefItem
		if self.optionsWidget:
			return self.optionsWidget
		####
		optionsWidget = VBox(spacing=10)
		####
		hbox = HBox(spacing=5)
		pack(hbox, gtk.Label(_("Active menu item color")))
		prefItem = LiveColorPrefItem(
			ui,
			"labelBoxMenuActiveColor",
			onChangeFunc=self.onConfigChange,
		)
		pack(hbox, prefItem.getWidget())
		pack(optionsWidget, hbox)
		###
		checkSizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
		###
		prefItem = LiveCheckColorPrefItem(
			CheckPrefItem(ui, "labelBoxYearColorEnable", _("Year Color")),
			ColorPrefItem(ui, "labelBoxYearColor", True),
			onChangeFunc=self.onDateChange,
			checkSizeGroup=checkSizeGroup,
		)
		pack(optionsWidget, prefItem.getWidget())
		###
		prefItem = LiveCheckColorPrefItem(
			CheckPrefItem(ui, "labelBoxMonthColorEnable", _("Month Color")),
			ColorPrefItem(ui, "labelBoxMonthColor", True),
			onChangeFunc=self.onDateChange,
			checkSizeGroup=checkSizeGroup,
		)
		pack(optionsWidget, prefItem.getWidget())
		###
		optionsWidget.show_all()
		self.optionsWidget = optionsWidget
		return self.optionsWidget
Пример #5
0
 def __init__(self):
     gtk.HBox.__init__(self)
     CalBase.__init__(self)
     self.set_property('height-request', ui.wcalHeight)
     ######################
     self.connect('scroll-event', self.scroll)
     ###
     self.connect('button-press-event', self.buttonPress)
     #####
     defaultItems = [
         ToolbarColumn(self),
         WeekDaysColumn(self),
         PluginsTextColumn(self),
         EventsIconColumn(self),
         EventsCountColumn(self),
         EventsTextColumn(self),
         EventsBoxColumn(self),
         DaysOfMonthColumnGroup(self),
     ]
     defaultItemsDict = dict([(item._name, item) for item in defaultItems])
     itemNames = defaultItemsDict.keys()
     for name, enable in ui.wcalItems:
         try:
             item = defaultItemsDict[name]
         except KeyError:
             print('weekCal item %s does not exist'%name)
         else:
             item.enable = enable
             self.appendItem(item)
             itemNames.remove(name)
     for name in itemNames:
         item = defaultItemsDict[name]
         item.enable = False
         self.appendItem(item)
     #####
     hbox = gtk.HBox()
     spin = IntSpinButton(1, 9999)
     spin.set_value(ui.wcalHeight)
     spin.connect('changed', self.heightSpinChanged)
     pack(hbox, gtk.Label(_('Height')))
     pack(hbox, spin)
     pack(self.optionsWidget, hbox)
     ###
     hbox = gtk.HBox()
     spin = FloatSpinButton(0.01, 1, 2)
     spin.set_value(ui.wcalTextSizeScale)
     spin.connect('changed', self.textSizeScaleSpinChanged)
     pack(hbox, gtk.Label(_('Text Size Scale')))
     pack(hbox, spin)
     pack(self.optionsWidget, hbox)
     ########
     hbox = gtk.HBox(spacing=3)
     ####
     item = CheckPrefItem(ui, 'wcalGrid', _('Grid'))
     item.updateWidget()
     gridCheck = item._widget
     pack(hbox, gridCheck)
     gridCheck.item = item
     ####
     colorItem = ColorPrefItem(ui, 'wcalGridColor', True)
     colorItem.updateWidget()
     pack(hbox, colorItem._widget)
     gridCheck.colorb = colorItem._widget
     gridCheck.connect('clicked', self.gridCheckClicked)
     colorItem._widget.item = colorItem
     colorItem._widget.connect('color-set', self.gridColorChanged)
     colorItem._widget.set_sensitive(ui.wcalGrid)
     ####
     pack(self.optionsWidget, hbox)
     ###
     self.optionsWidget.show_all()
Пример #6
0
 def __init__(self):
     gtk.Widget.__init__(self)
     CalBase.__init__(self)
     self.set_property('height-request', ui.mcalHeight)
     ######
     hbox = gtk.HBox()
     spin = IntSpinButton(1, 9999)
     spin.set_value(ui.mcalHeight)
     spin.connect('changed', self.heightSpinChanged)
     pack(hbox, gtk.Label(_('Height')))
     pack(hbox, spin)
     pack(self.optionsWidget, hbox)
     ####
     hbox = gtk.HBox(spacing=3)
     ##
     pack(hbox, gtk.Label(_('Left Margin')))
     spin = IntSpinButton(0, 99)
     spin.set_value(ui.mcalLeftMargin)
     spin.connect('changed', self.leftMarginSpinChanged)
     pack(hbox, spin)
     ##
     pack(hbox, gtk.Label(_('Top')))
     spin = IntSpinButton(0, 99)
     spin.set_value(ui.mcalTopMargin)
     spin.connect('changed', self.topMarginSpinChanged)
     pack(hbox, spin)
     ##
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self.optionsWidget, hbox)
     ########
     hbox = gtk.HBox(spacing=3)
     ####
     item = CheckPrefItem(ui, 'mcalGrid', _('Grid'))
     item.updateWidget()
     gridCheck = item._widget
     pack(hbox, gridCheck)
     gridCheck.item = item
     ####
     colorItem = ColorPrefItem(ui, 'mcalGridColor', True)
     colorItem.updateWidget()
     pack(hbox, colorItem._widget)
     gridCheck.colorb = colorItem._widget
     gridCheck.connect('clicked', self.gridCheckClicked)
     colorItem._widget.item = colorItem
     colorItem._widget.connect('color-set', self.gridColorChanged)
     colorItem._widget.set_sensitive(ui.mcalGrid)
     ####
     pack(self.optionsWidget, hbox)
     ########
     frame = gtk.Frame(_('Calendars'))
     self.typeParamsVbox = gtk.VBox()
     frame.add(self.typeParamsVbox)
     frame.show_all()
     pack(self.optionsWidget, frame)
     self.optionsWidget.show_all()
     self.updateTypeParamsWidget()## FIXME
     ######################
     #self.kTime = 0
     ######################
     self.connect('expose-event', self.drawAll)
     self.connect('button-press-event', self.buttonPress)
     #self.connect('screen-changed', self.screenChanged)
     self.connect('scroll-event', self.scroll)
     ######################
     self.updateTextWidth()