Ejemplo n.º 1
0
        /// <summary>
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void RegisterEvents(ControlA control)
        {
            ControlMouseEvent clickButtonEvent = new ControlMouseEvent(ClickButton);
            List <ControlA>   controls         = control.GetControls();
            int controlsSize = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                ControlA subControl = controls[i];
                ButtonA  button     = subControl as ButtonA;
                GridA    grid       = subControl as GridA;
                if (button != null)
                {
                    button.RegisterEvent(clickButtonEvent, EVENTID.CLICK);
                }
                else if (grid != null)
                {
                    GridRowStyle rowStyle = new GridRowStyle();
                    grid.RowStyle              = rowStyle;
                    rowStyle.BackColor         = COLOR.EMPTY;
                    rowStyle.SelectedBackColor = CDraw.PCOLORS_SELECTEDROWCOLOR;
                    rowStyle.HoveredBackColor  = CDraw.PCOLORS_HOVEREDROWCOLOR;
                }
                RegisterEvents(controls[i]);
            }
        }
Ejemplo n.º 2
0
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void RegisterEvents(ControlA control)
        {
            ControlMouseEvent clickButtonEvent = new ControlMouseEvent(ClickEvent);
            List <ControlA>   controls         = control.GetControls();
            int controlsSize = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                ControlA   subControl = controls[i];
                ButtonA    button     = subControl as ButtonA;
                GridColumn column     = subControl as GridColumn;
                GridA      grid       = subControl as GridA;
                CheckBoxA  checkBox   = subControl as CheckBoxA;
                if (column != null)
                {
                    column.AllowResize = true;
                    column.BackColor   = CDraw.PCOLORS_BACKCOLOR;
                    column.BorderColor = CDraw.PCOLORS_LINECOLOR2;
                    column.ForeColor   = CDraw.PCOLORS_FORECOLOR;
                }
                else if (checkBox != null)
                {
                    checkBox.ButtonBackColor = CDraw.PCOLORS_BACKCOLOR;
                }
                else if (button != null)
                {
                    button.RegisterEvent(clickButtonEvent, EVENTID.CLICK);
                }
                else if (grid != null)
                {
                    grid.BackColor     = COLOR.EMPTY;
                    grid.GridLineColor = CDraw.PCOLORS_LINECOLOR2;
                    GridRowStyle rowStyle = new GridRowStyle();
                    grid.RowStyle              = rowStyle;
                    rowStyle.BackColor         = COLOR.EMPTY;
                    rowStyle.SelectedBackColor = CDraw.PCOLORS_SELECTEDROWCOLOR;
                    rowStyle.HoveredBackColor  = CDraw.PCOLORS_HOVEREDROWCOLOR;
                    grid.HorizontalOffset      = grid.Width;
                    grid.UseAnimation          = true;
                }
                else
                {
                    if (subControl.GetControlType() == "Div" || subControl.GetControlType() == "TabControl" ||
                        subControl.GetControlType() == "TabPage" ||
                        subControl.GetControlType() == "SplitLayoutDiv")
                    {
                        subControl.BackColor = COLOR.EMPTY;
                    }
                }
                RegisterEvents(controls[i]);
            }
        }
