Exemplo n.º 1
0
 public override object GetValue(Aga.Controls.Tree.TreeNodeAdv node)
 {
     ValueEntry ent = node.Tag as ValueEntry;
     if (ent == null)
         return "";//if this is not a value entry, value is not relevant
     Entry linked = FormattedReader.ParseRef(ent, ent.Link);
     return ent.Value + (ent.Link != null && linked != null ? " (" + FormattedReader.ParseValueRefs(linked, linked.FriendlyName) + ")" : "");
 }
        public string GetToolTip(TreeNodeAdv node, Aga.Controls.Tree.NodeControls.NodeControl nodeControl)
        {
            var pNode = _tree.FindNode(node);

            if (pNode != null)
                return pNode.GetTooltipText(this);
            else
                return "";
        }
        public string GetToolTip(TreeNodeAdv node, Aga.Controls.Tree.NodeControls.NodeControl nodeControl)
        {
            var pNode = _tree.FindNode(node);

            // Use the process node's tooltip mechanism to allow caching.
            if (pNode != null)
                return pNode.GetTooltipText(this);
            else
                return "";
        }
Exemplo n.º 4
0
			public string GetToolTip(TreeNodeAdv node, Aga.Controls.Tree.NodeControls.NodeControl nodeControl)
			{
				NodeBase dataNode = node.Tag as NodeBase;
				GameObjectNode objNode = dataNode as GameObjectNode;

				if (dataNode.LinkState == NodeBase.PrefabLinkState.None) return null;
				if (objNode == null) return null;
				if (objNode.Obj.PrefabLink == null) return null;

				return String.Format(PluginRes.EditorBaseRes.SceneView_PrefabLink, objNode.Obj.PrefabLink.Prefab.Path);
			}
Exemplo n.º 5
0
        /// <summary>
        /// Funkcja obsługująca zdarzenie DrawText na NodeControlle. Bierze status Tasku i zmienia kolor
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btx_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawEventArgs e)
        {
            Task t = e.Node.Tag as Task;
            Task.TaskStatus status = Task.TaskStatus.ERROR;
            Color c = Color.Violet;

            if (t != null)
            {
                status = t.Status;
            }
            e.TextColor = getColorByTaskStatus(status);
        }
Exemplo n.º 6
0
        public override void MouseDoubleClick(Aga.Controls.Tree.TreeNodeAdvMouseEventArgs args)
        {
            base.MouseDoubleClick(args);
            if (args.Node.Tag != null && !(args.Node.Tag is ValueEntry))
                return;//if this is not a value entry, value is not relevant

            ValueEntry ent = (ValueEntry)args.Node.Tag;
            if (ent == null)
            {//this is the "add new entry" button
                this.BeginEdit();
            }
            else
            {
                FileEditorGUI egui = (FileEditorGUI)this.Parent.Model;
                egui.GotoLink(ent.Link, args.Node);
            }
        }
Exemplo n.º 7
0
        private void nodeTextBoxName_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawTextEventArgs e)
        {
            if (e.Context.Bounds.IsEmpty) return;
            NodeBase node = e.Node.Tag as NodeBase;

            ComponentNode cmpNode = node as ComponentNode;
            GameObjectNode objNode = (cmpNode != null ? cmpNode.Parent : node) as GameObjectNode;
            DesignTimeObjectData data = objNode != null ? DesignTimeObjectData.Get(objNode.Obj) : null;
            bool lockedOrHidden = data != null ? data.IsLocked || data.IsHidden : false;

            // Prefab-linked entities
            if (lockedOrHidden)
                e.TextColor = Color.FromArgb(96, 96, 96);
            else if (node.LinkState == NodeBase.PrefabLinkState.Active)
                e.TextColor = Color.Blue;
            else if (node.LinkState == NodeBase.PrefabLinkState.Broken)
                e.TextColor = Color.DarkRed;
            else
                e.TextColor = Color.Black;

            // Flashing
            if (node == this.flashNode)
            {
                float intLower = this.flashIntensity;
                Color hlBase = Color.FromArgb(224, 64, 32);
                Color hlLower = Color.FromArgb(
                    (int)(this.objectView.BackColor.R * (1.0f - intLower) + hlBase.R * intLower),
                    (int)(this.objectView.BackColor.G * (1.0f - intLower) + hlBase.G * intLower),
                    (int)(this.objectView.BackColor.B * (1.0f - intLower) + hlBase.B * intLower));
                e.BackgroundBrush = new SolidBrush(hlLower);
            }
        }
