#include "wx/validate.h"
#endif
+#include "wx/tooltip.h"
#include "wx/popupwin.h"
#include "wx/univ/renderer.h"
virtual bool SetSelection(const wxString& value);
virtual wxControl *GetControl() { return this; }
virtual void OnShow();
+ virtual wxCoord GetBestWidth() const;
protected:
// we shouldn't return height too big from here
{
wxSize sizeBtn = m_btn->GetBestSize(),
sizeText = m_text->GetBestSize();
+ wxCoord widthPopup = 0;
- return wxSize(sizeText.x + g_comboMargin + sizeBtn.x, wxMax(sizeBtn.y, sizeText.y));
+ if (m_popup)
+ {
+ widthPopup = m_popup->GetBestWidth();
+ }
+
+ return wxSize(wxMax(sizeText.x + g_comboMargin + sizeBtn.x, widthPopup),
+ wxMax(sizeBtn.y, sizeText.y));
}
void wxComboControl::DoMoveWindow(int x, int y, int width, int height)
return TRUE;
}
+#if wxUSE_TOOLTIPS
+void wxComboControl::DoSetToolTip(wxToolTip *tooltip)
+{
+ wxControl::DoSetToolTip(tooltip);
+
+ // Set tool tip for button and text box
+ if (m_text && m_btn)
+ {
+ if (tooltip)
+ {
+ const wxString &tip = tooltip->GetTip();
+ m_text->SetToolTip(tip);
+ m_btn->SetToolTip(tip);
+ }
+ else
+ {
+ m_text->SetToolTip(NULL);
+ m_btn->SetToolTip(NULL);
+ }
+ }
+}
+#endif // wxUSE_TOOLTIPS
+
// ----------------------------------------------------------------------------
// popup window handling
// ----------------------------------------------------------------------------
}
}
+wxCoord wxComboListBox::GetBestWidth() const
+{
+ wxSize size = wxListBox::GetBestSize();
+ return size.x;
+}
+
wxSize wxComboListBox::DoGetBestClientSize() const
{
// don't return size too big or we risk to not fit on the screen