Exemple #1
0
        private void trvJudgement_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            var pr = Program.TargetJudgementPR;

            if (e.Column == trvJudgeCol_Score)
            {
                float scoreNow = 0, scoreTol = 0;
                var   cls = e.Node.Tag as JudgeClass;
                var   itm = e.Node.Tag as JudgeItem;
                if (cls != null)
                {
                    scoreTol = cls.Score;
                    if (pr != null)
                    {
                        foreach (var i in cls.Items)
                        {
                            scoreNow += pr.GetTaskScore(i.ID);
                        }
                    }
                }
                else if (itm != null)
                {
                    scoreTol = itm.Score;
                    if (pr != null)
                    {
                        scoreNow = pr.GetTaskScore(itm.ID);
                    }
                }

                e.CellText = String.Format("{0}/{1}", scoreNow, scoreTol);
            }
        }
Exemple #2
0
        private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            string error = GetError(e.CellValue, e.Column, e.Node);

            SetError(e.EditViewInfo, error);
            e.EditViewInfo.CalcViewInfo(e.Graphics);
        }
Exemple #3
0
 void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     try
     {
         Brush brush = null;
         if (e.Column.FieldName.Substring(0, 2) == "tk" && e.CellValue != null)
         {
             if ((Double)e.CellValue == HDTime)
             {
                 brush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.Red, Color.Red, 180);
             }
             else if ((Double)e.CellValue > 0)
             {
                 brush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.Pink, Color.Pink, 90);
             }
         }
         if (brush != null)
         {
             Rectangle r;
             r = e.Bounds;
             e.Graphics.FillRectangle(brush, r);
             r.Inflate(-2, 0);
             e.Appearance.DrawString(e.Cache, e.CellText, r);
             //if (isFocusedCell)
             //    DevExpress.Utils.Paint.XPaint.Graphics.DrawFocusRectangle(e.Graphics, e.Bounds, SystemColors.WindowText, e.Appearance.BackColor);
             e.Handled = true;
         }
     }
     catch (Exception ex)
     {
     }
 }
        private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            if (e.Column == this.colSize)
            {
                if (e.Node.GetDisplayText("Type") == "File")
                {
                    e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                    e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Italic);
                    Int64 size = Convert.ToInt64(e.Node.GetValue("Size"));
                    if (size >= 1024)
                    {
                        e.CellText = string.Format("{0:### ### ###} KB", size / 1024);
                    }
                    else
                    {
                        e.CellText = string.Format("{0} Bytes", size);
                    }
                }
                else
                {
                    e.CellText = String.Format("<{0}>", e.Node.GetDisplayText("Type"));
                }
            }

            if (e.Column == this.colName)
            {
                if (e.Node.GetDisplayText("Type") == "File")
                {
                    e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
                }
            }
        }
Exemple #5
0
        private void TreeOrders_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.Tag == null)
            {
                return;
            }

            if (e.Column != treeListColumn1)
            {
                return;
            }

            var txt = e.Node.GetDisplayText(treeListColumn1).Replace("$", "").Replace(" ", "").Trim();

            if (txt == "" || txt == "0")
            {
                return;
            }


            var num = float.Parse(txt);

            var n = float.Parse(e.Node.GetDisplayText(treeListColumn2));

            if (num > n)
            {
                e.Appearance.ForeColor = Color.LimeGreen;
            }
            else if (num < n)
            {
                e.Appearance.ForeColor = Color.Orange;
            }
        }
 void treeView1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     if (e.Node.Id == 1)
     {
         e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
     }
 }
Exemple #7
0
        ///////////////////////////////////////////////////////////////////////////////////////////////
        // Override(Event, Properties, Method...)
        ///////////////////////////////////////////////////////////////////////////////////////////////

        #region :: PTreeList_CustomDrawNodeCell :: Cell이 추가/수정/삭제 되면 Color를 변경합니다.

        /// <summary>
        /// Cell이 추가/수정/삭제 되면 Color를 변경합니다.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PTreeList_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            try
            {
                //if (e.RowHandle < 0)
                //    return;

                //if (base.GetRow(e.RowHandle) == null)
                //    return;

                DataRowView drv = base.GetDataRecordByNode(e.Node) as DataRowView;

                switch (drv.Row.RowState)
                {
                case DataRowState.Added:
                    e.Appearance.ForeColor = ControlConfig.ADDEDROWCOLOR;
                    break;

                case DataRowState.Modified:
                    e.Appearance.ForeColor = ControlConfig.MODIFIEDROWCOLOR;
                    break;
                    //case DataRowState.Unchanged:
                    //    e.Appearance.ForeColor = Color.Black;
                    //    break;
                }
            }
            catch
            {
                throw;
            }
        }
