]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: textdlgg.h | |
fc5414a1 | 3 | // Purpose: wxTextEntryDialog class |
c801d85f KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef __TEXTDLGH_G__ | |
13 | #define __TEXTDLGH_G__ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
c50f1fb9 | 16 | #pragma interface "textdlgg.h" |
c801d85f KB |
17 | #endif |
18 | ||
d7260478 | 19 | #if wxUSE_TEXTDLG |
c50f1fb9 VZ |
20 | #include "wx/defs.h" |
21 | ||
c801d85f KB |
22 | #include "wx/dialog.h" |
23 | ||
fc0d5b6b JS |
24 | #if wxUSE_VALIDATORS |
25 | #include "wx/valtext.h" | |
26 | #endif | |
27 | ||
dfe1eee3 VZ |
28 | class WXDLLEXPORT wxTextCtrl; |
29 | ||
9d2f3c71 | 30 | WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr; |
c801d85f | 31 | |
fc0d5b6b | 32 | #define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY) |
a294c6d5 VZ |
33 | |
34 | // ---------------------------------------------------------------------------- | |
35 | // wxTextEntryDialog: a dialog with text control, [ok] and [cancel] buttons | |
36 | // ---------------------------------------------------------------------------- | |
37 | ||
c50f1fb9 | 38 | class WXDLLEXPORT wxTextEntryDialog : public wxDialog |
c801d85f | 39 | { |
c801d85f | 40 | public: |
c50f1fb9 VZ |
41 | wxTextEntryDialog(wxWindow *parent, |
42 | const wxString& message, | |
43 | const wxString& caption = wxGetTextFromUserPromptStr, | |
44 | const wxString& value = wxEmptyString, | |
a294c6d5 | 45 | long style = wxTextEntryDialogStyle, |
c50f1fb9 | 46 | const wxPoint& pos = wxDefaultPosition); |
c801d85f | 47 | |
a8f6ef51 | 48 | void SetValue(const wxString& val); |
c50f1fb9 | 49 | wxString GetValue() const { return m_value; } |
c801d85f | 50 | |
fc0d5b6b JS |
51 | #if wxUSE_VALIDATORS |
52 | void SetTextValidator( wxTextValidator& validator ); | |
53 | void SetTextValidator( long style = wxFILTER_NONE ); | |
54 | wxTextValidator* GetTextValidator() { return (wxTextValidator*)m_textctrl->GetValidator(); } | |
55 | #endif | |
56 | // wxUSE_VALIDATORS | |
57 | ||
c50f1fb9 | 58 | // implementation only |
c801d85f KB |
59 | void OnOK(wxCommandEvent& event); |
60 | ||
c50f1fb9 VZ |
61 | protected: |
62 | wxTextCtrl *m_textctrl; | |
63 | wxString m_value; | |
479cd5de | 64 | long m_dialogStyle; |
c50f1fb9 VZ |
65 | |
66 | private: | |
67 | DECLARE_EVENT_TABLE() | |
a294c6d5 | 68 | DECLARE_DYNAMIC_CLASS(wxTextEntryDialog) |
22f3361e | 69 | DECLARE_NO_COPY_CLASS(wxTextEntryDialog) |
c801d85f KB |
70 | }; |
71 | ||
c49245f8 | 72 | // ---------------------------------------------------------------------------- |
31528cd3 | 73 | // function to get a string from user |
c49245f8 VZ |
74 | // ---------------------------------------------------------------------------- |
75 | ||
c50f1fb9 VZ |
76 | wxString WXDLLEXPORT |
77 | wxGetTextFromUser(const wxString& message, | |
78 | const wxString& caption = wxGetTextFromUserPromptStr, | |
79 | const wxString& default_value = wxEmptyString, | |
80 | wxWindow *parent = (wxWindow *) NULL, | |
13d13a9e WS |
81 | wxCoord x = wxDefaultCoord, |
82 | wxCoord y = wxDefaultCoord, | |
ca65c044 | 83 | bool centre = true); |
c801d85f | 84 | |
a294c6d5 VZ |
85 | wxString WXDLLEXPORT |
86 | wxGetPasswordFromUser(const wxString& message, | |
87 | const wxString& caption = wxGetTextFromUserPromptStr, | |
88 | const wxString& default_value = wxEmptyString, | |
89 | wxWindow *parent = (wxWindow *) NULL); | |
90 | ||
d7260478 JS |
91 | #endif |
92 | // wxUSE_TEXTDLG | |
c801d85f KB |
93 | #endif |
94 | // __TEXTDLGH_G__ |