/// <summary> /// Adds a package node to the game explorer view. /// </summary> /// <param name="packageReference">File reference pointing to the package.</param> public void AddPackageNode(FileReference packageReference) { bool hasParentBeenAdded = packageReference.ParentReference.HasBeenAddedToTheUI(); bool hasThisBeenAdded = packageReference.HasBeenAddedToTheUI(); if (hasParentBeenAdded && !hasThisBeenAdded) { TreeIter parentIter = packageReference.ParentReference.ReferenceIter; Pixbuf packageIcon = IconManager.GetIcon("package-x-generic"); TreeIter packageNode = this.FiletreeStore.AppendValues(parentIter, packageIcon, packageReference.PackageName, "", "", (int)NodeType.Package); packageReference.ReferenceIter = packageNode; this.PackageNodeItemMapping.Add(packageNode, packageReference); } // Map package nodes to virtual root nodes VirtualFileReference virtualGroupReference; if (this.PackageGroupVirtualNodeMapping.TryGetValue(packageReference.PackageGroup, out virtualGroupReference)) { AddVirtualMapping(packageReference, virtualGroupReference); } }
/// <summary> /// Adds a package group node to the game explorer view /// </summary> /// <param name="groupReference">PackageGroup reference.</param> public void AddPackageGroupNode(FileReference groupReference) { // Add the group node Pixbuf packageGroupIcon = IconManager.GetIcon("user-home"); TreeIter packageGroupNode = this.FiletreeStore.AppendValues(packageGroupIcon, groupReference.PackageGroup.GroupName, "", "Virtual file tree", (int)NodeType.PackageGroup); groupReference.ReferenceIter = packageGroupNode; this.PackageNodeItemMapping.Add(packageGroupNode, groupReference); VirtualFileReference virtualGroupReference = groupReference as VirtualFileReference; if (virtualGroupReference != null) { this.PackageGroupVirtualNodeMapping.Add(groupReference.PackageGroup, virtualGroupReference); } // Add the package folder subnode Pixbuf packageFolderIcon = IconManager.GetIcon("applications-other"); TreeIter packageFolderNode = this.FiletreeStore.AppendValues(packageGroupNode, packageFolderIcon, "Packages", "", "Individual packages", (int)NodeType.PackageFolder); groupReference.ChildReferences.First().ReferenceIter = packageFolderNode; this.PackageNodeItemMapping.Add(packageFolderNode, groupReference.ChildReferences.First()); }
/// <summary> /// Creates a node in the <see cref="FiletreeStore"/> for the specified directory reference, as /// a child below the specified parent node. /// </summary> /// <param name="parentNode">The parent node where the new node should be attached.</param> /// <param name="directory">The <see cref="FileReference"/> describing the directory.</param> /// <returns>A <see cref="TreeIter"/> pointing to the new directory node.</returns> private TreeIter CreateDirectoryTreeNode(TreeIter parentNode, FileReference directory) { Pixbuf directoryIcon = IconManager.GetIcon(Stock.Directory); return(this.FiletreeStore.AppendValues(parentNode, directoryIcon, directory.GetReferencedItemName(), "", "", (int)NodeType.Directory)); }
void Windows_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { bool hasWindows = Windows.Any(); IconLight.Visibility = hasWindows ? Visibility.Visible : Visibility.Hidden; MenuMinimize.IsEnabled = MenuRestore.IsEnabled = MenuClose.IsEnabled = hasWindows; if (hasWindows) { Window window = Windows.First(); Text = StringUtils.LimitCharacters(window.Title, 50, 60); var bitmap = IconManager.GetIcon(window.FileName, SettingsManager.Settings.IconSize); Icon = bitmap; BlurredIcon = BitmapEffectHelper.GaussianBlur(bitmap, 2.5f); ChildIcon = IconManager.GetAppIcon(window.Hwnd); if (WindowManager.Manager.Windows.Count(w => w.FileName == window.FileName) > 1) { IconImageSmall.Visibility = Visibility.Visible; } } if (Info.Pinned && string.IsNullOrEmpty(Info.ImagePath)) { var bitmap = IconManager.GetIcon(Info.Path, SettingsManager.Settings.IconSize); Icon = bitmap; BlurredIcon = BitmapEffectHelper.GaussianBlur(bitmap, 2.5f); } }
public static void VariableField(DashVariables p_variables, string p_name, GameObject p_boundObject, float p_maxWidth) { var variable = p_variables.GetVariable(p_name); GUILayout.BeginHorizontal(); string newName = EditorGUILayout.TextField(p_name, GUILayout.Width(120)); GUILayout.Space(2); if (newName != p_name) { p_variables.RenameVariable(p_name, newName); } variable.ValueField(p_maxWidth - 150, p_boundObject); var oldColor = GUI.color; GUI.color = variable.IsBound || variable.IsLookup ? Color.yellow : Color.gray; GUILayout.FlexibleSpace(); GUILayout.BeginVertical(GUILayout.Width(16)); GUILayout.Space(2); if (GUILayout.Button(IconManager.GetIcon("bind_icon"), GUIStyle.none, GUILayout.Height(16), GUILayout.Width(16))) { var menu = GetVariableMenu(p_variables, p_name, p_boundObject); GenericMenuPopup.Show(menu, "", Event.current.mousePosition, 240, 300, false, false); } GUILayout.EndVertical(); GUI.color = oldColor; GUILayout.EndHorizontal(); }
private void FrmBase_Load(object sender, EventArgs e) { var positionHandler = new FormPositionHandler(this); positionHandler.RememberPosition = _rememberPosition; positionHandler.SetDefaultPosition(); Icon = IconManager.GetIcon(EIcons.window_32); }
static void Main(string[] args) { IconManager.FindIconsInResources(Resources1.ResourceManager); //IconManager.FindIconsInResources(Resources2.ResourceManager); //IconManager.FindIconsInResources(Resources3.ResourceManager); Image iconImage = IconManager.GetIcon("Incors_office_building_16x16"); }
void DrawScriptButton(Rect p_rect, Type p_type) { if (GUI.Button(new Rect(p_rect.x + 290, p_rect.y + 7, 16, 16), IconManager.GetIcon("script_icon"), GUIStyle.none)) { AssetDatabase.OpenAsset(EditorUtils.GetScriptFromType(p_type), 1); } }
void DrawDocumentationButton(Rect p_rect, Type p_type) { DocumentationAttribute documentation = p_type.GetCustomAttribute <DocumentationAttribute>(); if (documentation != null) { if (GUI.Button(new Rect(p_rect.x + 270, p_rect.y + 7, 16, 16), IconManager.GetIcon("help_icon"), GUIStyle.none)) { Application.OpenURL( "https://github.com/pshtif/Dash/blob/main/Documentation/" + documentation.url); } } }
private bool InsertButton(MButton btn, string path) { // 파일명 읽어와야 함 string fileName = Path.GetFileName(path); ImageSource imgIcon = IconManager.GetIcon(path); byte[] baIcon = IconManager.ImageSourceToByte(imgIcon); if (DataBase.InsertButton(btn.TabId, btn.Col, btn.Row, fileName, path, baIcon) < 1) { return(false); } btn.IconImage = imgIcon; btn.Text = fileName; btn.Path = path; return(true); }
string imageList_AddIcon(string iconFile, int iconIndex) { Icon icon = IconManager.GetIcon(iconFile, iconIndex, false); if (icon == null) { return(""); } else { string key = imageList_GetKey(iconFile, iconIndex); if (!imageList.Images.ContainsKey(key)) { imageList.Images.Add(key, icon); } icon.Dispose(); return(key); } }
public DockIcon(IconInfo info) : this() { Info = info; if (!File.Exists(info.Path)) { // TODO: Manage exceptions } else { if (string.IsNullOrEmpty(info.ImagePath)) { var bitmap = IconManager.GetIcon(info.Path, SettingsManager.Settings.IconSize); Icon = bitmap; BlurredIcon = BitmapEffectHelper.GaussianBlur(bitmap, 2.5f); } Text = info.Name; MenuPin.IsChecked = info.Pinned; } }
public void Draw(DashGraph p_graph) { if (p_graph != null) { if (GUI.Button(new Rect(0, 1, 100, 22), "File")) { GraphFileContextMenu.Show(p_graph); } GUI.DrawTexture(new Rect(80, 6, 10, 10), IconManager.GetIcon("arrowdown_icon")); if (GUI.Button(new Rect(102, 1, 120, 22), "Preferences")) { PreferencesContextMenu.Show(p_graph); } GUI.DrawTexture(new Rect(202, 6, 10, 10), IconManager.GetIcon("arrowdown_icon")); if (DashEditorCore.EditorConfig.showNodeSearch) { _search = GUI.TextField(new Rect(230, 2, 100, 19), _search); if (GUI.Button(new Rect(332, 3, 60, 18), "Search")) { if (!_search.IsNullOrWhitespace()) { if (_search != _previousSearch) { _previousSearch = _search; _index = 0; } else { _index++; } SelectionManager.SearchAndSelectNode(p_graph, _search, _index); } } } } }
private void UpdateImages() { bool hasWindows = Windows.Any(); IsActive = hasWindows; if (hasWindows) { Win32Window window = Windows.First(); Text = string.IsNullOrEmpty(window.Title) ? System.IO.Path.GetFileName(window.FileName) : window.Title; Text = StringUtils.LimitCharacters(Text, 40, 50); var bitmap = IconManager.GetIcon(window.FileName, VMLocator.Main.IconSize) ?? IconManager.UnknownIcon; Icon = bitmap; BlurredIcon = BitmapEffectHelper.GaussianBlur(bitmap, 2.5f); ChildIcon = IconManager.GetAppIcon(window.Hwnd); HasChildIcon = WindowManager.Manager.Windows.Count(w => w.FileName == window.FileName) > 1; } if (Pinned && string.IsNullOrEmpty(ImagePath)) { var bitmap = IconManager.GetIcon(Path, VMLocator.Main.IconSize) ?? IconManager.UnknownIcon; Icon = bitmap; BlurredIcon = BitmapEffectHelper.GaussianBlur(bitmap, 2.5f); } }
void UpdateInfoPanel(TreeNode selectedTreeNode) { labelName.Text = selectedTreeNode.Text + ":"; if (selectedTreeNode.Tag != null) { ItemProperty tag = (ItemProperty)selectedTreeNode.Tag; Icon ico = IconManager.GetIcon(tag.IconFile, tag.IconIndex, true); if (ico != null) { pictureBoxIcon.Image = ico.ToBitmap(); ico.Dispose(); } else { pictureBoxIcon.Image = null; } if (!tag.IsSubMenu) { textBoxCommand.Text = tag.Command; textBoxArguments.Text = tag.Arguments; } else { textBoxCommand.Text = ""; textBoxArguments.Text = ""; } } else { textBoxCommand.Text = ""; textBoxArguments.Text = ""; pictureBoxIcon.Image = null; } }
/// <summary> /// Handles rendering of the icon of a node in the tree. /// </summary> /// <param name="column">The column which the icon is in.</param> /// <param name="cell">The cell which the reference is in.</param> /// <param name="model">The model of the treeview.</param> /// <param name="iter">The <see cref="TreeIter"/> pointing to the row the icon is in.</param> private void RenderNodeIcon(TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { var cellIcon = cell as CellRendererPixbuf; var node = (SerializedNode)model.GetValue(iter, 0); if (node == null || cellIcon == null) { return; } if (node.Type.HasFlag(NodeType.Directory)) { cellIcon.Pixbuf = IconManager.GetIconForFiletype(WarcraftFileType.Directory); return; } if (node.Type.HasFlag(NodeType.Deleted)) { cellIcon.Pixbuf = IconManager.GetIcon("package-broken"); return; } if (node.Type.HasFlag(NodeType.Meta) && _treeModel.GetNodeName(node) == "Packages") { cellIcon.Pixbuf = IconManager.GetIcon("applications-other"); return; } if (node.Type.HasFlag(NodeType.Package)) { cellIcon.Pixbuf = IconManager.GetIcon("package-x-generic"); return; } cellIcon.Pixbuf = IconManager.GetIconForFiletype(node.FileType); }
private void FrmStartFormBase_Load(object sender, EventArgs e) { Icon = IconManager.GetIcon(EIcons.manor_logo); }
/// <summary> /// Handles queueing of a selected file in the archive, triggered by a context /// menu press. /// </summary> /// <param name="page">Sender.</param> /// <param name="fileReference">E.</param> private void OnEnqueueItemRequested(GamePage page, FileReference fileReference) { this.ExportQueueListStore.AppendValues(fileReference, IconManager.GetIcon("package-downgrade")); }
public override void DrawGUI(Event p_event, Rect p_rect) { if (Application.isPlaying || Graph == null || Controller == null || !Controller.gameObject.activeInHierarchy) { return; } if (Graph.previewControlsViewMinimized) { Rect rect = new Rect(p_rect.width / 2 + 170, p_rect.height - 28, 32, 70); DrawBoxGUI(rect, "", TextAnchor.UpperLeft, Color.white); if (GUI.Button(new Rect(rect.x + rect.width - 28, rect.y + 4, 24, 24), IconManager.GetIcon("rollin_icon"), GUIStyle.none)) { Graph.previewControlsViewMinimized = false; } } else { Rect rect = new Rect(p_rect.width / 2 - 220, p_rect.height - 80, 440, 70); DrawBoxGUI(rect, "Preview Controls", TextAnchor.UpperLeft, Color.white); GUI.color = Color.yellow; GUI.DrawTexture(new Rect(rect.x + 132, rect.y + 7, 16, 16), IconManager.GetIcon("experimental_icon")); GUI.color = Color.white; if (GUI.Button(new Rect(rect.x + rect.width - 28, rect.y + 4, 24, 24), IconManager.GetIcon("rollout_icon"), GUIStyle.none)) { Graph.previewControlsViewMinimized = true; } bool _previewRunning = DashEditorCore.Previewer.IsPreviewing; var previewNode = Graph.previewNode; if (previewNode != null) { GUI.Label(new Rect(rect.x + 214, rect.y + 32, 180, 30), "Preview: "); GUIStyle style = new GUIStyle(); style.normal.textColor = Color.magenta; style.fontStyle = FontStyle.Bold; style.alignment = TextAnchor.MiddleLeft; GUI.Label(new Rect(rect.x + 270, rect.y + 32, 180, 30), previewNode.Name, style); } else { GUI.Label(new Rect(rect.x + 220, rect.y + 32, 180, 30), "No preview node."); } GUI.enabled = !_previewRunning && Graph.previewNode != null; if (GUI.Button(new Rect(rect.x + 4, rect.y + 32, 100, 30), "RUN")) { DashEditorCore.Previewer.StartPreview(Graph.previewNode); } GUI.enabled = _previewRunning; if (GUI.Button(new Rect(rect.x + 108, rect.y + 32, 100, 30), "STOP")) { DashEditorCore.Previewer.StopPreview(); } GUI.enabled = true; } }
private void FormMain_Load(object sender, EventArgs e) { this.Icon = IconManager.GetIcon("shell32.dll", 39, true); if (!System.IO.File.Exists(Installer.GetMenu98Path())) { Installer.ShowInstaller(this); } if (WinVer.IsWin10OrGreater()) { Win10Style.EnableBlur(this.Handle); } else { checkBoxNoExplorerImmersiveMenu.Enabled = false; checkBoxEnableImmersiveMenu.Enabled = false; checkBoxShowIcon.Enabled = false; checkBoxHideToggleOption.Enabled = false; } if (WinVer.IsVistaOrGreater()) { //DPI.SetCurrentProcessDPIAware(); Win7Style.EnableAero(this.Handle, panelExtended.Height, panelMain.Bottom, 0, 0); toolStrip.Renderer = new ToolStripNonClientRender(); } else { toolStrip.Renderer = new ToolStripNonClientRender(SystemColors.Control); toolStrip.Location = new Point(toolStrip.Location.X, toolStrip.Location.Y - 1); this.FormBorderStyle = FormBorderStyle.FixedSingle; this.ControlBox = true; this.Height -= panelMain.Location.Y; this.panelMain.Location = new Point(panelMain.Location.X, 0); this.Text = labelCaption.Text; } panelFrameB.Visible = false; panelFrameT.Visible = false; panelFrameR.Visible = false; panelFrameL.Visible = false; pictureBoxAppIcon.BackgroundImage = this.Icon.ToBitmap(); contextMenuStrip.Renderer = new ToolStripNonClientRender(); comboBoxStyle.SelectedIndex = 0; FormUtils.ShowShield(buttonUpdateStartupCommand.Handle, true); FormUtils.ShowShield(buttonRemoveStartUp.Handle, true); for (int i = 0; i <= MenuControl.OSList.Length; i++) { comboBoxSysVer.Items.Add(MenuControl.GetOSFromIndex(i)); } comboBoxSysVer.SelectedIndex = MenuControl.Os2ListIndex(WinVer.SystemVersion); checkBoxNoExplorerImmersiveMenu.Checked = Installer.ExplorerImmersiveMenuRemoved(); if (System.IO.File.Exists(Installer.GetConfigPath())) { XML_Load(Installer.GetConfigPath()); } else { switch (Installer.ShowSelectConfigFileBox(this)) { case DialogResult.Yes: Installer.DeployDefaultConfigFile(); XML_Load(Installer.GetConfigPath()); break; case DialogResult.No: if (!OpenConfigUsingDialog()) { this.Close(); } break; case DialogResult.Cancel: this.Close(); break; } } }
/// <summary> /// Handles queueing of a selected file in the archive, triggered by a context /// menu press. /// </summary> /// <param name="page">Sender.</param> /// <param name="fileReference">E.</param> private Task OnEnqueueItemRequested(GamePage page, FileReference fileReference) { this.ExportQueueListStore.AppendValues(fileReference, IconManager.GetIcon("package-downgrade")); return(Task.CompletedTask); }
public IconViewModel(Icon icon) : base(icon) { Info = string.Format("Position [{0},{1}]", icon.X, icon.Y); Icon = IconManager.GetIcon(icon.Name); }