Fl_Light_Button Class Reference

This subclass displays the "on" state by turning on a light, rather than drawing pushed in. More...

#include <Fl_Light_Button.H>

Inheritance diagram for Fl_Light_Button:
Fl_Button Fl_Widget Fl_Check_Button Fl_Radio_Light_Button Fl_Round_Button Fl_Radio_Round_Button

List of all members.

Public Member Functions

 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.
virtual int handle (int)
 Handles the specified event.

Protected Member Functions

virtual void draw ()
 Draws the widget.

Detailed Description

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().

Fl_Light_Button.png

Constructor & Destructor Documentation

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.


Member Function Documentation

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.

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.

Parameters:
[in] event the kind of event received
Return values:
0 if the event was not used or understood
1 if the event was used and can be deleted
See also:
Fl_Event

Reimplemented from Fl_Button.


The documentation for this class was generated from the following files: