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
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-10-10 19:28:07 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#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"
|
2004-03-28 08:10:14 -05:00
|
|
|
#elif defined(__WXMSW__)
|
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__)
|
2004-05-17 15:14:38 -04:00
|
|
|
#include "wx/mac/spinctrl.h"
|
2004-04-01 17:42:53 -05:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#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) \
|
2004-09-22 10:38:52 -04:00
|
|
|
DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_SPINCTRL_UPDATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & fn ), (wxObject *) NULL ),
|
2000-01-15 05:20:46 -05:00
|
|
|
|
1999-10-10 19:28:07 -04:00
|
|
|
#endif // _WX_SPINCTRL_H_
|
|
|
|
|