00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef Fl_Button_H
00032 #define Fl_Button_H
00033
00034 #ifndef Fl_Widget_H
00035 #include "Fl_Widget.H"
00036 #endif
00037
00038
00039 #define FL_NORMAL_BUTTON 0
00041 #define FL_TOGGLE_BUTTON 1
00042 #define FL_RADIO_BUTTON (FL_RESERVED_TYPE+2)
00045 #define FL_HIDDEN_BUTTON 3
00046
00047 extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
00048
00049 class Fl_Widget_Tracker;
00050
00084 class FL_EXPORT Fl_Button : public Fl_Widget {
00085
00086 int shortcut_;
00087 char value_;
00088 char oldval;
00089 uchar down_box_;
00090
00091 protected:
00092
00093 static Fl_Widget_Tracker *key_release_tracker;
00094 static void key_release_timeout(void*);
00095 void simulate_key_action();
00096
00097 virtual void draw();
00098
00099 public:
00100
00101 virtual int handle(int);
00102
00103 Fl_Button(int X, int Y, int W, int H, const char *L = 0);
00104
00105 int value(int v);
00106
00110 char value() const {return value_;}
00111
00116 int set() {return value(1);}
00117
00122 int clear() {return value(0);}
00123
00124 void setonly();
00125
00130 int shortcut() const {return shortcut_;}
00131
00151 void shortcut(int s) {shortcut_ = s;}
00152
00157 Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
00158
00164 void down_box(Fl_Boxtype b) {down_box_ = b;}
00165
00167 void shortcut(const char *s) {shortcut(fl_old_shortcut(s));}
00168
00170 Fl_Color down_color() const {return selection_color();}
00171
00173 void down_color(unsigned c) {selection_color(c);}
00174 };
00175
00176 #endif
00177
00178
00179
00180