2001-06-26 16:59:19 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gauge.h
|
|
|
|
// Purpose: wxGauge interface
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 20.02.01
|
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
|
|
|
|
|
2014-09-10 10:57:20 -04:00
|
|
|
// Available since Windows 7 only. With this style, the value of guage will
|
|
|
|
// reflect on the taskbar button.
|
|
|
|
#define wxGA_PROGRESS 0x0010
|
2003-09-22 08:35:21 -04:00
|
|
|
// Win32 only, is default (and only) on some other platforms
|
|
|
|
#define wxGA_SMOOTH 0x0020
|
2014-08-23 21:50:11 -04:00
|
|
|
// QT only, display current completed percentage (text default format "%p%")
|
|
|
|
#define wxGA_TEXT 0x0040
|
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
|
2014-07-03 18:03:21 -04:00
|
|
|
#if !defined(__WXGTK20__) && !defined(__WXMAC__)
|
2006-09-09 09:36:54 -04:00
|
|
|
#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
|
|
|
|
2015-02-15 15:09:10 -05:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxAppProgressIndicator;
|
|
|
|
|
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:
|
2015-02-17 01:19:22 -05:00
|
|
|
wxGaugeBase() : m_rangeMax(0), m_gaugePos(0),
|
|
|
|
m_appProgressIndicator(NULL) { }
|
|
|
|
|
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); }
|
|
|
|
|
2011-03-22 10:17:38 -04:00
|
|
|
// overridden base class virtuals
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }
|
2001-06-26 16:59:19 -04:00
|
|
|
|
2015-04-20 12:43:43 -04:00
|
|
|
// Deprecated methods not doing anything since a long time.
|
|
|
|
wxDEPRECATED_MSG("Remove calls to this method, it doesn't do anything")
|
|
|
|
void SetShadowWidth(int WXUNUSED(w)) { }
|
|
|
|
|
|
|
|
wxDEPRECATED_MSG("Remove calls to this method, it always returns 0")
|
|
|
|
int GetShadowWidth() const { return 0; }
|
|
|
|
|
|
|
|
wxDEPRECATED_MSG("Remove calls to this method, it doesn't do anything")
|
|
|
|
void SetBezelFace(int WXUNUSED(w)) { }
|
|
|
|
|
|
|
|
wxDEPRECATED_MSG("Remove calls to this method, it always returns 0")
|
|
|
|
int GetBezelFace() const { return 0; }
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
protected:
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
|
2007-11-13 07:10:34 -05:00
|
|
|
|
2016-01-31 14:11:06 -05:00
|
|
|
// Initialize m_appProgressIndicator if necessary, i.e. if this object has
|
|
|
|
// wxGA_PROGRESS style. This method is supposed to be called from the
|
|
|
|
// derived class Create() if it doesn't call the base class Create(), which
|
|
|
|
// already does it, after initializing the window style and range.
|
|
|
|
void InitProgressIndicatorIfNeeded();
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2015-02-15 15:09:10 -05:00
|
|
|
wxAppProgressIndicator *m_appProgressIndicator;
|
|
|
|
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_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__)
|
2008-06-11 15:17:41 -04:00
|
|
|
#include "wx/osx/gauge.h"
|
2014-08-23 21:50:11 -04:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/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_
|