Ver Fonte

Buttons Inside TagPages

Fixed a bug where buttons (or other controls) inside of a tab page could not be moved around by dragging it because the page would always steal the selection.
Peter Robinson há 1 ano atrás
pai
commit
ea837244d2

+ 5 - 2
engine/source/gui/containers/guiTabBookCtrl.cc

@@ -361,8 +361,11 @@ bool GuiTabBookCtrl::onMouseDownEditor(const GuiEvent &event, const Point2I& off
          edit->select( mActivePage );
    }
 
-   // Return whether we handled this or not.
-   return handled;
+   if (!handled)
+   {
+	   return Parent::onMouseDownEditor(event, offset);
+   }
+   return true;
 
 }
 

+ 0 - 14
engine/source/gui/containers/guiTabPageCtrl.cc

@@ -37,20 +37,6 @@ GuiTabPageCtrl::GuiTabPageCtrl(void)
    mIsContainer = true;
 }
 
-bool GuiTabPageCtrl::onMouseDownEditor(const GuiEvent &event, const Point2I& offset )
-{
-   // This shouldn't be called if it's not design time, but check just incase
-   if ( GuiControl::smDesignTime )
-   {
-      GuiEditCtrl* edit = GuiControl::smEditorHandle;
-      if( edit )
-         edit->select( this );
-   }
-
-   return Parent::onMouseDownEditor( event, offset );
-}
-
-
 GuiControl *GuiTabPageCtrl::findNextTabable(GuiControl *curResponder, bool firstCall)
 {
    //set the global if this is the first call (directly from the canvas)

+ 0 - 1
engine/source/gui/containers/guiTabPageCtrl.h

@@ -33,7 +33,6 @@ class GuiTabPageCtrl : public GuiControl
    public:
       GuiTabPageCtrl();
       DECLARE_CONOBJECT(GuiTabPageCtrl);
-      bool onMouseDownEditor(const GuiEvent &event, const Point2I& offset );   ///< Called when a mouseDown event occurs and the GUI editor is active
 
       S32 getTabIndex(void) { return mTabIndex; }  ///< Get the tab index of this control