Exemplo n.º 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
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 4
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()
Exemplo n.º 5
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()