Exemple #8
0
 /// <summary>
 /// 设定树的单元格显示事件
 /// </summary>
 private void treeListDocTemp_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     try
     {
         if (e.Node == null)
         {
             return;
         }
         string tableNameStr = DataTypeConvert.GetString(e.Node["TableName"]).Trim();
         if (e.Column.FieldName == "Upload")
         {
             ButtonEditViewInfo buttonEditViewInfo = (ButtonEditViewInfo)e.EditViewInfo;
             if (buttonEditViewInfo.RightButtons.Count > 0)
             {
                 if (tableNameStr != "")
                 {
                     buttonEditViewInfo.RightButtons[0].State = DevExpress.Utils.Drawing.ObjectState.Normal;
                     buttonEditViewInfo.RightButtons[1].State = DevExpress.Utils.Drawing.ObjectState.Normal;
                     buttonEditViewInfo.RightButtons[2].State = DevExpress.Utils.Drawing.ObjectState.Normal;
                 }
                 else
                 {
                     buttonEditViewInfo.RightButtons[0].State = DevExpress.Utils.Drawing.ObjectState.Disabled;
                     buttonEditViewInfo.RightButtons[1].State = DevExpress.Utils.Drawing.ObjectState.Disabled;
                     buttonEditViewInfo.RightButtons[2].State = DevExpress.Utils.Drawing.ObjectState.Disabled;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         //ExceptionHandler.HandleException(this.Text + "--设定树的单元格显示事件错误。", ex);
         ExceptionHandler.HandleException(this.Text + "--" + tsmiSdsddyg.Text, ex);
     }
 }
        private void resourcesTree1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            AppointmentActivityType nodeAppointmentActivityType = (AppointmentActivityType)e.Node.GetValue(3);

            if (nodeAppointmentActivityType == AppointmentActivityType.WBS)
            {
                if (predefinedWBSBrushes == null)
                {
                    InitializePredefinedBrushColor();
                }

                // Create brushes for cells.
                Brush backBrush;
                Brush WBSBrush = Brushes.Transparent;
                if (predefinedWBSBrushes.Count <= e.Node.Level)
                {
                    predefinedWBSBrushes.Add(PickBrush());
                }

                WBSBrush  = predefinedWBSBrushes[e.Node.Level];
                backBrush = WBSBrush;

                // Fill the background.
                e.Graphics.FillRectangle(backBrush, e.Bounds);

                // Allow default painting for fonts.
                e.Handled = false;
            }
        }
Exemple #10
0
 private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     if (e.Column.FieldName == "Check")
     {
         //DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo ck = e.EditViewInfo as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo;
         //ck.State = DevExpress.Utils.Drawing.ObjectState.Disabled;
     }
 }
Exemple #11
0
 private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     if (e.Node.HasChildren)
     {
         e.Appearance.Font = new Font("Tahoma", 8.25F, FontStyle.Bold);
         e.Appearance.Options.UseTextOptions = true;
     }
 }
 private void ReportList_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     if (e.Node.Focused)
     {
         e.Appearance.BackColor = Color.Blue;
         e.Appearance.ForeColor = Color.White;
     }
 }
        private void xtraTreeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            MyTreeNodeData data = xtraTreeList1.GetDataRecordByNode(e.Node) as MyTreeNodeData;

            if (data.ID == "A5" && e.Column.FieldName == "ID")
            {
                e.Appearance.BackColor = Color.WhiteSmoke;
            }
        }
        private void treeData_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            int parentID = TextUtils.ToInt(e.Node.GetValue(colParentID));

            if (parentID == 0)
            {
                e.Appearance.BackColor = Color.LemonChiffon;
            }
        }
Exemple #15
0
 private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     DevExpress.XtraTreeList.TreeList tl = sender as DevExpress.XtraTreeList.TreeList;
     if (e.Node == tl.FocusedNode)
     {
         e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds);
         Rectangle R = new Rectangle(e.EditViewInfo.ContentRect.Left, e.EditViewInfo.ContentRect.Top, Convert.ToInt32(e.Graphics.MeasureString(e.CellText, e.Appearance.Font).Width - 2), e.Appearance.FontHeight);
         e.Graphics.FillRectangle(SystemBrushes.Highlight, R);
         e.Graphics.DrawString(e.CellText, e.Appearance.Font, SystemBrushes.HighlightText, R, e.Appearance.GetStringFormat());
         e.Handled = true;
     }
 }
Exemple #16
0
 /// <summary>
 /// Handles the 1 event of the treeList_CustomDrawNodeCell control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs"/> instance containing the event data.</param>
 private void treeList_CustomDrawNodeCell_1(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     if (!(e.CellValue is decimal))
     {
         return;
     }
     if ((decimal)e.CellValue != 0)
     {
         return;
     }
     e.Appearance.FillRectangle(e.Cache, e.Bounds);
     e.Handled = true;
 }
