예제 #1
0
    def __init__(self,
                 text="",
                 length=20,
                 max_length=None,
                 padding=0,
                 on_input=None):
        Viewer.__init__(self)
        FocusMixin.__init__(self)

        self._document = pyglet.text.document.UnformattedDocument(text)
        self._document_style_set = False  # check if style of document was set.

        self._length = length  # the length of the box in characters
        self._max_length = max_length  # the max length allowed for writing.
        self._on_input = on_input

        self._padding = 4 + padding

        # graphics loaded in both states
        self._field = None

        # graphics loaded in state "writing"
        self._text_layout = None
        self._caret = None

        # graphics loaded in state "label"
        self._label = None
예제 #2
0
    def __init__(self, text="", length=20, max_length=None, padding=0, on_input=None):
        Viewer.__init__(self)
        FocusMixin.__init__(self)

        self._document = pyglet.text.document.UnformattedDocument(text)
        self._document_style_set = False  # check if style of document was set.

        self._length = length  # the length of the box in characters
        self._max_length = max_length  # the max length allowed for writing.
        self._on_input = on_input

        self._padding = 4 + padding

        # graphics loaded in both states
        self._field = None

        # graphics loaded in state "writing"
        self._text_layout = None
        self._caret = None

        # graphics loaded in state "label"
        self._label = None
예제 #3
0
    def __init__(self,
                 text="",
                 length=20,
                 max_length=None,
                 font=None,
                 padding=0,
                 on_input=None,
                 width=None,
                 height=None,
                 font_size=None,
                 font_color=None,
                 multiline=False):
        Viewer.__init__(self)
        FocusMixin.__init__(self)

        self._document = pyglet.text.document.UnformattedDocument(text)
        self._document_style_set = False  # check if style of document was set.

        self._length = length  # the length of the box in characters
        self._max_length = max_length  # the max length allowed for writing.
        self._on_input = on_input
        self.focused = False
        self._padding = 4 + padding
        # graphics loaded in both states
        self._field = None
        self.w1 = width
        self.h1 = height
        self._fs = font_size
        # graphics loaded in state "writing"
        self._text_layout = None
        self._caret = None
        self._font = font
        self._font_color = font_color
        # graphics loaded in state "label"
        self._label = None
        self.ml = multiline
        self._caret_height = 0
예제 #4
0
 def __init__(self, label="", is_pressed=False, on_press=None):
     Button.__init__(self, label, is_pressed, on_press)
     FocusMixin.__init__(self)
예제 #5
0
 def __init__(self, label="", is_pressed=False, on_press=None):
     Button.__init__(self, label, is_pressed, on_press)
     FocusMixin.__init__(self)
예제 #6
0
 def __init__(self, text, is_pressed=False, on_press=None):
     Button.__init__(self, text, is_pressed, on_press)
     FocusMixin.__init__(self)
예제 #7
0
 def __init__(self, label="", is_pressed=False, on_press=None,width=0,height=0,path=None):
     Button.__init__(self, label, is_pressed, on_press,width,height,path=path)
     FocusMixin.__init__(self)