]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/numdlgg.h
Fixed to work with the new wxMacControl system.
[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
15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "numdlgg.h"
17#endif
18
19#if wxUSE_NUMBERDLG
20
21#include "wx/defs.h"
22
23#include "wx/dialog.h"
24
25#if wxUSE_SPINCTRL
26 class WXDLLEXPORT wxSpinCtrl;
27#else
28 class WXDLLEXPORT wxTextCtrl;
29#endif // wxUSE_SPINCTRL
30
31// ----------------------------------------------------------------------------
32// wxNumberEntryDialog: a dialog with spin control, [ok] and [cancel] buttons
33// ----------------------------------------------------------------------------
34
35class WXDLLEXPORT wxNumberEntryDialog : public wxDialog
36{
37public:
38 wxNumberEntryDialog(wxWindow *parent,
39 const wxString& message,
40 const wxString& prompt,
41 const wxString& caption,
42 long value, long min, long max,
43 const wxPoint& pos = wxDefaultPosition);
44
45 long GetValue() const { return m_value; }
46
47 // implementation only
48 void OnOK(wxCommandEvent& event);
49 void OnCancel(wxCommandEvent& event);
50
51protected:
52
53#if wxUSE_SPINCTRL
54 wxSpinCtrl *m_spinctrl;
55#else
56 wxTextCtrl *m_spinctrl;
57#endif // wxUSE_SPINCTRL
58
59 long m_value, m_min, m_max;
60
61private:
62 DECLARE_EVENT_TABLE()
4b5e5cfb 63 DECLARE_DYNAMIC_CLASS(wxNumberEntryDialog)
fc5414a1
VZ
64 DECLARE_NO_COPY_CLASS(wxNumberEntryDialog)
65};
66
67// ----------------------------------------------------------------------------
68// function to get a number from user
69// ----------------------------------------------------------------------------
70
71long WXDLLEXPORT
72wxGetNumberFromUser(const wxString& message,
73 const wxString& prompt,
74 const wxString& caption,
75 long value = 0,
76 long min = 0,
77 long max = 100,
78 wxWindow *parent = (wxWindow *)NULL,
79 const wxPoint& pos = wxDefaultPosition);
80
81#endif // wxUSE_NUMBERDLG
82
83#endif // __NUMDLGH_G__
84