Exemple #17
0
 void tlReport_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     if (e.Node.Focused)
     {
         e.Graphics.FillRectangle(Brushes.AliceBlue, e.Bounds);
     }
     else
     {
         e.Appearance.FillRectangle(e.Cache, e.Bounds);
     }
     e.Appearance.DrawString(e.Cache, e.CellText, e.Bounds);
     e.Handled = true;
 }
        private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            if (e.Column != treeList1.Columns["IMAGEINDEX"])
            {
                return;
            }
            string caption = "Node ID: " + e.Node.Id.ToString();

            DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo viewInfo  = (e.EditViewInfo as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo);
            DevExpress.Utils.Drawing.BaseCheckObjectInfoArgs  checkInfo = viewInfo.CheckInfo;
            checkInfo.Caption  = caption;
            checkInfo.Graphics = e.Graphics;
            viewInfo.CheckPainter.CalcObjectBounds(checkInfo);
        }
 /// <summary>
 /// 设定不同节点的字体颜色
 /// </summary>
 private void tvwUserRight_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     try
     {
         string tag = DataTypeConvert.GetString(e.Node.Tag);
         if (tag.Contains(":Role"))
         {
             e.Appearance.ForeColor            = Color.DeepSkyBlue;
             e.Appearance.Options.UseForeColor = true;
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #20
0
 private void tlLogs_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
     if (e != null)
     {
         if (e.Node.GetValue(tclmnErrCode.AbsoluteIndex).ToString() == "0")
         {
             e.Appearance.ForeColor = Color.Blue;
         }
         else
         {
             e.Appearance.ForeColor = Color.Red;
         }
         e.Appearance.Options.UseForeColor = true;
     }
 }
Exemple #21
0
        private void treeList_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            if (e?.Column?.FieldName == "TextSize")
            {
                if (e.CellValue != null)
                {
                    long temp = Convert.ToInt64(e.CellValue);
                    if (temp > 0)
                    {
                        e.Appearance.BackColor = Color.LightYellow;

                        if (temp > BIGTEXTSIZE)
                        {
                            e.Appearance.ForeColor = Color.Red;
                        }
                    }
                }
            }
        }
Exemple #22
0
        private void treeData_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            decimal percentVT = TextUtils.ToDecimal(e.Node.GetValue(colPercentVT));
            decimal qty       = TextUtils.ToDecimal(e.Node.GetValue(colQty));

            if (e.Column == colPercentExport || e.Column == colPercentVT)
            {
                decimal percentExport = TextUtils.ToDecimal(e.Node.GetValue(colPercentExport));
                if (percentVT >= 100 && percentExport >= 100)
                {
                    e.Appearance.BackColor = Color.GreenYellow;
                }
                if (percentVT >= 100 && percentExport < 100)
                {
                    e.Appearance.BackColor = Color.Yellow;
                }
                //if (percentVT == 0 && qty == 0 )
                //{
                //    e.Appearance.BackColor = Color.MediumTurquoise;
                //}
            }

            //if (e.Column == colDateAboutE && percentVT < 100)
            //{
            //    if (qty == 0) return;

            //    if (TextUtils.ToDate3(e.Node.GetValue(colDateAboutE)).Date > TextUtils.ToDate3(dtpSXLRDeadline.EditValue).Date)
            //    {
            //        e.Appearance.BackColor = Color.Red;
            //    }
            //    else
            //    {
            //        if (TextUtils.ToInt(e.Node.GetValue(colTotalDateAboutENull)) > 0)
            //        {
            //            e.Appearance.BackColor = Color.Orange;
            //        }
            //    }
            //}
        }
        private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.Checked)
            {
                e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
                e.Appearance.ForeColor = Color.Red;
            }

            if (e.Node.HasChildren)
            {
                e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Regular);
                foreach (TreeListNode item in e.Node.Nodes)
                {
                    if (item.Checked)
                    {
                        e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
                        e.Appearance.ForeColor = Color.Red;
                        break;
                    }
                }
            }
        }
Exemple #24
0
        private void cuTreeListPermission_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            bool flag = false;

            if (MainForm.ISnowSoftVersion == ISnowSoftVersion.ALL)
            {
                if (MainForm.Company.Contains("镇阳"))
                {
                    return;
                }
                else
                {
                    flag = true;
                }
            }
            else if (MainForm.ISnowSoftVersion == ISnowSoftVersion.EMS || MainForm.ISnowSoftVersion == ISnowSoftVersion.FSM)
            {
                flag = true;
            }
            if (GetVersion().Contains(e.CellText) == flag)
            {
                e.Appearance.ForeColor = Color.Gray;
            }
        }
Exemple #25
0
 private void TreeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 {
 }