]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/combobox.cpp
include wx/arrstr.h as it's needed by wxImageHandler and may not be implicitly includ...
[wxWidgets.git] / samples / widgets / combobox.cpp
index 6518ddd09f519452cc1ea5c2a241222900647b90..ecaea3e41996f89419106dd04e199d7d49c87c8a 100644 (file)
@@ -93,6 +93,7 @@ public:
     ComboboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
 
     virtual wxControl *GetWidget() const { return m_combobox; }
+    virtual wxTextEntryBase *GetTextEntry() const { return m_combobox; }
     virtual wxItemContainer* GetContainer() const { return m_combobox; }
     virtual void RecreateWidget() { CreateCombo(); }
 
@@ -113,6 +114,8 @@ protected:
     void OnButtonSetValue(wxCommandEvent& event);
     void OnButtonSetCurrent(wxCommandEvent& event);
 
+    void OnDropdown(wxCommandEvent& event);
+    void OnCloseup(wxCommandEvent& event);
     void OnComboBox(wxCommandEvent& event);
     void OnComboText(wxCommandEvent& event);
 
@@ -198,6 +201,8 @@ BEGIN_EVENT_TABLE(ComboboxWidgetsPage, WidgetsPage)
     EVT_UPDATE_UI(ComboPage_SetCurrent, ComboboxWidgetsPage::OnUpdateUISetCurrent)
 
     EVT_COMBOBOX(ComboPage_Combo, ComboboxWidgetsPage::OnComboBox)
+    EVT_COMBOBOX_DROPDOWN(ComboPage_Combo, ComboboxWidgetsPage::OnDropdown)
+    EVT_COMBOBOX_CLOSEUP(ComboPage_Combo, ComboboxWidgetsPage::OnCloseup)
     EVT_TEXT(ComboPage_Combo, ComboboxWidgetsPage::OnComboText)
     EVT_TEXT_ENTER(ComboPage_Combo, ComboboxWidgetsPage::OnComboText)
 
@@ -428,7 +433,7 @@ void ComboboxWidgetsPage::CreateCombo()
         m_combobox->Append(items[n]);
     }
 
-    m_sizerCombo->Add(m_combobox, 1, wxGROW | wxALL, 5);
+    m_sizerCombo->Add(m_combobox, 0, wxGROW | wxALL, 5);
     m_sizerCombo->Layout();
 }
 
@@ -635,6 +640,16 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
     CreateCombo();
 }
 
+void ComboboxWidgetsPage::OnDropdown(wxCommandEvent& WXUNUSED(event))
+{
+    wxLogMessage(_T("Combobox dropped down"));
+}
+
+void ComboboxWidgetsPage::OnCloseup(wxCommandEvent& WXUNUSED(event))
+{
+    wxLogMessage(_T("Combobox closed up"));
+}
+
 #endif //wxUSE_COMBOBOX
 
 #endif