00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef Fl_Button_H
00023 #define Fl_Button_H
00024
00025 #ifndef Fl_Widget_H
00026 #include "Fl_Widget.H"
00027 #endif
00028
00029
00030 #define FL_NORMAL_BUTTON 0
00032 #define FL_TOGGLE_BUTTON 1
00033 #define FL_RADIO_BUTTON (FL_RESERVED_TYPE+2)
00036 #define FL_HIDDEN_BUTTON 3
00037
00038 extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
00039
00040 class Fl_Widget_Tracker;
00041
00076 class FL_EXPORT Fl_Button : public Fl_Widget {
00077
00078 int shortcut_;
00079 char value_;
00080 char oldval;
00081 uchar down_box_;
00082
00083 protected:
00084
00085 static Fl_Widget_Tracker *key_release_tracker;
00086 static void key_release_timeout(void*);
00087 void simulate_key_action();
00088
00089 virtual void draw();
00090
00091 public:
00092
00093 virtual int handle(int);
00094
00095 Fl_Button(int X, int Y, int W, int H, const char *L = 0);
00096
00097 int value(int v);
00098
00102 char value() const {return value_;}
00103
00108 int set() {return value(1);}
00109
00114 int clear() {return value(0);}
00115
00116 void setonly();
00117
00122 int shortcut() const {return shortcut_;}
00123
00143 void shortcut(int s) {shortcut_ = s;}
00144
00149 Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
00150
00160 void down_box(Fl_Boxtype b) {down_box_ = b;}
00161
00163 void shortcut(const char *s) {shortcut(fl_old_shortcut(s));}
00164
00166 Fl_Color down_color() const {return selection_color();}
00167
00169 void down_color(unsigned c) {selection_color(c);}
00170 };
00171
00172 #endif
00173
00174
00175
00176