]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/classic/spinbutt.h
On screens with restricted space, it's useful to be able to add controls
[wxWidgets.git] / include / wx / mac / classic / spinbutt.h
CommitLineData
52479aef
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: spinbutt.h
3// Purpose: wxSpinButton class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
7// RCS-ID: $Id$
8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
52479aef
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_SPINBUTT_H_
13#define _WX_SPINBUTT_H_
14
52479aef
SC
15#include "wx/control.h"
16#include "wx/event.h"
17
18/*
19 The wxSpinButton is like a small scrollbar than is often placed next
20 to a text control.
21
22 wxSP_HORIZONTAL: horizontal spin button
23 wxSP_VERTICAL: vertical spin button (the default)
24 wxSP_ARROW_KEYS: arrow keys increment/decrement value
25 wxSP_WRAP: value wraps at either end
26 */
27
28class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
29{
30public:
31 // construction
32 wxSpinButton();
33
34 wxSpinButton(wxWindow *parent,
35 wxWindowID id = -1,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
38 long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
39 const wxString& name = wxT("wxSpinButton"))
40 {
41 Create(parent, id, pos, size, style, name);
42 }
43
44 virtual ~wxSpinButton();
45
46 bool Create(wxWindow *parent,
47 wxWindowID id = -1,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
51 const wxString& name = wxT("wxSpinButton"));
52
53
54 // accessors
55 virtual int GetMin() const;
56 virtual int GetMax() const;
57 virtual int GetValue() const;
58 virtual void SetValue(int val);
59 virtual void SetRange(int minVal, int maxVal);
60
61 // implementation
62
63 virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
64
65protected:
66 void MacHandleValueChanged( int inc ) ;
67 virtual wxSize DoGetBestSize() const;
68 int m_value ;
69
70private:
71 DECLARE_DYNAMIC_CLASS(wxSpinButton)
72};
73
74#endif
75 // _WX_SPINBUTT_H_