2001-06-26 16:59:19 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gauge.h
|
|
|
|
// Purpose: wxGauge interface
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 20.02.01
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 10:56:36 -04:00
|
|
|
// Copyright: (c) 1996-2001 wxWidgets team
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 16:59:19 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_GAUGE_H_BASE_
|
|
|
|
#define _WX_GAUGE_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_GAUGE
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
2003-09-22 08:35:21 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxGauge style flags
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#define wxGA_HORIZONTAL wxHORIZONTAL
|
|
|
|
#define wxGA_VERTICAL wxVERTICAL
|
|
|
|
|
|
|
|
// Win32 only, is default (and only) on some other platforms
|
|
|
|
#define wxGA_SMOOTH 0x0020
|
|
|
|
|
2006-04-14 13:01:16 -04:00
|
|
|
#if WXWIN_COMPATIBILITY_2_6
|
|
|
|
// obsolete style
|
|
|
|
#define wxGA_PROGRESSBAR 0
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_6
|
2003-09-22 08:35:21 -04:00
|
|
|
|
2006-09-09 09:36:54 -04:00
|
|
|
// GTK and Mac always have native implementation of the indeterminate mode
|
|
|
|
// wxMSW has native implementation only if comctl32.dll >= 6.00
|
|
|
|
#if !defined(__WXGTK20__) && !defined(__WXMAC__) && !defined(__WXCOCOA__)
|
|
|
|
#define wxGAUGE_EMULATE_INDETERMINATE_MODE 1
|
|
|
|
#else
|
|
|
|
#define wxGAUGE_EMULATE_INDETERMINATE_MODE 0
|
|
|
|
#endif
|
2003-09-22 08:35:21 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[];
|
2001-06-26 16:59:19 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxGauge: a progress bar
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxGaugeBase : public wxControl
|
2001-06-26 16:59:19 -04:00
|
|
|
{
|
|
|
|
public:
|
2003-09-22 08:28:25 -04:00
|
|
|
wxGaugeBase() { m_rangeMax = m_gaugePos = 0; }
|
2002-01-07 16:52:28 -05:00
|
|
|
virtual ~wxGaugeBase();
|
|
|
|
|
2001-06-26 16:59:19 -04: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);
|
|
|
|
|
2006-09-09 09:36:54 -04:00
|
|
|
// determinate mode API
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
// set/get the control range
|
|
|
|
virtual void SetRange(int range);
|
|
|
|
virtual int GetRange() const;
|
|
|
|
|
|
|
|
virtual void SetValue(int pos);
|
|
|
|
virtual int GetValue() const;
|
|
|
|
|
2006-09-09 09:36:54 -04:00
|
|
|
// indeterminate mode API
|
|
|
|
virtual void Pulse();
|
|
|
|
|
2003-09-22 08:28:25 -04:00
|
|
|
// simple accessors
|
|
|
|
bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
|
|
|
|
|
|
|
|
// appearance params (not implemented for most ports)
|
2001-06-26 16:59:19 -04:00
|
|
|
virtual void SetShadowWidth(int w);
|
|
|
|
virtual int GetShadowWidth() const;
|
|
|
|
|
|
|
|
virtual void SetBezelFace(int w);
|
|
|
|
virtual int GetBezelFace() const;
|
|
|
|
|
|
|
|
// overriden base class virtuals
|
2004-09-15 09:20:18 -04:00
|
|
|
virtual bool AcceptsFocus() const { return false; }
|
2001-06-26 16:59:19 -04:00
|
|
|
|
|
|
|
protected:
|
2007-11-13 07:10:34 -05:00
|
|
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
// the max position
|
|
|
|
int m_rangeMax;
|
|
|
|
|
|
|
|
// the current position
|
|
|
|
int m_gaugePos;
|
2003-07-21 20:24:07 -04:00
|
|
|
|
2006-09-09 09:36:54 -04:00
|
|
|
#if wxGAUGE_EMULATE_INDETERMINATE_MODE
|
|
|
|
int m_nDirection; // can be wxRIGHT or wxLEFT
|
|
|
|
#endif
|
|
|
|
|
2003-07-21 20:24:07 -04:00
|
|
|
DECLARE_NO_COPY_CLASS(wxGaugeBase)
|
2001-06-26 16:59:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/gauge.h"
|
|
|
|
#elif defined(__WXMSW__)
|
2008-03-15 12:53:06 -04:00
|
|
|
#include "wx/msw/gauge.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXMOTIF__)
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/motif/gauge.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK20__)
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/gtk/gauge.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/gauge.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/mac/gauge.h"
|
2003-07-15 10:04:22 -04:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/gauge.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/os2/gauge.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_GAUGE
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_GAUGE_H_BASE_
|