]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/spinbutt.h
[ 1585253 ] Various important bugfixes to wxFileName::Normalize
[wxWidgets.git] / include / wx / msw / spinbutt.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/univ/spinbutt.h
3// Purpose: wxSpinButton class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_SPINBUTT_H_
13#define _WX_SPINBUTT_H_
14
15#include "wx/control.h"
16#include "wx/event.h"
17
18#if wxUSE_SPINBTN
19
20class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
21{
22public:
23 // construction
24 wxSpinButton() { }
25
26 wxSpinButton(wxWindow *parent,
27 wxWindowID id = wxID_ANY,
28 const wxPoint& pos = wxDefaultPosition,
29 const wxSize& size = wxDefaultSize,
30 long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
31 const wxString& name = wxSPIN_BUTTON_NAME)
32 {
33 Create(parent, id, pos, size, style, name);
34 }
35
36 virtual ~wxSpinButton();
37
38 bool Create(wxWindow *parent,
39 wxWindowID id = wxID_ANY,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
42 long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
43 const wxString& name = wxSPIN_BUTTON_NAME);
44
45
46 // accessors
47 virtual int GetValue() const;
48 virtual void SetValue(int val);
49 virtual void SetRange(int minVal, int maxVal);
50
51 // implementation
52 virtual bool MSWCommand(WXUINT param, WXWORD id);
53 virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
54 virtual bool MSWOnScroll(int orientation, WXWORD wParam,
55 WXWORD pos, WXHWND control);
56
57 // a wxSpinButton can't do anything useful with focus, only wxSpinCtrl can
58 virtual bool AcceptsFocus() const { return false; }
59
60protected:
61 virtual wxSize DoGetBestSize() const;
62
63 // ensure that the control displays a value in the current range
64 virtual void NormalizeValue();
65
66private:
67 DECLARE_DYNAMIC_CLASS_NO_COPY(wxSpinButton)
68};
69
70#endif // wxUSE_SPINBTN
71
72#endif // _WX_SPINBUTT_H_