コード例 #1
0
        private void SetupHeading(LocationCookies cookies, IEnumerable <LinkInfo> links)
        {
            if (cookies.IsValid)
            {
                HeaderArea.AddCssClasses("has-address has-state");
                ElectedOfficialsButton.Visible = true;
                StatewideButton.Visible        = true;

                if (links != null)
                {
                    foreach (var button in links.Select(CreateSampleBallotButton))
                    {
                        button.AddTo(SampleBallotPlaceHolder);
                    }
                }
                ElectedOfficialsLink.HRef =
                    UrlManager.GetElectedPageUri(cookies.State, cookies.Congress, cookies.StateSenate,
                                                 cookies.StateHouse, cookies.County, cookies.District, cookies.Place, cookies.Elementary,
                                                 cookies.Secondary, cookies.Unified, cookies.CityCouncil, cookies.CountySupervisors,
                                                 cookies.SchoolDistrictDistrict)
                    .ToString();
                StatewideLink.HRef = UrlManager.GetOfficialsPageUri(cookies.State)
                                     .ToString();
            }
            else if (DomainData.IsValidStateCode)
            {
                HeaderArea.AddCssClasses("no-address has-state");
                ElectedOfficialsButton.Visible = false;
                StatewideButton.Visible        = true;
                StatewideLink.HRef             =
                    UrlManager.GetOfficialsPageUri(DomainData.FromQueryStringOrDomain)
                    .ToString();
            }
            else
            {
                HeaderArea.AddCssClasses("no-address no-state");
                ElectedOfficialsButton.Visible = false;
                StatewideButton.Visible        = false;
            }
            if (IsPostBack)
            {
                AddressEntry.Submit();
            }
        }
コード例 #2
0
ファイル: GridTextRow.cs プロジェクト: huamanhtuyen/VNACCS
        internal override void InternalMouseLeave(EventArgs e)
        {
            _HitArea = HeaderArea.NoWhere;

            InvalidateRender();

            base.InternalMouseLeave(e);
        }
コード例 #3
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);
        }
コード例 #4
0
 ///<summary>
 /// GridGetColumnHeaderToolTipEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="gridColumn"></param>
 ///<param name="hitArea"></param>
 ///<param name="toolTip"></param>
 public GridGetColumnHeaderToolTipEventArgs(
     GridPanel gridPanel, GridColumn gridColumn, HeaderArea hitArea, string toolTip)
     : base(gridPanel, gridColumn)
 {
     _HitArea = hitArea;
     _ToolTip = toolTip;
 }
コード例 #5
0
        internal void ActivateFilterPopup(GridPanel panel, GridColumn column)
        {
            if (_FilterMenu != null)
                _FilterMenu.Dispose();

            _FilterMenu = new FilterPopup(panel);

            _LockedColumn = true;
            _HitArea = HeaderArea.NoWhere;

            _FilterMenu.ActivatePopup(column, ResetColumnState);
        }
コード例 #6
0
        internal override void InternalMouseDown(MouseEventArgs e)
        {
            GridPanel panel = Parent as GridPanel;

            if (panel != null)
            {
                GridCell ecell = SuperGrid.EditorCell;

                if (ecell != null)
                {
                    if (ecell.EndEdit() == false)
                    {
                        _MouseDownHitArea = HeaderArea.NoWhere;
                        return;
                    }
                }

                if (_Reordering == true || _Resizing == true)
                {
                    StopResize();
                    StopReorder();

                    InvalidateRender();
                }

                _MouseDownPoint = e.Location;
                _MouseDownHitColumn = _HitColumn;
                _MouseDownHitArea = _HitArea;
                _MouseDownButtons = e.Button;

                _DragSelection = false;
                _DragStarted = false;

                if (_HitArea == HeaderArea.InContent)
                {
                    Capture = true;

                    ProcessInContentMouseDown(e, panel);
                }
                else
                {
                    if (e.Button == MouseButtons.Left)
                    {
                        Capture = true;

                        switch (_HitArea)
                        {
                            case HeaderArea.InResize:
                                ProcessInResizeMouseDown(e, panel);
                                break;

                            case HeaderArea.InRowHeader:
                                ProcessInRowHeaderMouseDown(panel);
                                break;

                            case HeaderArea.InRowHeaderResize:
                                ProcessInRowHeaderResizeMouseDown();
                                break;

                            case HeaderArea.InFilterMenu:
                                ProcessInFilterMouseDown(panel, _HitColumn);
                                break;
                        }
                    }
                }
            }

            base.InternalMouseDown(e);
        }
