private void MainForm_Load(object sender, EventArgs e) { if (Runtime.UseOpenGL) { STLibrary.Forms.Rendering.OpenTKHelper.CreateContext(); } LoadMDITheme(); LoadRecentList(); OnMdiWindowClosed(); ResetMenus(); foreach (var menu in CompressionMenu.GetMenuItems()) { var item = new STToolStipMenuItem(menu.Name, null, menu.Click) { Enabled = menu.Enabled }; compressionToolStripMenuItem.DropDownItems.Add(item); foreach (var child in menu.Children) { item.DropDownItems.Add(new STToolStipMenuItem(child.Name, null, child.Click) { Enabled = child.Enabled }); } } }
private void LoadTextures(List <string> textures) { ActiveLayout.TextureFolder = new TreeNode("Textures"); treeView1.Nodes.Add(ActiveLayout.TextureFolder); for (int i = 0; i < textures.Count; i++) { TreeNode matNode = new TreeNode(textures[i]); matNode.Tag = i; matNode.ContextMenuStrip = new ContextMenuStrip(); var menu = new STToolStipMenuItem("Rename"); menu.Click += RenameTextureAction; matNode.ContextMenuStrip.Items.Add(menu); matNode.ImageKey = "texture"; matNode.SelectedImageKey = "texture"; ActiveLayout.TextureFolder.Nodes.Add(matNode); } }
private ToolStripItem ContextMenuConvert(ToolMenuItem menu) { if (menu is ToolMenuItemSeparator) { return(new STToolStripSeparator()); } ToolStripMenuItem toolStripItem = new STToolStipMenuItem(menu.Name); if (menu.Click != null) { toolStripItem.Click += menu.Click; } foreach (var child in menu.Children) { toolStripItem.DropDownItems.Add(ContextMenuConvert(child)); } return(toolStripItem); }
public ByamlEditor() { InitializeComponent(); Reload(); xmlOldToolstrip = new STToolStipMenuItem("XML (Toolbox/Editorcore)", null, OnFormatChanged); xmlToolstrip = new STToolStipMenuItem("XML (YamlConv)", null, OnFormatChanged); yamlToolstrip = new STToolStipMenuItem("YAML", null, OnFormatChanged); if (Runtime.ByamlEditor.TextFormat == Runtime.ByamlTextFormat.YAML) { yamlToolstrip.Checked = true; } else if (Runtime.ByamlEditor.TextFormat == Runtime.ByamlTextFormat.XML_YamlConv) { xmlToolstrip.Checked = true; } else if (Runtime.ByamlEditor.TextFormat == Runtime.ByamlTextFormat.XML_EditorCore) { xmlOldToolstrip.Checked = true; } }