1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: gauge.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-05-20 10:01:55 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKGAUGEH__
|
|
|
|
#define __GTKGAUGEH__
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-05-20 10:01:55 -04:00
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-14 19:04:05 -04:00
|
|
|
|
|
|
|
#if wxUSE_GAUGE
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxGauge;
|
|
|
|
|
1998-05-28 18:05:55 -04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2002-08-05 14:04:08 -04:00
|
|
|
extern const wxChar* wxGaugeNameStr;
|
1998-05-28 18:05:55 -04:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxGaugeBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-05-28 18:05:55 -04:00
|
|
|
class wxGauge: public wxControl
|
|
|
|
{
|
1999-11-22 14:44:25 -05:00
|
|
|
public:
|
2002-12-04 09:11:26 -05:00
|
|
|
wxGauge() { Init(); }
|
|
|
|
|
|
|
|
wxGauge( wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
int range,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxGA_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxGaugeNameStr )
|
1998-08-14 06:07:38 -04:00
|
|
|
{
|
2002-12-04 09:11:26 -05:00
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, range, pos, size, style, validator, name);
|
1998-08-14 06:07:38 -04:00
|
|
|
}
|
2002-12-04 09:11:26 -05:00
|
|
|
|
|
|
|
bool Create( wxWindow *parent,
|
|
|
|
wxWindowID id, int range,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxGA_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxGaugeNameStr );
|
|
|
|
|
|
|
|
void SetShadowWidth( int WXUNUSED(w) ) { }
|
|
|
|
void SetBezelFace( int WXUNUSED(w) ) { }
|
1998-08-14 06:07:38 -04:00
|
|
|
void SetRange( int r );
|
|
|
|
void SetValue( int pos );
|
1999-01-24 10:07:54 -05:00
|
|
|
int GetShadowWidth() const { return 0; };
|
|
|
|
int GetBezelFace() const { return 0; };
|
|
|
|
int GetRange() const;
|
|
|
|
int GetValue() const;
|
1998-08-14 06:07:38 -04:00
|
|
|
|
1999-11-22 14:44:25 -05:00
|
|
|
// implementation
|
|
|
|
// -------------
|
2002-12-04 09:11:26 -05:00
|
|
|
|
1998-10-29 13:03:18 -05:00
|
|
|
void ApplyWidgetStyle();
|
2002-12-04 09:11:26 -05:00
|
|
|
|
|
|
|
// the max and current gauge values
|
|
|
|
int m_rangeMax,
|
|
|
|
m_gaugePos;
|
|
|
|
|
|
|
|
// obsolete functions, don't use
|
|
|
|
#ifdef WXWIN_COMPATIBILITY_2_2
|
|
|
|
bool GetProgressBar() const { return TRUE; }
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_2
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init() { m_rangeMax = m_gaugePos = 0; }
|
|
|
|
|
|
|
|
// set the gauge value to the value of m_gaugePos
|
|
|
|
void DoSetGauge();
|
|
|
|
|
1999-11-22 14:44:25 -05:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxGauge)
|
1998-05-28 18:05:55 -04:00
|
|
|
};
|
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif // __GTKGAUGEH__
|