コード例 #7
0
        private bool ProcessInGroupBox(GridPanel panel, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (panel.VisibleColumnCount > 1)
                {
                    if (panel.GroupByRow.DragStart(_MouseDownHitColumn) == true)
                    {
                        ResetColumnState();
                        StopReorder();

                        _MouseDownHitColumn = null;
                        _HitArea = HeaderArea.NoWhere;
                        _HitColumn = null;


                        return (true);
                    }
                }
            }

            return (false);
        }
コード例 #8
0
ファイル: GridGroupBy.cs プロジェクト: huamanhtuyen/VNACCS
        internal override void InternalMouseMove(MouseEventArgs e)
        {
            base.InternalMouseMove(e);

            SuperGrid.GridCursor = Cursors.Default;

            if (AllowSelection == true)
            {
                Point pt = e.Location;

                _LastHitArea = _HitArea;
                _LastHitGroupBox = _HitGroupBox;

                _HitGroupBox = GetGroupBoxAt(pt);
                _HitArea = GetHitArea(pt);

                if (IsMouseDown == true)
                {
                    if (_Dragging == true)
                    {
                        DragContinue(pt);
                    }
                    else if (_MouseDownHitBox != null)
                    {
                        if (Math.Abs(MouseDownPoint.X - pt.X) > 5 ||
                            Math.Abs(MouseDownPoint.Y - pt.Y) > 5)
                        {
                            DragStart(_MouseDownHitBox.Column);
                        }
                    }
                }
                else
                {
                    switch (_HitArea)
                    {
                        case HeaderArea.InFilterMenu:
                            SuperGrid.GridCursor = Cursors.Hand;
                            break;

                        default:
                            SuperGrid.GridCursor = Cursors.Default;
                            break;
                    }
                }

                if (_HitArea != _LastHitArea || _LastHitGroupBox != _HitGroupBox)
                {
                    if (_LastHitGroupBox != null)
                        InvalidateRender(_LastHitGroupBox.Bounds);

                    if (_HitGroupBox != null)
                    {
                        if ((_LastHitGroupBox != _HitGroupBox) ||
                            (_HitArea == HeaderArea.InFilterMenu || _LastHitArea == HeaderArea.InFilterMenu))
                        {
                            InvalidateRender(_HitGroupBox.Bounds);
                        }
                    }
                }
            }
        }
