]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
removing old xcode files
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index 761144bc8af01ae2eced2c34e4e375c79c4279f0..1c020573f544381590927e8bea5c7178b383e7ee 100644 (file)
@@ -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
 
@@ -539,8 +541,23 @@ bool MyApp::OnInit()
     menuHelp->Append(DIALOGS_ABOUTDLG_CUSTOM, wxT("About (&custom)...\tCtrl-Shift-F1"));
 #endif // wxUSE_ABOUTDLG
 
+    wxMenu* editMenu = new wxMenu;
+    editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z"));
+    editMenu->Append(wxID_REDO, _("&Redo\tCtrl+Y"));
+    editMenu->AppendSeparator();
+    editMenu->Append(wxID_CUT, _("Cu&t\tCtrl+X"));
+    editMenu->Append(wxID_COPY, _("&Copy\tCtrl+C"));
+    editMenu->Append(wxID_PASTE, _("&Paste\tCtrl+V"));
+    editMenu->Append(wxID_CLEAR, _("&Delete"));
+    
+    editMenu->AppendSeparator();
+    editMenu->Append(wxID_SELECTALL, _("Select All\tCtrl+A"));
+
     wxMenuBar *menubar = new wxMenuBar;
     menubar->Append(menuDlg, wxT("&Dialogs"));
+    
+    menubar->Append(editMenu, wxT("&Edit"));
+    
 #if wxUSE_ABOUTDLG
     menubar->Append(menuHelp, wxT("&Help"));
 #endif // wxUSE_ABOUTDLG
@@ -963,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")
@@ -977,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