Mixer: Fix receiving of direct OSC messages.
[nondaw.git] / FL / Fl_Arc_Dial.H
blob2df8084b06cd774647060113db27bd34367cd0b8
2 /*******************************************************************************/
3 /* Copyright (C) 2008 Jonathan Moore Liles                                     */
4 /*                                                                             */
5 /* This program is free software; you can redistribute it and/or modify it     */
6 /* under the terms of the GNU General Public License as published by the       */
7 /* Free Software Foundation; either version 2 of the License, or (at your      */
8 /* option) any later version.                                                  */
9 /*                                                                             */
10 /* This program is distributed in the hope that it will be useful, but WITHOUT */
11 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       */
12 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for   */
13 /* more details.                                                               */
14 /*                                                                             */
15 /* You should have received a copy of the GNU General Public License along     */
16 /* with This program; see the file COPYING.  If not,write to the Free Software */
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18 /*******************************************************************************/
20 /* simple stylistic variation on Fl_Dial */
22 #pragma once
24 #include <FL/Fl_Dial.H>
26 class Fl_Arc_Dial : public Fl_Dial
28     static int _default_style;
30     int _scaleticks;
32     void draw_knob ( void );
33     void draw_scale ( int ox,  int oy,  int side );
34     void draw_cursor ( int ox,  int oy,  int sidei );
36     void get_knob_dimensions ( int *X, int *Y, int *S );
38 protected:
40     virtual int handle ( int );
41     virtual void draw ( void );
42     virtual void draw_box ( void );
43     
44 public:
46     void scaleticks ( int tck );
48     int
49     type ( void ) const
50         { 
51         if ( Fl_Dial::type() == DEFAULT )
52             return Fl_Arc_Dial::_default_style;
53         else
54             return Fl_Dial::type();
55         }
57     void type ( int n )
58         { 
59             Fl_Dial::type( n );
60         }
61     
62     static void default_style ( int n ) { Fl_Arc_Dial::_default_style = n; }
64     enum 
65     {
66         DEFAULT,
67         BURNISHED_DIAL,
68         ARC_DIAL,
69         PLASTIC_DIAL
70     };
73     Fl_Arc_Dial ( int X, int Y, int W, int H, const char *L = 0 ) :
74         Fl_Dial( X, Y, W, H, L )
75         {
76             _scaleticks = 12;
77             
78             box( FL_NO_BOX );
79             type( DEFAULT );
80         }