Exemplo n.º 8
0
 void nodeTextBox1_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawEventArgs e)
 {
     DebugNode node = e.Node.Tag as DebugNode;
     if (node.Changed)
     {
         e.TextColor = Color.Red;
     }
 }
Exemplo n.º 9
0
        private void nodeStateIcon_DrawIcon(object sender, Aga.Controls.Tree.NodeControls.DrawIconEventArgs e)
        {
            if (e.Context.Bounds.IsEmpty) return;
            NodeBase node = e.Node.Tag as NodeBase;

            ComponentNode cmpNode = node as ComponentNode;
            GameObjectNode objNode = (cmpNode != null ? cmpNode.Parent : node) as GameObjectNode;
            DesignTimeObjectData data = objNode != null ? DesignTimeObjectData.Get(objNode.Obj) : null;
            bool lockedOrHidden = data != null ? data.IsLocked || data.IsHidden : false;

            if (lockedOrHidden) e.IconColorMatrix = this.inactiveIconMatrix;
        }
Exemplo n.º 10
0
 private void OnFragmentTreeItemDoubleClick(object sender, Aga.Controls.Tree.TreeNodeAdvMouseEventArgs e)
 {
     if (e.Node != null && e.Node.Tag is TreeViewArchiveModel.ParameterStructItem)
     {
         ShaderParameterUtil.EditParameter(graphControl, ((TreeViewArchiveModel.ParameterStructItem)e.Node.Tag).ArchiveName);
     }
 }
Exemplo n.º 11
0
 private void nodeCheckBox1_IsVisibleValueNeeded(object sender, Aga.Controls.Tree.NodeControls.NodeControlValueEventArgs e)
 {
     e.Value = e.Node.Tag is MyDebugTaskNode;
 }
Exemplo n.º 12
0
		private void nodeTextBoxObjId_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawTextEventArgs e)
		{
			DataTreeNode node = e.Node.Tag as DataTreeNode;
			ObjectRefTreeNode objRefNode = node as ObjectRefTreeNode;
			if (e.Text == "0") 
				e.TextColor = SystemColors.GrayText;
			else if (objRefNode != null)
			{
				if (this.IsObjectIdExisting(objRefNode.ObjId))
					e.TextColor = Color.Blue;
				else 
					e.TextColor = Color.Red;
			}
			else
				e.TextColor = Color.Black;
		}
Exemplo n.º 13
0
		private void treeViewAdv1_NodeMouseDoubleClick(object sender, Aga.Controls.Tree.TreeNodeAdvMouseEventArgs e)
		{
			Console.WriteLine("DblClick {0}", e.Node);
		}
Exemplo n.º 14
0
		private void nodeTextBoxValue_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawTextEventArgs e)
		{
			e.TextColor = Color.Black;
		}
Exemplo n.º 15
0
 string IToolTipProvider.GetToolTip(TreeNodeAdv viewNode, Aga.Controls.Tree.NodeControls.NodeControl nodeControl)
 {
     IEditorAction action = this.GetResourceOpenAction(viewNode, false);
     if (action != null) return string.Format(
         Duality.Editor.Plugins.ProjectView.Properties.ProjectViewRes.ProjectFolderView_Help_Doubleclick,
         action.Description);
     else return null;
 }
Exemplo n.º 16
0
        void OnNodeDrawText(object sender, Aga.Controls.Tree.NodeControls.DrawEventArgs e)
        {
            if (e.Node.Tag == null)
                return;

            var ocolor = PropertyService.Get(ConfigProperties.OpenColor, Color.LightGreen);
            var dcolor = PropertyService.Get(ConfigProperties.DirtyColor, Color.Pink);

            var item = (RepositoryItem)e.Node.Tag;
            var ctx = e.Context;
            if (item.ClipboardState != RepositoryItem.ClipboardAction.None)
            {
                var oldFont = e.Font;
                e.Font = new Font(oldFont.FontFamily, oldFont.Size, oldFont.Style | FontStyle.Italic);
            }
            if (item.IsDirty)
                e.BackgroundBrush = new SolidBrush(dcolor);
            else if (item.IsOpen)
                e.BackgroundBrush = new SolidBrush(ocolor);
        }
