set listview extended styles after switching to report view and not only when creating it (bug 1874996) [backport of 51390 from trunk]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -135,6 +135,8 @@ wxMSW:
|
|||||||
a custom wxEVT_COMMAND_TEXT_* event handler.
|
a custom wxEVT_COMMAND_TEXT_* event handler.
|
||||||
- Fix wxComboBox to not lose the current value if it was programmatically set
|
- Fix wxComboBox to not lose the current value if it was programmatically set
|
||||||
to a value not in a list of choices on popup close (Kolya Kosenko)
|
to a value not in a list of choices on popup close (Kolya Kosenko)
|
||||||
|
- Switching wxListCtrl to report mode from another one now uses full row
|
||||||
|
highlight, just as if the control were created in report mode initially
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -431,6 +431,11 @@ private:
|
|||||||
// process NM_CUSTOMDRAW notification message
|
// process NM_CUSTOMDRAW notification message
|
||||||
WXLPARAM OnCustomDraw(WXLPARAM lParam);
|
WXLPARAM OnCustomDraw(WXLPARAM lParam);
|
||||||
|
|
||||||
|
// set the extended styles for the control (used by Create() and
|
||||||
|
// UpdateStyle()), only should be called if InReportView()
|
||||||
|
void MSWSetExListStyles();
|
||||||
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxListCtrl)
|
DECLARE_DYNAMIC_CLASS(wxListCtrl)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_NO_COPY_CLASS(wxListCtrl)
|
DECLARE_NO_COPY_CLASS(wxListCtrl)
|
||||||
|
@@ -338,15 +338,21 @@ bool wxListCtrl::Create(wxWindow *parent,
|
|||||||
// GetTextColour will always return black
|
// GetTextColour will always return black
|
||||||
SetTextColour(GetDefaultAttributes().colFg);
|
SetTextColour(GetDefaultAttributes().colFg);
|
||||||
|
|
||||||
|
if ( InReportView() )
|
||||||
|
MSWSetExListStyles();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListCtrl::MSWSetExListStyles()
|
||||||
|
{
|
||||||
// for comctl32.dll v 4.70+ we want to have some non default extended
|
// for comctl32.dll v 4.70+ we want to have some non default extended
|
||||||
// styles because it's prettier (and also because wxGTK does it like this)
|
// styles because it's prettier (and also because wxGTK does it like this)
|
||||||
if ( InReportView() && wxApp::GetComCtl32Version() >= 470 )
|
if ( wxApp::GetComCtl32Version() >= 470 )
|
||||||
{
|
{
|
||||||
::SendMessage(GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE,
|
::SendMessage(GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE,
|
||||||
0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);
|
0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||||
@@ -445,6 +451,11 @@ void wxListCtrl::UpdateStyle()
|
|||||||
if ( dwStyleOld != dwStyleNew )
|
if ( dwStyleOld != dwStyleNew )
|
||||||
{
|
{
|
||||||
::SetWindowLong(GetHwnd(), GWL_STYLE, dwStyleNew);
|
::SetWindowLong(GetHwnd(), GWL_STYLE, dwStyleNew);
|
||||||
|
|
||||||
|
// if we switched to the report view, set the extended styles for
|
||||||
|
// it too
|
||||||
|
if ( !(dwStyleOld & LVS_REPORT) && (dwStyleNew & LVS_REPORT) )
|
||||||
|
MSWSetExListStyles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user