Beispiel #1
0
        private void channelGridView_MouseDown(object sender, MouseEventArgs e)
        {
            BandedGridView    view = sender as BandedGridView;
            BandedGridHitInfo hit  = channelGridView.CalcHitInfo(e.Location);

            if (hit == null)
            {
                return;
            }

            switch (hit.HitTest)
            {
            case BandedGridHitTest.Band:
                if (hit.Band.Index > 1)
                {
                    if (channelGridView.Columns[(hit.Band.Index - 2) * 2 + 5].OptionsColumn.AllowEdit == true)
                    {
                        Index = hit.Band.Index - 2;
                    }
                }
                break;

            case BandedGridHitTest.Column:
                if (hit.Column.FieldName == "Checked")
                {
                    CheckAll = !CheckAll;
                    SetCheckColumn(view);
                    OnRefreshView(sender, null);
                }
                break;
            }
        }
        private void OnMouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left || !(sender is MyBandedGridView))
            {
                return;
            }

            MyBandedGridView  view    = (MyBandedGridView)sender;
            BandedGridHitInfo hitInfo = view.CalcHitInfo(e.X, e.Y);

            if (hitInfo.HitTest == BandedGridHitTest.Band)
            {
                GridBandInfoArgs bandInfo = view.ViewInfo.BandsInfo[hitInfo.Band];
                if (CalcButtonBounds(bandInfo.Bounds).Contains(e.X, e.Y))
                {
                    EditorButtonObjectInfoArgs bandButtonInfo = FindButtonInnerElement(bandInfo);
                    if (bandButtonInfo != null)
                    {
                        bandButtonInfo.State = ObjectState.Pressed;
                        view.InvalidateBandHeader(hitInfo.Band);
                    }

                    ((DXMouseEventArgs)e).Handled = true;
                }
                else
                {
                    view.InvalidateBandHeader(hitInfo.Band);
                }
            }
        }
Beispiel #3
0
        private void bandedGridView1_MouseDown(object sender, MouseEventArgs e)
        {
            if (Control.ModifierKeys != (Keys.Shift | Keys.Control))
            {
                return;
            }
            BandedGridView    view  = (BandedGridView)sender;
            BandedGridHitInfo hInfo = view.CalcHitInfo(e.Location);

            if (hInfo.InColumn)
            {
                view.ClearSelection();
                SelectCells(hInfo.Column);
            }
            else if (hInfo.InBandPanel && hInfo.Band != null)
            {
                view.ClearSelection();
                SelectCells(hInfo.Band);
            }
            else
            {
                return;
            }
            ((DXMouseEventArgs)e).Handled = true;
        }
        private void OnMouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left || !(sender is MyBandedGridView))
            {
                return;
            }

            MyBandedGridView  view    = (MyBandedGridView)sender;
            BandedGridHitInfo hitInfo = view.CalcHitInfo(e.X, e.Y);

            if (hitInfo.HitTest == BandedGridHitTest.Band)
            {
                GridBandInfoArgs bandInfo = view.ViewInfo.BandsInfo[hitInfo.Band];
                if (CalcButtonBounds(bandInfo.Bounds).Contains(e.X, e.Y))
                {
                    EditorButtonObjectInfoArgs bandButtonInfo = FindButtonInnerElement(bandInfo);
                    if (bandButtonInfo != null)
                    {
                        for (int i = 0; i < hitInfo.Band.Columns.Count; i++)
                        {
                            if (!((MyBandedGridColumn)hitInfo.Band.Columns[i]).DefaultBandColumn)
                            {
                                hitInfo.Band.Columns[i].Visible = !hitInfo.Band.Columns[i].Visible;
                            }
                        }
                    }

                    ((DXMouseEventArgs)e).Handled = true;
                }
            }
        }
Beispiel #5
0
        private void gvwView_DoubleClick(object sender, EventArgs e)
        {
            BandedGridView view = (BandedGridView)sender;

            if (view != null)
            {
                Point             pt   = view.GridControl.PointToClient(Control.MousePosition);
                BandedGridHitInfo info = view.CalcHitInfo(pt);
                DevExpress.XtraGrid.Views.BandedGrid.BandedGridView sndr = sender as DevExpress.XtraGrid.Views.BandedGrid.BandedGridView;
                DevExpress.Utils.DXMouseEventArgs dxMouseEventArgs       = e as DevExpress.Utils.DXMouseEventArgs;
                DevExpress.XtraGrid.Views.BandedGrid.ViewInfo.BandedGridHitInfo hitInfo = sndr.CalcHitInfo(dxMouseEventArgs.Location);
                if (hitInfo.RowHandle < 0)
                {
                    if (hitInfo.Band.Caption.Equals("Chart"))
                    {
                        this.Close();
                        Form fc = Application.OpenForms["FRM_SMT_OS_TOPO_WEEKLY_CHART"];
                        if (fc != null)
                        {
                            fc.Show();
                        }
                        else
                        {
                            FRM_SMT_OS_TOPO_WEEKLY_CHART f = new FRM_SMT_OS_TOPO_WEEKLY_CHART();
                            f.Show();
                        }
                    }
                }
            }
        }
        private void advBandedGridViewPublication_Click(object sender, EventArgs e)
        {
            DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView view = (DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView)sender;
            BandedGridHitInfo hi = view.CalcHitInfo(view.GridControl.PointToClient(MousePosition));

            if (hi.InBandPanel && (hi.Band == gridBandDate || hi.Band == gridBandIndex))
            {
                SortInserts();
            }
        }
