WXHBRUSH wxChoice::MSWControlColor(WXHDC hDC, WXHWND hWnd)
{
- if ( !IsEnabled() )
+ if ( !IsThisEnabled() )
return MSWControlColorDisabled(hDC);
return wxChoiceBase::MSWControlColor(hDC, hWnd);
if ( !(flags & wxCONTROL_ISSUBMENU) )
{
// Drawing control
- isEnabled = IsEnabled();
+ isEnabled = IsThisEnabled();
doDrawFocusRect = ShouldDrawFocus();
#if wxUSE_UXTHEME
wxColour bgCol = GetBackgroundColour();
#if wxUSE_UXTHEME
- const bool isEnabled = IsEnabled();
+ const bool isEnabled = IsThisEnabled();
wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();
HDC hDc = GetHdcOf(*impl);
WXHBRUSH wxTextCtrl::MSWControlColor(WXHDC hDC, WXHWND hWnd)
{
- if ( !IsEnabled() && !HasFlag(wxTE_MULTILINE) )
+ if ( !IsThisEnabled() && !HasFlag(wxTE_MULTILINE) )
return MSWControlColorDisabled(hDC);
return wxTextCtrlBase::MSWControlColor(hDC, hWnd);
// so we have to issue explicit refresh to avoid rendering artifacts.
//
// TODO: find out just what exactly is wrong here
- Refresh();
+ //Refresh();
+
+ // JS: From observing other application behaviour, such as VS 2010, controls such
+ // as text fields and comboboxes do not indicate a disabled state when the parent
+ // is disabled due to a modal dialog being shown. Therefore I have changed these
+ // controls' behaviour to only indicate a disabled state when IsThisEnabled returns false,
+ // i.e. the application has specifically disabled each control. Since the colour
+ // no longer changes when the top-level window is disabled, this means we can avoid
+ // doing a refresh that causes a distracting flicker in some controls.
+ // Windows should probably be sending a paint event to each child control just in
+ // case the state change requires a refresh, but this would cause flicker so perhaps
+ // it's as well that it doesn't.
+ // The result of this change is to remove the flicker and also remove the distraction
+ // of individual controls greying-out due to a dialog being shown, which I think was
+ // the wrong behaviour.
}
void wxTopLevelWindowMSW::DoFreeze()