Fix background colour returned by wxTextCtrl::GetStyle() in wxMSW
Don't return the background colour unless it's really set, otherwise we returned black background even if it was never changed.
This commit is contained in:
@@ -94,6 +94,7 @@ wxMSW:
|
|||||||
- Fix crash when using wxCHMHelpController() in 64 bit builds (Xlord2).
|
- Fix crash when using wxCHMHelpController() in 64 bit builds (Xlord2).
|
||||||
- Fix MDI menu display after failure to create a child frame (troelsk).
|
- Fix MDI menu display after failure to create a child frame (troelsk).
|
||||||
- Fix wxScreenDC::GetSize() with multiple monitors (iwbnwif).
|
- Fix wxScreenDC::GetSize() with multiple monitors (iwbnwif).
|
||||||
|
- Fix background colour returned by wxTextCtrl::GetStyle() (Andreas Falkenhahn).
|
||||||
|
|
||||||
wxOSX:
|
wxOSX:
|
||||||
|
|
||||||
|
@@ -3054,8 +3054,13 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
|
|||||||
#if wxUSE_RICHEDIT2
|
#if wxUSE_RICHEDIT2
|
||||||
if ( m_verRichEdit != 1 )
|
if ( m_verRichEdit != 1 )
|
||||||
{
|
{
|
||||||
// cf.dwMask |= CFM_BACKCOLOR;
|
// Notice that, surprisingly, CFM_BACKCOLOR is still set in the mask
|
||||||
style.SetBackgroundColour(wxColour(cf.crBackColor));
|
// even when CFE_AUTOBACKCOLOR is set in the effects, indicating that
|
||||||
|
// the background colour is not used.
|
||||||
|
if ( !(cf.dwEffects & CFE_AUTOBACKCOLOR) && (cf.dwMask & CFM_BACKCOLOR) )
|
||||||
|
{
|
||||||
|
style.SetBackgroundColour(wxColour(cf.crBackColor));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // wxUSE_RICHEDIT2
|
#endif // wxUSE_RICHEDIT2
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user