private void NewFile_Click(object sender, EventArgs e) { var newFile = new DockDocument("New document", Icons.document_16xLG); DockPanel.AddContent(newFile); }
public CK3ScriptEd() { Instance = this; AutoScaleMode = AutoScaleMode.Font; InitializeComponent(); UpdateFont(); OpenDocuments = new OpenDocuments(DockPanel); AutoSave.Interval = BackupManager.Instance.TickTimeMS; // ScopeManager.Instance.LoadScopeDefinitions("ScopeDefs/scopes.xml"); // ScopeManager.Instance.LoadTriggerDefinitions("ScopeDefs/triggers.xml"); // ScopeManager.Instance.LoadEffectDefinitions("ScopeDefs/effects.xml"); Application.AddMessageFilter(new ControlScrollFilter()); // Add the dock content drag message filter to handle moving dock content around. Application.AddMessageFilter(DockPanel.DockContentDragFilter); // Add the dock panel message filter to filter through for dock panel splitter // input before letting events pass through to the rest of the application. Application.AddMessageFilter(DockPanel.DockResizeFilter); searchResults = new SearchResultsWindow(); fileOverview = new FileOverviewToolWindow(); soExplorer = new ScriptObjectExplorer(); detailsExplorer = new ObjectDetailsExplorer(); projectExplorer = new ProjectExplorer(); smartFind = new SmartFindOptionWindow(); // eventPreview = new EventRepresentationPanel(); // DockPanel.AddContent(_dockHistory, _dockLayers.DockGroup); _toolWindows.Add(detailsExplorer); _toolWindows.Add(projectExplorer); _toolWindows.Add(soExplorer); _toolWindows.Add(fileOverview); _toolWindows.Add(smartFind); _toolWindows.Add(searchResults); // _toolWindows.Add(eventPreview); soExplorer.UpdateScriptExplorer(); // Add the tool window list contents to the dock panel foreach (var toolWindow in _toolWindows) { DockPanel.AddContent(toolWindow); } // DockPanel.AddContent(detailsExplorer, smartFind.DockGroup); DockPanel.AddContent(detailsExplorer, smartFind.DockGroup); DockPanel.AddContent(soExplorer, projectExplorer.DockGroup); DockPanel.ActiveContentChanged += DockPanel_ActiveContentChanged; DockPanel.ContentRemoved += DockPanel_ContentRemoved; // Add the history panel to the layer panel group // DockPanel.AddContent(_dockHistory, _dockLayers.DockGroup); var fsmProvider = new FileSyntaxModeProvider("./"); HighlightingManager.Manager.AddSyntaxModeFileProvider(fsmProvider); // Attach to the text editor. BackupManager.Instance.UpdateTick(); CK3EditorPreferencesManager.Instance.Load(); //loadDlg.Init(this, ); mediumToolStripMenuItem.Checked = EditorGlobals.FontSize == FontSize.Normal; largeToolStripMenuItem.Checked = EditorGlobals.FontSize == FontSize.Large; }
public MainForm() { InitializeComponent(); // Add the control scroll message filter to re-route all mousewheel events // to the control the user is currently hovering over with their cursor. Application.AddMessageFilter(new ControlScrollFilter()); // Add the dock content drag message filter to handle moving dock content around. Application.AddMessageFilter(DockPanel.DockContentDragFilter); // Add the dock panel message filter to filter through for dock panel splitter // input before letting events pass through to the rest of the application. Application.AddMessageFilter(DockPanel.DockResizeFilter); if (DesignMode) { return; } HookEvents(); var ver = System.Reflection.Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString(); var verinfo = System.Reflection.Assembly.GetExecutingAssembly()?.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute)) ?.OfType <AssemblyInformationalVersionAttribute>().FirstOrDefault(); if (verinfo != null && !string.IsNullOrEmpty(verinfo.InformationalVersion)) { this.Text += " " + verinfo.InformationalVersion; } else if (!string.IsNullOrEmpty(ver)) { this.Text += " " + ver.ToString(); } var party = new Tabs.TabParty() { DockText = "国家" }; DockPanel.AddContent(party); DockPanel.AddContent(new Tabs.TabInventory() { DockText = "背包" }); DockPanel.AddContent(new Tabs.TabTroops() { DockText = "部队" }); DockPanel.AddContent(new Tabs.TabHero() { DockText = "同伴" }); DockPanel.AddContent(new Tabs.TabNPCs() { DockText = "角色" }); DockPanel.AddContent(new Tabs.TabFaction() { DockText = "势力" }); DockPanel.AddContent(new Tabs.TabSettlement() { DockText = "定居点" }); DockPanel.AddContent(new Tabs.TabCrafted() { DockText = "锻造" }); DockPanel.AddContent(new Tabs.TabWorkshops() { DockText = "工厂" }); DockPanel.ActiveContent = party; DockPanel.CloseButtonEnabled = false; var hero = (DesignMode == false) ? (Game.Current?.PlayerTroop as CharacterObject).HeroObject : null; this.coordinator = new MBCoordinator() { Hero = hero, Control = this.DockPanel }; RestoreSettings(); this.InitializeAutoSize(); DockPanel.ActiveContent = DockPanel.GetDocuments().FirstOrDefault(); }
private void NewFile_Click(object sender, EventArgs e) { DockDocument newFile = new DockDocument("New document", Properties.Resources.document_16xLG); DockPanel.AddContent(newFile); }