#12806: wxListCtrl: height of images is ignored
--------------------+-------------------------------------------------------
Reporter: Elmi | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.8.11
Keywords: | Blockedby:
Patch: 0 | Blocking:
--------------------+-------------------------------------------------------
I use following code to create a four column wxListCtrl with an image in
the first row:
{{{
m_item_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxLC_REPORT);
m_pImageList = new wxImageList(106,52,false);
m_item_list->SetImageList(m_pImageList, wxIMAGE_LIST_SMALL);
...
m_pImageList->Add(*myBitmap);
item.SetImage(m_imgCnt);
item.SetId(m_item_list->GetItemCount());
idx=m_item_list->InsertItem(item);
m_item_list->SetItem(idx,1,name);
idStr=wxString::Format(_("%d"),object->data.id);
m_item_list->SetItem(idx,2,idStr);
m_item_list->SetItem(idx,3,comment);
}}}
Using windows I get a row height which is sligtly too big, here the lower
line of the image is drawn twice. Using wxGTK the height of the image is
ignored completely, here the height of the text is taken for the row
height so that the images overlap each other.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/12806>
#12806: wxListCtrl: height of images is ignored
--------------------+-------------------------------------------------------
Reporter: Elmi | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9-svn
Keywords: | Blockedby:
Patch: 1 | Blocking:
--------------------+-------------------------------------------------------
Changes (by Elmi):
* version: 2.8.11 => 2.9-svn
* patch: 0 => 1
Comment:
The attached patch solves the problem:
Whenever the very first item is added to the list there is already a item
height cached (which might be done using the font height). Now every new
item may contain an image, and in worst case every new item may contain an
image with a different height. So this patch resets the stored height so
that it can be re-calculated again using the images out of the current
image list.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/12806#comment:1>
#12806: wxListCtrl: height of images is ignored
--------------------+-------------------------------------------------------
Reporter: Elmi | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9-svn
Keywords: | Blockedby:
Patch: 1 | Blocking:
--------------------+-------------------------------------------------------
Comment(by Elmi):
Patch updated according to given feedback: resetting the stored row height
only in case the new image is larger than the current height value
--
Ticket URL: <http://trac.wxwidgets.org/ticket/12806#comment:2>
#12806: wxListCtrl: height of images is ignored
---------------------+------------------------------------------------------
Reporter: Elmi | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxGTK | Version: 2.9-svn
Resolution: fixed | Keywords:
Blockedby: | Patch: 1
Blocking: |
---------------------+------------------------------------------------------
Changes (by VZ):
* status: new => closed
* resolution: => fixed
Comment:
(In [67615]) Update line height in generic wxListCtrl to match images
height.
The height of the items of the generic wxListCtrl remained too small if an
image of a greater than standard size was used.
Fix this by forcing the line height recalculation when adding an item
using an
image higher than the current line height.
Closes #12806.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/12806#comment:3>