Exemple #1
0
        private void toolTipController_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl == storeLoadTree)
            {
                DevExpress.XtraTreeList.TreeListHitInfo hit = storeLoadTree.CalcHitInfo(e.ControlMousePosition);

                if (hit.HitInfoType == HitInfoType.StateImage)
                {
                    object o          = (object)hit.Node;
                    int    imageIndex = hit.Node.StateImageIndex;
                    string toolText   = String.Empty;

                    switch (imageIndex)
                    {
                    case 2:
                        toolText = "Кассета не загружена";
                        break;

                    case 3:
                        toolText = "Кассета частично загружена";
                        break;

                    case 4:
                        toolText = "Кассета загружена полностью";
                        break;
                    }

                    e.Info = new ToolTipControlInfo(o, toolText);
                }
            }
        }
Exemple #2
0
 private void OnGetActiveObject(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
     if (e.SelectedControl == checkedComboBoxEdit1)
     {
         PopupContainerEditViewInfo editInfo = checkedComboBoxEdit1.GetViewInfo() as PopupContainerEditViewInfo;
         EditHitInfo hitInfo = editInfo.CalcHitInfo(e.ControlMousePosition);
         if (hitInfo.HitTest == EditHitTest.MaskBox)
         {
             object val = checkedComboBoxEdit1.EditValue;
             if (val == null || val == DBNull.Value || val.Equals(string.Empty))
             {
                 return;
             }
             string[]  checkedItems = checkedComboBoxEdit1.Text.Split(separatorChar);
             Rectangle rect         = editInfo.MaskBoxRect;
             string    description  = GetCheckedItemDescription(checkedItems, editInfo.PaintAppearance.Font, e.ControlMousePosition, rect);
             int       itemIndex    = GetItemIndex(checkedComboBoxEdit1, description);
             if (itemIndex == -1)
             {
                 return;
             }
             ToolTipControlInfo tInfo = tInfo = new ToolTipControlInfo();
             tInfo.Object   = itemIndex;
             tInfo.SuperTip = GetSuperToolTip(checkedComboBoxEdit1, (carsBindingSource.DataSource as DataTable).Rows[itemIndex]);
             e.Info         = tInfo;
         }
     }
 }
        private void ToolTipController_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            object o    = gridView1.ActiveEditor.ToString();
            string text = "Test";

            e.Info = new ToolTipControlInfo(o, text);
        }
Exemple #4
0
 private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
     if (MouseButtons == MouseButtons.Left)
     {
         e.Info = new DevExpress.Utils.ToolTipControlInfo(treeList1.TopVisibleNodeIndex, treeList1.TopVisibleNodeIndex.ToString(), true, DevExpress.Utils.ToolTipIconType.None);
     }
 }
Exemple #5
0
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl != gridControl1)
            {
                return;
            }
            ToolTipControlInfo info = null;

            try
            {
                GridView view = gridControl1.GetViewAt(e.ControlMousePosition) as GridView;
                if (view == null)
                {
                    return;
                }
                GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
                if (hi.InRowCell)
                {
                    info = new ToolTipControlInfo(new CellToolTipInfo(hi.RowHandle, hi.Column, "cell"), GetCellHintText(view, hi.RowHandle, hi.Column));
                    return;
                }
            }
            finally
            {
                e.Info = info;
            }
        }
