Exemple #1
0
    def __init__(self, menu = None, padding = 5, submenu_offset_x = 2, submenu_offset_y = 2,
                 x_align = 0, y_align = 0.5, pressed_offset = 0,
                 secondary_label = "", mnemonic = "", **kwargs):
        Button.__init__(self, padding=padding, pressed_offset = pressed_offset, x_align = x_align, y_align = y_align, **kwargs)

        self.expand = False

        #: submenu of the item
        self.menu = menu

        self.selected = False

        #: if specified will push the submeny by the given pixels
        self.submenu_offset_x = submenu_offset_x

        #: if specified will push the submeny by the given pixels
        self.submenu_offset_y = submenu_offset_y

        #: the secondary label element
        self.secondary_display_label = self.secondary_label_class("",
                                                                  color = "#666",
                                                                  fill=True,
                                                                  x_align=1,
                                                                  padding_right = 5,
                                                                  visible = True)
        self.container.add_child(self.secondary_display_label)

        #: text of the secondary label that is placed to the right of the primary
        self.secondary_label = secondary_label

        #: keypress that can also triger activation of this menu item
        #: This is string in for "Key+Key+Key". For example: "Shift+c"
        self.mnemonic = mnemonic

        self.connect("on-mnemonic-activated", self.on_mnemonic_activated)
Exemple #2
0
    def __init__(self,
                 menu=None,
                 padding=5,
                 submenu_offset_x=2,
                 submenu_offset_y=2,
                 x_align=0,
                 y_align=0.5,
                 pressed_offset=0,
                 secondary_label="",
                 mnemonic="",
                 **kwargs):
        Button.__init__(self,
                        padding=padding,
                        pressed_offset=pressed_offset,
                        x_align=x_align,
                        y_align=y_align,
                        **kwargs)

        self.expand = False

        #: submenu of the item
        self.menu = menu

        self.selected = False

        #: if specified will push the submeny by the given pixels
        self.submenu_offset_x = submenu_offset_x

        #: if specified will push the submeny by the given pixels
        self.submenu_offset_y = submenu_offset_y

        #: the secondary label element
        self.secondary_display_label = self.secondary_label_class(
            "",
            color="#666",
            fill=True,
            x_align=1,
            padding_right=5,
            visible=True)
        self.container.add_child(self.secondary_display_label)

        #: text of the secondary label that is placed to the right of the primary
        self.secondary_label = secondary_label

        #: keypress that can also triger activation of this menu item
        #: This is string in for "Key+Key+Key". For example: "Shift+c"
        self.mnemonic = mnemonic

        self.connect("on-mnemonic-activated", self.on_mnemonic_activated)
Exemple #3
0
    def __init__(self,
                 up=True,
                 expand=False,
                 width=15,
                 padding=0,
                 repeat_down_delay=100,
                 **kwargs):

        Button.__init__(self,
                        expand=expand,
                        width=width,
                        padding=padding,
                        repeat_down_delay=repeat_down_delay,
                        **kwargs)
        self.up = up
Exemple #4
0
    def __init__(self, padding = 0, direction = "up", **kwargs):
        Button.__init__(self, padding = padding, **kwargs)
        self.expand = False

        #: button direction - one of "up", "down", "left", "right"
        self.direction = direction
Exemple #5
0
 def __init__(self, padding = 0, **kwargs):
     Button.__init__(self, padding = padding, **kwargs)
     self.draggable = True
     self.expand = False
     self.connect("on-drag", self.on_drag)
Exemple #6
0
 def __init__(self, onset):
     Button.__init__(self, "Not ready", None)
     self.focused = False
     self.lastKey = 0
     self.onSet = onset
Exemple #7
0
    def __init__(self, padding=0, direction="up", **kwargs):
        Button.__init__(self, padding=padding, **kwargs)
        self.expand = False

        #: button direction - one of "up", "down", "left", "right"
        self.direction = direction
Exemple #8
0
 def __init__(self, padding=0, **kwargs):
     Button.__init__(self, padding=padding, **kwargs)
     self.draggable = True
     self.expand = False
     self.connect("on-drag", self.on_drag)
Exemple #9
0
 def __init__(self, text):
     Button.__init__(self, text)
     self.color = "#444"
     self.get_min_size = lambda: (0, Label.get_min_size(self)[1])
Exemple #10
0
    def __init__(self, up=True, expand=False, width = 15, padding=0, repeat_down_delay = 100, **kwargs):

        Button.__init__(self, expand=expand, width=width, padding=padding,
                        repeat_down_delay=repeat_down_delay, **kwargs)
        self.up = up
 def __init__(self, **kwargs):
     Button.__init__(self, **kwargs)
     self.padding = 0
     self.margin = 0
     self.draggable = True
     self.connect("on-drag-finish", self.__on_drag_finish)
Exemple #12
0
 def __init__(self, label="", pressed_offset=0, expanded=False, **kwargs):
     Button.__init__(self,
                     label=label,
                     pressed_offset=pressed_offset,
                     **kwargs)
     self.expanded = expanded
Exemple #13
0
 def __init__(self, label="", pressed_offset = 0, expanded = False, **kwargs):
     Button.__init__(self, label=label, pressed_offset = pressed_offset, **kwargs)
     self.expanded = expanded
Exemple #14
0
 def __init__(self, text):
     Button.__init__(self, text)
     self.color = "#444"
     self.get_min_size = lambda: (0, Label.get_min_size(self)[1])