Main Page | Class Hierarchy | Class List | File List | Class Members

Flu_Spinner.h

00001 // $Id: Flu_Spinner.h,v 1.10 2004/06/21 23:30:07 jbryan Exp $
00002 
00003 /***************************************************************
00004  *                FLU - FLTK Utility Widgets 
00005  *  Copyright (C) 2002 Ohio Supercomputer Center, Ohio State University
00006  *
00007  * This file and its content is protected by a software license.
00008  * You should have received a copy of this license with this file.
00009  * If not, please contact the Ohio Supercomputer Center immediately:
00010  * Attn: Jason Bryan Re: FLU 1224 Kinnear Rd, Columbus, Ohio 43212
00011  * 
00012  ***************************************************************/
00013 
00014 
00015 
00016 #ifndef _FLU_SPINNER_H
00017 #define _FLU_SPINNER_H
00018 
00019 #include <FL/Fl_Valuator.H>
00020 #include <FL/Fl_Input.H>
00021 #include <FL/Fl_Group.H>
00022 
00023 #include "FLU/Flu_Enumerations.h"
00024 
00026 class FLU_EXPORT Flu_Spinner : public Fl_Valuator
00027 {
00028 
00029   class NoTabInput : public Fl_Input
00030     {
00031     public:
00032       NoTabInput( Flu_Spinner *s, int x, int y, int w, int h, const char *l = 0 );
00033       int handle( int event );
00034       void draw();
00035       Flu_Spinner *spinner;
00036     };
00037 
00038 public:
00039 
00041   Flu_Spinner( int x, int y, int w, int h, const char *l = 0 );
00042 
00044   ~Flu_Spinner();
00045 
00047   inline bool enable_repeating() const
00048     { return _doRepeat; }
00049 
00051   inline void enable_repeating( bool b )
00052     { _doRepeat = b; }
00053 
00055 
00060   inline void repeat( float initialDelay, float initialTime, float rapidDelay, float rapidTime )
00061     { _initialDelay = initialDelay; _repeatTime[0] = initialTime; _rapidDelay = rapidDelay;_repeatTime[1] = rapidTime; }
00062 
00064   inline int input_when() const
00065     { return _input.when(); }
00066 
00068   inline void input_when( int w )
00069     { _input.when(w); }
00070 
00072   inline bool editable() const
00073     { return _editable; }
00074 
00076   inline void editable( bool b )
00077     { _editable = b; }
00078 
00080   int handle( int );
00081 
00083   void resize( int X, int Y, int W, int H );
00084 
00086   inline void precision( int p )
00087     { Fl_Valuator::precision(p); value_damage(); }
00088 
00090   void value_damage();
00091 
00093   inline void hide()
00094     { Fl_Valuator::hide(); _input.hide(); }
00095 
00097   inline void show()
00098     { Fl_Valuator::show(); _input.show(); }
00099 
00101   inline Fl_Font valuefont() const { return (Fl_Font)_input.textfont(); }
00102 
00104   inline void valuefont( uchar s ) { _input.textfont(s); }
00105 
00107   inline uchar valuesize() const { return _input.textsize(); }
00108 
00110   inline void valuesize( uchar s ) { _input.textsize(s); }
00111 
00113   inline Fl_Color valuecolor() const { return (Fl_Color)_input.color(); }
00114 
00116   inline void valuecolor( unsigned s ) { _input.color(s); }
00117 
00119   inline void valuecolor( unsigned s, unsigned s1 ) { _input.color(s,s1); }
00120 
00122   inline Fl_Color valuefontcolor() const { return (Fl_Color)_input.textcolor(); }
00123 
00125   inline void valuefontcolor( unsigned s ) { _input.textcolor(s); }
00126 
00127 protected:
00128 
00129   friend class NoTabInput;
00130 
00131   NoTabInput _input;
00132   uchar _valbox[2];
00133   bool _up, _pushed, _editable, _dragging;
00134   float _totalTime;
00135   double _lastValue;
00136   int _lastY;
00137   float _initialDelay, _repeatTime[2], _rapidDelay;
00138   bool _doRepeat;
00139 
00140   static void input_cb( Fl_Widget*, void* v );
00141   static void repeat_callback(void *);
00142   void increment_cb();
00143 
00144 protected:
00145 
00146   void draw();
00147 
00148 };
00149 
00150 #endif

Generated on Mon Aug 2 10:27:46 2004 for FLTK Utility Library and Widget Collection (FLU) by doxygen 1.3.5