Beispiel #7
0
        private void bandedGridView1_MouseMove(object sender, MouseEventArgs e)
        {
            BandedGridHitInfo _cInfo = this.bandedGridView1.CalcHitInfo(e.X, e.Y);

            if (_cInfo.InRowCell && _cInfo.RowHandle >= 0)
            {
                GridColumn _column = _cInfo.Column as GridColumn;
                ChangeCusor(_column);
            }
            else
            {
                this.sinoCommonGrid2.Cursor = Cursors.Default;
            }
        }
Beispiel #8
0
        private void bandedGridView1_DoubleClick(object sender, EventArgs e)
        {
            DXMouseEventArgs  _eArgs = e as DXMouseEventArgs;
            BandedGridHitInfo _cInfo = this.bandedGridView1.CalcHitInfo(_eArgs.X, _eArgs.Y);

            if (_cInfo.InRowCell)
            {
                if (this.bandedGridView1.FocusedRowHandle >= 0 && this.bandedGridView1.FocusedColumn != null)
                {
                    GridColumn _gc = this.bandedGridView1.FocusedColumn;
                    DataRow    _dr = this.bandedGridView1.GetDataRow(this.bandedGridView1.FocusedRowHandle);
                    ShowDetailByGridColumn(_gc, _dr);
                }
            }
        }
Beispiel #9
0
 private void bandedGridView1_Click(object sender, EventArgs e)
 {
     if (e is DXMouseEventArgs)
     {
         DXMouseEventArgs  _mArgs = e as DXMouseEventArgs;
         BandedGridHitInfo _cInfo = this.bandedGridView1.CalcHitInfo(_mArgs.X, _mArgs.Y);
         if (_cInfo.InBandPanel)
         {
             GridBand _band = _cInfo.Band;
             if (_band == null)
             {
                 return;
             }
             ChangeBandStatus(_band);
         }
     }
 }
        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            if (!(sender is MyBandedGridView))
            {
                return;
            }

            MyBandedGridView  view    = (MyBandedGridView)sender;
            BandedGridHitInfo hitInfo = view.CalcHitInfo(e.X, e.Y);

            if (hitInfo.HitTest == BandedGridHitTest.Band)
            {
                GridBandInfoArgs           bandInfo       = view.ViewInfo.BandsInfo[hitInfo.Band];
                EditorButtonObjectInfoArgs bandButtonInfo = FindButtonInnerElement(bandInfo);
                if (bandButtonInfo != null)
                {
                    if (CalcButtonBounds(bandInfo.Bounds).Contains(e.X, e.Y))
                    {
                        bandButtonInfo.State = ObjectState.Hot;
                        view.InvalidateBandHeader(hitInfo.Band);

                        ((DXMouseEventArgs)e).Handled = true;
                    }
                    else
                    {
                        bandButtonInfo.State = ObjectState.Normal;
                        view.InvalidateBandHeader(hitInfo.Band);
                    }
                }
            }
            else
            {
                for (int i = 0; i < view.ViewInfo.BandsInfo.Count; i++)
                {
                    EditorButtonObjectInfoArgs bandButtonInfo = FindButtonInnerElement(view.ViewInfo.BandsInfo[i]);
                    if (bandButtonInfo != null)
                    {
                        bandButtonInfo.State = ObjectState.Normal;
                    }
                }
            }
        }
        private void gvwView_DoubleClick(object sender, EventArgs e)
        {
            BandedGridView view = (BandedGridView)sender;

            if (view != null)
            {
                Point             pt   = view.GridControl.PointToClient(Control.MousePosition);
                BandedGridHitInfo info = view.CalcHitInfo(pt);
                DevExpress.XtraGrid.Views.BandedGrid.BandedGridView sndr = sender as DevExpress.XtraGrid.Views.BandedGrid.BandedGridView;
                DevExpress.Utils.DXMouseEventArgs dxMouseEventArgs       = e as DevExpress.Utils.DXMouseEventArgs;
                DevExpress.XtraGrid.Views.BandedGrid.ViewInfo.BandedGridHitInfo hitInfo = sndr.CalcHitInfo(dxMouseEventArgs.Location);
                if (hitInfo.RowHandle < 0)
                {
                    if (hitInfo.Band.Caption.Contains("Chart"))
                    {
                        FRM_SMT_DMP_TOPO_DAILY f1 = new FRM_SMT_DMP_TOPO_DAILY("FORM");
                        f1.Show();
                    }
                }
            }
        }
 protected override void DoStartResize(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hit)
 {
     if (hit.HitTest == GridHitTest.ColumnEdge)
     {
         BandedGridHitInfo hi        = new BandedGridHitInfo();
         GridBand          ownerBand = (hit as BandedGridHitInfo).Column.OwnerBand;
         hi.Band    = ownerBand;
         hi.HitTest = BandedGridHitTest.BandEdge;
         if (IsHitPointAtTheEdge(hit))
         {
             base.DoStartResize(hi);
         }
         else
         {
             base.DoStartResize(hit);
         }
     }
     else
     {
         base.DoStartResize(hit);
     }
 }
