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

void gcn::RadioButton::draw ( Graphics graphics  )  [virtual]

Draws the Widget. It is called by the parent widget when it is time for the Widget to draw itself. The graphics object is set up so that all drawing is relative to the Widget, i.e coordinate (0,0) is the top-left corner of the Widget. It is not possible to draw outside of a Widgets dimension.

graphics a Graphics object to draw with.

Implements gcn::Widget.

Definition at line 102 of file radiobutton.cpp.

References drawBox(), gcn::Graphics::drawRectangle(), gcn::Graphics::drawText(), getCaption(), gcn::Widget::getFont(), gcn::Widget::getForegroundColor(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), gcn::Widget::isFocused(), gcn::Graphics::setColor(), and gcn::Graphics::setFont().



        int h = getHeight() + getHeight() / 2;

        graphics->drawText(getCaption(), h - 2, 0);

        if (isFocused())
            graphics->drawRectangle(Rectangle(h - 4, 0, getWidth() - h + 3, getHeight()));

Generated by  Doxygen 1.6.0   Back to index