Logo Search packages:      
Sourcecode: ocempgui version File versions  Download package

def themes::default::DefaultEngine::DefaultEngine::draw_radiobutton (   self,
  button 
)

D.draw_radiobutton (button) -> Surface

Creates the surface for the passed RadioButton widget.

Definition at line 969 of file DefaultEngine.py.

00969                                        :
        """D.draw_radiobutton (button) -> Surface

        Creates the surface for the passed RadioButton widget.
        """
        cls = button.__class__
        active = StyleInformation.get ("ACTIVE_BORDER")
        border = self.style.get_border_size (cls, button.style, active)
        radiosize = StyleInformation.get ("RADIO_SIZE")
        
        # Create the absolute sizes of the surface, including the
        # padding and.
        width = 2 * (button.padding + border)
        height = 2 * (button.padding + border)
        if button.child:
            width += button.child.width
            height += button.child.height

        # Create radio box.
        rect_radio = pygame.Rect (button.padding, button.padding, radiosize,
                                  radiosize)

        # The layout looks like:
        #  ----------------
        #  | X | child    |
        #  ----------------
        # Check   Child
        # Thus we have to add a specific spacing between the child and the
        # check. By default we will use the given StyleInformation value.
        width += rect_radio.width + StyleInformation.get ("RADIO_SPACING")
        if height < rect_radio.height:
            # Do not forget to add the padding!
            height = rect_radio.height + 2 * button.padding

        # Guarantee size.
        width, height = button.check_sizes (width, height)

        # The surface on which both components will be placed.
        surface = self.draw_rect (width, height, button.state, cls,
                                  button.style)
        rect_surface = surface.get_rect ()

        rect_radio.centery = rect_surface.centery
        self.draw_radio (surface, rect_radio, button.active, button.state, cls,
                         button.style)

        # Draw a dashed border around the label, if the button has
        # focus.
        if button.focus:
            r = None
            if button.child:
                r = button.child.rect
                r.x -= border
                r.y -= border
                r.width += 2 * border
                r.height += 2 * border
            else:
                r = rect_surface
                r.topleft = (border, border)
                r.width -= 2 * border
                r.height -= 2 * border

            self.draw_border (surface, button.state, cls, button.style, active,
                              r, StyleInformation.get ("ACTIVE_BORDER_SPACE"))

        return surface

    def draw_progressbar (self, bar):


Generated by  Doxygen 1.6.0   Back to index