Exemple #6
0
        private void OnGetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl != gridControl1)
            {
                return;
            }
            ToolTipControlInfo info = null;
            GridView           view = gridControl1.GetViewAt(e.ControlMousePosition) as GridView;

            if (view == null)
            {
                return;
            }
            GridViewInfo viewInfo = view.GetViewInfo() as GridViewInfo;
            GridPainter  painter  = viewInfo.Painter;

            if (view.State == GridState.ColumnSizing)
            {
                GridColumn col   = painter.ReSizingObject as GridColumn;
                object     o     = col.FieldName + e.ControlMousePosition.ToString();
                int        width = GetColumnHeaderWidth(viewInfo.ColumnsInfo[col], painter);
                string     text  = string.Format("Width: {0}", width);
                info = new ToolTipControlInfo(o, text);
            }
            if (info != null)
            {
                e.Info = info;
            }
        }
        private void toolTip_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl != gridOrderDetail)
            {
                return;
            }
            ToolTipControlInfo info = null;

            var view = gridOrderDetail.GetViewAt(e.ControlMousePosition) as BandedGridView;

            if (view == null)
            {
                return;
            }
            GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
            var         orderDetailViewModel = (OrderDetailViewModel)gridOrderDetailView.GetRow(hi.RowHandle);

            if (hi.HitTest == GridHitTest.RowCell)
            {
                object o    = hi.HitTest.ToString() + hi.ToString();
                string text = "";

                if (hi.Column.FieldName == "ItemName")
                {
                    text = orderDetailViewModel.ItemName;
                }

                if (hi.Column.FieldName == "AMC")
                {
                    text = orderDetailViewModel.AMCCalculation;
                }

                if (hi.Column.FieldName == "MOS")
                {
                    text = orderDetailViewModel.MOSCalculation;
                }

                if (hi.Column == colManufacturer)
                {
                    var manufacturer = _manufacturerRepository.FindSingle(orderDetailViewModel.ManufacturerID);
                    if (manufacturer != null)
                    {
                        text = string.Format("{0} - {1}", manufacturer.Name, manufacturer.CountryOfOrigin);
                    }
                }

                if (hi.Column.FieldName == "ExpiryDate")
                {
                    text = string.Format("{0: dd/M/yy}", orderDetailViewModel.ExpiryDate);
                }

                info = new ToolTipControlInfo(o, text);
            }

            if (info != null)
            {
                e.Info = info;
            }
        }
 private void gv_Item_Tool_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
     //GridHitInfo hitInfo = gv_Item.CalcHitInfo(e.ControlMousePosition);
     //if (hitInfo.RowHandle < 0 || hitInfo.Column == null || hitInfo.HitTest != GridHitTest.RowCell)
     //{
     //    gv_Item_Tool.HideHint();
     //    return;
     //}
     //var row = lst2[hitInfo.RowHandle];
     //if (row.C_ORDER_NO == "合并订单")
     //{
     //    object obj = bllTrpPlanRollItemInfo.GetJoinOrder(row.C_ID);
     //    string message = obj == null ? "" : obj.ToString();
     //    e.Info = new ToolTipControlInfo("", message);
     //}
 }
 private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
     if (e.SelectedControl != gridControl1) return;
     ToolTipControlInfo info = null;
     GridView view = gridControl1.GetViewAt(e.ControlMousePosition) as GridView;
     if (view == null) return;
     GridHitInfo hitInfo = view.CalcHitInfo(e.ControlMousePosition);
     if (hitInfo.HitTest == GridHitTest.Footer && hitInfo.Column != null && hitInfo.Column.SummaryItem.SummaryType != DevExpress.Data.SummaryItemType.None)
     {
         object o = hitInfo.HitTest.ToString() + hitInfo.Column.ToString();
         string s = "Summary for " + hitInfo.Column.ToString();
         info = new ToolTipControlInfo(o, s);
     }
     if (info != null)
         e.Info = info;
 }
Exemple #10
0
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl != gridControl1)
            {
                return;
            }

            ToolTipControlInfo info = null;
            //Get the view at the current mouse position
            GridView view = gridControl1.GetViewAt(e.ControlMousePosition) as GridView;

            if (view == null)
            {
                return;
            }

            //Get the view's element information that resides at the current position
            GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);

            //Display a hint for row indicator cells
            if (hi.HitTest == GridHitTest.RowIndicator)
            {
                //An object that uniquely identifies a row indicator cell
                object o = hi.HitTest.ToString() + hi.RowHandle.ToString();

                string        tips = JsonLanguage.Default.GetString("行数据基本信息:");
                StringBuilder sb   = new StringBuilder();
                sb.AppendLine(tips);
                foreach (GridColumn gridCol in view.Columns)
                {
                    if (gridCol.Visible)
                    {
                        sb.AppendFormat("    {0}:{1}\r\n", gridCol.Caption, view.GetRowCellDisplayText(hi.RowHandle, gridCol.FieldName));
                    }
                }
                info = new ToolTipControlInfo(o, sb.ToString());
            }

            //Supply tooltip information if applicable, otherwise preserve default tooltip (if any)
            if (info != null)
            {
                e.Info = info;
            }
        }
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl != pivotGridControl1)
            {
                return;
            }
            PivotGridHitInfo hitInfo = pivotGridControl1.CalcHitInfo(e.ControlMousePosition);

            if (hitInfo.CellInfo != null)
            {
                PivotGridStyleFormatCondition condition = GetStyleFormatByValue(hitInfo.CellInfo.Item, pivotGridControl1);
                if (condition != null)
                {
                    object o             = hitInfo.CellInfo.DataField.ToString() + hitInfo.CellInfo.ColumnIndex + hitInfo.CellInfo.RowIndex;
                    string toolTipString = Convert.ToString(condition.Tag);
                    e.Info = new ToolTipControlInfo(o, toolTipString);
                }
            }
        }
