Remove wxTextCtrl::OnEnabled() hack from wxGTK.
Don't change the background colour when the control is being enabled or disabled, it doesn't seem necessary and it's unclear why was this added by r10179 in the first place. It does result in problems however as it could somehow make the selection of wxTextCtrl invisible when it lost focus and so fixes a serious usability problem which happened to all wxTextCtrls for which a wxEVT_UPDATE_UI handler using wxUpdateUIEvent::Enable() was defined. Closes #14898. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1149,8 +1149,6 @@ void wxWindowBase::NotifyWindowOnEnableChange(bool enabled)
|
||||
DoEnable(enabled);
|
||||
#endif // !defined(wxHAS_NATIVE_ENABLED_MANAGEMENT)
|
||||
|
||||
OnEnabled(enabled);
|
||||
|
||||
// Disabling a top level window is typically done when showing a modal
|
||||
// dialog and we don't need to disable its children in this case, they will
|
||||
// be logically disabled anyhow (i.e. their IsEnabled() will return false)
|
||||
@@ -1166,9 +1164,7 @@ void wxWindowBase::NotifyWindowOnEnableChange(bool enabled)
|
||||
// they would still show as enabled even though they wouldn't actually
|
||||
// accept any input (at least under MSW where children don't accept input
|
||||
// if any of the windows in their parent chain is enabled).
|
||||
//
|
||||
// Notice that we must do this even for wxHAS_NATIVE_ENABLED_MANAGEMENT
|
||||
// platforms as we still need to call the children OnEnabled() recursively.
|
||||
#ifndef wxHAS_NATIVE_ENABLED_MANAGEMENT
|
||||
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
@@ -1177,6 +1173,7 @@ void wxWindowBase::NotifyWindowOnEnableChange(bool enabled)
|
||||
if ( !child->IsTopLevel() && child->IsThisEnabled() )
|
||||
child->NotifyWindowOnEnableChange(enabled);
|
||||
}
|
||||
#endif // !defined(wxHAS_NATIVE_ENABLED_MANAGEMENT)
|
||||
}
|
||||
|
||||
bool wxWindowBase::Enable(bool enable)
|
||||
|
Reference in New Issue
Block a user