]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/numdlgg.h
listctrl header cleanup
[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
22 class WXDLLEXPORT wxSpinCtrl;
23#else
24 class WXDLLEXPORT wxTextCtrl;
25#endif // wxUSE_SPINCTRL
26
27// ----------------------------------------------------------------------------
28// wxNumberEntryDialog: a dialog with spin control, [ok] and [cancel] buttons
29// ----------------------------------------------------------------------------
30
31class WXDLLEXPORT wxNumberEntryDialog : public wxDialog
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)
fc5414a1
VZ
60 DECLARE_NO_COPY_CLASS(wxNumberEntryDialog)
61};
62
63// ----------------------------------------------------------------------------
64// function to get a number from user
65// ----------------------------------------------------------------------------
66
67long WXDLLEXPORT
68wxGetNumberFromUser(const wxString& message,
69 const wxString& prompt,
70 const wxString& caption,
71 long value = 0,
72 long min = 0,
73 long max = 100,
74 wxWindow *parent = (wxWindow *)NULL,
75 const wxPoint& pos = wxDefaultPosition);
76
77#endif // wxUSE_NUMBERDLG
78
79#endif // __NUMDLGH_G__