Ejemplo n.º 3
0
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void RegisterEvents(ControlA control)
        {
            ControlMouseEvent clickButtonEvent = new ControlMouseEvent(ClickButton);
            List <ControlA>   controls         = control.GetControls();
            int controlsSize = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                ControlA   subControl = controls[i];
                ButtonA    button     = controls[i] as ButtonA;
                LinkLabelA linkLabel  = subControl as LinkLabelA;
                GridColumn column     = subControl as GridColumn;
                GridA      grid       = subControl as GridA;
                CheckBoxA  checkBox   = subControl as CheckBoxA;
                if (column != null)
                {
                    column.AllowDrag   = true;
                    column.AllowResize = true;
                    column.BackColor   = CDraw.PCOLORS_BACKCOLOR;
                    column.Font        = new FONT("微软雅黑", 12, false, false, false);
                    column.ForeColor   = CDraw.PCOLORS_FORECOLOR;
                }
                else if (button != null)
                {
                    button.RegisterEvent(clickButtonEvent, EVENTID.CLICK);
                }
                else if (linkLabel != null)
                {
                    linkLabel.RegisterEvent(clickButtonEvent, EVENTID.CLICK);
                }
                else if (grid != null)
                {
                    grid.GridLineColor              = COLOR.CONTROLBORDER;
                    grid.RowStyle.HoveredBackColor  = CDraw.PCOLORS_HOVEREDROWCOLOR;
                    grid.RowStyle.SelectedBackColor = CDraw.PCOLORS_SELECTEDROWCOLOR;
                    grid.RowStyle.SelectedForeColor = CDraw.PCOLORS_FORECOLOR4;
                    grid.RowStyle.Font              = new FONT("微软雅黑", 12, false, false, false);
                    GridRowStyle alternateRowStyle = new GridRowStyle();
                    alternateRowStyle.BackColor         = CDraw.PCOLORS_ALTERNATEROWCOLOR;
                    alternateRowStyle.HoveredBackColor  = CDraw.PCOLORS_HOVEREDROWCOLOR;
                    alternateRowStyle.SelectedBackColor = CDraw.PCOLORS_SELECTEDROWCOLOR;
                    alternateRowStyle.SelectedForeColor = CDraw.PCOLORS_FORECOLOR4;
                    alternateRowStyle.Font = new FONT("微软雅黑", 12, false, false, false);
                    grid.AlternateRowStyle = alternateRowStyle;
                    grid.UseAnimation      = true;
                }
                RegisterEvents(controls[i]);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void RegisterEvents(ControlA control)
        {
            ControlMouseEvent clickButtonEvent = new ControlMouseEvent(ClickButton);
            List <ControlA>   controls         = control.GetControls();
            int controlsSize = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                ButtonA button = controls[i] as ButtonA;
                if (button != null)
                {
                    button.RegisterEvent(clickButtonEvent, EVENTID.CLICK);
                }
                RegisterEvents(controls[i]);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void RegisterEvents(ControlA control)
        {
            ControlMouseEvent clickButtonEvent          = new ControlMouseEvent(ClickButton);
            ControlEvent      selectedIndexChangedEvent = new ControlEvent(ComboBoxSelectedIndexChanged);
            List <ControlA>   controls = control.GetControls();
            int controlsSize           = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                ControlA   subControl = controls[i];
                GridColumn column     = subControl as GridColumn;
                ButtonA    button     = subControl as ButtonA;
                GridA      grid       = subControl as GridA;
                ComboBoxA  comboBox   = subControl as ComboBoxA;
                if (column != null)
                {
                    column.AllowResize = true;
                    column.BackColor   = CDraw.PCOLORS_BACKCOLOR;
                    column.BorderColor = COLOR.CONTROLBORDER;
                    column.ForeColor   = CDraw.PCOLORS_FORECOLOR;
                }
                else if (button != null)
                {
                    button.RegisterEvent(clickButtonEvent, EVENTID.CLICK);
                }
                else if (comboBox != null)
                {
                    comboBox.RegisterEvent(selectedIndexChangedEvent, EVENTID.SELECTEDINDEXCHANGED);
                }
                else if (grid != null)
                {
                    grid.GridLineColor = COLOR.EMPTY;
                    GridRowStyle rowStyle = new GridRowStyle();
                    grid.RowStyle              = rowStyle;
                    rowStyle.BackColor         = COLOR.EMPTY;
                    rowStyle.SelectedBackColor = CDraw.PCOLORS_SELECTEDROWCOLOR;
                    rowStyle.HoveredBackColor  = CDraw.PCOLORS_HOVEREDROWCOLOR;
                }
                RegisterEvents(subControl);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void RegisterEvents(ControlA control)
        {
            ControlMouseEvent clickButtonEvent      = new ControlMouseEvent(ClickButton);
            ControlEvent      spinInputChangedEvent = new ControlEvent(SpinTextChanged);
            List <ControlA>   controls = control.GetControls();
            int controlsSize           = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                ButtonA button = controls[i] as ButtonA;
                if (button != null)
                {
                    button.RegisterEvent(clickButtonEvent, EVENTID.CLICK);
                }
                SpinA spin = controls[i] as SpinA;
                if (spin != null)
                {
                    spin.RegisterEvent(spinInputChangedEvent, EVENTID.TEXTCHANGED);
                }
                RegisterEvents(controls[i]);
            }
        }