/// <summary> /// Gets display info (label, icon, ...) for the ProjectLister and other controls</summary> /// <param name="info">Item info: passed in and modified by this method</param> public virtual void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = Name; if (IsLocked) info.StateImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.LockImage); }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { Character character = item.As<Character>(); info.Label = character.Name; info.Properties = new object[] { character.Age }; }
public void GetInfo(ItemInfo info) { info.ImageIndex = info.GetImageList().Images.IndexOfKey(LevelEditorCore.Resources.CubesImage); info.Label = DomNode.Type.GetTag("OpaqueListable") as string; info.Label = info.Label ?? "<<opaque>>"; info.IsLeaf = false; }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { info.Label = Language == null ? @"?" : Language.LanguageName; info.Properties = new[] { File == null ? @"?" : File.Path, Line.ToString(), Error }; info.IsLeaf = true; info.ImageIndex = info.GetImageIndex(Atf.Resources.DataImage); }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { var node = item as XElement; if (node == null) return; info.IsLeaf = !node.HasElements; if (node.Name.LocalName == "suv") { var attibute = node.Attribute("name"); if (attibute != null) { info.Label = (string) attibute; var mpg = new StringDataEditor(m_dataEditorTheme) { Owner = item, Value = (string)node.Attribute("mpg"), ReadOnly = true, Name = "MPG", // (column)name of the data value, should be unique among columns, }; var weight = new StringDataEditor(m_dataEditorTheme) { Owner = item, Value = (string)node.Attribute("weight"), Name = "Weight", }; var awd = new BoolDataEditor(m_dataEditorTheme) { Owner = item, Value = (bool)node.Attribute("awd"), Name = "AWD", }; var color = new ColorDataEditor(m_dataEditorTheme) { Owner = item, Name = "Color", }; color.Parse((string) node.Attribute("color")); var msrp = new FloatDataEditor(m_dataEditorTheme) { Owner = item, Value = (float) node.Attribute("msrp"), Min = (float) node.Attribute("min"), Max = (float) node.Attribute("max"), Name = "MSRP", ShowSlider = true }; info.Properties = new object[] { mpg, weight, awd, color, msrp }; } } else info.Label = node.Name.LocalName; }
private static WinFormsItemInfo GetWinFormsItemInfo(ItemInfo itemInfo) { var WinFormsItemInfo = (WinFormsItemInfo)itemInfo; if (WinFormsItemInfo == null) throw new InvalidOperationException("ItemInfo is not an instance of, or derived from, WinFormsItemInfo"); return WinFormsItemInfo; }
/// <summary> /// Fill in contents for displaying on a GUI /// </summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public virtual void GetInfo(object item, ItemInfo info) { info.Label = Name; info.IsLeaf = true; info.AllowLabelEdit = false; info.Description = "Name: " + Name; info.ImageIndex = info.GetImageIndex(Atf.Resources.DataImage); }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { var file = s_bShowFileNamesOnly ? Name : File; info.Label = file; info.Properties = new[] { Line.ToString(), LineText }; info.IsLeaf = true; info.ImageIndex = info.GetImageIndex(Atf.Resources.DocumentImage); }
/// <summary> /// Gets display info (label, icon, ...) for the ProjectLister and other controls</summary> /// <param name="info">Item info: passed in and modified by this method</param> public override void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = Name; info.IsLeaf = ControlPoints.Count == 0; if (IsLocked) info.StateImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.LockImage); }
/// <summary> /// Fill in contents for displaying on a GUI /// </summary> /// <param name="item"></param> /// <param name="info">structure to hold display information</param> public void GetInfo(object item, ItemInfo info) { info.Label = Address; info.Checked = Checked; info.Properties = new[] { Name }; info.IsLeaf = false; info.Description = SledUtil.TransSub(Localization.SledLuaLuaState, Address); info.ImageIndex = info.GetImageIndex(Atf.Resources.DataImage); }
/// <summary> /// Gets display information for the item</summary> /// <param name="item">Item</param> /// <param name="info">Information object, which client can fill out</param> void IPaletteClient.GetInfo(object item, ItemInfo info) { NodeTypePaletteItem paletteItem = item.As<NodeTypePaletteItem>(); if (paletteItem != null) { info.Label = paletteItem.Name; info.Description = paletteItem.Description; } }
/// <summary> /// Provides info for the ProjectLister tree view and other controls</summary> /// <param name="info">Item info passed in and modified by the method</param> public override void GetInfo(ItemInfo info) { base.GetInfo(info); info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); if (Reference != null && Reference.Target != null && Reference.Target.Uri != null) info.Label = string.Format("{0}: {1}", Name, Path.GetFileName(Reference.Target.Uri.LocalPath)); else info.Label = Name; info.IsLeaf = false; }
/// <summary> /// Gets display information for the item</summary> /// <param name="item">Item</param> /// <param name="info">Information object, which client can fill out</param> void IPaletteClient.GetInfo(object item, ItemInfo info) { DomNodeType nodeType = (DomNodeType)item; NodeTypePaletteItem paletteItem = nodeType.GetTag<NodeTypePaletteItem>(); if (paletteItem != null) { info.Label = paletteItem.Name; info.Description = paletteItem.Description; info.ImageIndex = info.GetImageList().Images.IndexOfKey(paletteItem.ImageName); } }
/// <summary> /// Provides info for the ProjectLister tree view and other controls</summary> /// <param name="info">Item info passed in and modified by the method</param> public override void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); if (Reference != null && Reference.Target != null && Reference.Target.Uri != null) info.Label = string.Format("{0}: {1}", Name, Path.GetFileName(Reference.Target.Uri.LocalPath)); else info.Label = Name; if (IsLocked) info.StateImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.LockImage); info.IsLeaf = false; }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { Resource resource = Adapters.As<Resource>(item); info.Label = resource.Name; string type = null; if (resource.DomNode.Type == Schema.animationResourceType.Type) type = Resources.AnimationImage; else if (resource.DomNode.Type == Schema.geometryResourceType.Type) type = Resources.GeometryImage; info.ImageIndex = info.GetImageList().Images.IndexOfKey(type); info.Properties = new object[] { resource.Size }; }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { info.Label = Order.ToString(); info.Properties = new[] { What, OldAddress, NewAddress, OldSize.ToString(), NewSize.ToString() }; info.ImageIndex = info.GetImageIndex(Atf.Resources.DataImage); info.IsLeaf = true; }
public void GetInfo(object item, Sce.Atf.Applications.ItemInfo info) { DirectoryInfo directoryInfo = item as DirectoryInfo; if (directoryInfo != null) { info.Label = directoryInfo.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.ComputerImage); DirectoryInfo[] directories = GetSubDirectories(directoryInfo); info.IsLeaf = directories != null && directories.Length == 0; } }
/// <summary> /// For IItemView /// </summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { if (item.Is<SledCallStackListType>()) { info.Label = Name; info.ImageIndex = info.GetImageIndex(Atf.Resources.FolderImage); return; } var itemView = item.As<IItemView>(); if ((itemView == null) || ReferenceEquals(itemView, this)) return; itemView.GetInfo(item, info); }
void IItemView.GetInfo(object item, ItemInfo info) { var node = item as DomNode; if (node != null) { string name = node.GetId(); if (string.IsNullOrEmpty(name)) { var attInfo = node.Type.GetAttributeInfo("name"); if (attInfo == null) attInfo = node.Type.GetAttributeInfo("label"); if (attInfo != null && attInfo.Type.Type == AttributeTypes.String) name = (string)node.GetAttribute(attInfo); } info.AllowLabelEdit = false; info.IsLeaf = !node.Children.Any(); info.Label = string.IsNullOrWhiteSpace(name) ? node.Type.Name : name; } }
public void GetInfo(object item, ItemInfo info) { IListable listable = item.As<IListable>(); if (listable != null) { listable.GetInfo(info); return; } IResource resource = item.As<IResource>(); if (resource != null && !item.Is<Game>()) { info.Label = Path.GetFileName(resource.Uri.LocalPath); info.ImageIndex = info.GetImageList().Images.IndexOfKey(Sce.Atf.Resources.ResourceImage); } // If the object has a name use it as the label (overriding whatever may have been set previously) INameable nameable = Adapters.As<INameable>(item); if (nameable != null && !string.IsNullOrEmpty(nameable.Name)) info.Label = nameable.Name; }
/// <summary> /// Update column widths only under auto-resizing mode.</summary> /// <param name="node">Tree node</param> /// <param name="info">Mode info</param> /// <param name="g">Graphics object used for drawing</param> private void UpdateColumnWidths(TreeControl.Node node, ItemInfo info, Graphics g) { var treeListControl = node.TreeControl as TreeListControl; if (treeListControl.AutoResizeColumns) { bool updateColumnWidths = treeListControl.Columns.Count == info.Properties.Length; for (int i = 0; i < info.Properties.Length; ++i) { var dataEditor = info.Properties[i] as DataEditor; if (dataEditor != null) // show object data details in columns { var size = dataEditor.Measure(g, SizeF.Empty); if (updateColumnWidths) { treeListControl.Columns[i].ActualWidth = Math.Max(treeListControl.Columns[i].Width, (int)size.Width); } } } } }
/// <summary> /// Gets display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info for item</param> public void GetInfo(object item, ItemInfo info) { // set the first column info (name) FileSystemInfo fileSystemInfo = item as FileSystemInfo; if (fileSystemInfo is DirectoryInfo) { info.Label = fileSystemInfo.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.FolderImage); } else if (fileSystemInfo is FileInfo) { info.Label = fileSystemInfo.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.DocumentImage); info.IsLeaf = true; } // set the 2nd and 3nd columns info (size and creation time) info.Properties = new string[m_fileDataExtensions.Length-1]; for (int i = 0; i < info.Properties.Length; i++) info.Properties[i] = m_fileDataExtensions[i+1].GetValue(fileSystemInfo); }
public void GetInfo(object item, ItemInfo info) { ILayer layer = Adapters.As<ILayer>(item); if (layer != null) { info.Label = layer.Name; info.HasCheck = true; info.SetCheckState(GetCheckState(layer)); } else { IReference<IGameObject> reference = Adapters.As<IReference<IGameObject>>(item); if (reference != null) { IListable listable = reference.As<IListable>(); listable.GetInfo(info); //INameable nameable = Adapters.As<INameable>(reference.Target); //if (nameable != null && !string.IsNullOrEmpty(nameable.Name)) // info.Label = nameable.Name; info.IsLeaf = true; IVisible iVisible = GetIVisible(item); if (iVisible != null) { info.HasCheck = true; info.Checked = iVisible.Visible; } } } }
public void GetInfo(ItemInfo info) { info.ImageIndex = Util.GetTypeImageIndex(DomNode.Type, info.GetImageList()); info.Label = "EnvUtility"; }
/// <summary> /// Fills in or modifies the given display info for the item /// </summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { // Cache value if (s_iBpCsiImgIndex == -1) s_iBpCsiImgIndex = info.GetImageIndex(SledIcon.BreakpointCsi); info.Label = string.Empty; info.Properties = new[] { Function, File, CurrentLine.ToString() }; info.Description = Function; if (IsCursorInFunction) info.ImageIndex = s_iBpCsiImgIndex; info.IsLeaf = true; }
/// <summary> /// Gets display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Info object, which client can fill out</param> void IPaletteClient.GetInfo(object item, ItemInfo info) { var paletteItem = (NodeTypePaletteItem)item; if (paletteItem != null) { info.Label = paletteItem.Name; info.Description = paletteItem.Description; info.ImageIndex = info.GetImageList().Images.IndexOfKey(paletteItem.ImageName); info.HoverText = paletteItem.Description; } }
public void GetInfo(object item, ItemInfo info) { Bookmark bookmark = Adapters.As<Bookmark>(item); if (bookmark != null) { info.Label = bookmark.Name; info.HasCheck = false; info.IsLeaf = bookmark.Bookmarks.Count == 0; info.ImageIndex = info.GetImageList().Images.IndexOfKey(LevelEditorCore.Resources.BookmarkImage); } }
public void GetInfo(object item, ItemInfo info) { info.IsLeaf = !HasChildren(item); DomNode node = item as DomNode; if (node != null && node.ChildInfo != null) { info.Label = node.ChildInfo.Name; //info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.DomObjectImage); return; } Adapter adapter = item as Adapter; if (adapter != null) { DomNodeAdapter nodeAdapter = adapter.Adaptee as DomNodeAdapter; StringBuilder sb = new StringBuilder(); Type type = nodeAdapter.GetType(); sb.Append(type.Name); sb.Append(" ("); foreach (Type interfaceType in type.GetInterfaces()) { sb.Append(interfaceType.Name); sb.Append(","); } sb[sb.Length - 1] = ')'; // remove trailing comma info.Label = sb.ToString(); //info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.DomObjectInterfaceImage); return; } }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { Event _event = item.As<Event>(); info.Label = _event.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.EventImage); info.Properties = new object[] { _event.Duration }; }
public void GetInfo(object item, ItemInfo info) { m_itemView.GetInfo(item, info); // Call the filtered GetChildren() // to determine if node is leaf or not. if (!m_matching && !info.IsLeaf) info.IsLeaf = !GetChildren(item).Any(); }
/// <summary> /// Fills in or modifies the given display info for the item</summary> /// <param name="item">Item</param> /// <param name="info">Display info to update</param> public void GetInfo(object item, ItemInfo info) { PrototypeFolder category = Adapters.As<PrototypeFolder>(item); if (category != null) { info.Label = category.Name; } else { Prototype prototype = Adapters.As<Prototype>(item); if (prototype != null) { info.Label = prototype.Name; info.ImageIndex = info.GetImageList().Images.IndexOfKey(Resources.StatechartDocImage); info.IsLeaf = true; } } }