Esempio n. 1
0
        ///<summary>
        /// FilterScan
        ///</summary>
        ///<param name="gridColumn"></param>
        public FilterScan(GridColumn gridColumn)
        {
            _GridColumn = gridColumn;

            _OnScanComplete = new EventHandler(OnScanComplete);
            _ScanListDelegate = new ScanListDelegate(AddScanItems);
        }
Esempio n. 2
0
        ///<summary>
        /// CustomFilter
        ///</summary>
        public CustomFilter(GridPanel gridPanel, GridColumn gridColumn, string filterText)
        {
            _GridPanel = gridPanel;
            _GridColumn = gridColumn;

            InitializeComponent();
            InitializeText();
            InitializeFilter(filterText);

            PositionWindow(_GridPanel.SuperGrid);
        }
        private string GetColumnText(GridColumn col, int index)
        {
            string s = index + " ";

            if (string.IsNullOrEmpty(col.Name) == false)
                return (s + "-" + col.Name);

            if (string.IsNullOrEmpty(col.HeaderText) == false)
                return (s + "-" + col.HeaderText);

            return (s);
        }
Esempio n. 4
0
        ///<summary>
        /// CustomFilter
        ///</summary>
        public CustomFilterEx(GridPanel gridPanel,
            GridColumn gridColumn, string filterText)
        {
            _GridPanel = gridPanel;
            _GridColumn = gridColumn;

            InitializeComponent();
            InitializeText();
            InitializeFilter(filterText);

            PositionWindow(_GridPanel.SuperGrid);

            FormClosing += CustomFilterExFormClosing;

            filterExprEdit1.InputTextChanged += FilterExprEdit1InputTextChanged;
        }
Esempio n. 5
0
        /// <summary>
        /// Handles invocation of FilterEndEdit events
        /// </summary>
        internal void DoFilterEndEditEvent(GridColumn column)
        {
            if (FilterEndEdit != null)
            {
                GridFilterEndEditEventArgs ev = new
                    GridFilterEndEditEventArgs(column.GridPanel, column);

                FilterEndEdit(this, ev);
            }
        }
