Esempio n. 1
0
        protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonDown(e);

            if (e.Button == GUISystem.ClickButton &&
                this.isSizingEnabled == true)
            {
                sizingLocation = GetSizingBorderAtPoint(e.Position);
                if (sizingLocation != SizingLocation.None)
                {
                    // ensure all inputs come to us for now
                    CaptureInput();

                    // setup the 'dragging' state variables
                    isBeingSized      = true;
                    dragStartPosition = e.Position;

                    return(true);
                }
            }
            return(ret);
        }
Esempio n. 2
0
 /// <summary>
 /// return true if given SizingLocation is on top edge.
 /// </summary>
 /// <param name="loc">
 /// SizingLocation value to be checked.
 /// </param>
 /// <returns>
 /// true if \a loc is on the top edge.  false if \a loc is not on the top edge.
 /// </returns>
 protected bool IsTopSizingLocation(SizingLocation loc)
 {
     return((loc == SizingLocation.SizingTop) ||
            (loc == SizingLocation.SizingTopLeft) ||
            (loc == SizingLocation.SizingTopRight));
 }
Esempio n. 3
0
 /// <summary>
 /// return true if given SizingLocation is on right edge.
 /// </summary>
 /// <param name="loc">
 /// SizingLocation value to be checked.
 /// </param>
 /// <returns>
 /// true if \a loc is on the right edge.  false if \a loc is not on the right edge.
 /// </returns>
 protected bool IsRightSizingLocation(SizingLocation loc)
 {
     return((loc == SizingLocation.SizingRight) ||
            (loc == SizingLocation.SizingTopRight) ||
            (loc == SizingLocation.SizingBottomRight));
 }
Esempio n. 4
0
 /// <summary>
 /// return true if given SizingLocation is on left edge.
 /// </summary>
 /// <param name="loc">
 /// SizingLocation value to be checked.
 /// </param>
 /// <returns>
 /// true if \a loc is on the left edge.  false if \a loc is not on the left edge.
 /// </returns>
 protected bool IsLeftSizingLocation(SizingLocation loc)
 {
     return((loc == SizingLocation.SizingLeft) ||
            (loc == SizingLocation.SizingTopLeft) ||
            (loc == SizingLocation.SizingBottomLeft));
 }
Esempio n. 5
0
 /// <summary>
 /// return true if given SizingLocation is on bottom edge.
 /// </summary>
 /// <param name="loc">
 /// SizingLocation value to be checked.
 /// </param>
 /// <returns>
 /// true if \a loc is on the bottom edge.  false if \a loc is not on the bottom edge.
 /// </returns>
 protected bool IsBottomSizingLocation(SizingLocation loc)
 {
     return((loc == SizingLocation.SizingBottom) ||
            (loc == SizingLocation.SizingBottomLeft) ||
            (loc == SizingLocation.SizingBottomRight));
 }
Esempio n. 6
0
 protected internal override void OnCaptureLost(GUIEventArgs e)
 {
     base.OnCaptureLost(e);
     isBeingSized   = false;
     sizingLocation = SizingLocation.None;
 }