From 77b9600303ac952cd3a5153ce2cbf5809d5034b3 Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Mon, 2 Feb 2015 13:54:56 -0800 Subject: [PATCH] IsActive fix & code cleanup Now if a text edit is set to inactive you can't mouse down. changed code to use setVariable so code is a bit cleaner. Fixed some small spacing issues. --- Engine/source/gui/controls/guiTextEditCtrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/source/gui/controls/guiTextEditCtrl.cpp b/Engine/source/gui/controls/guiTextEditCtrl.cpp index c451400b7..a68104bcd 100644 --- a/Engine/source/gui/controls/guiTextEditCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditCtrl.cpp @@ -212,8 +212,7 @@ void GuiTextEditCtrl::execConsoleCallback() Parent::execConsoleCallback(); // Update the console variable: - if ( mConsoleVariable[0] ) - Con::setVariable( mConsoleVariable, mTextBuffer.getPtr8() ); + setVariable(mTextBuffer.getPtr8()); } void GuiTextEditCtrl::updateHistory( StringBuffer *inTxt, bool moveIndex ) @@ -374,6 +373,8 @@ S32 GuiTextEditCtrl::calculateCursorPos( const Point2I &globalPos ) void GuiTextEditCtrl::onMouseDown( const GuiEvent &event ) { + if(!isActive()) + return; mDragHit = false; // If we have a double click, select all text. Otherwise