예제 #1
0
    def __init__(self, parent='osd', x=None, y=None, width=0, height=0):
        GUIObject.__init__(self, x, y, width, height)

        if not parent or parent == 'osd':
            parent = self.osd.app_list[0]

        parent.add_child(self)

        self.osd.add_app(self)

        self.event_context = 'input'
        _debug_('window: setting context to %s' % self.event_context, 2)
        rc.set_context(self.event_context)

        if not width:
            self.width = self.osd.width / 2

        if not height:
            self.height = self.osd.height / 4

        if not self.left:
            self.left = self.osd.width / 2 - self.width / 2

        if not self.top:
            self.top = self.osd.height / 2 - self.height / 2
            self.center_on_screen = True

        self.internal_h_align = Align.CENTER
        self.internal_v_align = Align.CENTER
예제 #2
0
    def __init__(self, parent='osd', x=None, y=None, width=0, height=0):
        GUIObject.__init__(self, x, y, width, height)

        if not parent or parent == 'osd':
            global OSD_PARENT
            if OSD_PARENT is None:
                OSD_PARENT = GUIObject()
            parent = OSD_PARENT

        parent.add_child(self)


        self.event_context = 'input'

        if not width:
            self.width  = self.osd.width / 2

        if not height:
            self.height = self.osd.height / 4

        if not self.left:
            self.left = self.osd.width/2 - self.width/2

        if not self.top:
            self.top  = self.osd.height/2 - self.height/2
            self.center_on_screen = True

        self.internal_h_align = Align.CENTER
        self.internal_v_align = Align.CENTER

        self.refresh_abs_position()
예제 #3
0
    def __init__(self, type='frame', left=0, top=0, width=0, height=0,
                 bg_color=None, fg_color=None, selected_bg_color=None,
                 selected_fg_color=None, border=None, bd_color=None,
                 bd_width=None, vertical_expansion=0):

        GUIObject.__init__(self, left, top, width, height, bg_color, fg_color)

        self.layout_manager     = None
        self.border             = border
        self.bd_color           = bd_color
        self.bd_width           = bd_width
        self.vertical_expansion = vertical_expansion

        self.internal_h_align   = Align.LEFT
        self.internal_v_align   = Align.TOP
        self.h_spacing          = self.h_margin
        self.v_spacing          = self.v_margin

        if type == 'widget':
            ci = self.content_layout.types['selected'].rectangle
            self.selected_bg_color = selected_bg_color or Color(ci.bgcolor)
            self.selected_fg_color = selected_fg_color or Color(ci.color)

            if not self.bd_color:
                self.bd_color = Color(self.skin_info_widget.rectangle.color)

            if not self.bd_width:
                self.bd_width = self.skin_info_widget.rectangle.size

            if not self.border:
                self.border = Border(self, Border.BORDER_FLAT, self.bd_color, self.bd_width)

            elif border == -1:
                self.border = None
예제 #4
0
    def __init__content__(self):
        x, y, width, height = self.content_layout.x, self.content_layout.y, \
                              self.content_layout.width, self.content_layout.height
        width  = eval_attr(width, self.width) or self.width
        height = eval_attr(height, self.height) or self.height

        self.content = Container('frame', x, y, width, height, vertical_expansion=1)
        GUIObject.add_child(self, self.content)

        # adjust left to content
        self.left += (self.width - width-x) / 2

        self.content.internal_h_align = Align.CENTER
        self.content.internal_v_align = Align.CENTER
예제 #5
0
    def __init__(self,
                 type='frame',
                 left=0,
                 top=0,
                 width=0,
                 height=0,
                 bg_color=None,
                 fg_color=None,
                 selected_bg_color=None,
                 selected_fg_color=None,
                 border=None,
                 bd_color=None,
                 bd_width=None,
                 vertical_expansion=0):

        GUIObject.__init__(self, left, top, width, height, bg_color, fg_color)

        self.layout_manager = None
        self.border = border
        self.bd_color = bd_color
        self.bd_width = bd_width
        self.vertical_expansion = vertical_expansion

        self.internal_h_align = Align.LEFT
        self.internal_v_align = Align.TOP
        self.h_spacing = self.h_margin
        self.v_spacing = self.v_margin

        if type == 'widget':
            ci = self.content_layout.types['selected'].rectangle
            self.selected_bg_color = selected_bg_color or Color(ci.bgcolor)
            self.selected_fg_color = selected_fg_color or Color(ci.color)

            if not self.bd_color:
                self.bd_color = Color(self.skin_info_widget.rectangle.color)

            if not self.bd_width:
                self.bd_width = self.skin_info_widget.rectangle.size

            if not self.border:
                self.border = Border(self, Border.BORDER_FLAT, self.bd_color,
                                     self.bd_width)

            elif border == -1:
                self.border = None