1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-06-26 16:59:19 -04:00
|
|
|
// Name: wx/univ/spinbutt.h
|
1998-05-20 10:12:05 -04:00
|
|
|
// Purpose: wxSpinButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_SPINBUTT_H_
|
|
|
|
#define _WX_SPINBUTT_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/event.h"
|
|
|
|
|
2004-08-05 12:52:13 -04:00
|
|
|
#if wxUSE_SPINBTN
|
|
|
|
|
1999-07-23 17:03:02 -04:00
|
|
|
class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-01-31 18:28:58 -05:00
|
|
|
public:
|
1999-10-10 19:28:07 -04:00
|
|
|
// construction
|
1999-07-23 19:41:45 -04:00
|
|
|
wxSpinButton() { }
|
1999-05-13 17:21:04 -04:00
|
|
|
|
1999-01-31 18:28:58 -05:00
|
|
|
wxSpinButton(wxWindow *parent,
|
2004-08-05 12:52:13 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
1999-01-31 18:28:58 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
|
2001-06-26 16:59:19 -04:00
|
|
|
const wxString& name = wxSPIN_BUTTON_NAME)
|
1999-01-31 18:28:58 -05:00
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
1999-05-13 17:21:04 -04:00
|
|
|
|
1999-01-31 18:28:58 -05:00
|
|
|
virtual ~wxSpinButton();
|
1999-05-13 17:21:04 -04:00
|
|
|
|
1999-01-31 18:28:58 -05:00
|
|
|
bool Create(wxWindow *parent,
|
2004-08-05 12:52:13 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
1999-01-31 18:28:58 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1999-05-13 17:21:04 -04:00
|
|
|
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
|
2001-06-26 16:59:19 -04:00
|
|
|
const wxString& name = wxSPIN_BUTTON_NAME);
|
1999-05-13 17:21:04 -04:00
|
|
|
|
|
|
|
|
1999-07-28 17:01:04 -04:00
|
|
|
// accessors
|
1999-07-23 17:03:02 -04:00
|
|
|
virtual int GetValue() const;
|
|
|
|
virtual void SetValue(int val);
|
|
|
|
virtual void SetRange(int minVal, int maxVal);
|
1999-05-13 17:21:04 -04:00
|
|
|
|
1999-07-28 17:01:04 -04:00
|
|
|
// implementation
|
1999-01-31 18:28:58 -05:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
1999-07-28 17:01:04 -04:00
|
|
|
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
1999-05-13 17:21:04 -04:00
|
|
|
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
|
|
|
|
WXWORD pos, WXHWND control);
|
1999-10-10 19:28:07 -04:00
|
|
|
|
2000-01-23 18:23:46 -05:00
|
|
|
// a wxSpinButton can't do anything useful with focus, only wxSpinCtrl can
|
2004-08-05 12:52:13 -04:00
|
|
|
virtual bool AcceptsFocus() const { return false; }
|
2000-01-23 18:23:46 -05:00
|
|
|
|
2007-08-07 15:22:43 -04:00
|
|
|
// returns true if the platform should explicitly apply a theme border
|
|
|
|
virtual bool CanApplyThemeBorder() const { return false; }
|
|
|
|
|
1999-10-10 19:28:07 -04:00
|
|
|
protected:
|
1999-11-19 16:01:20 -05:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
1999-10-10 19:28:07 -04:00
|
|
|
|
2006-08-09 20:43:35 -04:00
|
|
|
// ensure that the control displays a value in the current range
|
2006-09-20 10:15:14 -04:00
|
|
|
virtual void NormalizeValue();
|
2006-08-09 20:43:35 -04:00
|
|
|
|
1999-10-10 19:28:07 -04:00
|
|
|
private:
|
2003-07-21 20:24:07 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSpinButton)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2004-08-05 12:52:13 -04:00
|
|
|
#endif // wxUSE_SPINBTN
|
|
|
|
|
|
|
|
#endif // _WX_SPINBUTT_H_
|