Exemplo n.º 17
0
 private void OnFragmentTreeItemDoubleClick(object sender, Aga.Controls.Tree.TreeNodeAdvMouseEventArgs e)
 {
     // if (e.Node != null && e.Node.Tag is NodeEditorCore.ShaderFragmentArchiveModel.ParameterStructItem)
     // {
     //     NodeEditorCore.ShaderParameterUtil.EditParameter(_hyperGraphModel, ((NodeEditorCore.ShaderFragmentArchiveModel.ParameterStructItem)e.Node.Tag).ArchiveName);
     // }
 }
        private void tree_DrawControl(object sender, Aga.Controls.Tree.NodeControls.DrawEventArgs e)
        {
            var item = e.Node.Tag as BaseItem;
            var groupItem = item as GroupItem;
            var regGroupItem = item as RegisterGroupItem;
            var registerItem = item as RegisterItem;
            var fieldItem = item as FieldItem;
            var control = e.Control as BindableControl;

            if (item == null || control == null) return;

            switch (control.DataPropertyName)
            {
                case "Bin":
                    e.Text = item.FormatBin();
                    e.TextColor = (item.Changed) ? System.Drawing.Color.Red : System.Drawing.SystemColors.ControlText;
                    break;
                case "Hex":
                    e.Text = item.FormatHex();
                    e.TextColor = (item.Changed) ? System.Drawing.Color.Red : System.Drawing.SystemColors.ControlText;
                    break;
                case "Reset":
                    e.Text = item.FormatReset();
                    break;
                case "Address":
                    e.Text = item.FormatAddress();
                    break;
                case "Description":
                    if (fieldItem != null)
                        e.Text = fieldItem.Interpretation();
                    break;
            }
        }
Exemplo n.º 19
0
        private void treeProcesses_NodeMouseDoubleClick(object sender, Aga.Controls.Tree.TreeNodeAdvMouseEventArgs e)
        {
            var pNode = treeProcesses.FindNode(e.Node);

            this.ShowProperties(pNode.ProcessItem);
        }
Exemplo n.º 20
0
        /// <summary>
        /// The constructor that has to be overwritten in the derived model classes
        /// </summary>
        /// <param name="TreeView">The TreeViewAdv control this model is used for</param>
        /// <param name="GrtTree">The GRT tree this model is representing</param>
        /// <param name="StateIcon">The NodeStateIcon Node Control that displays the icon</param>
        /// <param name="DynamicContextMenu">Use context menu definition provided by backend</param>
        protected GrtTreeModel(TreeViewAdv TreeView, MySQL.Grt.TreeModelWrapper GrtTree, Aga.Controls.Tree.NodeControls.NodeStateIcon NodeStateIcon, bool DynamicContextMenu)
            : this(TreeView, GrtTree, DynamicContextMenu)
        {
            nodeStateIcon = NodeStateIcon;

              if (nodeStateIcon != null)
              {
            // Ensure that the VirtualMode is enabled
            nodeStateIcon.VirtualMode = true;

            // Assign virtual value events for displaying and processing the edited value content
            nodeStateIcon.ValueNeeded += new EventHandler<NodeControlValueEventArgs>(StateIconNeeded);
              }
        }
Exemplo n.º 21
0
 void default_NodeMouseDoubleClick(object sender, Aga.Controls.Tree.TreeNodeAdvMouseEventArgs e)
 {
     if (e.Node != null && e.Node.Tag != null)
       {
     if (e.Control is AdvNodeTextBox)
     {
       AdvNodeTextBox tbox = e.Control as AdvNodeTextBox;
       tbox.BeginEdit();
     }
     else if (e.Control is AdvNodeComboBox)
     {
       AdvNodeComboBox tbox = e.Control as AdvNodeComboBox;
       tbox.BeginEdit();
     }
       }
 }
Exemplo n.º 22
0
 /// <summary>
 /// Funkcja obsługująca zdarzenie DrawText na NodeControlle. Bierze status Tasku i zmienia kolor
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void btx_DrawText_ColorBlock(object sender, Aga.Controls.Tree.NodeControls.DrawEventArgs e)
 {
     Task t = e.Node.Tag as Task;
     e.TextColor = t.getFontColor();
     Task.TaskStatus status = Task.TaskStatus.ERROR;
     if (t != null)
     {
         status = t.Status;
     }
 }
Exemplo n.º 23
0
 void canEdit(object sender, Aga.Controls.Tree.NodeControls.NodeControlValueEventArgs e)
 {
     if (dragInProgress)
     e.Value = false;
 }
