fixed SetWindowStyleFlag() to not remove WS_VISIBLE; also refresh the control automatically (closes bug 1019440)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -278,6 +278,7 @@ wxMSW:
|
|||||||
- fixed wxMaximizeEvent generation in wxFrame
|
- fixed wxMaximizeEvent generation in wxFrame
|
||||||
- don't send duplicate EVT_COMBOBOX events whenever selection changes any more
|
- don't send duplicate EVT_COMBOBOX events whenever selection changes any more
|
||||||
- implemented support for selecting printer bin (Steven Van Ingelgem)
|
- implemented support for selecting printer bin (Steven Van Ingelgem)
|
||||||
|
- fixed wxListCtrl::SetSingleStyle() which was broken since a few releases
|
||||||
|
|
||||||
wxUniv/X11:
|
wxUniv/X11:
|
||||||
|
|
||||||
|
@@ -447,9 +447,17 @@ void wxListCtrl::UpdateStyle()
|
|||||||
// The new window view style
|
// The new window view style
|
||||||
DWORD dwStyleNew = MSWGetStyle(m_windowStyle, NULL);
|
DWORD dwStyleNew = MSWGetStyle(m_windowStyle, NULL);
|
||||||
|
|
||||||
|
// some styles are not returned by MSWGetStyle()
|
||||||
|
if ( IsShown() )
|
||||||
|
dwStyleNew |= WS_VISIBLE;
|
||||||
|
|
||||||
// Get the current window style.
|
// Get the current window style.
|
||||||
DWORD dwStyleOld = ::GetWindowLong(GetHwnd(), GWL_STYLE);
|
DWORD dwStyleOld = ::GetWindowLong(GetHwnd(), GWL_STYLE);
|
||||||
|
|
||||||
|
// we don't have wxVSCROLL style, but the list control may have it,
|
||||||
|
// don't change it then
|
||||||
|
dwStyleNew |= dwStyleOld & (WS_HSCROLL | WS_VSCROLL);
|
||||||
|
|
||||||
// Only set the window style if the view bits have changed.
|
// Only set the window style if the view bits have changed.
|
||||||
if ( dwStyleOld != dwStyleNew )
|
if ( dwStyleOld != dwStyleNew )
|
||||||
{
|
{
|
||||||
@@ -510,30 +518,25 @@ void wxListCtrl::SetSingleStyle(long style, bool add)
|
|||||||
flag = flag & ~wxLC_MASK_SORT;
|
flag = flag & ~wxLC_MASK_SORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( flag & style )
|
if ( add )
|
||||||
{
|
flag |= style;
|
||||||
if ( !add )
|
|
||||||
flag -= style;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
flag &= ~style;
|
||||||
if ( add )
|
|
||||||
{
|
|
||||||
flag |= style;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_windowStyle = flag;
|
SetWindowStyleFlag(flag);
|
||||||
|
|
||||||
UpdateStyle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the whole window style
|
// Set the whole window style
|
||||||
void wxListCtrl::SetWindowStyleFlag(long flag)
|
void wxListCtrl::SetWindowStyleFlag(long flag)
|
||||||
{
|
{
|
||||||
m_windowStyle = flag;
|
if ( flag != m_windowStyle )
|
||||||
|
{
|
||||||
|
m_windowStyle = flag;
|
||||||
|
|
||||||
UpdateStyle();
|
UpdateStyle();
|
||||||
|
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user