当前位置: 首页>>代码示例>>Python>>正文


Python IntSpinButton.connect方法代码示例

本文整理汇总了Python中scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton.connect方法的典型用法代码示例。如果您正苦于以下问题:Python IntSpinButton.connect方法的具体用法?Python IntSpinButton.connect怎么用?Python IntSpinButton.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton的用法示例。


在下文中一共展示了IntSpinButton.connect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: optionsWidgetCreate

# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton import connect [as 别名]
	def optionsWidgetCreate(self):
		from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
		if self.optionsWidget:
			return
		self.optionsWidget = gtk.VBox()
		####
		if self.customizeWidth:
			value = self.getWidthValue()
			###
			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()
开发者ID:ubuntu-ir,项目名称:starcal,代码行数:29,代码来源:weekCal.py

示例2: optionsWidgetCreate

# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton import connect [as 别名]
 def optionsWidgetCreate(self):
     from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
     if self.optionsWidget:
         return
     self.optionsWidget = gtk.HBox()
     ###
     hbox = gtk.HBox()
     spin = IntSpinButton(1, 9999)
     spin.set_value(ui.eventViewMaxHeight)
     spin.connect('changed', self.heightSpinChanged)
     pack(hbox, gtk.Label(_('Maximum Height')))
     pack(hbox, spin)
     pack(self.optionsWidget, hbox)
     ###
     self.optionsWidget.show_all()
开发者ID:greyzero,项目名称:starcal,代码行数:17,代码来源:eventDayView.py

示例3: optionsWidgetCreate

# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton import connect [as 别名]
 def optionsWidgetCreate(self):
     from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
     from scal3.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()
     frame.set_label(_('Calendars'))
     self.typeParamsVbox = gtk.VBox()
     frame.add(self.typeParamsVbox)
     frame.show_all()
     pack(self.optionsWidget, frame)
     self.optionsWidget.show_all()
     self.updateTypeParamsWidget()## FIXME
开发者ID:greyzero,项目名称:starcal,代码行数:61,代码来源:monthCal.py

示例4: optionsWidgetCreate

# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton import connect [as 别名]
 def optionsWidgetCreate(self):
     from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
     from scal3.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.dcalHeight)
     spin.connect('changed', self.heightSpinChanged)
     pack(hbox, gtk.Label(_('Height')))
     pack(hbox, spin)
     pack(self.optionsWidget, hbox)
     ########
     frame = gtk.Frame()
     frame.set_label(_('Calendars'))
     self.typeParamsVbox = gtk.VBox()
     frame.add(self.typeParamsVbox)
     frame.show_all()
     pack(self.optionsWidget, frame)
     self.optionsWidget.show_all()
     self.updateTypeParamsWidget()## FIXME
开发者ID:greyzero,项目名称:starcal,代码行数:25,代码来源:dayCal.py

示例5: WidgetClass

# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton import connect [as 别名]
class WidgetClass(common.WidgetClass):
    def __init__(self, event):## FIXME
        common.WidgetClass.__init__(self, event)
        ######
        sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL)
        ######
        hbox = gtk.HBox()
        label = gtk.Label(_('Scale'))
        label.set_alignment(0, 0.5)
        sizeGroup.add_widget(label)
        pack(hbox, label)
        self.scaleCombo = common.Scale10PowerComboBox()
        pack(hbox, self.scaleCombo)
        pack(self, hbox)
        ####
        hbox = gtk.HBox()
        label = gtk.Label(_('Start'))
        label.set_alignment(0, 0.5)
        sizeGroup.add_widget(label)
        pack(hbox, label)
        self.startSpin = IntSpinButton(-maxStart, maxStart)
        self.startSpin.connect('changed', self.startSpinChanged)
        pack(hbox, self.startSpin)
        pack(self, hbox)
        ####
        hbox = gtk.HBox()
        self.endRelCombo = gtk.ComboBoxText()
        for item in ('Duration', 'End'):
            self.endRelCombo.append_text(_(item))
        self.endRelCombo.connect('changed', self.endRelComboChanged)
        sizeGroup.add_widget(self.endRelCombo)
        pack(hbox, self.endRelCombo)
        self.endSpin = IntSpinButton(-maxDur, maxDur)
        pack(hbox, self.endSpin)
        pack(self, hbox)
        ####
        self.endRelComboChanged()
    def endRelComboChanged(self, combo=None):
        rel = self.endRelCombo.get_active()
        start = self.startSpin.get_value()
        end = self.endSpin.get_value()
        if rel==0:## reletive(duration)
            self.endSpin.set_range(1, maxStart)
            self.endSpin.set_value(max(1, end-start))
        elif rel==1:## absolute(end)
            self.endSpin.set_range(start+1, maxStart)
            self.endSpin.set_value(max(start+1, start+end))
    def startSpinChanged(self, spin=None):
        if self.endRelCombo.get_active() == 1:## absolute(end)
            self.endSpin.set_range(self.startSpin.get_value()+1, maxStart)
    def updateWidget(self):
        common.WidgetClass.updateWidget(self)
        self.scaleCombo.set_value(self.event.scale)
        self.startSpin.set_value(self.event.start)
        self.endRelCombo.set_active(0 if self.event.endRel else 1)
        self.endSpin.set_value(self.event.end)
    def updateVars(self):## FIXME
        common.WidgetClass.updateVars(self)
        self.event.scale = self.scaleCombo.get_value()
        self.event.start = self.startSpin.get_value()
        self.event.endRel = (self.endRelCombo.get_active()==0)
        self.event.end = self.endSpin.get_value()
