Example #1
0
        private StyleState GetFilterImageState(GridGroupBox box, out bool inFilter)
        {
            inFilter = false;

            StyleState state = StyleState.Default;

            if (box.IsEqualTo(_HitGroupBox) == true)
            {
                state = StyleState.MouseOver;

                if (_HitArea == HeaderArea.InFilterMenu)
                    inFilter = true;
            }

            if (string.IsNullOrEmpty(box.Column.FilterExpr) == false)
                state |= StyleState.Selected;

            return (state);
        }
Example #2
0
        private StyleType GetGroupByStyleType(GridGroupBox box)
        {
            if (IsMouseDown == true)
            {
                Point pt = Control.MousePosition;
                pt = SuperGrid.PointToClient(pt);

                if (box.FilterImageBounds.Contains(pt) == false)
                {
                    if (box.IsDragBox == true || box.IsEqualTo(_MouseDownHitBox))
                    {
                        if (box.IsEqualTo(_HitGroupBox) == true)
                            return (StyleType.SelectedMouseOver);

                        return (StyleType.Selected);
                    }

                    return (StyleType.Default);
                }
            }

            if (box.IsEqualTo(_HitGroupBox) == true)
                return (StyleType.MouseOver);

            return (StyleType.Default);
        }
Example #3
0
        private bool CanShowFilterImage(GridPanel panel, GridGroupBox box)
        {
            switch (_FilterImageVisibility)
            {
                case ImageVisibility.Auto:
                    if (box.Column.IsFilteringEnabled == true)
                    {
                        if (string.IsNullOrEmpty(box.Column.FilterExpr) == false)
                            return (true);

                        return (_Dragging == false && box.IsEqualTo(_HitGroupBox) == true);
                    }
                    break;

                case ImageVisibility.Always:
                    if (box.Column.IsFilteringEnabled == true)
                        return (true);
                    break;

                case ImageVisibility.NotSet:

                    switch (panel.ColumnHeader.FilterImageVisibility)
                    {
                        case ImageVisibility.Always:
                            return (true);

                        case ImageVisibility.Never:
                            return (false);

                        case ImageVisibility.Auto:
                            if (string.IsNullOrEmpty(box.Column.FilterExpr) == false)
                                return (true);

                            return (_Dragging == false && box.IsEqualTo(_HitGroupBox) == true);
                    }
                    break;
            }

            return (false);
        }