示例#1
0
 public void AlignBottom()
 {
     if (this.FocusControl != null)
     {
         this.m_FocusControlAlignment = AlignmentQuadSide.Bottom;
         this.m_NewLocationX          = this.FocusControl.Location.X;
         this.m_NewLocationY          = this.FocusControl.Bottom;
         base.Location = new Point(this.m_NewLocationX, this.m_NewLocationY);
     }
 }
示例#2
0
 public void AlignTop()
 {
     if (this.FocusControl != null)
     {
         this.m_FocusControlAlignment = AlignmentQuadSide.Top;
         this.m_NewLocationX          = this.FocusControl.Location.X;
         this.m_NewLocationY          = this.FocusControl.Top - base.Height;
         base.Location = new Point(this.m_NewLocationX, this.m_NewLocationY);
     }
 }
示例#3
0
 protected override void SetDefaults()
 {
     base.SetDefaults();
     base.Rotation = RotationQuad.X000;
     this.Text     = "";
     base.AutoSize = true;
     this.FocusControlAlignment = AlignmentQuadSide.Left;
     base.TabStop                               = false;
     this.TextLayout.Trimming                   = StringTrimming.None;
     this.TextLayout.LineLimit                  = false;
     this.TextLayout.MeasureTrailingSpaces      = false;
     this.TextLayout.NoWrap                     = false;
     this.TextLayout.NoClip                     = false;
     this.TextLayout.AlignmentHorizontal.Style  = StringAlignment.Far;
     this.TextLayout.AlignmentHorizontal.Margin = 0.5;
     this.TextLayout.AlignmentVertical.Style    = StringAlignment.Center;
     this.TextLayout.AlignmentVertical.Margin   = 0.5;
 }
示例#4
0
 public void AlignRight()
 {
     if (this.FocusControl != null)
     {
         this.m_FocusControlAlignment = AlignmentQuadSide.Right;
         int num = 0;
         if (this.FocusControl is TextBox)
         {
             num = -1;
         }
         if (this.FocusControl is ComboBox)
         {
             num = -1;
         }
         if (this.FocusControl is NumericUpDown)
         {
             num = -2;
         }
         this.m_NewLocationX = this.FocusControl.Location.X + this.FocusControl.Width;
         this.m_NewLocationY = this.FocusControl.Location.Y + this.FocusControl.Height / 2 - base.Height / 2 + num;
         base.Location       = new Point(this.m_NewLocationX, this.m_NewLocationY);
     }
 }
示例#5
0
        public static Point[] Triangle(Rectangle r, AlignmentQuadSide side)
        {
            switch (side)
            {
            case AlignmentQuadSide.Left:
                return(new Point[3]
                {
                    new Point(r.Left, r.Top),
                    new Point(r.Left + r.Width / 2, r.Top + r.Height / 2),
                    new Point(r.Left, r.Bottom + 1)
                });

            case AlignmentQuadSide.Right:
                return(new Point[3]
                {
                    new Point(r.Right + 1, r.Top),
                    new Point(r.Left + r.Width / 2, r.Top + r.Height / 2),
                    new Point(r.Right + 1, r.Bottom + 1)
                });

            case AlignmentQuadSide.Top:
                return(new Point[3]
                {
                    new Point(r.Left, r.Top),
                    new Point(r.Left + r.Width / 2, r.Top + r.Height / 2),
                    new Point(r.Right + 1, r.Top)
                });

            default:
                return(new Point[3]
                {
                    new Point(r.Left, r.Bottom + 1),
                    new Point(r.Left + r.Width / 2, r.Top + r.Height / 2),
                    new Point(r.Right + 1, r.Bottom + 1)
                });
            }
        }