|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include <Fl_Light_Button.H>


Public Member Functions | |
| virtual int | handle (int) |
| Fl_Light_Button (int x, int y, int w, int h, const char *l=0) | |
Protected Member Functions | |
| virtual void | draw () |
This subclass displays the "on" state by turning on a light, rather than drawing pushed in. The shape of the "light" is initially set to FL_DOWN_BOX. The color of the light when on is controlled with selection_color(), which defaults to FL_YELLOW.
Buttons generate callbacks when they are clicked by the user. You control exactly when and how by changing the values for type() and when().
Definition at line 47 of file Fl_Light_Button.H.
| Fl_Light_Button::Fl_Light_Button | ( | int | X, |
| int | Y, | ||
| int | W, | ||
| int | H, | ||
| const char * | l = 0 |
||
| ) |
Creates a new Fl_Light_Button widget using the given position, size, and label string.
The destructor deletes the check button.
Definition at line 165 of file Fl_Light_Button.cxx.
References Fl_Widget::align(), FL_ALIGN_INSIDE, FL_ALIGN_LEFT, FL_TOGGLE_BUTTON, FL_YELLOW, Fl_Widget::selection_color(), and Fl_Widget::type().
| void Fl_Light_Button::draw | ( | ) | [protected, virtual] |
Draws the widget. Never call this function directly. FLTK will schedule redrawing whenever needed. If your widget must be redrawn as soon as possible, call redraw() instead.
Override this function to draw your own widgets.
If you ever need to call another widget's draw method from within your own draw() method, e.g. for an embedded scrollbar, you can do it (because draw() is virtual) like this:
Fl_Widget *s = &scroll; // scroll is an embedded Fl_Scrollbar s->draw(); // calls Fl_Scrollbar::draw()
Reimplemented from Fl_Button.
Definition at line 40 of file Fl_Light_Button.cxx.
References _FL_PLASTIC_DOWN_BOX, _FL_PLASTIC_UP_BOX, _FL_ROUND_DOWN_BOX, _FL_ROUND_UP_BOX, Fl_Widget::active_r(), Fl_Widget::box(), Fl::box_dw(), Fl::box_dx(), Fl_Widget::color(), Fl_Button::down_box(), Fl_Widget::draw_box(), Fl_Widget::draw_focus(), Fl_Widget::draw_label(), dx, dy, f, fl_arc(), FL_BACKGROUND2_COLOR, FL_BLACK, fl_color(), fl_color_average(), fl_down(), FL_DOWN_BOX, fl_inactive(), fl_line(), fl_pie(), fl_rectf(), FL_SELECTION_COLOR, FL_THIN_DOWN_BOX, FL_UP_BOX, FL_WHITE, Fl::focus(), Fl_Widget::h(), Fl_Widget::labelsize(), Fl::pushed(), Fl::scheme(), Fl_Widget::selection_color(), Fl_Button::value(), Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().
| int Fl_Light_Button::handle | ( | int | event | ) | [virtual] |
Handles the specified event. You normally don't call this method directly, but instead let FLTK do it when the user interacts with the widget.
When implemented in a widget, this function must return 0 if the widget does not use the event or 1 otherwise.
Most of the time, you want to call the inherited handle() method in your overridden method so that you don't short-circuit events that you don't handle. In this last case you should return the callee retval.
| [in] | event | the kind of event received |
| 0 | if the event was not used or understood |
| 1 | if the event was used and can be deleted |
Reimplemented from Fl_Button.
Definition at line 151 of file Fl_Light_Button.cxx.
References Fl_Widget::box(), FL_RELEASE, and Fl_Widget::redraw().