Exemplo n.º 1
0
 /// <summary>
 /// Raises the <see cref="GridDrawButtonFace"/> event
 /// </summary>
 /// <param name="e"><see cref="GridDrawButtonFaceEventArgs"/> data</param>
 public void RaiseDrawButtonFace(GridDrawButtonFaceEventArgs e)
 {
     if (e == null)
     {
         return;
     }
     if (this.GridDrawButtonFace != null)
     {
         this.GridDrawButtonFace(this, e);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Draws the button face
        /// </summary>
        /// <param name="g">The <see cref="System.Drawing.Graphics"/> context of the canvas.</param>
        /// <param name="buttonState">A <see cref="ButtonState"/> that specifies the current state.</param>
        /// <param name="style">The <see cref="GridStyleInfo"/> object that holds cell information.</param>
        protected virtual void DrawButtonFace(Graphics g, ButtonState buttonState, GridStyleInfo style)
        {
            GridDrawButtonFaceEventArgs e = new GridDrawButtonFaceEventArgs(this, g, style, style.CellIdentity.RowIndex, style.CellIdentity.ColIndex);

            OnDrawButtonFace(e);

            if (!e.Handled)
            {
                this.DrawDefaultButtonFace(g, buttonState, style);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Used to draw border lines around the button
        /// </summary>
        void Form1_GridDrawButtonFace(object sender, GridDrawButtonFaceEventArgs e)
        {
            if (e.RowIndex == 47 && e.ColIndex == 5)
            {
                Brush br = new SolidBrush(Color.SaddleBrown);
                Pen   pn = new Pen(Color.SaddleBrown, 2);

                // Draw border around the button
                e.Graphics.DrawLine(pn, new Point(e.Button.Bounds.X + 2, e.Button.Bounds.Y + 2), new Point(e.Button.Bounds.X + e.Button.Bounds.Width - 2, e.Button.Bounds.Y + 2));
                e.Graphics.DrawLine(pn, new Point(e.Button.Bounds.X + 2, e.Button.Bounds.Y + 2), new Point(e.Button.Bounds.X + 2, e.Button.Bounds.Y + e.Button.Bounds.Height - 2));
                e.Graphics.DrawLine(pn, new Point(e.Button.Bounds.X + 2, e.Button.Bounds.Y + e.Button.Bounds.Height - 2), new Point(e.Button.Bounds.X + e.Button.Bounds.Width - 2, e.Button.Bounds.Y + e.Button.Bounds.Height - 2));
                e.Graphics.DrawLine(pn, new Point(e.Button.Bounds.X + e.Button.Bounds.Width - 2, e.Button.Bounds.Y + 2), new Point(e.Button.Bounds.X + e.Button.Bounds.Width - 2, e.Button.Bounds.Y + e.Button.Bounds.Height - 2));

                e.Handled = true;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Raises the <see cref="ButtonEditCellModel.GridDrawButtonFace"/> event
        /// </summary>
        /// <param name="e">An <see cref="GridDrawButtonFaceEventArgs"/>GridDrawButtonFaceEventArgs that contains event data</param>

        protected virtual void OnDrawButtonFace(GridDrawButtonFaceEventArgs e)
        {
            //Raise the event from CellModel
            //TODO - move to Grid instead..
            (this.Owner.Model as ButtonEditCellModel).RaiseDrawButtonFace(e);
        }