Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Button Class Reference

Buttons generate callbacks when they are clicked by the user. More...

#include <Fl_Button.h>

Inheritance diagram for Fl_Button:

Fl_Widget Fl_Check_Button Fl_Highlight_Button Fl_Repeat_Button Fl_Return_Button Fl_Toggle_Button Fl_Light_Button Fl_Radio_Button Fl_Radio_Light_Button Fl_Round_Button List of all members.

Public Types

enum  { NORMAL = 0, TOGGLE = 1, RADIO = 2, HIDDEN = 3 }
 values for type(int), which can be one of:. More...

Public Methods

 Fl_Button (int x, int y, int w, int h, const char *l=0)
 Creates the button widget using the position, size, and label.

 Fl_Button (const char *l=0, int layout_size=30, Fl_Align layout_al=FL_ALIGN_TOP)
 Creates the button using the label, size, and alignment.

bool value () const
bool value (bool)
bool set ()
 Same as value(true).

bool clear ()
 Same as value(false).

void setonly ()
 Turns on this button and turns off all other radio buttons in the group (calling value(true) or set() does not do this).

virtual void draw ()
virtual int handle (int event)
virtual void preferred_size (int &w, int &h) const

Static Public Attributes


Protected Methods

void draw (int glyph, int glyph_width) const

Detailed Description

Buttons generate callbacks when they are clicked by the user.

You control exactly when and how by changing the values for type() and when().

Buttons can also generate callbacks in response to FL_SHORTCUT events. The button can either have an explicit shortcut() value or a letter shortcut can be indicated in the label() with an '&' character before it. For the label shortcut it does not matter if Alt is held down, but if you have an input field in the same window, the user will have to hold down the Alt key so that the input field does not eat the event first as an FL_KEY event.

Definition at line 35 of file Fl_Button.h.

Member Enumeration Documentation

anonymous enum

values for type(int), which can be one of:.

Enumeration values:
NORMAL  The value is unchanged.
TOGGLE  The value is inverted.
RADIO  The value is set to 1, and all other buttons in the current group with type() == FL_RADIO_BUTTON are set to zero.
HIDDEN  The hidden button.

Definition at line 46 of file Fl_Button.h.

The documentation for this class was generated from the following file:
Generated on Thu Jul 31 15:33:46 2003 for eFLTK by doxygen1.2.15