Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Slider.h

00001 /*
00002  * $Id: Fl_Slider.h,v 1.4 2003/03/30 20:40:48 parshin Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_SLIDER_H_
00023 #define _FL_SLIDER_H_
00024 
00025 #include "Fl_Valuator.h"
00026 
00028 class FL_API Fl_Slider : public Fl_Valuator {
00029 public:
00030     static Fl_Named_Style* default_style;
00031 
00033     Fl_Slider(int x,int y,int w,int h, const char *l = 0);
00034 
00036     Fl_Slider(const char* l = 0,int layout_size=30,Fl_Align layout_al=FL_ALIGN_TOP,int label_w=100);
00037 
00038     enum { // bit flags for type():
00039         VERTICAL        = 0,
00040         HORIZONTAL      = 1,
00041         TICK_ABOVE      = 2,
00042         TICK_LEFT       = TICK_ABOVE,
00043         TICK_BELOW      = 4,
00044         TICK_RIGHT      = TICK_BELOW,
00045         TICK_BOTH       = TICK_ABOVE|TICK_BELOW,
00046         LOG         = 8,
00047         FILL        = 16 // for back compatability only
00048     };
00049 
00050     bool horizontal() const {return (type()&HORIZONTAL)!=0;}
00051     bool log() const {return (type()&LOG)!=0;}
00052 
00053     unsigned short slider_size() const {return slider_size_;}
00054     void slider_size(int n) {slider_size_ = (unsigned short)n;}
00055 
00056     unsigned short tick_size() const {return tick_size_;}
00057     void tick_size(int n) {tick_size_ = (unsigned short)n;}
00058 
00059     virtual void draw();
00060     virtual int handle(int);
00061 
00062 protected:
00063     int slider_position(double value, int w);
00064     double position_value(int x, int w);
00065     int handle(int event, int, int, int, int);
00066     void draw_ticks(int,int,int,int, int min_spacing);
00067     bool draw(int, int, int, int, Fl_Flags flags, bool slot);
00068 
00069 private:
00070     unsigned short slider_size_;
00071     unsigned short tick_size_;
00072     unsigned short old_position;
00073 };
00074 
00075 #endif

Generated on Thu Jul 31 15:33:45 2003 for eFLTK by doxygen1.2.15