Beispiel #13
0
        /// <summary>
        /// 点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void m_GridView_Click(object sender, EventArgs e)
        {
            Point             screenPoint = Control.MousePosition;
            Point             p           = this.PointToClient(Control.MousePosition);
            BandedGridHitInfo info        = MainView.CalcHitInfo(p);

            if (info != null && info.Band != null && info.Band.Columns.Count > 0 && !info.InRow && !info.InRowCell)
            {
                #region 过滤与排序
                if (m_IsFiler)
                {
                    int lf = p.X + 5;
                    BandedGridHitInfo tinfo = MainView.CalcHitInfo(lf, p.Y);
                    if (tinfo != null && tinfo.Band != info.Band)
                    {
                        return;
                    }

                    lf    = p.X + 14;
                    tinfo = MainView.CalcHitInfo(lf, p.Y);
                    if (tinfo != null && tinfo.Band != info.Band)
                    {
                        this.BeginInvoke(new MethodInvoker(() =>
                        {
                            MainView.ShowFilterPopup(info.Band.Columns[0]);
                        }));
                        return;
                    }

                    SentClickHeadEvent(info.Band.Columns[0].FieldName);
                }
                else
                {
                    SentClickHeadEvent(info.Band.Columns[0].FieldName);
                }
                #endregion
            }
        }
