소스 검색

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();
    Parent::execConsoleCallback();
 
 
    // Update the console variable:
    // Update the console variable:
-   if ( mConsoleVariable[0] )
-      Con::setVariable( mConsoleVariable, mTextBuffer.getPtr8() );
+   setVariable(mTextBuffer.getPtr8());
 }
 }
 
 
 void GuiTextEditCtrl::updateHistory( StringBuffer *inTxt, bool moveIndex )
 void GuiTextEditCtrl::updateHistory( StringBuffer *inTxt, bool moveIndex )
@@ -374,6 +373,8 @@ S32 GuiTextEditCtrl::calculateCursorPos( const Point2I &globalPos )
 
 
 void GuiTextEditCtrl::onMouseDown( const GuiEvent &event )
 void GuiTextEditCtrl::onMouseDown( const GuiEvent &event )
 {
 {
+   if(!isActive())
+      return;
    mDragHit = false;
    mDragHit = false;
 
 
    // If we have a double click, select all text.  Otherwise
    // If we have a double click, select all text.  Otherwise