X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7962f85aaeb3014f9b77cffb67811b24dbb2473f..13e24d79876b78545ba300e6b6871bc47af60848:/src/generic/odcombo.cpp diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index 575641d93d..3e62b8349d 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -116,7 +116,7 @@ void wxVListBoxComboPopup::PaintComboControl( wxDC& dc, const wxRect& rect ) if ( m_value >= 0 ) { - OnDrawItem(dc,rect,m_value,wxODCB_PAINTING_CONTROL); + OnDrawItem(dc,rect,m_value,flags); return; } } @@ -129,13 +129,20 @@ void wxVListBoxComboPopup::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) co // TODO: Maybe this code could be moved to wxVListBox::OnPaint? dc.SetFont(m_useFont); + int flags = 0; + // Set correct text colour for selected items if ( wxVListBox::GetSelection() == (int) n ) + { dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) ); + flags |= wxODCB_PAINTING_SELECTED; + } else + { dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) ); + } - OnDrawItem(dc,rect,(int)n,0); + OnDrawItem(dc,rect,(int)n,flags); } wxCoord wxVListBoxComboPopup::OnMeasureItem(size_t n) const @@ -399,7 +406,7 @@ void wxVListBoxComboPopup::OnMouseMove(wxMouseEvent& event) const size_t lineMax = GetVisibleEnd(); for ( size_t line = GetVisibleBegin(); line < lineMax; line++ ) { - y -= OnGetLineHeight(line); + y -= OnGetRowHeight(line); if ( y < 0 ) { // Only change selection if item is fully visible @@ -797,7 +804,19 @@ BEGIN_EVENT_TABLE(wxOwnerDrawnComboBox, wxComboCtrl) END_EVENT_TABLE() +#if wxUSE_EXTENDED_RTTI +IMPLEMENT_DYNAMIC_CLASS2_XTI(wxOwnerDrawnComboBox, wxComboCtrl, wxControlWithItems, "wx/odcombo.h") + +wxBEGIN_PROPERTIES_TABLE(wxOwnerDrawnComboBox) +wxEND_PROPERTIES_TABLE() + +wxBEGIN_HANDLERS_TABLE(wxOwnerDrawnComboBox) +wxEND_HANDLERS_TABLE() + +wxCONSTRUCTOR_5( wxOwnerDrawnComboBox , wxWindow* , Parent , wxWindowID , Id , wxString , Value , wxPoint , Position , wxSize , Size ) +#else IMPLEMENT_DYNAMIC_CLASS2(wxOwnerDrawnComboBox, wxComboCtrl, wxControlWithItems) +#endif void wxOwnerDrawnComboBox::Init() {