<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 141: [wxTreeListCtrl] Incorrect width of hidden columns</title><link>https://sourceforge.net/p/wxcode/bugs/141/</link><description>Recent changes to 141: [wxTreeListCtrl] Incorrect width of hidden columns</description><atom:link href="https://sourceforge.net/p/wxcode/bugs/141/feed.rss" rel="self"/><language>en</language><lastBuildDate>Fri, 27 Apr 2012 17:50:02 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/wxcode/bugs/141/feed.rss" rel="self" type="application/rss+xml"/><item><title>[wxTreeListCtrl] Incorrect width of hidden columns</title><link>https://sourceforge.net/p/wxcode/bugs/141/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The existing code for calculation of the column width does not consider hidden columns. The width is always the same, even when I hide all column beside the main column. The width remains always the same. I refer to the inner width and the scrollbars inside the wxTreeListCtrl.&lt;br /&gt;
The attached patch fixes this issue. It consists of 2 parts:&lt;/p&gt;
&lt;p&gt;Part 1: a change to the function: wxTreeListColumnInfo&amp;amp; GetColumn (int column);&lt;/p&gt;
&lt;p&gt;take the following code:&lt;br /&gt;
void wxTreeListCtrl::SetColumnShown(int column, bool shown)&lt;br /&gt;
{&lt;br /&gt;
wxASSERT_MSG (column != GetMainColumn(), _T("The main column may not be hidden") );&lt;br /&gt;
m_header_win-&amp;gt;SetColumn (column, GetColumn(column).SetShown(GetMainColumn()==column? true: shown));&lt;br /&gt;
m_header_win-&amp;gt;Refresh();&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;GetColumn(column) returns a reference to the column information of the control and therefore SetShown modifies it directly. Calling SetColumn now does not work correctly because the column information has already been updated before the call to SetColumn happens. So I changed GetColumn to return a copy (and not a reference), which can then modified and passed to SetColumn.&lt;/p&gt;
&lt;p&gt;Part 2: Extended all calls to column changes to check for visibility for calculation of m_total_col_width.&lt;/p&gt;
&lt;p&gt;Beside this the patch contains 2 changes to compile with wxWidgets 2.9 and fixes a little warning (on MSVC).&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">T. Modes</dc:creator><pubDate>Fri, 27 Apr 2012 17:50:02 -0000</pubDate><guid>https://sourceforge.net67352287506bc422ee557ca66285c46c78a46079</guid></item></channel></rss>