Bugs item #3522074, was opened at 2012-04-27 10:50
Message generated for change (Tracker Item Submitted) made by tmodes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=3522074&group_id=51305

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: treelistctrl
Group: Subversion TRUNK
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: T. Modes (tmodes)
Assigned to: Ronan Chartois (pgriddev)
Summary: [wxTreeListCtrl] Incorrect width of hidden columns

Initial Comment:
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.
The attached patch fixes this issue. It consists of 2 parts:

Part 1: a change to the function: wxTreeListColumnInfo& GetColumn (int column);

take the following code:
void wxTreeListCtrl::SetColumnShown(int column, bool shown)
{
    wxASSERT_MSG (column != GetMainColumn(), _T("The main column may not be 
hidden") );
    m_header_win->SetColumn (column, 
GetColumn(column).SetShown(GetMainColumn()==column? true: shown));
    m_header_win->Refresh();
}

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.

Part 2: Extended all calls to column changes to check for visibility for 
calculation of m_total_col_width.

Beside this the patch contains 2 changes to compile with wxWidgets 2.9 and 
fixes a little warning (on MSVC).


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=3522074&group_id=51305

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
wxCode-users mailing list
wxCode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxcode-users

Reply via email to