コード例 #1
0
		void _nodeTextBox_DrawText(object sender, DrawTextEventArgs e)
		{
            if ((e.Node.Tag as MyNode).Text.StartsWith("Child"))
            {
                e.TextColor = Color.Red;
                e.Font = _childFont;
            }
		}
コード例 #2
0
ファイル: CreateObjectDialog.cs プロジェクト: KSLcom/duality
		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);
			}
		}
コード例 #3
0
        protected virtual void OnDrawText(DrawTextEventArgs args)
        {
            TreeViewAdv tree = args.Node.Tree;

            if (tree != null)
            {
                tree.FireDrawControl(args);
            }
            if (DrawText != null)
            {
                DrawText(this, args);
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: DebugForm.cs プロジェクト: Soucha/BrainSimulator
        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;
            }
        }
コード例 #6
0
ファイル: DebugForm.cs プロジェクト: Soucha/BrainSimulator
        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;
                }
            }
        }
コード例 #7
0
        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;
            }
        }
コード例 #8
0
        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;
            }
        }
コード例 #9
0
 protected virtual void OnDrawText(DrawTextEventArgs args)
 {
     TreeViewAdv tree = args.Node.Tree;
     if (tree != null)
         tree.FireDrawControl(args);
     if (DrawText != null)
         DrawText(this, args);
 }
コード例 #10
0
 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;
 }
コード例 #11
0
		private void folderViewControlName_DrawText(object sender, DrawTextEventArgs e)
		{
			e.TextColor = Color.Black;
		}
コード例 #12
0
ファイル: DebugForm.cs プロジェクト: Soucha/BrainSimulator
        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);
                }
            }
        }
コード例 #13
0
ファイル: DebugForm.cs プロジェクト: Soucha/BrainSimulator
 private void nodeTextBox1_DrawText(object sender, DrawTextEventArgs e)
 {
     AlterText(e);
     AlterBackground(e);
 }
コード例 #14
0
		private void fileTreeNodeName_DrawText(object sender, DrawTextEventArgs e)
		{
			e.TextColor = Color.FromArgb(192, Color.Black);
		}
コード例 #15
0
		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;
			}
		}
コード例 #16
0
 private void nodeTextBox1_DrawText(object sender, DrawTextEventArgs e)
 {
     if (e.Node.IsSelected)
         e.Font = new System.Drawing.Font(e.Font, FontStyle.Bold);
 }