void _nodeTextBox_DrawText(object sender, DrawTextEventArgs e) { if ((e.Node.Tag as MyNode).Text.StartsWith("Child")) { e.TextColor = Color.Red; e.Font = _childFont; } }
private void treeNodeName_DrawText(object sender, DrawTextEventArgs e) { TypeItem item = e.Node.Tag as TypeItem; if (item != null && this.CanInstantiateType(item.TypeInfo)) { e.TextColor = this.objectTypeView.ForeColor; } else { e.TextColor = Color.FromArgb(128, this.objectTypeView.ForeColor); } }
protected virtual void OnDrawText(DrawTextEventArgs args) { TreeViewAdv tree = args.Node.Tree; if (tree != null) { tree.FireDrawControl(args); } if (DrawText != null) { DrawText(this, args); } }
protected Font GetDrawingFont(TreeNodeAdv node, DrawContext context, string label) { Font font = context.Font; if (DrawTextMustBeFired(node)) { DrawTextEventArgs args = new DrawTextEventArgs(node, this, context, label); args.Font = context.Font; OnDrawText(args); font = args.Font; } return(font); }
private void AlterBackground(DrawTextEventArgs e) { if (e.Node.IsSelected) e.BackgroundBrush = m_selectedBrush; var nodeData = e.Node.Tag as MyDebugNode; if (nodeData != null && nodeData.Breakpoint && e.Node != debugTreeView.SelectedNode) { e.BackgroundBrush = Brushes.IndianRed; } if (e.Node == m_selectedNodeView && m_selectedNodeView != debugTreeView.SelectedNode) { e.BackgroundBrush = Brushes.Gold; } }
private static void AlterText(DrawTextEventArgs e) { if (e.Node.Tag is MyDebugNode) { IMyExecutable executable = (e.Node.Tag as MyDebugNode).Executable; if (executable is MyExecutionBlock) { e.Font = new Font(e.Font, FontStyle.Bold); } if (!executable.Enabled) { e.TextColor = SystemColors.GrayText; } } }
private void CreateBrushes(TreeNodeAdv node, DrawContext context, string text, out Brush backgroundBrush, out Color textColor, out Font font, ref string label) { textColor = SystemColors.ControlText; //!!!!betauser if (DarkTheme) { textColor = Color.FromArgb(230, 230, 230); } backgroundBrush = null; font = context.Font; if (context.DrawSelection == DrawSelectionMode.Active) { textColor = SystemColors.HighlightText; backgroundBrush = SystemBrushes.Highlight; } else if (context.DrawSelection == DrawSelectionMode.Inactive) { textColor = SystemColors.ControlText; backgroundBrush = SystemBrushes.InactiveBorder; } else if (context.DrawSelection == DrawSelectionMode.FullRowSelect) { textColor = SystemColors.HighlightText; } if (!context.Enabled) { textColor = SystemColors.GrayText; } if (DrawTextMustBeFired(node)) { DrawTextEventArgs args = new DrawTextEventArgs(node, this, context, text); args.Text = label; args.TextColor = textColor; args.BackgroundBrush = backgroundBrush; args.Font = font; OnDrawText(args); textColor = args.TextColor; backgroundBrush = args.BackgroundBrush; font = args.Font; label = args.Text; } }
private void CreateBrushes(TreeNodeAdv node, DrawContext context, string text, out Brush backgroundBrush, out Color textColor, out Font font, ref string label) { textColor = SystemColors.ControlText; backgroundBrush = null; font = context.Font; if (context.DrawSelection == DrawSelectionMode.Active) { textColor = SystemColors.HighlightText; backgroundBrush = SystemBrushes.Highlight; } else if (context.DrawSelection == DrawSelectionMode.Inactive) { textColor = SystemColors.ControlText; backgroundBrush = SystemBrushes.InactiveBorder; } else if (context.DrawSelection == DrawSelectionMode.FullRowSelect) textColor = SystemColors.HighlightText; if (!context.Enabled) textColor = SystemColors.GrayText; if (DrawTextMustBeFired(node)) { DrawTextEventArgs args = new DrawTextEventArgs(node, this, context, text); args.Text = label; args.TextColor = textColor; args.BackgroundBrush = backgroundBrush; args.Font = font; OnDrawText(args); textColor = args.TextColor; backgroundBrush = args.BackgroundBrush; font = args.Font; label = args.Text; } }
protected virtual void OnDrawText(DrawTextEventArgs args) { TreeViewAdv tree = args.Node.Tree; if (tree != null) tree.FireDrawControl(args); if (DrawText != null) DrawText(this, args); }
protected Font GetDrawingFont(TreeNodeAdv node, DrawContext context, string label) { Font font = context.Font; if (DrawTextMustBeFired(node)) { DrawTextEventArgs args = new DrawTextEventArgs(node, this, context, label); args.Font = context.Font; OnDrawText(args); font = args.Font; } return font; }
private void folderViewControlName_DrawText(object sender, DrawTextEventArgs e) { e.TextColor = Color.Black; }
private void profilerTimeValue_DrawText(object sender, DrawTextEventArgs e) { if (e.Node.IsSelected) e.BackgroundBrush = m_selectedBrush; var parentTreeNode = e.Node.Parent; var parentDebugNode = parentTreeNode.Tag as MyDebugNode; if (parentDebugNode != null) { var parentBlock = parentDebugNode.Executable as MyExecutionBlock; if (parentBlock != null) { // The parent node contains an executable block. var debugNode = e.Node.Tag as MyDebugNode; // Fill the time property in the view model. TimeSpan profilingTime; if (parentBlock.ProfilingInfo.TryGetValue(debugNode.Executable, out profilingTime)) debugNode.ProfilerTime = profilingTime; TreeNodeAdv selectedTreeNode = GetSelectedTreeNode(); if (selectedTreeNode == null) return; // If the this node should be colored according to the time it took, use the pre-calculated color // in the draw event. if (parentTreeNode == selectedTreeNode) e.BackgroundBrush = new SolidBrush(debugNode.BackgroundColor); } } }
private void nodeTextBox1_DrawText(object sender, DrawTextEventArgs e) { AlterText(e); AlterBackground(e); }
private void fileTreeNodeName_DrawText(object sender, DrawTextEventArgs e) { e.TextColor = Color.FromArgb(192, Color.Black); }
private void importerTreeNodeName_DrawText(object sender, DrawTextEventArgs e) { ImporterNode importerNode = e.Node.Tag as ImporterNode; e.TextColor = Color.Black; if (importerNode != null && importerNode.Importer == this.defaultImporter) { e.TextColor = Color.Blue; } }
private void nodeTextBox1_DrawText(object sender, DrawTextEventArgs e) { if (e.Node.IsSelected) e.Font = new System.Drawing.Font(e.Font, FontStyle.Bold); }