fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Button.H
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Button header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2014 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
19 /* \file
20  Fl_Button widget . */
21 
22 #ifndef Fl_Button_H
23 #define Fl_Button_H
24 
25 #ifndef Fl_Widget_H
26 #include "Fl_Widget.H"
27 #endif
28 
29 // values for type()
30 #define FL_NORMAL_BUTTON 0
32 #define FL_TOGGLE_BUTTON 1
33 #define FL_RADIO_BUTTON (FL_RESERVED_TYPE+2)
36 #define FL_HIDDEN_BUTTON 3
37 
38 extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
39 
40 class Fl_Widget_Tracker;
41 
76 class FL_EXPORT Fl_Button : public Fl_Widget {
77 
78  int shortcut_;
79  char value_;
80  char oldval;
81  uchar down_box_;
82 
83 protected:
84 
85  static Fl_Widget_Tracker *key_release_tracker;
86  static void key_release_timeout(void*);
87  void simulate_key_action();
88 
89  virtual void draw();
90 
91 public:
92 
93  virtual int handle(int);
94 
95  Fl_Button(int X, int Y, int W, int H, const char *L = 0);
96 
97  int value(int v);
98 
102  char value() const {return value_;}
103 
108  int set() {return value(1);}
109 
114  int clear() {return value(0);}
115 
116  void setonly(); // this should only be called on FL_RADIO_BUTTONs
117 
122  int shortcut() const {return shortcut_;}
123 
143  void shortcut(int s) {shortcut_ = s;}
144 
149  Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
150 
160  void down_box(Fl_Boxtype b) {down_box_ = b;}
161 
163  void shortcut(const char *s) {shortcut(fl_old_shortcut(s));}
164 
166  Fl_Color down_color() const {return selection_color();}
167 
169  void down_color(unsigned c) {selection_color(c);}
170 };
171 
172 #endif
173 
174 //
175 // End of "$Id$".
176 //
Fl_Widget.H
Fl_Color
unsigned int Fl_Color
Definition: Enumerations.H:934
Fl_Boxtype
Fl_Boxtype
Definition: Enumerations.H:603
Fl_Button
Buttons generate callbacks when they are clicked by the user.
Definition: Fl_Button.H:79
down_box
static void down_box(int x, int y, int w, int h, Fl_Color c)
Definition: fl_gleam.cxx:159
H
static int H
Definition: Fl_Tooltip.cxx:76
Fl_Shortcut
unsigned int Fl_Shortcut
Definition: fl_types.h:46
b
long b
Definition: jpegint.h:397
FL_EXPORT
#define FL_EXPORT
Definition: Fl_Export.H:35
Fl_Widget::selection_color
Fl_Color selection_color() const
Definition: Fl_Widget.H:396
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Button::down_color
Fl_Color down_color() const
(for backwards compatibility)
Definition: Fl_Button.H:169
Fl_Widget_Tracker
Definition: Fl.H:1371
Fl_Widget::handle
virtual int handle(int event)
Definition: Fl_Widget.cxx:112
clear
void clear()
Definition: gl2opengl.h:12
fl_old_shortcut
Fl_Shortcut fl_old_shortcut(const char *)
Definition: fl_shortcut.cxx:396
Fl_Widget::draw
virtual void draw()=0
set
int set
Definition: fl_boxtype.cxx:287
Y
static int Y
Definition: Fl_Tooltip.cxx:76
uchar
unsigned char uchar
Definition: fl_types.h:30