Esempio n. 6
0
        static internal void RenderCheckBox(
            Graphics g, GridFilter gf, GridColumn column, Rectangle bounds)
        {
            object value = column.FilterValue;

            if (_sizeCheckBox == null)
            {
                _sizeCheckBox = new MyCheckBoxX();

                _sizeCheckBox.Text = "";
                _sizeCheckBox.BackColor = Color.Transparent;
            }

            _sizeCheckBox.Enabled = false;
            _sizeCheckBox.Size = new Size(20, 20);
            _sizeCheckBox.BackColor = GetSimpleColor(gf.GetEffectiveStyle(column));

            if (value is CheckState)
                _sizeCheckBox.CheckState = (CheckState)value;
            else
                _sizeCheckBox.CheckState = CheckState.Indeterminate;

            Rectangle r = new Rectangle(0, 0, 20, 20);

            using (Bitmap bm = new Bitmap(20, 20))
            {
                _sizeCheckBox.DrawToBitmap(bm, r);

                Rectangle t = bounds;

                if (bounds.Width > r.Width)
                {
                    t.X += (t.Width - r.Width - 1) / 2;
                    t.Width = r.Width;
                }

                if (bounds.Height > r.Height)
                {
                    t.Y += (t.Height - r.Height) / 2;
                    t.Height = r.Height;
                }

                g.DrawImage(bm, t);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Handles invocation of PreRenderFilterRowEvent events
        /// </summary>
        internal bool DoPreRenderFilterRowEvent(Graphics g,
            GridFilter filter, GridColumn column, RenderParts parts, Rectangle bounds)
        {
            if (PreRenderFilterRow != null)
            {
                GridPanel panel = filter.GridPanel;

                GridPreRenderFilterRowEventArgs ev = new
                    GridPreRenderFilterRowEventArgs(g, panel, filter, column, parts, bounds);

                PreRenderFilterRow(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 8
0
        /// <summary>
        /// Handles invocation of PreRenderFilterPopupGripBar events
        /// </summary>
        internal bool DoPreRenderFilterPopupGripBarEvent(
            Graphics g, FilterPopup filterPopup, GridColumn gridColumn, Rectangle bounds)
        {
            if (PreRenderFilterPopupGripBar != null)
            {
                GridPreRenderFilterPopupGripBarEventArgs ev = new
                    GridPreRenderFilterPopupGripBarEventArgs(g, filterPopup, gridColumn, bounds);

                PreRenderFilterPopupGripBar(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 9
0
        /// <summary>
        /// Handles invocation of FilterPopupOpening events
        /// </summary>
        internal bool DoFilterPopupOpeningEvent(GridColumn column, FilterPopup filterPopup)
        {
            if (FilterPopupOpening != null)
            {
                GridFilterPopupOpeningEventArgs ev = new
                    GridFilterPopupOpeningEventArgs(column.GridPanel, column, filterPopup);

                FilterPopupOpening(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 10
0
        /// <summary>
        /// Handles invocation of FilterPopupLoaded events
        /// </summary>
        internal void DoFilterPopupLoadedEvent(GridColumn column, FilterPopup filterPopup)
        {
            if (FilterPopupLoaded != null)
            {
                GridFilterPopupLoadedEventArgs ev = new
                    GridFilterPopupLoadedEventArgs(column.GridPanel, column, filterPopup);

                FilterPopupLoaded(this, ev);
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Handles invocation of FilterLoadItems events
        /// </summary>
        internal bool DoFilterLoadItemsEvent(GridColumn column, ComboBoxEx comboBox)
        {
            if (FilterLoadItems != null)
            {
                GridFilterLoadItemsEventArgs ev = new
                    GridFilterLoadItemsEventArgs(column.GridPanel, column, comboBox);

                FilterLoadItems(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 12
0
        /// <summary>
        /// Handles invocation of FilterItemsLoaded events
        /// </summary>
        internal void DoFilterItemsLoadedEvent(GridColumn column, ComboBoxEx comboBox)
        {
            if (FilterItemsLoaded != null)
            {
                GridFilterItemsLoadedEventArgs ev = new
                    GridFilterItemsLoadedEventArgs(column.GridPanel, column, comboBox);

                FilterItemsLoaded(this, ev);
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Handles invocation of FilterHelpOpening events
        /// </summary>
        internal bool DoFilterHelpOpeningEvent(GridPanel panel, GridColumn column, SampleExpr sampleExpr)
        {
            if (FilterHelpOpening != null)
            {
                GridFilterHelpOpeningEventArgs ev = new
                    GridFilterHelpOpeningEventArgs(panel, column, sampleExpr);

                FilterHelpOpening(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 14
0
        /// <summary>
        /// Handles invocation of FilterHelpClosing events
        /// </summary>
        internal void DoFilterHelpClosingEvent(GridPanel panel, GridColumn column, SampleExpr sampleExpr)
        {
            if (FilterHelpClosing != null)
            {
                GridFilterHelpClosingEventArgs ev = new
                    GridFilterHelpClosingEventArgs(panel, column, sampleExpr);

                FilterHelpClosing(this, ev);
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Handles invocation of FilterHeaderClick events
        /// </summary>
        internal bool DoFilterHeaderClickEvent(
            GridPanel gridPanel, GridColumn gridColumn, MouseEventArgs e)
        {
            if (FilterHeaderClick != null)
            {
                GridFilterHeaderClickEventArgs ev = new
                    GridFilterHeaderClickEventArgs(gridPanel, gridColumn, e);

                FilterHeaderClick(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 16
0
        /// <summary>
        /// Handles invocation of PreRenderColumnHeaderEvent events
        /// </summary>
        internal bool DoPreRenderColumnHeaderEvent(Graphics g,
            GridColumnHeader header, GridColumn column, RenderParts parts, Rectangle bounds)
        {
            if (PreRenderColumnHeader != null)
            {
                GridPanel panel = header.GridPanel;

                GridPreRenderColumnHeaderEventArgs ev = new
                    GridPreRenderColumnHeaderEventArgs(g, panel, header, column, parts, bounds);

                PreRenderColumnHeader(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 17
0
        /// <summary>
        /// Handles invocation of PostRenderFilterPopupGripBar events
        /// </summary>
        internal void DoPostRenderFilterPopupGripBarEvent(
            Graphics g, FilterPopup filterPopup, GridColumn gridColumn, Rectangle bounds)
        {
            if (PostRenderFilterPopupGripBar != null)
            {
                GridPostRenderFilterPopupGripBarEventArgs ev = new
                    GridPostRenderFilterPopupGripBarEventArgs(g, filterPopup, gridColumn, bounds);

                PostRenderFilterPopupGripBar(this, ev);
            }
        }
Esempio n. 18
0
        /// <summary>
        /// Handles invocation of FilterPopupValueChanged events
        /// </summary>
        internal bool DoFilterPopupValueChangedEvent(GridColumn column, FilterItemType filterItemType,
            ref object filterValue, ref object filterDisplayValue, ref string filterExpr)
        {
            if (FilterPopupValueChanged != null)
            {
                GridFilterPopupValueChangedEventArgs ev = 
                    new GridFilterPopupValueChangedEventArgs(column.GridPanel,
                    column, filterItemType, filterValue, filterDisplayValue, filterExpr);

                FilterPopupValueChanged(this, ev);

                filterValue = ev.FilterValue;
                filterDisplayValue = ev.FilterDisplayValue;
                filterExpr = ev.FilterExpr;

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 19
0
        /// <summary>
        /// Handles invocation of PostRenderFilterRow events
        /// </summary>
        internal void DoPostRenderFilterRowEvent(Graphics g,
            GridFilter filter, GridColumn column, RenderParts parts, Rectangle bounds)
        {
            if (PostRenderFilterRow != null)
            {
                GridPanel panel = filter.GridPanel;

                GridPostRenderFilterRowEventArgs ev = new
                    GridPostRenderFilterRowEventArgs(g, panel, filter, column, parts, bounds);

                PostRenderFilterRow(this, ev);
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Handles invocation of GetFilterEditType events
        /// </summary>
        internal void DoGetFilterEditTypeEvent(
            GridColumn gridColumn, ref FilterEditType filterType)
        {
            if (GetFilterEditType != null)
            {
                GridGetFilterEditTypeEventArgs ev = new
                    GridGetFilterEditTypeEventArgs(gridColumn.GridPanel, gridColumn, filterType);

                GetFilterEditType(this, ev);

                filterType = ev.FilterEditType;
            }
        }
Esempio n. 21
0
 ///<summary>
 /// CustomFilter
 ///</summary>
 public CustomFilterEx(GridPanel gridPanel, GridColumn gridColumn)
     : this(gridPanel, gridColumn, gridColumn != null ? gridColumn.FilterExpr : gridPanel.FilterExpr)
 {
 }
Esempio n. 22
0
        /// <summary>
        /// Handles invocation of GetColumnHeader events
        /// </summary>
        internal void DoGetColumnHeaderStyleEvent(
            GridColumn gridColumn, StyleType eStyle, ref ColumnHeaderVisualStyle style)
        {
            if (GetColumnHeaderStyle != null)
            {
                GridGetColumnHeaderStyleEventArgs ev = new
                    GridGetColumnHeaderStyleEventArgs(gridColumn.GridPanel, gridColumn, eStyle, style);

                GetColumnHeaderStyle(this, ev);

                style = ev.Style;
            }
        }
Esempio n. 23
0
        /// <summary>
        /// FilterDateTimePicker
        /// </summary>
        /// <param name="gridColumn"></param>
        public FilterDateTimePicker(GridColumn gridColumn)
        {
            InitializeComponent();

            SuperGridControl sg = gridColumn.SuperGrid;

            LoadLocalizedStrings(sg);

            cbxShowAll.Text = sg.FilterShowAllString;
            cbxShowNull.Text = sg.FilterShowNullString;
            cbxShowNotNull.Text = sg.FilterShowNotNullString;

            if (string.IsNullOrEmpty(cbxShowNull.Text) == true)
                cbxShowNull.Visible = false;

            if (string.IsNullOrEmpty(cbxShowNotNull.Text) == true)
                cbxShowNotNull.Visible = false;

            if (cbxShowNull.Visible == false || cbxShowNotNull.Visible == false)
            {
                int y = (cbxDateRelative.Location.Y - cbxShowAll.Size.Height) / 2;

                cbxShowAll.Location = new Point(cbxShowAll.Location.X, y);

                if (cbxShowNull.Visible == true)
                    cbxShowNull.Location = new Point(cbxShowNull.Location.X, y);

                if (cbxShowNotNull.Visible == true)
                    cbxShowNotNull.Location = new Point(cbxShowNotNull.Location.X, y);
            }

            btnApply.Text = sg.FilterApplyString;

            if (sg.FilterCustomString != null)
            {
                cbxCustom.Text = sg.FilterCustomString;
                btnCustom.Text = sg.FilterCustomString + "...";
            }
            else
            {
                cbxCustom.Visible = false;
                btnCustom.Visible = false;
            }

            cbxDateRelative.Text = _filterByRelativeDateString;
            cbxDateSpecific.Text = _filterBySpecificDateString;
            cbxDateRange.Text = _filterByDateRangeString;

            cboDateRelative.Items.Add(CurrentMonth);
            cboDateRelative.Items.Add(CurrentYear);
            cboDateRelative.Items.Add(LastMonthPeriod);
            cboDateRelative.Items.Add(Last3MonthPeriod);
            cboDateRelative.Items.Add(Last6MonthPeriod);
            cboDateRelative.Items.Add(Last9MonthPeriod);
            cboDateRelative.Items.Add(LastYear);
            cboDateRelative.Items.Add(Last5YearPeriod);
            cboDateRelative.Items.Add(Last10YearPeriod);

            cboDateRelative.SelectedIndex = 0;

            _GridColumn = gridColumn;

            FilterColumnHeaderVisualStyle style = _GridColumn.GetFilterStyle(StyleType.Default);

            Font = style.Font;
            BackColor = style.Background.Color1;

            Cancel = false;
        }
Esempio n. 24
0
        /// <summary>
        /// Handles invocation of GetColumnHeaderToolTip events
        /// </summary>
        internal bool DoGetColumnHeaderToolTipEvent(GridPanel panel,
            GridColumn gridColumn, HeaderArea hitArea, ref string toolTip)
        {
            if (GetColumnHeaderToolTip != null)
            {
                GridGetColumnHeaderToolTipEventArgs ev = new
                    GridGetColumnHeaderToolTipEventArgs(panel, gridColumn, hitArea, toolTip);

                GetColumnHeaderToolTip(this, ev);

                toolTip = ev.ToolTip;

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 25
0
        private void ScanColumn(
            GridItemsCollection rows, GridColumn gridColumn, List<object> scanItems)
        {
            if (rows != null && rows.Count > 0)
            {
                for (int i = 0; i < rows.Count; i++)
                {
                    GridContainer cont = rows[i] as GridContainer;

                    if (cont != null)
                    {
                        GridRow row = cont as GridRow;

                        if (row != null)
                        {
                            GridCell cell = row.GetCell(gridColumn.ColumnIndex);

                            if (cell != null)
                            {
                                object value = cell.ValueEx;

                                if (value != null && value != DBNull.Value)
                                {
                                    if (value is DateTime)
                                        value = ((DateTime) value).Date;

                                    scanItems.Add(value);
                                }
                            }
                        }

                        if (cont is GridPanel == false)
                            ScanColumn(cont.Rows, gridColumn, scanItems);
                    }
                }
            }
        }
Esempio n. 26
0
        /// <summary>
        /// Handles invocation of GetGroupedDetailRows events
        /// </summary>
        internal bool DoGetGroupedDetailRowsEvent(GridPanel gridPanel, GridColumn gridColumn,
            GridGroup gridGroup, out List<GridRow> preRows, out List<GridRow> postRows)
        {
            if (GetGroupDetailRows != null)
            {
                GridGetGroupDetailRowsEventArgs ev = new
                    GridGetGroupDetailRowsEventArgs(gridPanel, gridColumn, gridGroup);

                GetGroupDetailRows(this, ev);

                preRows = ev.PreDetailRows;
                postRows = ev.PostDetailRows;

                return (true);
            }

            preRows = null;
            postRows = null;

            return (false);
        }
Esempio n. 27
0
        static internal Size GetPreferredSize(
            GridFilter gridFilter, GridColumn gridColumn)
        {
            Size size = Size.Empty;

            FilterEditType type = gridColumn.GetFilterPanelType();

            switch (type)
            {
                case FilterEditType.ComboBox:
                    if (_sizeComboBox == null)
                        _sizeComboBox = new ComboBoxEx();

                    _sizeComboBox.Font = gridFilter.GetEffectiveStyle(gridColumn).Font;

                    size = _sizeComboBox.GetPreferredSize(Size.Empty);
                    break;

                case FilterEditType.TextBox:
                case FilterEditType.DateTime:
                    if (_sizeTextBox == null)
                        _sizeTextBox = new TextBoxX();

                    _sizeTextBox.BorderStyle = BorderStyle.None;
                    _sizeTextBox.Font = gridFilter.GetEffectiveStyle(gridColumn).Font;

                    size = _sizeTextBox.GetPreferredSize(Size.Empty);
                    break;

                case FilterEditType.CheckBox:
                    if (_sizeCheckBox == null)
                        _sizeCheckBox = new MyCheckBoxX();

                    size = new Size(20, 20);
                    break;
            }

            return (size);
        }
Esempio n. 28
0
        /// <summary>
        /// Handles invocation of GetGroupId events
        /// </summary>
        internal void DoGetGroupIdEvent(
            GridElement row, GridColumn column, ref object groupId)
        {
            if (GetGroupId != null)
            {
                GridGetGroupIdEventArgs ev = new
                    GridGetGroupIdEventArgs(row.GridPanel, row, column, groupId);

                GetGroupId(this, ev);

                groupId = ev.GroupId ?? "<null>";
            }
        }
Esempio n. 29
0
        static internal FilterPanel GetFilterPanel(GridColumn gridColumn)
        {
            FilterEditType type = gridColumn.GetFilterPanelType();

            if (type != FilterEditType.None)
            {
                GridFilter gridFilter = gridColumn.GridPanel.Filter;

                FilterPanel fp = GetFilterPanel(gridFilter, type);

                fp.GridFilter = gridFilter;
                fp.GridColumn = gridColumn;

                fp.Style = gridFilter.GetEffectiveStyle(gridColumn);

                fp.InitEditControl(type);

                return (fp);
            }

            return (null);
        }
Esempio n. 30
0
        /// <summary>
        /// Handles invocation of PostRenderColumnHeader events
        /// </summary>
        internal void DoPostRenderColumnHeaderEvent(Graphics g,
            GridColumnHeader header, GridColumn column, RenderParts parts, Rectangle bounds)
        {
            if (PostRenderColumnHeader != null)
            {
                GridPanel panel = header.GridPanel;

                GridPostRenderColumnHeaderEventArgs ev = new
                    GridPostRenderColumnHeaderEventArgs(g, panel, header, column, parts, bounds);

                PostRenderColumnHeader(this, ev);
            }
        }