1
votes

For the application that I am developing in AIR, I have removed the chrome through the app.xml. I am managing the features of minimizing, maximizing, close, resize and all other functions from within the application. I am facing a problem with resize feature. I have defined the grips for resizing and also I am able to display my custom cursor when mouse moves over it. The problem is that only the part of this cursor is visible which lies inside the boundary of the application rest of the cursor image is hidden.

For implementing the custom cursor, I do the following.

  1. Embed the cursor image.
    [Embed(source='/resources/images/resize_right.png')]
    public var resizeRight:Class;
  1. Add the event listener to the canvas that acts as a grip.
    rightResizeGrip.addEventListener(MouseEvent.MOUSE_OVER, function(e)
    {
      setResizeCursor(CURSOR_RIGHT);
    });
    rightResizeGrip.addEventListener(MouseEvent.MOUSE_OUT, function(e)
    {
      unsetResizeCursor();
    });
  1. In setResizeCursor
    private function setResizeCursor(type:String)
{
    var cursorClass;
    var xOffset;
    var yOffset;

    switch(type)
    {
        case CURSOR_RIGHT:
            cursorClass = resizeRight;
            xOffset = -14;
            yOffset = -10;
            break;
        case CURSOR_LEFT:
            cursorClass = resizeLeft;
            xOffset = 0;
            yOffset = -10;
            break;
        case CURSOR_RIGHT_TOP:
            cursorClass = resizeRightTop;
            xOffset = -20;
            yOffset = 0;
            break;
        case CURSOR_RIGHT_BOTTOM:
            cursorClass = resizeRightBottom;
            xOffset = -20;
            yOffset = -20;
            break;
        case CURSOR_BOTTOM:
            cursorClass = resizeBottom;
            xOffset = -10;
            yOffset = -14;
            break;
        case CURSOR_LEFT_BOTTOM:
            cursorClass = resizeLeftBottom;
            xOffset = 0;
            yOffset = -20;
            break;
        case CURSOR_LEFT_TOP:
            cursorClass = resizeleftTop;
            xOffset = 0;
            yOffset = 0;
            break;
    }

    if(cursorClass)
        CursorManager.setCursor(cursorClass, CursorManagerPriority.HIGH, xOffset, yOffset);
}

Is it possible to have the complete image of the cursor shown though it lies outside the application boundary?

1
+1 for good question. I'm in the same situation with my AIR app so I hope someone has a good answer...Wade Mueller

1 Answers

0
votes

I believe you can add few-pixels margin in your custom chrome from the top, left, right and the bottom of the system window borders.

P.S: Do not forget to remove it on window maximize.