コード例 #9
0
        internal override void InternalMouseMove(MouseEventArgs e)
        {
            GridPanel panel = Parent as GridPanel;

            if (panel != null)
            {
                if (AllowSelection == true)
                {
                    _LastHitArea = _HitArea;
                    _LastHitColumn = _HitColumn;

                    if (IsMouseDown == true)
                    {
                        if (ProcessMouseDownMove(e) == false)
                        {
                            if (_MouseDownHitColumn != null)
                            {
                                SuperGrid.EnableAutoScrolling(AutoScrollEnable.Horizontal, ViewRect);

                                StopResize();
                                StopReorder();
                            }
                        }
                    }
                    else
                    {
                        _HitArea = GetHitArea(e.Location, ref _HitColumn, IsMouseDown);

                        switch (_HitArea)
                        {
                            case HeaderArea.InContent:
                                SuperGrid.GridCursor = Cursors.Default;

                                if (_HitColumn.HeaderTextMarkup != null)
                                    _HitColumn.HeaderTextMarkup.MouseMove(SuperGrid, e);

                                if (_ShowToolTips == true)
                                    UpdateToolTip(panel, _HitColumn.ToolTip);
                                break;

                            case HeaderArea.InResize:
                            case HeaderArea.InRowHeaderResize:
                                SuperGrid.GridCursor = Cursors.VSplit;
                                SuperGrid.ToolTipText = "";
                                break;

                            case HeaderArea.InRowHeader:
                                SuperGrid.GridCursor =
                                    (panel.TopLeftHeaderSelectBehavior != TopLeftHeaderSelectBehavior.NoSelection)
                                        ? Cursors.Hand
                                        : Cursors.Default;

                                UpdateToolTip(panel, "");
                                break;

                            case HeaderArea.InFilterMenu:
                                SuperGrid.GridCursor = Cursors.Hand;

                                if (_ShowFilterToolTips == true && _HitColumn.IsFilteringEnabled == true)
                                    UpdateToolTip(panel, _HitColumn.FilterExpr);
                                break;

                            default:
                                SuperGrid.GridCursor = Cursors.Default;
                                SuperGrid.ToolTipText = "";
                                break;
                        }

                        if (_HitArea != _LastHitArea || _LastHitColumn != _HitColumn)
                        {
                            if (_LastHitColumn != null)
                                InvalidateHeader(panel, _LastHitColumn);

                            if (_HitColumn != null)
                            {
                                if ((_LastHitColumn != _HitColumn) ||
                                    (_HitArea == HeaderArea.InFilterMenu || _LastHitArea == HeaderArea.InFilterMenu))
                                {
                                    InvalidateHeader(panel, _HitColumn);
                                }
                            }

                            if (_HitArea == HeaderArea.InRowHeader || _LastHitArea == HeaderArea.InRowHeader)
                                InvalidateRowHeader();
                        }
                    }
                }

                base.InternalMouseMove(e);
            }
        }
コード例 #10
0
        internal void ResetColumnStateEx()
        {
            ResetColumnState();

            _HitColumn = null;
            _HitArea = HeaderArea.NoWhere;
        }
コード例 #11
0
        internal override void InternalMouseLeave(EventArgs e)
        {
            if (_LockedColumn == false)
            {
                ResetColumnState();

                _HitArea = HeaderArea.NoWhere;
                _HitColumn = null;
            }

            SuperGrid.ToolTipText = "";

            base.InternalMouseLeave(e);
        }
コード例 #12
0
ファイル: GridFilter.cs プロジェクト: huamanhtuyen/VNACCS
        internal override void InternalMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            GridPanel panel = GridPanel;

            if (panel != null)
            {
                _MouseDownHitArea = _HitArea;
                _MouseDownHitColumn = _HitColumn;

                switch (_HitArea)
                {
                    case HeaderArea.InContent:
                        GridColumn column = _HitColumn;

                        if (column != null)
                        {
                            if (_HitColumn.IsFilteringEnabled == true)
                            {
                                if (panel.SetActiveRow(null, false) == true)
                                {
                                    FilterPanel fp = FilterPanel.GetFilterPanel(column);

                                    if (fp != null)
                                        fp.BeginEdit();
                                }
                            }
                        }
                        break;

                    case HeaderArea.InFilterMenu:
                        if (panel.SuperGrid.DoFilterBeginEditEvent(panel, null) == false)
                            LaunchCustomDialog(panel, panel.FilterExpr);
                        break;
                }
            }
        }
