/// <summary>
        /// Draws the element.
        /// </summary>
        /// <param name="drawPhase">The draw phase.</param>
        /// <param name="drawParams">The draw parameters.</param>
        /// <returns></returns>
        public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
        {
            UIElement element = drawParams.Element;

            if (drawPhase == DrawPhase.BeforeDrawBorders)
            {
                Border3DSide sides = (Border3DSide)0;
                if (element is DayHeaderAreaUIElement)
                {
                    sides = Border3DSide.Top | Border3DSide.Bottom;
                }
                else if (element is DayHeaderUIElement)
                {
                    sides = Border3DSide.Bottom;
                }

                if (sides != 0)
                {
                    if ((sides & Border3DSide.Top) != 0)
                    {
                        drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Top);
                    }

                    if ((sides & Border3DSide.Bottom) != 0)
                    {
                        drawParams.DrawBorders(UIElementBorderStyle.TwoColor, Border3DSide.Bottom);
                    }
                    return(true);
                }
            }
            return(false);
        }
        private void DrawElement_RowSelectorHeaderUIElement(ref UIElementDrawParams drawParams)
        {
            drawParams.DrawBackColor(drawParams.Element.Rect);

            Border3DSide border = Border3DSide.Bottom | Border3DSide.Right;

            drawParams.DrawBorders(UIElementBorderStyle.Solid, border);
        }
Example #3
0
        private void DrawBorder(ref UIElementDrawParams drawParams, Border3DSide borderSide, Color?color)
        {
            if (null == color)
            {
                return;
            }

            drawParams.DrawBorders(UIElementBorderStyle.Solid, borderSide, color.Value, drawParams.Element.Rect, drawParams.ElementDrawingClipRect);
        }
Example #4
0
        public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
        {
            // Draw a custom border around ButtonToolUIElements
            ButtonToolUIElement buttonToolUiElement = drawParams.Element as ButtonToolUIElement;

            if (buttonToolUiElement != null && drawPhase == DrawPhase.BeforeDrawBorders)
            {
                drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.All);
                return(true);
            }
            return(false);
        }
