]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/textdlgg.h
Updated version numbers to 2.3.1
[wxWidgets.git] / include / wx / generic / textdlgg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: textdlgg.h
3 // Purpose: wxStatusBar class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __TEXTDLGH_G__
13 #define __TEXTDLGH_G__
14
15 #ifdef __GNUG__
16 #pragma interface "textdlgg.h"
17 #endif
18
19 #include "wx/defs.h"
20
21 #include "wx/dialog.h"
22
23 class WXDLLEXPORT wxTextCtrl;
24
25 WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr;
26 WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
27
28 #define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE)
29
30 // ----------------------------------------------------------------------------
31 // wxTextEntryDialog: a dialog with text control, [ok] and [cancel] buttons
32 // ----------------------------------------------------------------------------
33
34 class WXDLLEXPORT wxTextEntryDialog : public wxDialog
35 {
36 public:
37 wxTextEntryDialog(wxWindow *parent,
38 const wxString& message,
39 const wxString& caption = wxGetTextFromUserPromptStr,
40 const wxString& value = wxEmptyString,
41 long style = wxTextEntryDialogStyle,
42 const wxPoint& pos = wxDefaultPosition);
43
44 void SetValue(const wxString& val) { m_value = val; }
45 wxString GetValue() const { return m_value; }
46
47 // implementation only
48 void OnOK(wxCommandEvent& event);
49
50 protected:
51 wxTextCtrl *m_textctrl;
52 wxString m_value;
53 long m_dialogStyle;
54
55 private:
56 DECLARE_EVENT_TABLE()
57 DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
58 };
59
60 // ----------------------------------------------------------------------------
61 // function to get a string from user
62 // ----------------------------------------------------------------------------
63
64 wxString WXDLLEXPORT
65 wxGetTextFromUser(const wxString& message,
66 const wxString& caption = wxGetTextFromUserPromptStr,
67 const wxString& default_value = wxEmptyString,
68 wxWindow *parent = (wxWindow *) NULL,
69 int x = -1,
70 int y = -1,
71 bool centre = TRUE);
72
73 wxString WXDLLEXPORT
74 wxGetPasswordFromUser(const wxString& message,
75 const wxString& caption = wxGetTextFromUserPromptStr,
76 const wxString& default_value = wxEmptyString,
77 wxWindow *parent = (wxWindow *) NULL);
78
79 #endif
80 // __TEXTDLGH_G__