2001-06-26 20:59:19 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gauge.h
|
|
|
|
// Purpose: wxGauge interface
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 20.02.01
|
2004-05-23 14:56:36 +00:00
|
|
|
// Copyright: (c) 1996-2001 wxWidgets team
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 20:59:19 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_GAUGE_H_BASE_
|
|
|
|
#define _WX_GAUGE_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_GAUGE
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
2003-09-22 12:35:21 +00: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-09-09 13:36:54 +00: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 12:35:21 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[];
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxGauge: a progress bar
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxGaugeBase : public wxControl
|
2001-06-26 20:59:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-09-22 12:28:25 +00:00
|
|
|
wxGaugeBase() { m_rangeMax = m_gaugePos = 0; }
|
2002-01-07 21:52:28 +00:00
|
|
|
virtual ~wxGaugeBase();
|
|
|
|
|
2001-06-26 20:59:19 +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);
|
|
|
|
|
2006-09-09 13:36:54 +00:00
|
|
|
// determinate mode API
|
|
|
|
|
2001-06-26 20:59:19 +00: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 13:36:54 +00:00
|
|
|
// indeterminate mode API
|
|
|
|
virtual void Pulse();
|
|
|
|
|
2003-09-22 12:28:25 +00:00
|
|
|
// simple accessors
|
|
|
|
bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
|
|
|
|
|
|
|
|
// appearance params (not implemented for most ports)
|
2001-06-26 20:59:19 +00:00
|
|
|
virtual void SetShadowWidth(int w);
|
|
|
|
virtual int GetShadowWidth() const;
|
|
|
|
|
|
|
|
virtual void SetBezelFace(int w);
|
|
|
|
virtual int GetBezelFace() const;
|
|
|
|
|
2011-03-22 14:17:38 +00:00
|
|
|
// overridden base class virtuals
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
protected:
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
|
2007-11-13 12:10:34 +00:00
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
// the max position
|
|
|
|
int m_rangeMax;
|
|
|
|
|
|
|
|
// the current position
|
|
|
|
int m_gaugePos;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
2006-09-09 13:36:54 +00:00
|
|
|
#if wxGAUGE_EMULATE_INDETERMINATE_MODE
|
|
|
|
int m_nDirection; // can be wxRIGHT or wxLEFT
|
|
|
|
#endif
|
|
|
|
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxGaugeBase);
|
2001-06-26 20:59:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/gauge.h"
|
|
|
|
#elif defined(__WXMSW__)
|
2008-03-15 16:53:06 +00:00
|
|
|
#include "wx/msw/gauge.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/motif/gauge.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK20__)
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/gtk/gauge.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/gauge.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 19:17:41 +00:00
|
|
|
#include "wx/osx/gauge.h"
|
2003-07-15 14:04:22 +00:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/gauge.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // wxUSE_GAUGE
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_GAUGE_H_BASE_
|