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