Exemplo n.º 24
0
 void btx_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawEventArgs e)
 {
     Task t = e.Node.Tag as Task;
     e.TextColor = Color.Black;
     Task.TaskStatus status = Task.TaskStatus.ERROR;
     if (t != null)
     {
         status = t.Status;
     }
 }
Exemplo n.º 25
0
		private void nodeTextBoxType_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawTextEventArgs e)
		{
			DataTreeNode node = e.Node.Tag as DataTreeNode;
			ObjectTreeNode objNode = node as ObjectTreeNode;
			if (objNode != null && objNode.ResolvedMember == null)
				e.TextColor = Color.Red;
			else
				e.TextColor = Color.Black;
		}
Exemplo n.º 26
0
        void IsEditEnabledValueNeeded(object sender, Aga.Controls.Tree.NodeControls.NodeControlValueEventArgs e)
        {
            e.Value = false;

            if (!UnrealDebuggerIDE.Instance.IsWaitingForUDKResponse() && UnrealDebuggerIDE.Instance.Project.EditWatchValues)
            {
                WatchNode watchNode = e.Node != null ? e.Node.Tag as WatchNode : null;

                WatchNode.DataTypes type = WatchNode.DataTypes.Bool;
                if (watchNode != null && Enum.TryParse<WatchNode.DataTypes>(watchNode.Type, true, out type))
                {
                    switch (type)
                    {
                        case WatchNode.DataTypes.Bool:
                            {
                                WatchNode parentWatchNode = e.Node.Parent != null ? e.Node.Parent.Tag as WatchNode : null;
                                e.Value = parentWatchNode != null && (parentWatchNode.IsClass || parentWatchNode.IsStruct);
                            } break;

                        case WatchNode.DataTypes.Int:
                        case WatchNode.DataTypes.Float:
                            {
                                e.Value = true;
                            } break;
                    }
                }
            }
        }
Exemplo n.º 27
0
        private void nodeTextBoxName_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawTextEventArgs e)
        {
            NodeBase node = e.Node.Tag as NodeBase;
            ResourceNode resNode = node as ResourceNode;

            // Readonly nodes
            if (node.ReadOnly)
                e.TextColor = Color.FromArgb(192, 0, 0, 32);
            else
                e.TextColor = Color.Black;

            // Unsaved nodes
            if (resNode != null && DualityEditorApp.IsResourceUnsaved(resNode.ResLink))
                e.Font = this.treeFontItalic;

            // Flashing
            if (node == this.flashNode && !e.Context.Bounds.IsEmpty)
            {
                float intLower = this.flashIntensity;
                Color hlBase = Color.FromArgb(224, 64, 32);
                Color hlLower = Color.FromArgb(
                    (int)(this.folderView.BackColor.R * (1.0f - intLower) + hlBase.R * intLower),
                    (int)(this.folderView.BackColor.G * (1.0f - intLower) + hlBase.G * intLower),
                    (int)(this.folderView.BackColor.B * (1.0f - intLower) + hlBase.B * intLower));
                e.BackgroundBrush = new SolidBrush(hlLower);
            }
        }
Exemplo n.º 28
0
		string IToolTipProvider.GetToolTip(TreeNodeAdv viewNode, Aga.Controls.Tree.NodeControls.NodeControl nodeControl)
		{
			IEditorAction action = this.GetResourceOpenAction(viewNode);
			if (action != null) return string.Format(
				EditorBase.PluginRes.EditorBaseRes.SceneView_Help_Doubleclick,
				action.Description);
			else return null;
		}
Exemplo n.º 29
0
 private void nodeTextBoxType_DrawText(object sender, Aga.Controls.Tree.NodeControls.DrawTextEventArgs e)
 {
     e.TextColor = Color.FromArgb(128, 0, 0, 0);
     e.BackgroundBrush = null;
 }
Exemplo n.º 30
0
 /// <summary>
 /// Gets the tooltip
 /// </summary>
 /// <param name="node"></param>
 /// <param name="nodeControl"></param>
 /// <returns></returns>
 public string GetToolTip(TreeNodeAdv node, Aga.Controls.Tree.NodeControls.NodeControl nodeControl)
 {
     RepositoryItem item = node.Tag as RepositoryItem;
     if (item != null && !item.IsRoot)
     {
         return string.Format(Strings.SITE_EXPLORER_TOOLTIP_TEMPLATE, Environment.NewLine, item.Name, item.ResourceType, item.CreatedDate, item.ModifiedDate, item.Owner);
     }
     return string.Empty;
 }