• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_Button.H

00001 //
00002 // "$Id$"
00003 //
00004 // Button header file for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2014 by Bill Spitzak and others.
00007 //
00008 // This library is free software. Distribution and use rights are outlined in
00009 // the file "COPYING" which should have been included with this file. If this
00010 // file is missing or damaged, see the license at:
00011 //
00012 //     http://www.fltk.org/COPYING.php
00013 //
00014 // Please report all bugs and problems on the following page:
00015 //
00016 //     http://www.fltk.org/str.php
00017 //
00018 
00019 /* \file
00020    Fl_Button widget . */
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 // values for type()
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(); // this should only be called on FL_RADIO_BUTTONs
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 // End of "$Id$".
00176 //
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.