1999-10-10 23:28:07 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: spinctrl.h
|
|
|
|
// Purpose: wxSpinCtrlBase class
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 22.07.99
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Vadim Zeitlin
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-10-10 23:28:07 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SPINCTRL_H_
|
|
|
|
#define _WX_SPINCTRL_H_
|
|
|
|
|
2005-03-16 16:18:31 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_SPINCTRL
|
|
|
|
|
1999-12-29 19:18:01 +00:00
|
|
|
#include "wx/spinbutt.h" // should make wxSpinEvent visible to the app
|
1999-10-10 23:28:07 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// a spin ctrl is a text control with a spin button which is usually used to
|
|
|
|
// prompt the user for a numeric input
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/* there is no generic base class for this control because it's imlpemented
|
|
|
|
very differently under MSW and other platforms
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxSpinCtrlBase : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxSpinCtrlBase() { Init(); }
|
|
|
|
|
|
|
|
// accessors
|
|
|
|
virtual int GetValue() const = 0;
|
|
|
|
virtual int GetMin() const { return m_min; }
|
|
|
|
virtual int GetMax() const { return m_max; }
|
|
|
|
|
|
|
|
// operations
|
1999-10-29 17:54:13 +00:00
|
|
|
virtual void SetValue(const wxString& value) = 0;
|
1999-10-10 23:28:07 +00:00
|
|
|
virtual void SetValue(int val) = 0;
|
|
|
|
virtual void SetRange(int minVal, int maxVal) = 0;
|
|
|
|
|
2002-09-01 20:24:25 +00:00
|
|
|
// as the wxTextCtrl method
|
|
|
|
virtual void SetSelection(long from, long to) = 0;
|
|
|
|
|
1999-10-10 23:28:07 +00:00
|
|
|
protected:
|
|
|
|
// initialize m_min/max with the default values
|
|
|
|
void Init() { m_min = 0; m_max = 100; }
|
|
|
|
|
|
|
|
int m_min;
|
|
|
|
int m_max;
|
|
|
|
};
|
|
|
|
*/
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// include the platform-dependent class implementation
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/generic/spinctlg.h"
|
2004-03-28 13:10:14 +00:00
|
|
|
#elif defined(__WXMSW__)
|
1999-10-10 23:28:07 +00:00
|
|
|
#include "wx/msw/spinctrl.h"
|
1999-10-17 17:23:27 +00:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/spinctrl.h"
|
1999-10-11 10:05:36 +00:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk/spinctrl.h"
|
2001-07-09 13:14:28 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
|
|
|
#include "wx/generic/spinctlg.h"
|
2001-06-28 06:23:26 +00:00
|
|
|
#elif defined(__WXMAC__)
|
2004-05-17 19:14:38 +00:00
|
|
|
#include "wx/mac/spinctrl.h"
|
2004-04-01 22:42:53 +00:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/generic/spinctlg.h"
|
1999-10-10 23:28:07 +00:00
|
|
|
#endif // platform
|
|
|
|
|
2001-01-26 17:35:36 +00:00
|
|
|
#define EVT_SPINCTRL(id, fn) \
|
2005-02-14 23:53:48 +00:00
|
|
|
wx__DECLARE_EVT1(wxEVT_COMMAND_SPINCTRL_UPDATED, id, wxSpinEventHandler(fn))
|
2000-01-15 10:20:46 +00:00
|
|
|
|
2005-03-16 16:18:31 +00:00
|
|
|
#endif // wxUSE_SPINCTRL
|
1999-10-10 23:28:07 +00:00
|
|
|
|
2005-03-16 16:18:31 +00:00
|
|
|
#endif // _WX_SPINCTRL_H_
|