]> git.saurik.com Git - wxWidgets.git/commitdiff
ok, it does work - it's just that wxGTK doesn't
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Nov 2000 21:11:41 +0000 (21:11 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Nov 2000 21:11:41 +0000 (21:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/choicdgg.h
samples/dialogs/dialogs.cpp
src/generic/choicdgg.cpp

index ff12c18d9233fd127ba9997dd65dbdee499e8253..9bba7c06db9542f3a951831ed7af1b78a24f724e 100644 (file)
@@ -164,14 +164,13 @@ public:
     wxArrayInt GetSelections() const { return m_selections; }
 
     // implementation from now on
-    void OnOK(wxCommandEvent& event);
+    virtual bool TransferDataFromWindow();
 
 protected:
     wxArrayInt m_selections;
 
 private:
     DECLARE_DYNAMIC_CLASS(wxMultiChoiceDialog)
-    DECLARE_EVENT_TABLE()
 };
 
 // ----------------------------------------------------------------------------
index cafe3bdf228ddbcafa001f6a3ed4ce5331fc93fd..f2d8a6ead2814aaa40e9744511385bbd60718a3d 100644 (file)
@@ -365,12 +365,14 @@ void MyFrame::MultiChoice(wxCommandEvent& WXUNUSED(event) )
                                         this);
     if ( count )
     {
-        wxLogMessage("You selected %u items:", count);
+        wxString msg;
+        msg.Printf("You selected %u items:\n", count);
         for ( size_t n = 0; n < count; n++ )
         {
-            wxLogMessage("\t%u: %u (%s)", n, selections[n],
-                         choices[selections[n]].c_str());
+            msg += wxString::Format("\t%u: %u (%s)\n", n, selections[n],
+                                    choices[selections[n]].c_str());
         }
+        wxLogMessage(msg);
     }
     //else: cancelled or nothing selected
 }
index 62a5371f1572bd82cbfb992e876dac3f971a2ce7..b99fe2057f6ef1cbe3b26d3800b2e3755ff507c5 100644 (file)
@@ -436,10 +436,6 @@ void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
 // wxMultiChoiceDialog
 // ----------------------------------------------------------------------------
 
-BEGIN_EVENT_TABLE(wxMultiChoiceDialog, wxDialog)
-    EVT_BUTTON(wxID_OK, wxMultiChoiceDialog::OnOK)
-END_EVENT_TABLE()
-
 IMPLEMENT_DYNAMIC_CLASS(wxMultiChoiceDialog, wxDialog)
 
 bool wxMultiChoiceDialog::Create( wxWindow *parent,
@@ -453,7 +449,7 @@ bool wxMultiChoiceDialog::Create( wxWindow *parent,
     if ( !wxAnyChoiceDialog::Create(parent, message, caption,
                                     n, choices,
                                     style, pos,
-                                    wxLB_ALWAYS_SB | wxLB_MULTIPLE) )
+                                    wxLB_ALWAYS_SB | wxLB_EXTENDED) )
         return FALSE;
 
     return TRUE;
@@ -468,7 +464,7 @@ void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections)
     }
 }
 
-void wxMultiChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
+bool wxMultiChoiceDialog::TransferDataFromWindow()
 {
     m_selections.Empty();
     size_t count = m_listbox->GetCount();
@@ -478,5 +474,5 @@ void wxMultiChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
             m_selections.Add(n);
     }
 
-    EndModal(wxID_OK);
+    return TRUE;
 }