Example #5
0
        /// <summary>
        /// Called during the drawing operation of a UIElement for a specific phase
        /// of the operation. This will only be called for the phases returned
        /// from the GetPhasesToFilter method.
        /// </summary>
        /// <param name="drawPhase">Contains a single bit which identifies the current draw phase.</param>
        /// <param name="drawParams">The <see cref="T:Infragistics.Win.UIElementDrawParams" /> used to provide rendering information.</param>
        /// <returns>
        /// Returning true from this method indicates that this phase has been handled and the default processing should be skipped.
        /// </returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
        {
            switch (drawPhase)
            {
            case DrawPhase.BeforeDrawBorders:
                if (drawParams.Element is HeaderUIElement)
                {
                    drawParams.DrawBorders(UIElementBorderStyle.TwoColor, System.Windows.Forms.Border3DSide.Bottom);
                    return(true);
                }
                break;
            }

            return(false);
        }
        private void DrawElement_EditorWithComboDropDownButtonUIElement(ref UIElementDrawParams drawParams)
        {
            EditorWithComboDropDownButtonUIElement dropDownButtonElement = (EditorWithComboDropDownButtonUIElement)drawParams.Element;

            if (dropDownButtonElement.Parent is EditorWithComboUIElement)
            {
                EditorWithComboUIElement comboElement = (EditorWithComboUIElement)dropDownButtonElement.Parent;
                UltraGridCell            cell         = (UltraGridCell)comboElement.SelectableItem;
                UltraGridColumn          column       = cell.Column;

                if (this.grid.IsCellEditable(cell) == true)
                {
                    if (dropDownButtonElement.IsHotTracked == true)
                    {
                        drawParams.AppearanceData.BackColor = Color.FromArgb(230, 230, 230);
                        drawParams.DrawBackColor(drawParams.Element.Rect);
                        drawParams.DrawImage(Properties.Resources.button_code_hover, this.GetDropDownButtonRect(drawParams), false, null);
                        drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Left);
                    }
                    else
                    {
                        drawParams.AppearanceData.BackColor = Color.FromArgb(215, 215, 215);
                        drawParams.DrawBackColor(drawParams.Element.Rect);
                        drawParams.DrawImage(Properties.Resources.button_code_normal, this.GetDropDownButtonRect(drawParams), false, null);
                        drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Left);
                    }
                }
                else
                {
                    drawParams.AppearanceData.BackColor = Color.FromArgb(180, 180, 180);
                    drawParams.DrawBackColor(drawParams.Element.Rect);
                    drawParams.DrawImage(Properties.Resources.button_code_normal, this.GetDropDownButtonRect(drawParams), false, null);
                    drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Left);
                }
            }
        }
        /// <summary>
        /// Called during the drawing operation of a UIElement for a specific phase
        /// of the operation. This will only be called for the phases returned
        /// from the GetPhasesToFilter method.
        /// </summary>
        /// <param name="drawPhase">Contains a single bit which identifies the current draw phase.</param>
        /// <param name="drawParams">The <see cref="T:Infragistics.Win.UIElementDrawParams" /> used to provide rendering information.</param>
        /// <returns>
        /// Returning true from this method indicates that this phase has been handled and the default processing should be skipped.
        /// </returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
        {
            UIElement element = drawParams.Element;

            switch (drawPhase)
            {
            case DrawPhase.BeforeDrawBorders:
            {
                Border3DSide sides = (Border3DSide)0;

                if (element is DayOfWeekHeaderUIElement)
                {
                    sides = Border3DSide.Top | Border3DSide.Bottom;
                }

                if (sides != 0)
                {
                    if ((sides & Border3DSide.Top) != 0)
                    {
                        drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Top);
                    }

                    if ((sides & Border3DSide.Bottom) != 0)
                    {
                        drawParams.DrawBorders(UIElementBorderStyle.TwoColor, Border3DSide.Bottom);
                    }
                    return(true);
                }
                break;
            }

            case DrawPhase.BeforeDrawFocus:
                return(true);
            }
            return(false);
        }
        public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
        {
            // Custom draw borders around the column headers.
            HeaderUIElement headerUiElement = drawParams.Element as HeaderUIElement;

            if (headerUiElement != null && drawPhase == DrawPhase.BeforeDrawBorders)
            {
                drawParams.DrawBorders(headerUiElement.BorderStyle, Border3DSide.Bottom);
                return(true);
            }

            // Remove the focus rectangle.
            if (drawPhase == DrawPhase.BeforeDrawFocus)
            {
                return(true);
            }

            return(false);
        }
        private void DrawElement_RowSelectorUIElement(ref UIElementDrawParams drawParams)
        {
            Rectangle rect = drawParams.Element.Rect;

            rect.X += 1;

            UltraGridRow ultraGridRow = (UltraGridRow)drawParams.Element.GetContext(typeof(UltraGridRow));

            // active row header color
            if (ultraGridRow.IsActiveRow == true)
            {
                drawParams.AppearanceData.BackColor = CommonColorSet.ActiveCellHeaderColor;
            }

            drawParams.DrawBackColor(rect);
            drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Top | Border3DSide.Bottom | Border3DSide.Right, rect);

            // draw row number
            drawParams.DrawString(drawParams.Element.Rect, (ultraGridRow.VisibleIndex + 1).ToString(), false, false);

            // draw CRUD image. (DataRow Only)
            Rectangle imageRect = new Rectangle(rect.Left + 3, rect.Top + (ultraGridRow.Height - Properties.Resources.new_16.Height) / 2, Properties.Resources.new_16.Width, Properties.Resources.new_16.Height);

            // DataRowView 얻기
            DataRowView dataRowView = (DataRowView)ultraGridRow.ListObject;
            DataRow     dataRow     = dataRowView.Row;

            switch (dataRow.RowState)
            {
            case DataRowState.Added:
                drawParams.DrawImage(Properties.Resources.new_16, imageRect, false, null);
                break;

            case DataRowState.Modified:
                drawParams.DrawImage(Properties.Resources.edit_16, imageRect, false, null);
                break;

            case DataRowState.Deleted:
                drawParams.DrawImage(Properties.Resources.delete_16, imageRect, false, null);
                break;
            }
        }
 public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
 {
     // Only draw the top and bottom border
     drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Top | Border3DSide.Bottom);
     return(true);
 }
Example #11
0
 public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
 {
     drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Top, drawParams.Element.Rect);
     return(true);
 }