]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/generic/textdlgg.h
Declare wxObject
[wxWidgets.git] / include / wx / generic / textdlgg.h
... / ...
CommitLineData
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
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __TEXTDLGH_G__
13#define __TEXTDLGH_G__
14
15#if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "textdlgg.h"
17#endif
18
19#if wxUSE_TEXTDLG
20#include "wx/defs.h"
21
22#include "wx/dialog.h"
23
24#if wxUSE_VALIDATORS
25#include "wx/valtext.h"
26#endif
27
28class WXDLLEXPORT wxTextCtrl;
29
30WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr;
31WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
32
33#define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY)
34
35// ----------------------------------------------------------------------------
36// wxTextEntryDialog: a dialog with text control, [ok] and [cancel] buttons
37// ----------------------------------------------------------------------------
38
39class WXDLLEXPORT wxTextEntryDialog : public wxDialog
40{
41public:
42 wxTextEntryDialog(wxWindow *parent,
43 const wxString& message,
44 const wxString& caption = wxGetTextFromUserPromptStr,
45 const wxString& value = wxEmptyString,
46 long style = wxTextEntryDialogStyle,
47 const wxPoint& pos = wxDefaultPosition);
48
49 void SetValue(const wxString& val);
50 wxString GetValue() const { return m_value; }
51
52#if wxUSE_VALIDATORS
53 void SetTextValidator( wxTextValidator& validator );
54 void SetTextValidator( long style = wxFILTER_NONE );
55 wxTextValidator* GetTextValidator() { return (wxTextValidator*)m_textctrl->GetValidator(); }
56#endif
57 // wxUSE_VALIDATORS
58
59 // implementation only
60 void OnOK(wxCommandEvent& event);
61
62protected:
63 wxTextCtrl *m_textctrl;
64 wxString m_value;
65 long m_dialogStyle;
66
67private:
68 DECLARE_EVENT_TABLE()
69 DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
70 DECLARE_NO_COPY_CLASS(wxTextEntryDialog)
71};
72
73// ----------------------------------------------------------------------------
74// function to get a string from user
75// ----------------------------------------------------------------------------
76
77wxString WXDLLEXPORT
78wxGetTextFromUser(const wxString& message,
79 const wxString& caption = wxGetTextFromUserPromptStr,
80 const wxString& default_value = wxEmptyString,
81 wxWindow *parent = (wxWindow *) NULL,
82 int x = -1,
83 int y = -1,
84 bool centre = TRUE);
85
86wxString WXDLLEXPORT
87wxGetPasswordFromUser(const wxString& message,
88 const wxString& caption = wxGetTextFromUserPromptStr,
89 const wxString& default_value = wxEmptyString,
90 wxWindow *parent = (wxWindow *) NULL);
91
92#endif
93 // wxUSE_TEXTDLG
94#endif
95 // __TEXTDLGH_G__