make IsEnabled() return false even if the window parent, and not the window itself, is disabled and added IsThisEnabled() implementing the old IsEnabled() behaviour; also significantly simplify the window state management code in all ports by factoring out the common parts in wxWindowBase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -690,32 +690,26 @@ void wxTextCtrl::SetEditable( bool editable )
|
||||
}
|
||||
}
|
||||
|
||||
bool wxTextCtrl::Enable( bool enable )
|
||||
void wxTextCtrl::DoEnable( bool enable )
|
||||
{
|
||||
if (!wxWindowBase::Enable(enable))
|
||||
{
|
||||
// nothing to do
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
{
|
||||
gtk_text_set_editable( GTK_TEXT(m_text), enable );
|
||||
OnParentEnable(enable);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_sensitive( m_text, enable );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// wxGTK-specific: called recursively by Enable,
|
||||
// to give widgets an oppprtunity to correct their colours after they
|
||||
// have been changed by Enable
|
||||
void wxTextCtrl::OnParentEnable( bool enable )
|
||||
void wxTextCtrl::OnEnabled( bool enable )
|
||||
{
|
||||
if ( IsSingleLine() )
|
||||
return;
|
||||
|
||||
// If we have a custom background colour, we use this colour in both
|
||||
// disabled and enabled mode, or we end up with a different colour under the
|
||||
// text.
|
||||
|
Reference in New Issue
Block a user