开发者ID:greyzero,项目名称:starcal,代码行数:64,代码来源:largeScale.py

示例6: CustomizableToolbar

# 需要导入模块: from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton [as 别名]
# 或者: from scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton import connect [as 别名]
class CustomizableToolbar(gtk.Toolbar, CustomizableCalObj):
	_name = 'toolbar'
	desc = _('Toolbar')
	#signals = CustomizableCalObj.signals + [
	#	('popup-main-menu', [int, int, int]),
	#]
	styleList = (
		## Gnome's naming is not exactly the best here
		## And Gnome's order of options is also different from Gtk's enum
		'Icon',## 'icons', 'Icons only'
		'Text',## 'text', 'Text only'
		'Text below Icon',## 'both', 'Text below items'
		'Text beside Icon',## 'both-horiz', 'Text beside items'
	)
	defaultItems = []
	defaultItemsDict = {}
	def __init__(self, funcOwner, vertical=False, onPressContinue=False):
		from scal3.ui_gtk.mywidgets.multi_spin.integer import IntSpinButton
		gtk.Toolbar.__init__(self)
		self.funcOwner = funcOwner
		self.set_orientation(gtk.Orientation.VERTICAL if vertical else gtk.Orientation.HORIZONTAL)
		self.add_events(gdk.EventMask.POINTER_MOTION_MASK)
		self.onPressContinue = onPressContinue
		self.remain = False
		self.lastPressTime = 0
		###
		optionsWidget = gtk.VBox()
		##
		hbox = gtk.HBox()
		pack(hbox, gtk.Label(_('Style')))
		self.styleCombo = gtk.ComboBoxText()
		for item in self.styleList:
			self.styleCombo.append_text(_(item))
		pack(hbox, self.styleCombo)
		pack(optionsWidget, hbox)
		##
		hbox = gtk.HBox()
		pack(hbox, gtk.Label(_('Icon Size')))
		self.iconSizeCombo = gtk.ComboBoxText()
		for (i, item) in enumerate(ud.iconSizeList):
			self.iconSizeCombo.append_text(_(item[0]))
		pack(hbox, self.iconSizeCombo)
		pack(optionsWidget, hbox)
		self.iconSizeHbox = hbox
		##
		hbox = gtk.HBox()
		pack(hbox, gtk.Label(_('Buttons Border')))
		self.buttonsBorderSpin = IntSpinButton(0, 99)
		pack(hbox, self.buttonsBorderSpin)
		pack(optionsWidget, hbox)
		##
		self.initVars(optionsWidget=optionsWidget)
		self.iconSizeCombo.connect('changed', self.iconSizeComboChanged)
		self.styleCombo.connect('changed', self.styleComboChanged)
		self.buttonsBorderSpin.connect('changed', self.buttonsBorderSpinChanged)
		#self.styleComboChanged()
		##
		#print('toolbar state', self.get_state()## STATE_NORMAL)
		#self.set_state(gtk.StateType.ACTIVE)## FIXME
		#self.set_property('border-width', 0)
		#style = self.get_style()
		#style.border_width = 10
		#self.set_style(style)
	getIconSizeName = lambda self: ud.iconSizeList[self.iconSizeCombo.get_active()][0]
	setIconSizeName = lambda self, size_name: self.set_icon_size(ud.iconSizeDict[size_name])
	## gtk.Toolbar.set_icon_size was previously Deprecated, but it's not Deprecated now!!
	def setButtonsBorder(self, bb):
		for item in self.items:
			item.set_border_width(bb)
	def iconSizeComboChanged(self, combo=None):
		self.setIconSizeName(self.getIconSizeName())
	def styleComboChanged(self, combo=None):
		style = self.styleCombo.get_active()
		self.set_style(style)
		#self.showHide()## FIXME
		self.iconSizeHbox.set_sensitive(style!=1)
	def buttonsBorderSpinChanged(self, spin=None):
		self.setButtonsBorder(self.buttonsBorderSpin.get_value())
	def moveItemUp(self, i):
		button = self.items[i]
		self.remove(button)
		self.insert(button, i-1)
		self.items.insert(i-1, self.items.pop(i))
	#def insertItem(self, item, pos):
	#	CustomizableCalObj.insertItem(self, pos, item)
	#	gtk.Toolbar.insert(self, item, pos)
	#	item.show()
	def appendItem(self, item):
		CustomizableCalObj.appendItem(self, item)
		gtk.Toolbar.insert(self, item, -1)
		if item.enable:
			item.show()
	getData = lambda self: {
		'items': self.getItemsData(),
		'iconSize': self.getIconSizeName(),
		'style': self.styleList[self.styleCombo.get_active()],
		'buttonsBorder': self.buttonsBorderSpin.get_value(),
	}
	def setupItemSignals(self, item):
		if item.method:
#.........这里部分代码省略.........
开发者ID:ubuntu-ir,项目名称:starcal,代码行数:103,代码来源:toolbar.py


注:本文中的scal3.ui_gtk.mywidgets.multi_spin.integer.IntSpinButton.connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。