non/FL/Fl_Arc_Dial.H

83 lines
2.5 KiB
C++
Raw Normal View History

2008-03-14 05:27:13 +01:00
/*******************************************************************************/
/* Copyright (C) 2008 Jonathan Moore Liles */
/* */
/* This program is free software; you can redistribute it and/or modify it */
/* under the terms of the GNU General Public License as published by the */
/* Free Software Foundation; either version 2 of the License, or (at your */
/* option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, but WITHOUT */
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
/* more details. */
/* */
/* You should have received a copy of the GNU General Public License along */
/* with This program; see the file COPYING. If not,write to the Free Software */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
/* simple stylistic variation on Fl_Dial */
#pragma once
#include <FL/Fl_Dial.H>
class Fl_Arc_Dial : public Fl_Dial
{
2012-03-03 03:02:23 +01:00
static int _default_style;
int _scaleticks;
void draw_knob ( void );
void draw_scale ( int ox, int oy, int side );
void draw_cursor ( int ox, int oy, int sidei );
void get_knob_dimensions ( int *X, int *Y, int *S );
2008-03-14 05:27:13 +01:00
2008-03-20 08:13:45 +01:00
protected:
virtual int handle ( int );
virtual void draw ( void );
virtual void draw_box ( void );
2008-03-14 05:27:13 +01:00
public:
void scaleticks ( int tck );
int
type ( void ) const
{
if ( Fl_Dial::type() == DEFAULT )
2012-03-03 03:02:23 +01:00
return Fl_Arc_Dial::_default_style;
else
return Fl_Dial::type();
}
void type ( int n )
{
Fl_Dial::type( n );
}
2012-03-03 03:02:23 +01:00
static void default_style ( int n ) { Fl_Arc_Dial::_default_style = n; }
enum
{
DEFAULT,
BURNISHED_DIAL,
ARC_DIAL,
PLASTIC_DIAL
};
2008-03-14 05:27:13 +01:00
Fl_Arc_Dial ( int X, int Y, int W, int H, const char *L = 0 ) :
Fl_Dial( X, Y, W, H, L )
{
_scaleticks = 12;
box( FL_NO_BOX );
type( DEFAULT );
2008-03-15 01:23:03 +01:00
}
2008-03-14 05:27:13 +01:00
};