public void CreateFloatingForm(DLELayoutableUserControl tab) { Form f = new Form(); f.SuspendLayout(); f.StartPosition = FormStartPosition.WindowsDefaultLocation; f.FormBorderStyle = FormBorderStyle.FixedSingle; f.MaximizeBox = false; f.MinimizeBox = false; f.ClientSize = tab.Size; f.Text = tab.FloatingTitle; f.Controls.Add(tab); f.FormClosing += (object sender, FormClosingEventArgs e) => { if (e.CloseReason == CloseReason.UserClosing) { f.Hide(); e.Cancel = true; } }; tab.Location = new System.Drawing.Point(0, 0); if (tab.HelpPageName != null) { f.HelpButton = true; f.HelpButtonClicked += (object sender, CancelEventArgs e) => { (Owner as EditorWindow)?.OpenHelpPage(tab.HelpPageName, f); e.Cancel = true; // prevent help mouse cursor }; } f.ResumeLayout(false); }
private void SetDialogLayout(DLELayoutableUserControl target, LayoutOrientation dialogLayout) { string controlName = target.Name; target.DialogLayout = dialogLayout; // cascading copy target.Name = controlName; }
public void AttachToContainer(LayoutOrientation layout, EditorTabContainer ctr) { if (attached) { Detach(); } attachedToFloating = false; attached = true; TabControl tabControl = ctr.Controls.OfType <TabControl>().First(); for (int i = 0; i < AllTools.Length; ++i) { DLELayoutableUserControl tab = AllTools[i]; TabPage tabPage = tabControl.TabPages[i]; tabPage.Controls.Add(tab); tab.Location = new System.Drawing.Point(0, 0); tab.DialogLayout = layout; tabPage.ContextMenuStrip = tab.ContextMenuStrip; } }
public EditorTools(object owner) { Owner = owner; Textures = new TextureTool(); Segments = new SegmentTool(); Walls = new WallTool(); Triggers = new TriggerTool(); Objects = new ObjectTool(); Effects = new EffectTool(); Lights = new LightsTool(); Reactor = new ReactorTool(); Mission = new MissionTool(); Diagnostics = new DiagnosticsTool(); TextureFilters = new TextureFiltersTab(); Settings = new SettingsTool(); AllTools = new DLELayoutableUserControl[] { Textures, Segments, Walls, Triggers, Objects, Effects, Lights, Reactor, Mission, Diagnostics, TextureFilters, Settings }; attached = attachedToFloating = false; foreach (DLELayoutableUserControl tab in AllTools) { tab.Owner = (EditorWindow)owner; } }