コード例 #1
0
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;   
}
コード例 #2
0
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;
   }
}
コード例 #3
0
void ForestEditorCtrl::onSleep()
{
   // Pop our default cursor off.
   GuiCanvas *root = getRoot();
   if ( root )
   {
      PlatformWindow *window = root->getPlatformWindow();
      PlatformCursorController *controller = window->getCursorController();
      controller->popCursor();
   }

   Parent::onSleep();
}