Document wxTE_MULTILINE support in wxTextEntryDialog.
It wasn't immediately obvious that this dialog could be used for multiline text entry too so mention it explicitly in the documentation. Also show this in action in the dialogs sample. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -152,6 +152,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
#endif // wxUSE_INFOBAR
|
||||
|
||||
#if wxUSE_TEXTDLG
|
||||
EVT_MENU(DIALOGS_LINE_ENTRY, MyFrame::LineEntry)
|
||||
EVT_MENU(DIALOGS_TEXT_ENTRY, MyFrame::TextEntry)
|
||||
EVT_MENU(DIALOGS_PASSWORD_ENTRY, MyFrame::PasswordEntry)
|
||||
#endif // wxUSE_TEXTDLG
|
||||
@@ -395,7 +396,8 @@ bool MyApp::OnInit()
|
||||
wxMenu *entry_menu = new wxMenu;
|
||||
|
||||
#if wxUSE_TEXTDLG
|
||||
entry_menu->Append(DIALOGS_TEXT_ENTRY, wxT("Text &entry\tCtrl-E"));
|
||||
entry_menu->Append(DIALOGS_LINE_ENTRY, wxT("Single line &entry\tCtrl-E"));
|
||||
entry_menu->Append(DIALOGS_TEXT_ENTRY, wxT("Multi line text &entry\tShift-Ctrl-E"));
|
||||
entry_menu->Append(DIALOGS_PASSWORD_ENTRY, wxT("&Password entry\tCtrl-P"));
|
||||
#endif // wxUSE_TEXTDLG
|
||||
|
||||
@@ -978,7 +980,7 @@ void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
}
|
||||
|
||||
void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::LineEntry(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxTextEntryDialog dialog(this,
|
||||
wxT("This is a small sample\n")
|
||||
@@ -992,6 +994,19 @@ void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event))
|
||||
wxMessageBox(dialog.GetValue(), wxT("Got string"), wxOK | wxICON_INFORMATION, this);
|
||||
}
|
||||
}
|
||||
|
||||
void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxTextEntryDialog dialog(this, "You can enter a multiline string here.",
|
||||
"Please enter some text",
|
||||
"First line\nSecond one\nAnd another one too",
|
||||
wxOK | wxCANCEL | wxTE_MULTILINE);
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxMessageBox(dialog.GetValue(), wxT("Got text"), wxOK | wxICON_INFORMATION, this);
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_TEXTDLG
|
||||
|
||||
#if wxUSE_CHOICEDLG
|
||||
|
Reference in New Issue
Block a user