]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
Added full UNICODE support for VisualAge C++ for OS/2 V4.0
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index fe0d694bbc548685db541c3ffb0109920aff2402..06adc34fb2995d19f3080bb751f6cd235a04f163 100644 (file)
@@ -56,7 +56,7 @@ bool MyApp::OnInit(void)
   m_canvasFont = *wxNORMAL_FONT;
 
   // Create the main frame window
-  MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows dialogs example", wxPoint(50, 50), wxSize(400, 300));
+  MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows dialogs example", wxPoint(20, 20), wxSize(400, 300));
 
   // Make a menubar
   wxMenu *file_menu = new wxMenu;
@@ -193,7 +193,7 @@ void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
 {
-  wxMessageDialog dialog(NULL, "This is a message box\nA long, long string to test out the message box properly",
+  wxMessageDialog dialog( this, "This is a message box\nA long, long string to test out the message box properly",
       "Message box text", wxYES_NO|wxCANCEL|wxICON_INFORMATION);
 
   dialog.ShowModal();
@@ -271,7 +271,7 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
 {
-    wxFileDialog dialog(this, "Testing save file dialog", "", "",
+    wxFileDialog dialog(this, "Testing save file dialog", "", "myletter.txt",
         "Text files (*.txt)|*.txt|Document files (*.doc)|*.doc",
         wxSAVE|wxOVERWRITE_PROMPT);
 
@@ -286,7 +286,11 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::DirChoose(wxCommandEvent& WXUNUSED(event) )
 {
-    wxDirDialog dialog(this, "Testing directory picker", "");
+    // pass some initial dir to wxDirDialog
+    wxString dirHome;
+    wxGetHomeDir(&dirHome);
+
+    wxDirDialog dialog(this, "Testing directory picker", dirHome);
 
     if (dialog.ShowModal() == wxID_OK)
     {