Fixed setting colours of wxSlider and wxRadioBox in wxMSW.
Sibling windows (like labels and radio buttons) need to be explicitly refreshed when foreground or background colour is changed. This is implemented by invoking newly implemented method wxSubwindows::Refresh every time the colour of the control is changed. Note: Setting foreground colour of wxRadioBox still doesn't work correctly when themes are enabled. Closes #17142.
This commit is contained in:
committed by
Vadim Zeitlin
parent
7f08dbbf78
commit
865c8565af
@@ -128,6 +128,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// add all windows to update region to force redraw
|
||||
void Refresh()
|
||||
{
|
||||
for ( size_t n = 0; n < m_count; n++ )
|
||||
{
|
||||
if ( m_hwnds[n] )
|
||||
{
|
||||
::InvalidateRect(m_hwnds[n], NULL, FALSE /* don't erase bg */);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// find the bounding box for all windows
|
||||
wxRect GetBoundingBox() const
|
||||
{
|
||||
@@ -212,7 +224,29 @@ private:
|
||||
subwins->SetFont(font); \
|
||||
\
|
||||
return true; \
|
||||
}
|
||||
} \
|
||||
\
|
||||
bool cname::SetForegroundColour(const wxColour& colour) \
|
||||
{ \
|
||||
if ( !base::SetForegroundColour(colour) ) \
|
||||
return false; \
|
||||
\
|
||||
if ( subwins ) \
|
||||
subwins->Refresh(); \
|
||||
\
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
bool cname::SetBackgroundColour(const wxColour& colour) \
|
||||
{ \
|
||||
if ( !base::SetBackgroundColour(colour) ) \
|
||||
return false; \
|
||||
\
|
||||
if ( subwins ) \
|
||||
subwins->Refresh(); \
|
||||
\
|
||||
return true; \
|
||||
} \
|
||||
|
||||
|
||||
#endif // _WX_MSW_SUBWIN_H_
|
||||
|
Reference in New Issue
Block a user