]> git.saurik.com Git - wxWidgets.git/commitdiff
wxMultiChoiceDialog uses now wxCheckListBox if possible, wxListBox if not
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 1 Nov 2005 22:35:50 +0000 (22:35 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 1 Nov 2005 22:35:50 +0000 (22:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/generic/choicdgg.h
src/generic/choicdgg.cpp

index d356938603071644dbd2812c6c36f5335fd7d37c..19d04d4309f43354555149f7b32c87ccc9b0fc6a 100644 (file)
@@ -24,6 +24,7 @@ All (GUI):
   wxLB_TOP, wxNB_TOP, wxCHB_TOP, wxTBK_TOP.
 - Added parent window parameter to wxHelpController constructor
   and added SetParentWindow/GetParentWindow.
   wxLB_TOP, wxNB_TOP, wxCHB_TOP, wxTBK_TOP.
 - Added parent window parameter to wxHelpController constructor
   and added SetParentWindow/GetParentWindow.
+- wxMultiChoiceDialog uses now wxCheckListBox if possible, wxListBox if not.
 
 wxMSW:
 
 
 wxMSW:
 
index 6678bc16b4357ffefd2a2f0e615a22156ba1a297..3699e126ca88015406530d030ac790b470bbcf98 100644 (file)
@@ -80,7 +80,11 @@ public:
                 long styleLbox = wxLB_ALWAYS_SB);
 
 protected:
                 long styleLbox = wxLB_ALWAYS_SB);
 
 protected:
-    wxListBox  *m_listbox;
+    wxListBoxBase *m_listbox;
+
+    virtual wxListBoxBase *CreateList(int n,
+                                      const wxString *choices,
+                                      long styleLbox);
 
     DECLARE_NO_COPY_CLASS(wxAnyChoiceDialog)
 };
 
     DECLARE_NO_COPY_CLASS(wxAnyChoiceDialog)
 };
@@ -206,6 +210,12 @@ public:
     virtual bool TransferDataFromWindow();
 
 protected:
     virtual bool TransferDataFromWindow();
 
 protected:
+#if wxUSE_CHECKLISTBOX
+    virtual wxListBoxBase *CreateList(int n,
+                                      const wxString *choices,
+                                      long styleLbox);
+#endif // wxUSE_CHECKLISTBOX
+
     wxArrayInt m_selections;
 
 private:
     wxArrayInt m_selections;
 
 private:
index cd5743cbae04035c59b0b55649ec243fe7c720b6..62beddd961620fb11aef87f269991e0f9f378725 100644 (file)
@@ -272,10 +272,8 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
     topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) );
 
     // 2) list box
     topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) );
 
     // 2) list box
-    m_listbox = new wxListBox( this, wxID_LISTBOX,
-                               wxDefaultPosition, wxDefaultSize,
-                               n, choices,
-                               styleLbox );
+    m_listbox = CreateList(n,choices,styleLbox);
+
     if ( n > 0 )
         m_listbox->SetSelection(0);
 
     if ( n > 0 )
         m_listbox->SetSelection(0);
 
@@ -326,6 +324,14 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
                   styleDlg, pos, styleLbox);
 }
 
                   styleDlg, pos, styleLbox);
 }
 
+wxListBoxBase *wxAnyChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
+{
+    return new wxListBox( this, wxID_LISTBOX,
+                          wxDefaultPosition, wxDefaultSize,
+                          n, choices,
+                          styleLbox );
+}
+
 // ----------------------------------------------------------------------------
 // wxSingleChoiceDialog
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxSingleChoiceDialog
 // ----------------------------------------------------------------------------
@@ -506,4 +512,16 @@ bool wxMultiChoiceDialog::TransferDataFromWindow()
     return true;
 }
 
     return true;
 }
 
+#if wxUSE_CHECKLISTBOX
+
+wxListBoxBase *wxMultiChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
+{
+    return new wxCheckListBox( this, wxID_LISTBOX,
+                               wxDefaultPosition, wxDefaultSize,
+                               n, choices,
+                               styleLbox );
+}
+
+#endif // wxUSE_CHECKLISTBOX
+
 #endif // wxUSE_CHOICEDLG
 #endif // wxUSE_CHOICEDLG