瀏覽代碼

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.
Nathan Bowhay 10 年之前
父節點
當前提交
77b9600303
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Engine/source/gui/controls/guiTextEditCtrl.cpp

+ 3 - 2
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