]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/spinbutt.h
Common code for the same handling of wxSL_INVERSE.
[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#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "spinbutt.h"
17#endif
18
19#include "wx/control.h"
20#include "wx/event.h"
21
22#if wxUSE_SPINBTN
23
24class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
25{
26public:
27 // construction
28 wxSpinButton() { }
29
30 wxSpinButton(wxWindow *parent,
31 wxWindowID id = wxID_ANY,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
35 const wxString& name = wxSPIN_BUTTON_NAME)
36 {
37 Create(parent, id, pos, size, style, name);
38 }
39
40 virtual ~wxSpinButton();
41
42 bool Create(wxWindow *parent,
43 wxWindowID id = wxID_ANY,
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxDefaultSize,
46 long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
47 const wxString& name = wxSPIN_BUTTON_NAME);
48
49
50 // accessors
51 virtual int GetValue() const;
52 virtual void SetValue(int val);
53 virtual void SetRange(int minVal, int maxVal);
54
55 // implementation
56 virtual bool MSWCommand(WXUINT param, WXWORD id);
57 virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
58 virtual bool MSWOnScroll(int orientation, WXWORD wParam,
59 WXWORD pos, WXHWND control);
60
61 // a wxSpinButton can't do anything useful with focus, only wxSpinCtrl can
62 virtual bool AcceptsFocus() const { return false; }
63
64protected:
65 virtual wxSize DoGetBestSize() const;
66
67private:
68 DECLARE_DYNAMIC_CLASS_NO_COPY(wxSpinButton)
69};
70
71#endif // wxUSE_SPINBTN
72
73#endif // _WX_SPINBUTT_H_