Beispiel #14
0
        /// <summary>
        /// 双击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void m_GridView_DoubleClick(object sender, EventArgs e)
        {
            Point       pt   = MainView.GridControl.PointToClient(Control.MousePosition);
            GridHitInfo info = MainView.CalcHitInfo(pt);

            if (info.InRow)
            {
                if (RowHeaderDoublickEvent != null)
                {
                    RowHeaderDoublickEvent(info.RowHandle);
                }
            }
            else
            {
                BandedGridHitInfo binfo = MainView.CalcHitInfo(pt);
                if (binfo != null && binfo.Band != null && binfo.Band.Columns.Count > 0)
                {
                    foreach (BandedGridColumn col in MainView.Columns)
                    {
                        if (col.Name != binfo.Band.Columns[0].Name)
                        {
                            col.SortOrder = DevExpress.Data.ColumnSortOrder.None;
                        }
                    }
                    if (binfo.Band.Columns[0].SortOrder != DevExpress.Data.ColumnSortOrder.Descending)
                    {
                        binfo.Band.Columns[0].SortOrder = DevExpress.Data.ColumnSortOrder.Descending;
                    }
                    else
                    {
                        binfo.Band.Columns[0].SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
                    }

                    UpColnumHeaderIcon();
                }
            }
        }
        private void advBandedGridView1_MouseDown(object sender, MouseEventArgs e)
        {
            System.Drawing.Point pt  = new System.Drawing.Point(e.X, e.Y);
            BandedGridHitInfo    hit = advBandedGridView1.CalcHitInfo(e.Location);

            if (!hit.InBandPanel || !calldataEnable)
            {
                return;
            }

            string terminalid = "";

            for (int i = 0; i < advBandedGridView1.RowCount; i++)
            {
                if (advBandedGridView1.IsRowSelected(i))
                {
                    terminalid = advBandedGridView1.GetRowCellValue(i, "TerminalID").ToString().Trim();
                    break;
                }
            }

            if (string.IsNullOrEmpty(terminalid))
            {
                XtraMessageBox.Show("请选中一条记录操作!", GlobalValue.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            GridBand gb1 = hit.Band;

            if (DialogResult.No == XtraMessageBox.Show("是否确定发送招测" + gb1.Caption.Trim() + "命令?", GlobalValue.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk))
            {
                return;
            }
            if (gb1.Tag != null)
            {
                if (calldataEnable)
                {
                    SocketEntity msmqEntity = new SocketEntity();
                    msmqEntity.MsgType      = ConstValue.MSMQTYPE.Cmd_CallData;
                    msmqEntity.DevId        = Convert.ToInt16(terminalid);
                    msmqEntity.DevType      = ConstValue.DEV_TYPE.UNIVERSAL_CTRL;
                    msmqEntity.CallDataType = new CallDataTypeEntity();
                    int config_Seq = typeBll.GetCofingSequence(currentTerid.Trim(), ((UniversalWayTypeEntity)gb1.Tag).ID.ToString().Trim(), TerType.UniversalTer);
                    if (config_Seq == -1)
                    {
                        return;
                    }
                    else if (config_Seq == 1)
                    {
                        msmqEntity.CallDataType.GetSim1 = true;
                    }
                    else if (config_Seq == 2)
                    {
                        msmqEntity.CallDataType.GetSim2 = true;
                    }
                    else if (config_Seq == 3)
                    {
                        msmqEntity.CallDataType.GetSim3 = true;
                    }
                    else if (config_Seq >= 4 && config_Seq <= 8)
                    {
                        msmqEntity.CallDataType.GetPluse = true;
                    }
                    else if (config_Seq == 9)
                    {
                        msmqEntity.CallDataType.GetRS4851 = true;
                    }
                    else if (config_Seq == 10)
                    {
                        msmqEntity.CallDataType.GetRS4852 = true;
                    }
                    else if (config_Seq == 11)
                    {
                        msmqEntity.CallDataType.GetRS4853 = true;
                    }
                    else if (config_Seq == 12)
                    {
                        msmqEntity.CallDataType.GetRS4854 = true;
                    }
                    else if (config_Seq == 13)
                    {
                        msmqEntity.CallDataType.GetRS4855 = true;
                    }
                    else if (config_Seq == 14)
                    {
                        msmqEntity.CallDataType.GetRS4856 = true;
                    }
                    else if (config_Seq == 15)
                    {
                        msmqEntity.CallDataType.GetRS4857 = true;
                    }
                    else if (config_Seq == 16)
                    {
                        msmqEntity.CallDataType.GetRS4858 = true;
                    }

                    GlobalValue.SocketMgr.SendMessage(msmqEntity);
                }
            }
        }
Beispiel #16
0
        private void ShowColumnSelectorMenu()
        {
            throw new NotImplementedException();             // todo...
#if false
            QueryColumn  qc;
            DataRow      dr;
            ColumnMapMsx colMap;
            int          ri, ci;

            MouseEventArgs    e   = LastMouseDownEventArgs;
            Point             p   = new Point(e.X, e.Y);
            BandedGridHitInfo ghi = V.CalcHitInfo(p);

            ri = ghi.RowHandle;
            //if (ri < 0) return;
            BandedGridColumn col = ghi.Column;
            if (col == null)
            {
                return;
            }
            ci = col.AbsoluteIndex;

            if (ci != LabelCol)
            {
                return;
            }

            qc = null;             // existing assignment
            if (ri != GridControl.NewItemRowHandle)
            {
                dr = DataTable.Rows[ri];
                string spotfireName = dr[LabelCol] as string;
                qc = CurrentMap.ColumnMapCollection.GetQueryColumnForSpotfireColumnName(spotfireName);
            }

            ColumnSelectorFromQueryMsx csc = new ColumnSelectorFromQueryMsx();
            csc.Setup(SVP, qc);
            csc.Flags.ExcludeNonNumericTypes = true;

            Point       screenLoc = this.PointToScreen(p);
            QueryColumn qc2       = csc.ShowMenu(screenLoc);
            if (qc2 == null)
            {
                return;
            }

            if (ri == GridControl.NewItemRowHandle)             // adding row
            {
                dr = DataTable.NewRow();
                DataTable.Rows.Add(dr);

                if (IconImage.Visible)
                {
                    dr[ValCol]       = "(Min)";
                    dr[ValCol2]      = "(Max)";
                    dr[IconImageCol] = Bitmaps.GetImageIndexFromName(ColumnImageCollection, CondFormat.DefaultColorScale);
                }

                else
                {
                    Color[] ca = Bitmaps.GetColorSetByName(Bitmaps.ColorSetImageColors, CondFormat.DefaultColorSet);
                    if (ca != null && ca.Length > 0)
                    {
                        dr[BackColorCol1] = ca[DataTable.Rows.Count % ca.Length];
                    }
                }
            }

            else
            {
                dr = DataTable.Rows[ri];
            }

            colMap       = CurrentMap.UpdateColumnMapList(qc2);
            dr[LabelCol] = colMap.SpotfireColumnName;

            return;
#endif
        }