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); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
protected internal override void OnCaptureLost(GUIEventArgs e) { base.OnCaptureLost(e); isBeingSized = false; sizingLocation = SizingLocation.None; }