def __init__(self, x, y, text, parent, c=(255,0,0)):
		Button.__init__(self, x, y, text, parent, c)
		self.font = pygame.font.SysFont('Calibri', 12)
		self.width -= 10
		self.height = 20
		self.surface = pygame.Surface((self.width, self.height))
		self.render()
Esempio n. 2
0
    def __init__ (self, text):
        Button.__init__ (self, text)

        # Internal click handler
        self.__click = False
        self._active = False
        
        # The ToggleButton emits a 'toggled' event.
        self._signals[SIG_TOGGLED] = []
Esempio n. 3
0
 def __init__(self, parent, **kwargs):
     Button.__init__(self, parent)
     # data
     self.direction = Const.ALIGN_N
     # del
     del self.text
     del self.icons
     # flags
     self.processKWArguments(kwargs)
     parent.registerWidget(self)
Esempio n. 4
0
	def __init__(self, parent, **kwargs):
		Button.__init__(self, parent)
		# data
		self.direction = ALIGN_N
		# del
		del self.text
		del self.icons
		# flags
		self.processKWArguments(kwargs)
		parent.registerWidget(self)
Esempio n. 5
0
    def __init__ (self, caption, _props={}):
        # Properties
        props = _props.copy()
        if 'class' in props:
            props['class'] += ' druid-button'
        else:
            props['class'] = 'druid-button'

        # Parent's constructor
        Button.__init__ (self, caption, props)
Esempio n. 6
0
    def __init__(self, caption, _props={}):
        # Properties
        props = _props.copy()
        if 'class' in props:
            props['class'] += ' druid-button'
        else:
            props['class'] = 'druid-button'

        # Parent's constructor
        Button.__init__(self, caption, props)
Esempio n. 7
0
 def __init__(self, pX, pY, pText, pColor=BLACK, pFontSize=36, pMethod=None, pName=None, pParams=None):
     '''
     Constructor
     '''
     if pName == None:
         name = pText
     else:
         name = pName
     Button.__init__(self, pX, pY, pName=name, pMethod=pMethod, pParams=pParams)
     font = pygame.font.Font(None, pFontSize)
     self.text = font.render(pText, 1, (pColor))
Esempio n. 8
0
    def __init__(self, button_pin=29, led_pin=31):
        # GPIO interaction
        Button.__init__(self, pin=button_pin)
        LED.__init__(self, pin=led_pin)
        GPIO.add_event_callback(self.button_pin, callback=self.listener)
        # for record
        self.pa = None
        self.stream = None
        self.frames = None
        # check button state
        self.button_pressed = None

        while True:
            time.sleep(.01)
Esempio n. 9
0
    def __init__(self,
                 text=' ',
                 x=None,
                 y=None,
                 width=35,
                 height=35,
                 bg_color=None,
                 fg_color=None,
                 selected_bg_color=None,
                 selected_fg_color=None):

        self.upper_case = True
        self.max_width = width

        Button.__init__(self,
                        text,
                        None,
                        x,
                        y,
                        width,
                        height,
                        bg_color,
                        fg_color,
                        selected_bg_color,
                        selected_fg_color,
                        border=None)

        self.h_margin = 0
        self.v_margin = 0
        self.h_spacing = 0
        self.v_spacing = 0
        self.set_v_align(Align.BOTTOM)
        self.set_h_align(Align.CENTER)
        self.label.set_v_align(Align.CENTER)
        self.label.set_h_align(Align.CENTER)

        for c in copy.copy(self.children):
            if isinstance(c, Border):
                self.children.remove(c)

        self.border = -1
Esempio n. 10
0
    def __init__(self, text=' ', x=None, y=None, width=35, height=35,
                 bg_color=None, fg_color=None, selected_bg_color=None,
                 selected_fg_color=None):

        self.upper_case = True
        self.max_width  = width

        Button.__init__(self, text, None, x, y, width, height, bg_color,
                        fg_color, selected_bg_color, selected_fg_color, border=None)

        self.h_margin  = 0
        self.v_margin  = 0
        self.h_spacing = 0
        self.v_spacing = 0
        self.set_v_align(Align.BOTTOM)
        self.set_h_align(Align.CENTER)
        self.label.set_v_align(Align.CENTER)
        self.label.set_h_align(Align.CENTER)

        for c in copy.copy(self.children):
            if isinstance(c, Border):
                self.children.remove(c)

        self.border = -1
Esempio n. 11
0
 def __init__(self, parent, **kwargs):
     Button.__init__(self, parent)
     # data
     # flags
     self.processKWArguments(kwargs)
     parent.registerWidget(self)
Esempio n. 12
0
 def __init__(self, parent, **kwargs):
     Button.__init__(self, parent)
     # data
     # flags
     self.processKWArguments(kwargs)
     parent.registerWidget(self)
Esempio n. 13
0
 def __init__(self, component):
     Button.__init__(self, component)
     self.buttonStyle = Button.CHECKBOX_STYLE
Esempio n. 14
0
 def __init__(self, caption="Submit"):
     Button.__init__(self, caption)
Esempio n. 15
0
 def __init__(self, x, y, button_text, game):
     Button.__init__(self, x, y, button_text)
     self.game = game
Esempio n. 16
0
    def __init__(self, icon):

        Button.__init__(self, "", icon)
        self.set_images(theme.ui_toolbar_button_1, theme.ui_toolbar_button_2)
Esempio n. 17
0
 def __init__(self, component):
     Button.__init__(self, component)
     self.buttonStyle = Button.CHECKBOX_STYLE
Esempio n. 18
0
 def __init__(self, text, x, y, width, height, paddle):
     Button.__init__(self, text, x, y, width, height)
     self.paddle = paddle
Esempio n. 19
0
 def __init__ (self, caption="Submit"):
     Button.__init__ (self, caption)
Esempio n. 20
0
 def __init__ (self, image):
     Button.__init__ (self, "")
     self._picture = None
     self._path = None
     self.set_picture (image)
Esempio n. 21
0
 def __init__(self, parent=None, name=None):
     Button.__init__(self, parent, name)
     self.setFixedSize(ITEM_SIZE)
Esempio n. 22
0
 def __init__(self, texture):
     Button.__init__(self, texture)