void GuiDecalEditorCtrl::get3DCursor( GuiCursor *&cursor, bool &visible, const Gui3DMouseEvent &event_ ) { cursor = NULL; visible = false; GuiCanvas *root = getRoot(); if ( !root ) return; S32 currCursor = PlatformCursorController::curArrow; if ( root->mCursorChanged == currCursor ) return; PlatformWindow *window = root->getPlatformWindow(); PlatformCursorController *controller = window->getCursorController(); // We've already changed the cursor, // so set it back before we change it again. if( root->mCursorChanged != -1) controller->popCursor(); // Now change the cursor shape controller->pushCursor(currCursor); root->mCursorChanged = currCursor; }
void GuiSplitContainer::getCursor( GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent ) { GuiCanvas *rootCtrl = getRoot(); if ( !rootCtrl ) return; S32 desiredCursor = 0; RectI splitRect = getSplitRect(); // Figure out which cursor we want if we need one if ( mOrientation == Horizontal ) desiredCursor = PlatformCursorController::curResizeHorz; else if ( mOrientation == Vertical ) desiredCursor = PlatformCursorController::curResizeVert; PlatformWindow *platformWindow = static_cast<GuiCanvas*>(getRoot())->getPlatformWindow(); AssertFatal( platformWindow != NULL,"GuiControl without owning platform window! This should not be possible." ); PlatformCursorController *cusrorController = platformWindow->getCursorController(); AssertFatal( cusrorController != NULL,"PlatformWindow without an owned CursorController!" ); // Check to see if we need one or just the default... Point2I localPoint = Point2I( globalToLocalCoord( lastGuiEvent.mousePoint ) ); if ( splitRect.pointInRect( localPoint ) || mDragging ) { // Do we need to change it or is it already set? if ( rootCtrl->mCursorChanged != desiredCursor ) { // We've already changed the cursor, so set it back if ( rootCtrl->mCursorChanged != -1 ) cusrorController->popCursor(); // Now change the cursor shape cusrorController->pushCursor( desiredCursor ); rootCtrl->mCursorChanged = desiredCursor; } } else if ( rootCtrl->mCursorChanged != -1 ) { // Just the default cusrorController->popCursor(); rootCtrl->mCursorChanged = -1; } }
bool ForestEditorCtrl::onWake() { if ( !Parent::onWake() ) return false; // Push our default cursor on here once. GuiCanvas *root = getRoot(); if ( root ) { S32 currCursor = PlatformCursorController::curArrow; PlatformWindow *window = root->getPlatformWindow(); PlatformCursorController *controller = window->getCursorController(); controller->pushCursor( currCursor ); } return true; }