Exemple #12
0
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            GridHitInfo hitInfo = gv_GPSJ.CalcHitInfo(e.ControlMousePosition);

            if (hitInfo.RowHandle < 0 || hitInfo.Column == null || hitInfo.HitTest != GridHitTest.RowCell)
            {
                toolTipController1.HideHint();
                return;
            }
            int    selectedHandle = this.gv_GPSJ.FocusedRowHandle;                                      //获取计划焦点行索引
            string stove          = this.gv_GPSJ.GetRowCellValue(selectedHandle, "C_STOVE").ToString(); //获取焦点炉号
            var    dt             = bll_gpsj.GetSlabInfo(stove);

            if (dt.Rows.Count > 0)
            {
                string message = "入坑:" + dt.Rows[0]["D_ESC_DATE"].ToString();
                message += "  出坑: " + dt.Rows[0]["D_LSC_DATE"].ToString();
                e.Info   = new ToolTipControlInfo("", message);
            }
        }
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            RadioGroup rg = e.SelectedControl as RadioGroup;

            if (rg == null)
            {
                return;
            }

            for (int i = 0; i < rGroup.Properties.Items.Count; i++)
            {
                Rectangle rect = rGroup.GetItemRectangle(i);

                if (rect.Contains(e.ControlMousePosition))
                {
                    e.Info = new ToolTipControlInfo(i, rGroup.Properties.Items[i].Description);
                    break;
                }
            }
        }
        private void toolTipController_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl is GridControl)
            {
                GridView view = ((GridControl)e.SelectedControl).GetViewAt(e.ControlMousePosition) as GridView;

                if (view == null)
                {
                    return;
                }

                GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);

                if (hi.HitTest == GridHitTest.RowCell && hi.Column != null && hi.Column == filledColumn)
                {
                    Image relatedImage = (Image)view.GetRowCellValue(hi.RowHandle, hi.Column);
                    if (relatedImage != null)
                    {
                        if (relatedImage == receiptImageCollection.Images[0])
                        {
                            e.Info = new ToolTipControlInfo(hi.Column, "Материал не доступен для принятия, т.к. не содержит комплекты.");
                        }
                        else
                        {
                            e.Info = new ToolTipControlInfo(hi.Column, "Материал доступен к принятию.");
                        }
                    }
                }
                if (hi.HitTest == GridHitTest.RowCell && hi.Column != null && hi.Column == materialEntryColumn)
                {
                    Image relatedImage = (Image)view.GetRowCellValue(hi.RowHandle, hi.Column);
                    if (relatedImage != null)
                    {
                        if (relatedImage == receiptImageCollection.Images[2])
                        {
                            e.Info = new ToolTipControlInfo(hi.Column, "Для материала не определена зона хранения или складская группа, либо зона хранения не содержит ячеек.");
                        }
                    }
                }
            }
        }
Exemple #15
0
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl != gridControl1)
            {
                return;
            }

            ToolTipControlInfo info = null;
            //Get the view at the current mouse position
            GridView view = gridControl1.GetViewAt(e.ControlMousePosition) as GridView;

            if (view == null)
            {
                return;
            }
            //Get the view's element information that resides at the current position
            GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);

            //Display a hint for row indicator cells
            if (hi.HitTest == GridHitTest.RowCell)
            {
                //An object that uniquely identifies a row indicator cell
                DataRow   dataRow  = view.GetDataRow(hi.RowHandle);
                cNgayCong ngayCong = (cNgayCong)dataRow["cNgayCong"];
                if (ngayCong == null)
                {
                    return;
                }
                string text = XL.TaoTooltip5(ngayCong);
                object o    = hi.HitTest.ToString() + hi.RowHandle.ToString();
                //string text = "Row " + hi.RowHandle.ToString();
                info = new ToolTipControlInfo(o, text);
            }
            //Supply tooltip information if applicable, otherwise preserve default tooltip (if any)
            if (info != null)
            {
                e.Info = info;
            }
        }
Exemple #16
0
        private void toolTip_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.SelectedControl == GridGC)
            {
                ToolTipControlInfo info = null;
                //Get the view at the current mouse position
                BandedGridView view = GridGC.GetViewAt(e.ControlMousePosition) as BandedGridView;
                if (view == null)
                {
                    return;
                }
                //Get the view's element information that resides at the current position
                GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);
                //Display a hint for row indicator cells
                if (hi.HitTest == GridHitTest.RowIndicator || hi.HitTest == GridHitTest.RowCell && hi.Column.FieldName == "CondenserState")
                {
                    //An object that uniquely identifies a row indicator cell
                    object o    = hi.HitTest.ToString() + hi.RowHandle.ToString();
                    string text = "";

                    DataRow row = GridView.GetDataRow(hi.RowHandle);
                    if (Convert.ToInt64(row["CondenserState"]) == 0)
                    {
                        text = "Работоспособен";
                    }
                    else
                    {
                        text = "Неработоспособен";
                    }

                    info = new ToolTipControlInfo(o, text);
                }
                //Supply tooltip information if applicable, otherwise preserve default tooltip (if any)
                if (info != null)
                {
                    e.Info = info;
                }
            }
        }
