diff --git a/include/wx/combo.h b/include/wx/combo.h index 658861ce13..2ac66cda0a 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -644,6 +644,8 @@ enum wxCP_IFLAG_CREATED = 0x0001 // Set by wxComboCtrlBase after Create is called }; +class WXDLLIMPEXP_FWD_CORE wxComboCtrl; + class WXDLLIMPEXP_CORE wxComboPopup { @@ -721,6 +723,9 @@ public: return (m_iFlags & wxCP_IFLAG_CREATED) ? true : false; } + // Returns pointer to the associated parent wxComboCtrl. + wxComboCtrl* GetComboCtrl() const; + // Default PaintComboControl behaviour static void DefaultPaintComboControl( wxComboCtrlBase* combo, wxDC& dc, diff --git a/interface/wx/combo.h b/interface/wx/combo.h index 4cfafc2598..4bcc4c9988 100644 --- a/interface/wx/combo.h +++ b/interface/wx/combo.h @@ -56,6 +56,11 @@ public: */ virtual wxSize GetAdjustedSize(int minWidth, int prefHeight, int maxHeight); + /** + Returns pointer to the associated parent wxComboCtrl. + */ + wxComboCtrl* GetComboCtrl() const; + /** The derived class must implement this to return pointer to the associated control created in Create(). diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 06b3cf23ce..17b6a37663 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -499,6 +499,11 @@ void wxComboPopup::OnDismiss() { } +wxComboCtrl* wxComboPopup::GetComboCtrl() const +{ + return wxStaticCast(m_combo, wxComboCtrl); +} + wxSize wxComboPopup::GetAdjustedSize( int minWidth, int prefHeight, int WXUNUSED(maxHeight) )