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
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SPINCTRL_H_
|
|
|
|
#define _WX_SPINCTRL_H_
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
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"
|
|
|
|
#elif defined(__WXMSW__) && defined(__WIN32__)
|
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__)
|
|
|
|
#include "wx/generic/spinctlg.h"
|
1999-10-10 23:28:07 +00:00
|
|
|
#else // Win16 || !Win
|
1999-10-29 17:54:13 +00:00
|
|
|
#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) \
|
2001-01-31 17:16:40 +00:00
|
|
|
DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_SPINCTRL_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & fn, (wxObject *) NULL ),
|
2000-01-15 10:20:46 +00:00
|
|
|
|
1999-10-10 23:28:07 +00:00
|
|
|
#endif // _WX_SPINCTRL_H_
|
|
|
|
|