コード例 #13
0
ファイル: GridFilter.cs プロジェクト: huamanhtuyen/VNACCS
        internal override void InternalMouseMove(MouseEventArgs e)
        {
            GridPanel panel = Parent as GridPanel;

            if (panel != null)
            {
                _LastHitArea = _HitArea;
                _LastHitColumn = _HitColumn;

                _HitArea = GetHitArea(e.Location, ref _HitColumn, false);

                switch (_HitArea)
                {
                    case HeaderArea.InFilterMenu:
                        SuperGrid.GridCursor = Cursors.Hand;
                        UpdateToolTip(panel, panel.FilterExpr);
                        break;

                    case HeaderArea.InContent:
                        SuperGrid.GridCursor = Cursors.Default;

                        if (_HitColumn != null)
                        {
                            if (_HitColumn.IsFilteringEnabled == true)
                                UpdateToolTip(panel, _HitColumn.FilterExpr);
                        }
                        break;

                    default:
                        SuperGrid.GridCursor = Cursors.Default;
                        SuperGrid.ToolTipText = "";
                        break;
                }

                if (_LastHitArea != _HitArea)
                    InvalidateRowHeader();

                base.InternalMouseMove(e);
            }
        }
コード例 #14
0
ファイル: GridFilter.cs プロジェクト: huamanhtuyen/VNACCS
        internal override void InternalMouseLeave(EventArgs e)
        {
            GridPanel panel = GridPanel;

            if (panel != null)
            {
                if (_HitArea == HeaderArea.InRowHeader || _HitArea == HeaderArea.InFilterMenu)
                    InvalidateRowHeader();

                _HitArea = HeaderArea.NoWhere;
                _HitColumn = null;

                SuperGrid.ToolTipText = "";
            }

            base.InternalMouseLeave(e);
        }
コード例 #15
0
ファイル: GridTextRow.cs プロジェクト: huamanhtuyen/VNACCS
        internal override void InternalMouseMove(MouseEventArgs e)
        {
            SuperGrid.GridCursor = Cursors.Default;

            HeaderArea area = GetHitArea(e.Location);

            if (_HitArea != area)
            {
                _HitArea = area;

                InvalidateRender();
            }

            if (AllowSelection == true)
            {
                if (_TextMarkup != null)
                    _TextMarkup.MouseMove(SuperGrid, e);
            }

            base.InternalMouseMove(e);
        }
コード例 #16
0
ファイル: GridTextRow.cs プロジェクト: huamanhtuyen/VNACCS
        internal override void InternalMouseDown(MouseEventArgs e)
        {
            _MouseDownHitArea = _HitArea;

            base.InternalMouseDown(e);
        }
コード例 #17
0
        private bool ProcessMouseDownMove(MouseEventArgs e)
        {
            GridPanel panel = Parent as GridPanel;

            if (panel != null)
            {
                if (_MouseDownHitArea == HeaderArea.InRowHeaderResize)
                {
                    ProcessInRowHeaderResize(e.Location, e);

                    return (true);
                }

                if (_MouseDownHitColumn != null)
                {
                    Rectangle r = ViewRect;

                    if ((_MouseDownHitArea == HeaderArea.InResize) ||
                        (_MouseDownHitArea == HeaderArea.InRowHeaderResize) ||
                        (e.X >= r.X && e.X < r.Right) ||
                        (_MouseDownHitColumn.IsHFrozen == true && panel.IsSubPanel == false))
                    {
                        SuperGrid.DisableAutoScrolling();

                        switch (_MouseDownHitArea)
                        {
                            case HeaderArea.InContent:
                                _HitArea = GetHitArea(e.Location, ref _HitColumn, IsMouseDown);

                                if (_HitArea == HeaderArea.InGroupBox &&
                                    _MouseDownHitColumn.GroupBoxEffectsEx != GroupBoxEffects.None)
                                {
                                    if (ProcessInGroupBox(panel, e) == true)
                                        return (true);
                                }

                                if (_HitColumn == null)
                                    return (false);

                                ProcessInContent(e);
                                break;

                            case HeaderArea.InResize:
                                ProcessInResize(e.Location, e);
                                break;
                        }

                        return (true);
                    }
                }
            }

            return (false);
        }