]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/numdlgg.h
synchronize GTK2 minimum version in docs
[wxWidgets.git] / include / wx / generic / numdlgg.h
CommitLineData
fc5414a1
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/generic/numdlgg.h
3// Purpose: wxNumberEntryDialog class
4// Author: John Labenski
5// Modified by:
6// Created: 07.02.04 (extracted from textdlgg.cpp)
7// RCS-ID: $Id$
77ffb593 8// Copyright: (c) wxWidgets team
65571936 9// Licence: wxWindows licence
fc5414a1
VZ
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __NUMDLGH_G__
13#define __NUMDLGH_G__
14
fc5414a1
VZ
15#include "wx/defs.h"
16
1e25a373
WS
17#if wxUSE_NUMBERDLG
18
fc5414a1
VZ
19#include "wx/dialog.h"
20
21#if wxUSE_SPINCTRL
b5dbe15d 22 class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
fc5414a1 23#else
b5dbe15d 24 class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
fc5414a1
VZ
25#endif // wxUSE_SPINCTRL
26
27// ----------------------------------------------------------------------------
28// wxNumberEntryDialog: a dialog with spin control, [ok] and [cancel] buttons
29// ----------------------------------------------------------------------------
30
53a2db12 31class WXDLLIMPEXP_CORE wxNumberEntryDialog : public wxDialog
fc5414a1
VZ
32{
33public:
34 wxNumberEntryDialog(wxWindow *parent,
35 const wxString& message,
36 const wxString& prompt,
37 const wxString& caption,
38 long value, long min, long max,
39 const wxPoint& pos = wxDefaultPosition);
40
41 long GetValue() const { return m_value; }
42
43 // implementation only
44 void OnOK(wxCommandEvent& event);
45 void OnCancel(wxCommandEvent& event);
46
47protected:
48
49#if wxUSE_SPINCTRL
50 wxSpinCtrl *m_spinctrl;
51#else
52 wxTextCtrl *m_spinctrl;
53#endif // wxUSE_SPINCTRL
54
55 long m_value, m_min, m_max;
56
57private:
58 DECLARE_EVENT_TABLE()
4b5e5cfb 59 DECLARE_DYNAMIC_CLASS(wxNumberEntryDialog)
c0c133e1 60 wxDECLARE_NO_COPY_CLASS(wxNumberEntryDialog);
fc5414a1
VZ
61};
62
63// ----------------------------------------------------------------------------
64// function to get a number from user
65// ----------------------------------------------------------------------------
66
53a2db12
FM
67WXDLLIMPEXP_CORE long
68 wxGetNumberFromUser(const wxString& message,
69 const wxString& prompt,
70 const wxString& caption,
71 long value = 0,
72 long min = 0,
73 long max = 100,
d3b9f782 74 wxWindow *parent = NULL,
53a2db12 75 const wxPoint& pos = wxDefaultPosition);
fc5414a1
VZ
76
77#endif // wxUSE_NUMBERDLG
78
79#endif // __NUMDLGH_G__