1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: gauge.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-05-20 14:01:55 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKGAUGEH__
|
|
|
|
#define __GTKGAUGEH__
|
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-05-20 14:01:55 +00:00
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-06-14 23:04:05 +00:00
|
|
|
|
|
|
|
#if wxUSE_GAUGE
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxGauge;
|
|
|
|
|
1998-05-28 22:05:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2002-08-05 18:04:08 +00:00
|
|
|
extern const wxChar* wxGaugeNameStr;
|
1998-05-28 22:05:55 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxGaugeBox
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-05-28 22:05:55 +00:00
|
|
|
class wxGauge: public wxControl
|
|
|
|
{
|
1999-11-22 19:44:25 +00:00
|
|
|
public:
|
2002-12-04 14:11:26 +00: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 10:07:38 +00:00
|
|
|
{
|
2002-12-04 14:11:26 +00:00
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, range, pos, size, style, validator, name);
|
1998-08-14 10:07:38 +00:00
|
|
|
}
|
2002-12-04 14:11:26 +00: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 10:07:38 +00:00
|
|
|
void SetRange( int r );
|
|
|
|
void SetValue( int pos );
|
1999-01-24 15:07:54 +00:00
|
|
|
int GetShadowWidth() const { return 0; };
|
|
|
|
int GetBezelFace() const { return 0; };
|
|
|
|
int GetRange() const;
|
|
|
|
int GetValue() const;
|
1998-08-14 10:07:38 +00:00
|
|
|
|
2003-09-24 20:08:25 +00:00
|
|
|
bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
|
|
|
|
|
1999-11-22 19:44:25 +00:00
|
|
|
// implementation
|
|
|
|
// -------------
|
2002-12-04 14:11:26 +00:00
|
|
|
|
1998-10-29 18:03:18 +00:00
|
|
|
void ApplyWidgetStyle();
|
2002-12-04 14:11:26 +00:00
|
|
|
|
|
|
|
// the max and current gauge values
|
|
|
|
int m_rangeMax,
|
|
|
|
m_gaugePos;
|
|
|
|
|
|
|
|
// obsolete functions, don't use
|
2003-10-18 23:22:11 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_2_2
|
|
|
|
bool GetProgressBar() const { return true; }
|
2002-12-04 14:11:26 +00:00
|
|
|
#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();
|
|
|
|
|
2004-03-10 01:15:30 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
1999-11-22 19:44:25 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxGauge)
|
1998-05-28 22:05:55 +00:00
|
|
|
};
|
|
|
|
|
1999-06-14 23:04:05 +00:00
|
|
|
#endif
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif // __GTKGAUGEH__
|