1999-10-10 19:28:07 -04: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 14:18:01 -05:00
|
|
|
#include "wx/spinbutt.h" // should make wxSpinEvent visible to the app
|
1999-10-10 19:28:07 -04: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 13:54:13 -04:00
|
|
|
virtual void SetValue(const wxString& value) = 0;
|
1999-10-10 19:28:07 -04:00
|
|
|
virtual void SetValue(int val) = 0;
|
|
|
|
virtual void SetRange(int minVal, int maxVal) = 0;
|
|
|
|
|
2002-09-01 16:24:25 -04:00
|
|
|
// as the wxTextCtrl method
|
|
|
|
virtual void SetSelection(long from, long to) = 0;
|
|
|
|
|
1999-10-10 19:28:07 -04: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 16:59:19 -04:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/generic/spinctlg.h"
|
|
|
|
#elif defined(__WXMSW__) && defined(__WIN32__)
|
1999-10-10 19:28:07 -04:00
|
|
|
#include "wx/msw/spinctrl.h"
|
1999-10-17 13:23:27 -04:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/spinctrl.h"
|
1999-10-11 06:05:36 -04:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk/spinctrl.h"
|
2001-07-09 09:14:28 -04:00
|
|
|
#elif defined(__WXMOTIF__)
|
|
|
|
#include "wx/generic/spinctlg.h"
|
2001-06-28 02:23:26 -04:00
|
|
|
#elif defined(__WXMAC__)
|
2002-08-02 11:30:58 -04:00
|
|
|
#include "wx/mac/spinctrl.h"
|
1999-10-10 19:28:07 -04:00
|
|
|
#else // Win16 || !Win
|
1999-10-29 13:54:13 -04:00
|
|
|
#include "wx/generic/spinctlg.h"
|
1999-10-10 19:28:07 -04:00
|
|
|
#endif // platform
|
|
|
|
|
2001-01-26 12:35:36 -05:00
|
|
|
#define EVT_SPINCTRL(id, fn) \
|
2001-01-31 12:16:40 -05:00
|
|
|
DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_SPINCTRL_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & fn, (wxObject *) NULL ),
|
2000-01-15 05:20:46 -05:00
|
|
|
|
1999-10-10 19:28:07 -04:00
|
|
|
#endif // _WX_SPINCTRL_H_
|
|
|
|
|