X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1e1272f2020447bc26e10fc2cb2809e0b8eb856..1a19e369fbce12ce4d8097fc08609a436748a6ed:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index a3e4d59802..d1e2359f23 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2027,7 +2027,8 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) // and the width of the icon, if any static const int MARGIN_BETWEEN_TEXT_AND_ICON = 2; - int ix, iy; + int ix = 0, // init them just to suppress the compiler warnings + iy = 0; const int image = item.m_image; wxImageListType *imageList; if ( image != -1 ) @@ -2579,8 +2580,16 @@ wxCoord wxListMainWindow::GetLineHeight() const if ( y < SCROLL_UNIT_Y ) y = SCROLL_UNIT_Y; - y += EXTRA_HEIGHT; + if ( m_small_image_list && m_small_image_list->GetImageCount() ) + { + int iw = 0; + int ih = 0; + m_small_image_list->GetSize(0, iw, ih); + y = wxMax(y, ih); + } + + y += EXTRA_HEIGHT; self->m_lineHeight = y + LINE_SPACING; } @@ -3407,7 +3416,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() ); le.m_itemIndex = m_current; GetLine(m_current)->GetItem( 0, le.m_item ); - le.m_code = (int)event.KeyCode(); + le.m_code = event.GetKeyCode(); le.SetEventObject( parent ); parent->GetEventHandler()->ProcessEvent( le ); } @@ -3424,7 +3433,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) ke.SetEventObject( parent ); if (parent->GetEventHandler()->ProcessEvent( ke )) return; - if (event.KeyCode() == WXK_TAB) + if (event.GetKeyCode() == WXK_TAB) { wxNavigationKeyEvent nevent; nevent.SetWindowChange( event.ControlDown() ); @@ -3442,7 +3451,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) return; } - switch (event.KeyCode()) + switch (event.GetKeyCode()) { case WXK_UP: if ( m_current > 0 ) @@ -3685,6 +3694,7 @@ void wxListMainWindow::SetImageList( wxImageListType *imageList, int which ) { m_small_image_list = imageList; m_small_spacing = width + 14; + m_lineHeight = 0; // ensure that the line height will be recalc'd } }