Пример #1
0
 override public void MouseUp(int ScreenMouseX, int ScreenMouseY)
 {
     /*
      * Reset the currently selected items. Most recently selected remain active for any commands
      */
     OutlineAreas.MouseUp(ScreenMouseX, ScreenMouseY);
     OpenAreas.MouseUp(ScreenMouseX, ScreenMouseY);
     Walls.MouseUp(ScreenMouseX, ScreenMouseY);
 }
Пример #2
0
        /*
         * Sub classes will override these methods to implement mouse operations on their canvas
         */
        override public eMouseDownCapture MouseDown(int ScreenMouseX, int ScreenMouseY)
        {
            /*
             * Try to capture something in the outline, then the open area, in turn
             */
            eMouseDownCapture sts = OutlineAreas.MouseDown(ScreenMouseX, ScreenMouseY);

            if (sts != eMouseDownCapture.Nothing)
            {
                return(sts);
            }

            sts = OpenAreas.MouseDown(ScreenMouseX, ScreenMouseY);
            if (sts != eMouseDownCapture.Nothing)
            {
                return(sts);
            }

            sts = Walls.MouseDown(ScreenMouseX, ScreenMouseY);

            return(sts);
        }
Пример #3
0
        override public bool MouseMove(eMouseState MouseState, int ScreenMouseX, int ScreenMouseY, int ScreenDeltaX, int ScreenDeltaY)
        {
            /*
             * See if we are moving anything in the outline, then the open area
             */
            if (OutlineAreas.MouseMove(MouseState, ScreenMouseX, ScreenMouseY, ScreenDeltaX, ScreenDeltaY))
            {
                return(true);
            }

            if (OpenAreas.MouseMove(MouseState, ScreenMouseX, ScreenMouseY, ScreenDeltaX, ScreenDeltaY))
            {
                return(true);
            }

            if (Walls.MouseMove(MouseState, ScreenMouseX, ScreenMouseY, ScreenDeltaX, ScreenDeltaY))
            {
                return(true);
            }

            /*
             * If we are here we scrolled the background. Update the dependent controls
             */
            int WorldDeltaX = (int)((float)ScreenDeltaX * CurrentZoom);
            int WorldDeltaY = (int)((float)ScreenDeltaY * CurrentZoom);

            OutlineAreas.WorldPointScrollX -= WorldDeltaX;
            OutlineAreas.WorldPointScrollY -= WorldDeltaY;

            OpenAreas.WorldPointScrollX -= WorldDeltaX;
            OpenAreas.WorldPointScrollY -= WorldDeltaY;

            Walls.WorldPointScrollX -= WorldDeltaX;
            Walls.WorldPointScrollY -= WorldDeltaY;

            return(false);
        }