MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / getCursor

Method getCursor

Engine/source/gui/containers/guiFrameCtrl.cpp:399–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397//-----------------------------------------------------------------------------
398
399void GuiFrameSetCtrl::getCursor(GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent)
400{
401 GuiCanvas *pRoot = getRoot();
402 if( !pRoot )
403 return;
404
405 Region curRegion = NONE;
406 // Determine the region by mouse position.
407 Point2I curMousePos = globalToLocalCoord(lastGuiEvent.mousePoint);
408 curRegion = pointInAnyRegion(curMousePos);
409
410 PlatformWindow *pWindow = pRoot->getPlatformWindow();
411 AssertFatal(pWindow != NULL,"GuiControl without owning platform window! This should not be possible.");
412 PlatformCursorController *pController = pWindow->getCursorController();
413 AssertFatal(pController != NULL,"PlatformWindow without an owned CursorController!");
414
415 switch (curRegion)
416 {
417 case VERTICAL_DIVIDER:
418 // change to left-right cursor
419 if(pRoot->mCursorChanged != PlatformCursorController::curResizeVert)
420 {
421 //*** We've already changed the cursor, so set it back before we change it again.
422 if(pRoot->mCursorChanged != -1)
423 pController->popCursor();
424
425 //*** Now change the cursor shape
426 pController->pushCursor(PlatformCursorController::curResizeVert);
427 pRoot->mCursorChanged = PlatformCursorController::curResizeVert;
428
429 }
430 break;
431
432 case HORIZONTAL_DIVIDER:
433 // change to up-down cursor
434 if(pRoot->mCursorChanged != PlatformCursorController::curResizeHorz)
435 {
436 //*** We've already changed the cursor, so set it back before we change it again.
437 if(pRoot->mCursorChanged != -1)
438 pController->popCursor();
439
440 //*** Now change the cursor shape
441 pController->pushCursor(PlatformCursorController::curResizeHorz);
442 pRoot->mCursorChanged = PlatformCursorController::curResizeHorz;
443 }
444 break;
445
446 case DIVIDER_INTERSECTION:
447 // change to move cursor
448 if(pRoot->mCursorChanged != PlatformCursorController::curResizeAll)
449 {
450 //*** We've already changed the cursor, so set it back before we change it again.
451 if(pRoot->mCursorChanged != -1)
452 pController->popCursor();
453
454 //*** Now change the cursor shape
455 pController->pushCursor(PlatformCursorController::curResizeAll);
456 pRoot->mCursorChanged = PlatformCursorController::curResizeAll;

Callers

nothing calls this directly

Calls 4

getPlatformWindowMethod · 0.80
getCursorControllerMethod · 0.80
popCursorMethod · 0.80
pushCursorMethod · 0.80

Tested by

no test coverage detected