Added GetWidestItem() and GetWidestItemWidth() to wxVListBoxComboPopup

and wxOwnerDrawnComboBox as per Jaakko Salli


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Alex Bligh
2006-07-06 17:42:39 +00:00
parent ca5db7b213
commit d9e0958c7e
2 changed files with 49 additions and 29 deletions

View File

@@ -157,6 +157,12 @@ protected:
void OnKey(wxKeyEvent& event);
void OnLeftClick(wxMouseEvent& event);
// Return the widest item width (recalculating it if necessary)
int GetWidestItemWidth() { CalcWidths(); return m_widestWidth; }
// Return the index of the widest item (recalculating it if necessary)
int GetWidestItem() { CalcWidths(); return m_widestItem; }
wxArrayString m_strings;
wxArrayPtrVoid m_clientDatas;
@@ -189,6 +195,9 @@ private:
// has the mouse been released on this control?
bool m_clicked;
// Recalculate widths if they are dirty
void CalcWidths();
DECLARE_EVENT_TABLE()
};
@@ -293,6 +302,12 @@ public:
wxComboCtrl::SetSelection(from,to);
}
// Return the widest item width (recalculating it if necessary)
virtual int GetWidestItemWidth() { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItemWidth(); }
// Return the index of the widest item (recalculating it if necessary)
virtual int GetWidestItem() { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItem(); }
wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
protected: