]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/spinctrl.h
allow wxFileConfig be created with empty name (will take it from wxApp) (patch 749749)
[wxWidgets.git] / include / wx / gtk1 / spinctrl.h
CommitLineData
738f9e5a
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: spinctrl.h
3// Purpose: wxSpinCtrl class
4// Author: Robert Roebling
5// Modified by:
6// RCS-ID: $Id$
7// Copyright: (c) Robert Roebling
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef __GTKSPINCTRLH__
12#define __GTKSPINCTRLH__
13
ab7ce33c 14#if defined(__GNUG__) && !defined(__APPLE__)
738f9e5a
RR
15#pragma interface
16#endif
17
a075e27b
RR
18#include "wx/defs.h"
19
20#if wxUSE_SPINCTRL
21
22#include "wx/control.h"
23
738f9e5a 24//-----------------------------------------------------------------------------
ce89fdd2 25// wxSpinCtrl
738f9e5a
RR
26//-----------------------------------------------------------------------------
27
28class wxSpinCtrl : public wxControl
29{
30public:
31 wxSpinCtrl() {}
32 wxSpinCtrl(wxWindow *parent,
33 wxWindowID id = -1,
ce89fdd2 34 const wxString& value = wxEmptyString,
738f9e5a
RR
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = wxSP_ARROW_KEYS,
38 int min = 0, int max = 100, int initial = 0,
39 const wxString& name = _T("wxSpinCtrl"))
40 {
ce89fdd2 41 Create(parent, id, value, pos, size, style, min, max, initial, name);
738f9e5a
RR
42 }
43
44 bool Create(wxWindow *parent,
45 wxWindowID id = -1,
ce89fdd2 46 const wxString& value = wxEmptyString,
738f9e5a
RR
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
49 long style = wxSP_ARROW_KEYS,
50 int min = 0, int max = 100, int initial = 0,
51 const wxString& name = _T("wxSpinCtrl"));
52
ce89fdd2
VZ
53 void SetValue(const wxString& text);
54
738f9e5a
RR
55 virtual int GetValue() const;
56 virtual void SetValue( int value );
57 virtual void SetRange( int minVal, int maxVal );
58 virtual int GetMin() const;
59 virtual int GetMax() const;
60
ce89fdd2 61 // implementation
da048e3d
RR
62 void OnChar( wxKeyEvent &event );
63
738f9e5a
RR
64 bool IsOwnGtkWindow( GdkWindow *window );
65 void ApplyWidgetStyle();
07f5b19a
RR
66 void GtkDisableEvents();
67 void GtkEnableEvents();
738f9e5a
RR
68
69 GtkAdjustment *m_adjust;
70 float m_oldPos;
71
9d9b7755
VZ
72protected:
73 virtual wxSize DoGetBestSize() const;
74
738f9e5a
RR
75private:
76 DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
da048e3d 77 DECLARE_EVENT_TABLE()
738f9e5a
RR
78};
79
a075e27b
RR
80#endif
81 // wxUSE_SPINCTRL
82
738f9e5a
RR
83#endif
84 // __GTKSPINCTRLH__