Exemple #17
0
        private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            /*
             * if (e.Info == null && e.SelectedControl == aodGridControl)
             * {
             *  GridView view = aodGridControl.FocusedView as GridView;
             *  GridHitInfo info = view.CalcHitInfo(e.ControlMousePosition);
             *  if (info.InRowCell)
             *  {
             *      string text = view.GetRowCellDisplayText(info.RowHandle, info.Column);
             *      string cellKey = info.RowHandle.ToString() + " - " + info.Column.ToString();
             *      e.Info = new DevExpress.Utils.ToolTipControlInfo(cellKey, text+"  sener");
             *  }
             * }*/


            if (e.SelectedControl != aodGridControl)
            {
                return;
            }

            ToolTipControlInfo info = null;
            //Get the view at the current mouse position
            GridView view = aodGridControl.GetViewAt(e.ControlMousePosition) as GridView;

            if (view == null)
            {
                return;
            }
            //Get the view's element information that resides at the current position
            GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition);

            //Display a hint for row indicator cells
            if (hi.HitTest == GridHitTest.RowIndicator)
            {
                //An object that uniquely identifies a row indicator cell
                object o    = hi.HitTest.ToString() + hi.RowHandle.ToString();
                string text = "Row " + hi.RowHandle.ToString();
                //text = string.Format("<color=255,0,0>Tür:\t{0}</color>\nID: \t{1}\nNo:\t{2}\nTrh:\t{3}\nVde:\t{4}\nTut:\t{5:n2}\nKln:\t{6:n2}",
                text = string.Format("<size=10>" +
                                     "<color=255,0,0>Referans Belge</color><br>" +
                                     "Tür: <b>{0}</b></color><br>" +
                                     "ID:  <b>{1}</b><br>" +
                                     "No:  <b>{2}</b><br>" +
                                     "Trh: <b>{3}</b><br>" +
                                     "Vde: <b>{4}</b><br>" +
                                     "Dvz: <b>{5}</b><br>" +
                                     "Tut: <b>{6,20:n2}</b><br>" +
                                     "Kln: <b>{7,20:n2}</b>" +
                                     "</size>",
                                     view.GetRowCellDisplayText(hi.RowHandle, colREFTURkln),
                                     view.GetRowCellDisplayText(hi.RowHandle, colREFID),
                                     view.GetRowCellDisplayText(hi.RowHandle, colREFNO),
                                     view.GetRowCellDisplayText(hi.RowHandle, colREFTRH),
                                     view.GetRowCellDisplayText(hi.RowHandle, colREFODMVDE),
                                     view.GetRowCellDisplayText(hi.RowHandle, colREFDVZ),
                                     view.GetRowCellValue(hi.RowHandle, colREFTUT),
                                     view.GetRowCellValue(hi.RowHandle, colREFKLNTUT)
                                     );
                info = new ToolTipControlInfo(o, text);
            }
            //Supply tooltip information if applicable, otherwise preserve default tooltip (if any)
            if (info != null)
            {
                e.Info = info;
            }
        }
 private void defaultToolTipController1_DefaultController_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
     if (e.SelectedControl == this.simpleButton1)
     {
         e.Info = this.CreateToolTipInfo();
         e.Info.ToolTipAnchor   = ToolTipAnchor.Object;
         e.Info.ToolTipLocation = ToolTipLocation.RightTop;
     }
 }
Exemple #19
0
        private void defaultToolTipController1_DefaultController_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            GridControl gridControl = e.SelectedControl as GridControl;

            if (gridControl == null)
            {
                return;
            }
            GridView view = gridControl.GetViewAt(e.ControlMousePosition) as GridView;

            if (view == null)
            {
                return;
            }
            GridHitInfo  hi      = view.CalcHitInfo(e.ControlMousePosition);
            SuperToolTip toolTip = GetToolTipByHitInfo(view, hi);

            if (toolTip == null)
            {
                return;
            }
            e.Info                  = new ToolTipControlInfo();
            e.Info.Object           = hi.Column;
            e.SelectedObject        = hi.Column;
            e.Info.SuperTip         = toolTip;
            e.Info.ToolTipType      = ToolTipType.SuperTip;
            e.Info.ToolTipPosition  = Control.MousePosition;
            e.Info.ImmediateToolTip = true;
        }