private void newDocumentToolStripMenuItem_Click(object sender, EventArgs e) { DockContent dc = new DockContent(); dc.Text = "Testing"; ScriptEditorControl sec = new ScriptEditorControl(); sec.Dock = DockStyle.Fill; dc.Controls.Add(sec); if (dockMain.DocumentStyle == DocumentStyle.SystemMdi) { dc.MdiParent = this; dc.Show(); } else dc.Show(dockMain); }
void Ajouter_Objectif() { ctrlFicheObjectif f = new ctrlFicheObjectif(); f.Acces = Acces; f.Creation = true; f.Console = Console; f.objectif = new Objectif(); f.objectif.Code = "OBJ_PA" + ((lblRecherche.Text.Length > 0) ? lblRecherche.Text : ""); f.objectif.Actif = true; f.objectifParent = null; n_obj++; f.Tag = Acces.type_OBJECTIF.id + n_obj; f.EVT_Enregistrer += Handler_evt_Modifier; f.Initialiser(); var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Objectif (Nouveau)"; f.Dock = DockStyle.Fill; D.Controls.Add(f); D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document); }
public FrmMain() { InitializeComponent(); var v = Assembly.GetEntryAssembly().GetName().Version; this.Version = string.Format("v{0}.{1}", v.Major, v.Minor); string title = string.Format("编程辅助工具{0}", this.Version); this.Text = title; BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += new DoWorkEventHandler(worker_DoWork); worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); worker.RunWorkerAsync(); this.IsMdiContainer = true; this.dockPanel.DocumentStyle = DocumentStyle.DockingMdi; //详细信息 DockContent dc = new DockContent(); dc.CloseButtonVisible = false; dc.Text = "详细信息"; DetailTabPage dtpage = new DetailTabPage(); dtpage.Dock = DockStyle.Fill; dc.Controls.Add(dtpage); dc.Show(this.dockPanel, DockState.Document); //数据 DockContent dc2 = new DockContent(); dc2.CloseButtonVisible = false; dc2.Text = "数据"; SchemaTreeView stpage = new SchemaTreeView(); stpage.Dock = DockStyle.Fill; dc2.Controls.Add(stpage); dc2.Show(this.dockPanel, DockState.DockLeft); }
public void CreateContent() { this.Text = "DockPanelSuite TestApp"; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 600); // var dockPanel = new DockPanel(); dockPanel.AllowDrop = true; dockPanel.TabIndex = 1; dockPanel.DocumentStyle = DocumentStyle.DockingWindow; dockPanel.AllowEndUserDocking = true; dockPanel.AllowEndUserNestedDocking = true; dockPanel.Dock = DockStyle.Fill; this.Controls.Add(dockPanel); // var dc = new DockContent(); dc.TabText = "Hello Doc!"; dc.DockPanel = dockPanel; dc.DockAreas = DockAreas.Document; var rtb = new RichTextBox(); rtb.Dock = DockStyle.Fill; dc.Controls.Add(rtb); dc.Show(); // DockContent dc2 = new DockContent(); dc2.TabText = "Hello Doc!"; dc2.DockPanel = dockPanel; dc2.DockAreas = DockAreas.Document; var rtb2 = new RichTextBox(); rtb2.Dock = DockStyle.Fill; dc2.Controls.Add(rtb2); dc2.Show(); // DockContent dc3 = new DockContent(); dc3.AllowEndUserDocking = true; dc3.AllowDrop = true; dc3.TabText = "Hello Tab!"; dc3.DockPanel = dockPanel; dc3.DockAreas = DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop; dc3.DockState = DockState.DockRight; var rtb3 = new RichTextBox(); rtb3.Dock = DockStyle.Fill; dc3.Controls.Add(rtb3); dc3.Show(); // DockContent dc4 = new DockContent(); dc4.AllowEndUserDocking = true; dc4.AllowDrop = true; dc4.TabText = "Hello Tab!"; dc4.DockPanel = dockPanel; dc4.DockAreas = DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.Float; dc4.DockState = DockState.DockBottomAutoHide; var rtb4 = new RichTextBox(); rtb4.Dock = DockStyle.Fill; dc4.Controls.Add(rtb4); dc4.Show(); }
void FormPicFormClosed(object sender, FormClosedEventArgs e) { if (show.DockState == DockState.DockRightAutoHide || show.DockState == DockState.DockLeftAutoHide || show.DockState == DockState.DockTopAutoHide || show.DockState == DockState.DockBottomAutoHide) { Program.MainForm.dockPanel.ActiveAutoHideContent = show; } show.Show(); }
/// <summary> /// Création d'une action par l'intermédiaire de la fiche action /// </summary> void Ajouter_Action() { string code = CodeRef; var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Action (nouvelle)"; Console.Ajouter("[AJOUT ACTION]"); ctrlFicheAction f = new ctrlFicheAction(); f.Acces = Acces; f.Creation = true; f.action = new PATIO.CAPA.Classes.Action(); f.action.Code = "ACT-"; f.action._type = "ACT"; if (plan._ref1 != null) { f.action._codeplan = plan._ref1; } if (plan._ref2 != null) { f.action._axe = plan._ref2; } if (plan._os != null) { f.action._os = plan._os; } if (plan._og != null) { f.action._og = plan._og; } f.action.Actif = true; f.actionParent = null; Console.Ajouter("Code plan : " + f.action._codeplan); n_action++; f.Tag = Acces.type_ACTION.ID + n_action; f.EVT_Enregistrer += Handler_evt_Modifier; f.Initialiser(); f.Dock = DockStyle.Fill; D.Controls.Add(f); D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document); }
private void Ouvrir_Indicateur() { var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Indicateur " + lstIndicateur.SelectedNode.Name; var ctrl = new ctrlIndicateur(); ctrl.Acces = Acces; ctrl.IndicateurId = lstIndicateur.SelectedNode.Name; ctrl.Affiche(); ctrl.Dock = DockStyle.Fill; D.Controls.Add(ctrl); D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document); }
public void ShowMapWindow(Situation situation, WarPresentationModel model) { // �Ƃ肠�����S�ẴE�B���h�E��\������ // MapWindow �C���X�^���X�̐��� var mapWindow = new MapWindow(model); mainDock = mapWindow; mainDock.AllowEndUserDocking = false; mainDock.Show(dockPanel, DockState.Document); var commandWindow = new CommandWindow(model); commandWindow.Show(mapWindow.Pane, DockAlignment.Top, 0.12); var mapChipInfoWindow = new MapChipInfoWindow(model); mapChipInfoWindow.Show(commandWindow.Pane, DockAlignment.Right, 0.5); // UnitMiniInfoWindow�\���p Action<Point2> showUnitMiniInfoWindow = delegate(Point2 p) { var unit = model.WarMap[p].Unit; if (unit != null) { MiniUnitInfoWindow.ShowWindow(this, unit); } else { MiniUnitInfoWindow.HideWindow(); } }; // MapChip�N���b�N�ɂ��UnitInfoWindow�̕\���̃f���Q�[�g��lj� model.SelectMapChipEvent += p => { var unit = model.WarMap[p].Unit; if (unit != null && model.Scope == null) UnitInfoWindow.ShowWindow(this, unit); else UnitInfoWindow.HideWindow(); }; model.CursorChipPointChangedEvent += showUnitMiniInfoWindow; model.CursorEnterEvent += showUnitMiniInfoWindow; model.CursorLeaveEvent += delegate { if (MiniUnitInfoWindow.IsInitialized && !MiniUnitInfoWindow.IsOnCursor) MiniUnitInfoWindow.HideWindow(); }; }
/// <summary> /// Creates a new editor window /// </summary> /// <param name="p">Parent window</param> /// <param name="openFile">File to open, null if template should be used, empty if blank should be used</param> public FormEditor(FormMain p, string openFile = "") { IsClosed = false; InitializeComponent(); // Docking //dockPanel.Controls.Add(editor); var ed = new DockContent {CloseButton = false, CloseButtonVisible = false}; ed.Controls.Add(editor); editor.Dock = DockStyle.Fill; ed.Show(dockPanel); _parent = p; LoadEditorSettings(); if (openFile == null) New(true); else { if (!String.IsNullOrEmpty(openFile)) OpenFile(openFile); } UpdateGui(); // Sorting the toolstrips toolStripMain.Location = new Point(0, menuStripMain.Height); toolStripSendTo.Location = new Point(toolStripMain.Width + 3, menuStripMain.Height); // Adjusting the dock dockPanel.DockBottomPortion = 0.4; dockPanel.DockLeftPortion = 0.3; dockPanel.DockTopPortion = 0.4; dockPanel.DockRightPortion = 0.3; // Adding the charmap _charmapWindow = new FormCharmapWindow(this, _fontCollection); _charmapWindow.Show(dockPanel, DockState.DockBottomAutoHide); // Adding the help _helpWindow = new FormHelpWindow(CommandsFile, _fontCollection); _helpWindow.Show(dockPanel, DockState.DockBottomAutoHide); _helpWindow.ReferenceLoaded += (o, args) => SearchReference(true); }
public void Modifier_Objectif() { if (obj == null) { return; } ctrlFicheObjectif f = new ctrlFicheObjectif(); f.Acces = Acces; f.Creation = false; f.Console = Console; var Id = obj.ID; Objectif P = (Objectif)Acces.Trouver_Element(Acces.type_OBJECTIF.id, Id); f.objectif = P; n_obj++; f.Tag = Acces.type_OBJECTIF.id + n_obj; f.EVT_Enregistrer += Handler_evt_Modifier; f.Initialiser(); f.Dock = DockStyle.Fill; var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Objectif " + P.Code; f.Dock = DockStyle.Fill; D.Controls.Add(f); D.Tag = obj.Code; //Recherche si la fiche élément n'est pas ouverte foreach (DockContent d in DP.Documents) { if (d.Tag == D.Tag) { d.Show(); return; } } D.Show(DP, DockState.Document); }
protected override void OnFormClosing(FormClosingEventArgs e) { if (Pane != null && Pane.DockPanel != null && Pane.DockPanel.CloseTabsToLeft && Pane.ActiveContent == this && Pane.TabStripControl != null) { var tabs = Pane.TabStripControl.Tabs; if (tabs != null && tabs.Count > 1) { for (int i = 0; i < tabs.Count; i++) { if (tabs[i].Content == this) { DockContent dc = null; if (i > 0) { for (int j = i - 1; j >= 0; j--) { if (tabs[j].Content is DockContent) { dc = tabs[j].Content as DockContent; break; } } } if (dc != null) { dc.Show(); } break; } } } } base.OnFormClosing(e); }
/// <summary> /// Modiication d'une action ou sous-action par l'intermédiaire de la fiche action /// </summary> public void Modifier_Action() { if (action == null) { return; } Console.Ajouter("[MODIFICATION ACTION]"); var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Action " + action.Code; ctrlFicheAction f = new ctrlFicheAction(); f.Acces = Acces; f.Creation = false; f.plan = plan; n_action++; f.Tag = Acces.type_ACTION.ID + n_action; f.EVT_Enregistrer += Handler_evt_Modifier; f.action = action; f.Initialiser(); f.Dock = DockStyle.Fill; D.Controls.Add(f); D.Tag = action.Code; //Recherche si la fiche élément n'est pas ouverte foreach (DockContent d in DP.Documents) { if (d.Tag == D.Tag) { d.Show(); return; } } D.Show(DP, DockState.Document); }
public void Ouvrir_Plan() { if (plan == null) { return; } //if ((lstPlan.SelectedNode is null) && (plan is null)) { return; } //Plan plan = (Plan)Acces.Trouver_Element(Acces.type_PLAN, int.Parse(lstPlan.SelectedNode.Name)); var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Plan " + plan.Code; //MessageBox.Show(int.Parse(lstPlan.SelectedNode.Name).ToString()); var ctrl = new ctrlPlan(); ctrl.Acces = Acces; ctrl.plan = plan; ctrl.DP = DP; ctrl.Console = Console; ctrl.Chemin = Chemin; ctrl.Afficher(); ctrl.Dock = DockStyle.Fill; D.Controls.Add(ctrl); D.Tag = plan.Code; //Recherche si la fiche élément n'est pas ouverte foreach (DockContent d in DP.Documents) { if (d.Tag == D.Tag) { d.Show(); return; } } D.Show(DP, DockState.Document); }
void Ajouter_SousObjectif() { string code = CodeRef; if (lstObjectif.SelectedNode is null) { MessageBox.Show("Vous devez choisir un objectif parent"); return; } int id = int.Parse(lstObjectif.SelectedNode.Name); Objectif obj = (Objectif)Acces.Trouver_Element(Acces.type_OBJECTIF.id, id); code = obj.Code; ctrlFicheObjectif f = new ctrlFicheObjectif(); f.Acces = Acces; f.Creation = true; f.objectif = new Objectif(); f.objectif.Code = code; f.objectif.Actif = true; f.objectifParent = (Objectif)Acces.Trouver_Element(Acces.type_OBJECTIF.id, int.Parse(lstObjectif.SelectedNode.Name));; n_obj++; f.Tag = Acces.type_OBJECTIF.code + n_obj; f.EVT_Enregistrer += Handler_evt_Modifier; f.Initialiser(); var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Objectif (Nouveau)"; f.Dock = DockStyle.Fill; D.Controls.Add(f); D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document); }
/// <summary> /// Création d'une sous-action par l'intermédiaire de la fiche action /// </summary> void Ajouter_SousAction() { string code = CodeRef; Console.Ajouter("[AJOUT SOUS-ACTION"); //Recherche du code du parent pour optimiser le codage des actions if (lstAction.SelectedNode is null) { MessageBox.Show("Vous devez sélectionner une action.", "Erreur"); return; } ctrlFicheAction f = new ctrlFicheAction(); f.Acces = Acces; f.Creation = true; n_action++; f.Tag = Acces.type_ACTION.Code + n_action; f.EVT_Enregistrer += Handler_evt_Modifier; f.action = new PATIO.CAPA.Classes.Action(); //f.action.Code = "ACT-" + code; f.action.Actif = true; f.actionParent = (PATIO.CAPA.Classes.Action)Acces.Trouver_Element(Acces.type_ACTION, int.Parse(lstAction.SelectedNode.Name)); Console.Ajouter("Action parent : " + f.actionParent.Code); f.Initialiser(); var D = new WeifenLuo.WinFormsUI.Docking.DockContent(); D.TabText = "Action (nouvelle)"; f.Dock = DockStyle.Fill; D.Controls.Add(f); D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document); }
public DockableDocument(String filePath, DockPanel dockPanel) { Editor.ModifiedChanged += new EventHandler(Editor_ModifiedChanged); try { dockContent = new DockContent(); dockContent.ShowHint = DockState.Document; dockContent.BackColor = Color.Black; dockContent.DockAreas = DockAreas.Document | DockAreas.Float; dockContent.Controls.Add(this.Editor); Editor.Dock = DockStyle.Fill; dockContent.Show(dockPanel); dockContent.Tag = this; if (String.IsNullOrEmpty(filePath)) { Editor.Text = newDocumentTemplate; Editor.Selection.Start = Editor.Selection.End = Editor.Text.Length; Editor.UndoRedo.EmptyUndoBuffer(); Editor.Modified = false; dockContent.TabText = "Untitled"; return; } if (OpenDoc(filePath)) { FilePath = filePath; dockContent.Name = filePath; dockContent.TabText = DocTitle; } } catch { } }
/// <summary> /// Creates a new Sphere Studio document tab. /// </summary> /// <param name="ide">The IDE form that the tab will be created in.</param> /// <param name="view">The IDocumentView the tab is hosting.</param> /// <param name="fileName">The fully-qualified filename of the document, or null if untitled.</param> /// <param name="restoreView">'true' to restore the last saved view state. Has no effect on untitled tabs.</param> public DocumentTab(MainWindow ide, DocumentView view, string fileName = null, bool restoreView = false) { FileName = fileName; View = view; View.Dock = DockStyle.Fill; _tabText = fileName != null ? Path.GetFileName(fileName) : string.Format("Untitled{0}", _unsavedID++); _ide = ide; _content = new DockContent(); _content.FormClosing += on_FormClosing; _content.FormClosed += on_FormClosed; _content.Tag = this; _content.Icon = View.Icon; _content.TabText = _tabText; _content.ToolTipText = FileName; _content.Controls.Add(View); _content.Show(ide.MainDock, DockState.Document); View.DirtyChanged += on_DirtyChanged; UpdateTabText(); if (View is ScriptView) { ScriptView scriptView = View as ScriptView; scriptView.Breakpoints = Core.Project.GetBreakpoints(FileName); scriptView.BreakpointChanged += on_BreakpointSet; } if (restoreView && FileName != null) { string setting = string.Format("viewState:{0:X8}", FileName.GetHashCode()); try { View.ViewState = Core.Project.User.GetString(setting, ""); } catch (Exception) { } // *munch* } }
public void ShowSQLQuery(ShowSQLQueryEvent e) { var query = new SQLQueryView(); query.Dock = DockStyle.Fill; DockContent dc = new DockContent(); dc.Text = "查询"; dc.Controls.Add(query); dc.Show(this.dockPanel, DockState.Document); if (!string.IsNullOrEmpty(e.SQL)) { query.Query(e.SQL); } }
private void InitializeDocking() { Controls.Remove(DirectionSplitter); SpriteDrawer.Dock = DockStyle.Fill; _drawContent = new DockContent { Text = @"Sprite Drawer", DockAreas = DockAreas.Document }; _drawContent.DockHandler.CloseButtonVisible = false; _drawContent.Controls.Add(SpriteDrawer); DirectionHolder.Dock = DockStyle.Fill; _directionContent = new DockContent { Text = @"Sprite Directions", DockAreas = DockAreas.Document }; _directionContent.DockHandler.CloseButtonVisible = false; _directionContent.Controls.Add(DirectionHolder); ImagePanel.Dock = DockStyle.Fill; _imageContent = new DockContent { Text = @"Spriteset Images", DockAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.Float }; _imageContent.DockHandler.CloseButtonVisible = false; _imageContent.Controls.Add(ImagePanel); AnimPanel.Dock = DockStyle.Fill; _animContent = new DockContent { Text = @"Direction Animation", DockAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.Float | DockAreas.DockBottom | DockAreas.DockTop }; _animContent.DockHandler.CloseButtonVisible = false; _animContent.Controls.Add(AnimPanel); BasePanel.Dock = DockStyle.Fill; _baseContent = new DockContent { Text = @"Base Editor", DockAreas = DockAreas.Document | DockAreas.DockTop | DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight }; _baseContent.DockHandler.CloseButtonVisible = false; _baseContent.Controls.Add(BasePanel); _mainDockPanel = new DockPanel { DocumentStyle = DocumentStyle.DockingWindow, Dock = DockStyle.Fill }; if (File.Exists("SpriteEditor.xml")) { DeserializeDockContent dc = GetContent; _mainDockPanel.LoadFromXml("SpriteEditor.xml", dc); } else { _directionContent.Show(_mainDockPanel, DockState.Document); _baseContent.Show(_directionContent.Pane, DockAlignment.Bottom, 0.40); _drawContent.Show(_baseContent.PanelPane, _baseContent); _imageContent.Show(_mainDockPanel, DockState.DockRight); _animContent.Show(_imageContent.Pane, DockAlignment.Bottom, 0.40); } Controls.Add(_mainDockPanel); }
public void ShowCode(ShowCodeEvent e) { CodeView codeShow = new CodeView(); codeShow.Dock = DockStyle.Fill; DockContent dc = new DockContent(); dc.Text = e.Title; dc.Controls.Add(codeShow); dc.Show(this.dockPanel, DockState.Document); codeShow.Show(e.Code); }
public void SetDetailView(IGameDetailView view) { detailView = view as DockContent; detailView.Show (dockPanel, DockState.DockRight); }
private void HandleDockContentToolStripMenuClick(DockContent dockWindow, DockState state) { if (dockWindow.IsHidden || dockWindow.DockState == DockState.Unknown) { dockWindow.Show(dockPanel, state); } else { dockWindow.Close(); } }
private void OpenFloatingOrActivate(DockContent view) { if ((view.DockAreas & DockAreas.Float) > 0 && !view.Created) { Size viewSize = new Size(view.Bounds.Size.Width, view.Bounds.Size.Height); view.Show(dockPanel, DockState.Float); view.FloatPane.FloatWindow.Size = viewSize; } else { view.Activate(); } }
private DockContent ShowWatch() { if (m_WatchDock != null) { m_WatchDock.Show(); return m_WatchDock; } m_WatchDock = Helpers.WrapDockContent(dockPanel, watchBox); m_WatchDock.HideOnClose = true; if (m_VariablesDock != null) { m_WatchDock.Show(m_VariablesDock.Pane, m_VariablesDock); } else { m_WatchDock.Show(dockPanel, DockState.DockBottom); } return m_WatchDock; }
private DockContent ShowConstants() { if (m_ConstantsDock != null) { m_ConstantsDock.Show(); return m_ConstantsDock; } m_ConstantsDock = Helpers.WrapDockContent(dockPanel, constantBox); m_ConstantsDock.HideOnClose = true; m_ConstantsDock.Show(dockPanel, DockState.DockBottom); return m_ConstantsDock; }
private DockContent ShowErrors() { if (m_ErrorsDock != null) { m_ErrorsDock.Show(); return m_ErrorsDock; } m_ErrorsDock = Helpers.WrapDockContent(dockPanel, errorsBox); m_ErrorsDock.HideOnClose = true; m_ErrorsDock.Show(dockPanel, DockState.DockBottom); return m_ErrorsDock; }
public static Form AddPanel(string title = "", bool noTabber = false) { try { if (title == "") { title = Language.strNewPanel; } DockContent pnlcForm = new DockContent(); UI.Window.Connection cForm = new UI.Window.Connection(pnlcForm); pnlcForm = cForm; //create context menu ContextMenuStrip cMen = new ContextMenuStrip(); //create rename item ToolStripMenuItem cMenRen = new ToolStripMenuItem(); cMenRen.Text = Language.strRename; cMenRen.Image = Resources.Rename; cMenRen.Tag = pnlcForm; cMenRen.Click += new EventHandler(cMenConnectionPanelRename_Click); ToolStripMenuItem cMenScreens = new ToolStripMenuItem(); cMenScreens.Text = Language.strSendTo; cMenScreens.Image = Resources.Monitor; cMenScreens.Tag = pnlcForm; cMenScreens.DropDownItems.Add("Dummy"); cMenScreens.DropDownOpening += new EventHandler(cMenConnectionPanelScreens_DropDownOpening); cMen.Items.AddRange(new ToolStripMenuItem[] { cMenRen, cMenScreens }); pnlcForm.TabPageContextMenuStrip = cMen; cForm.SetFormText(title.Replace("&", "&&")); //ToDo: Fix this try { frmMain.Default.pnlDock.DocumentStyle = frmMain.Default.pnlDock.DocumentsCount > 1 ? DocumentStyle.DockingMdi : DocumentStyle.DockingSdi; pnlcForm.Show(frmMain.Default.pnlDock, DockState.Document); } catch (Exception exp) { //MessageBox.Show(exp.ToString()); frmMain.Default.pnlDock.DocumentStyle = DocumentStyle.DockingSdi; pnlcForm.Show(frmMain.Default.pnlDock, DockState.Document); } if (noTabber) { cForm.TabController.Dispose(); } else { WindowList.Add(cForm); } return cForm; } catch (Exception ex) { MessageCollector.AddMessage(MessageClass.ErrorMsg, (string) ("Couldn\'t add panel" + Constants.vbNewLine + ex.Message)); return null; } }
/// <summary> /// Registers a control so it becomes visible as part of the main form</summary> /// <param name="control">Control to register</param> /// <param name="info">Control display information</param> /// <param name="client">Client that owns the control and will receive notifications /// about its status, or null if no notifications are needed</param> public void RegisterControl(Control control, ControlInfo info, IControlHostClient client) { if (control == null) throw new ArgumentNullException("control"); if (info == null) throw new ArgumentNullException("info"); if (FindControlInfo(control) != null) throw new ArgumentException("Control already registered"); // allow null client if (client == null) client = Global<DefaultClient>.Instance; info.Client = client; info.Control = control; info.Changed += new EventHandler(info_Changed); DockContent dockContent = new DockContent(this); UpdateDockContent(dockContent, info); m_dockContent.Add(info, dockContent); m_controls.ActiveItem = info; info.HostControl = dockContent; // Any property we set on this Control needs to be restored in UnregisterControl. // For example, QuadPanelControl was broken by setting Dock property but not restoring it. info.OriginalDock = control.Dock; control.Dock = DockStyle.Fill; dockContent.Controls.Add(control); dockContent.FormClosing += new FormClosingEventHandler(dockContent_FormClosing); if (IsCenterGroup(info.Group)) { dockContent.Show(m_dockPanel, DockState.Document); RegisterMenuCommand(control, "@" + dockContent.Text); // tells m_commandService not to interpret slashes as submenus } else { DockState state; switch (info.Group) { case StandardControlGroup.Left: state = DockState.DockLeft; break; case StandardControlGroup.Right: state = DockState.DockRight; break; case StandardControlGroup.Top: state = DockState.DockTop; break; case StandardControlGroup.Bottom: state = DockState.DockBottom; break; case StandardControlGroup.Floating: state = DockState.Float; break; default: state = DockState.DockLeftAutoHide; break; } dockContent.Show(m_dockPanel, state); RegisterMenuCommand(control, dockContent.Text); // tells m_commandService not to interpret slashes as submenus } UpdateContent(control); ActivateClient(client, true); Show(control); }
public static void Show(Type WindowType, PortScanMode PortScanMode = PortScanMode.Normal) { try { switch (WindowType) { case Type.About: if (aboutForm == null || aboutPanel == null | aboutPanel.VisibleState==DockState.Unknown) { aboutForm = new About(aboutPanel); aboutPanel = aboutForm; aboutForm.Show(frmMain.Default.pnlDock); } else { aboutPanel.Focus(); aboutPanel.Show(); aboutPanel.BringToFront(); aboutForm.Focus(); } break; case Type.ADImport: adimportForm = new ADImport(adimportPanel); adimportPanel = adimportForm; adimportPanel.Show(frmMain.Default.pnlDock); break; case Type.Options: optionsForm = new frmOptions(optionsPanel); optionsForm.Show(frmMain.Default.pnlDock); break; case Type.SaveAs: saveasForm = new SaveAs(saveasPanel); saveasPanel = saveasForm; saveasForm.Show(frmMain.Default.pnlDock); break; case Type.SSHTransfer: sshtransferForm = new SSHTransfer(sshtransferPanel); sshtransferPanel = sshtransferForm; sshtransferForm.Show(frmMain.Default.pnlDock); break; case Type.Update: if (updateForm == null || updatePanel == null || updatePanel.VisibleState == DockState.Unknown) { updateForm = new UI.Window.Update(updatePanel); updatePanel = updateForm; updateForm.Show(frmMain.Default.pnlDock); } else { updatePanel.Focus(); updatePanel.Show(); updatePanel.BringToFront(); updateForm.Focus(); } break; case Type.Help: helpForm = new Help(helpPanel); helpPanel = helpForm; helpForm.Show(frmMain.Default.pnlDock); break; case Type.ExternalApps: if (externalappsForm == null || externalappsPanel == null || externalappsPanel.VisibleState == DockState.Unknown) { externalappsForm = new ExternalApps(externalappsPanel); externalappsPanel = externalappsForm; externalappsForm.Show(frmMain.Default.pnlDock); } else { externalappsPanel.Focus(); externalappsPanel.Show(); externalappsPanel.BringToFront(); externalappsForm.Focus(); } break; case Type.PortScan: portscanForm = new PortScan(portscanPanel, PortScanMode); portscanPanel = portscanForm; portscanForm.Show(frmMain.Default.pnlDock); break; case Type.UltraVNCSC: ultravncscForm = new UltraVNCSC(ultravncscPanel); ultravncscPanel = ultravncscForm; ultravncscForm.Show(frmMain.Default.pnlDock); break; case Type.ComponentsCheck: if (componentscheckForm == null || componentscheckPanel == null || componentscheckPanel.VisibleState == DockState.Unknown) { componentscheckForm = new ComponentsCheck(componentscheckPanel); componentscheckPanel = componentscheckForm; componentscheckForm.Show(frmMain.Default.pnlDock); } else { componentscheckPanel.Focus(); componentscheckPanel.Show(); componentscheckPanel.BringToFront(); componentscheckForm.Focus(); } break; case Type.Announcement: AnnouncementForm = new UI.Window.Announcement(AnnouncementPanel); AnnouncementPanel = AnnouncementForm; AnnouncementForm.Show(frmMain.Default.pnlDock); break; case Type.ConnectionStatus: connectionStatusForm = new ConnectionStatusForm(); componentscheckPanel = connectionStatusForm; connectionStatusForm.Show(frmMain.Default.pnlDock); break; case Type.QuickText: if (quicktextPanel != null && (quicktextForm == null || quicktextPanel == null | quicktextPanel.VisibleState == DockState.Unknown)) { quicktextForm = new QuickTextEdit(quicktextPanel); quicktextPanel = quicktextForm; quicktextForm.Show(frmMain.Default.pnlDock); } else { quicktextPanel.Focus(); quicktextPanel.Show(); quicktextPanel.BringToFront(); quicktextForm.Focus(); } break; } } catch (Exception ex) { MessageCollector.AddMessage(MessageClass.ErrorMsg, (string) ("Show (Runtime.Windows) failed" + Constants.vbNewLine + ex.Message), true); } }
/// <summary> /// 添加视图对象到主容器 /// </summary> /// <param name="content">视图窗口对象</param> public void AddFrmView(WeifenLuo.WinFormsUI.Docking.DockContent content) { content.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.Document); }
private void UI_SetupDocks() { m_PreviewPanel = Helpers.WrapDockContent(dockPanel, renderToolstripContainer, "Current"); m_PreviewPanel.DockState = DockState.Document; m_PreviewPanel.AllowEndUserDocking = false; m_PreviewPanel.Show(); m_PreviewPanel.CloseButton = false; m_PreviewPanel.CloseButtonVisible = false; m_PreviewPanel.DockHandler.TabPageContextMenuStrip = tabContextMenu; dockPanel.ActiveDocumentChanged += new EventHandler(dockPanel_ActiveDocumentChanged); var w3 = Helpers.WrapDockContent(dockPanel, roPanel, "Inputs"); w3.DockAreas &= ~DockAreas.Document; w3.DockState = DockState.DockRight; w3.Show(); w3.CloseButton = false; w3.CloseButtonVisible = false; var w5 = Helpers.WrapDockContent(dockPanel, rwPanel, "Outputs"); w5.DockAreas &= ~DockAreas.Document; w5.DockState = DockState.DockRight; w5.Show(w3.Pane, w3); w5.CloseButton = false; w5.CloseButtonVisible = false; m_TexlistDockPanel = Helpers.WrapDockContent(dockPanel, texlistContainer, "Texture List"); m_TexlistDockPanel.DockAreas &= ~DockAreas.Document; m_TexlistDockPanel.DockState = DockState.DockLeft; m_TexlistDockPanel.Hide(); m_TexlistDockPanel.HideOnClose = true; var w4 = Helpers.WrapDockContent(dockPanel, pixelContextPanel, "Pixel Context"); w4.DockAreas &= ~DockAreas.Document; w4.Show(w3.Pane, DockAlignment.Bottom, 0.3); w4.CloseButton = false; w4.CloseButtonVisible = false; }
private void LoadTemplates() { TreeView tbTemp = new TreeView(); tbTemp.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tbTemp_NodeMouseDoubleClick); //模板 TreeNode tmpNode = new TreeNode("模板"); int i = 0; foreach (var item in UIs) { item.Name = string.Format("TempUI_{0}", i); TreeNode node = new TreeNode(item.ToString()); node.Tag = item; tmpNode.Nodes.Add(node); i++; } tbTemp.Nodes.Add(tmpNode); tmpNode.Expand(); //工具 TreeNode toolNode = new TreeNode("工具"); i = 0; foreach (var item in ToolUIs) { item.Name = string.Format("Tool_{0}", i); TreeNode node = new TreeNode(item.ToString()); node.Tag = item; toolNode.Nodes.Add(node); i++; } tbTemp.Nodes.Add(toolNode); toolNode.Expand(); DockContent dc2 = new DockContent(); dc2.CloseButtonVisible = false; dc2.Text = "工具"; tbTemp.Dock = DockStyle.Fill; dc2.Controls.Add(tbTemp); dc2.Show(this.dockPanel, DockState.DockLeft); }
private DockContent ShowVariables() { if (m_VariablesDock != null) { m_VariablesDock.Show(); return m_VariablesDock; } m_VariablesDock = Helpers.WrapDockContent(dockPanel, variableBox); m_VariablesDock.HideOnClose = true; if (m_ConstantsDock != null) { m_VariablesDock.Show(m_ConstantsDock.Pane, DockAlignment.Right, 0.5); } else { m_VariablesDock.Show(dockPanel, DockState.DockBottom); } return m_VariablesDock; }
private void ShowDockContent(DockContent dockContent, ControlInfo info) { if (info == null) { dockContent.Show(m_dockPanel); return; } DockState state; if (IsCenterGroup(info.Group)) { if (dockContent.DockHandler.IsFloat) state = DockState.Float; else state = DockState.Document; } else { switch (info.Group) { case StandardControlGroup.Left: state = DockState.DockLeft; break; case StandardControlGroup.Right: state = DockState.DockRight; break; case StandardControlGroup.Top: state = DockState.DockTop; break; case StandardControlGroup.Bottom: state = DockState.DockBottom; break; case StandardControlGroup.Floating: state = DockState.Float; break; default: state = DockState.DockLeftAutoHide; break; } } if (dockContent.GroupTag != null && state != DockState.Float) { // try floating window first to see if there is a match foreach (var floatWindow in m_dockPanel.FloatWindows) { foreach (var pane in floatWindow.VisibleNestedPanes) { if (pane.GroupTag == dockContent.GroupTag) { state = DockState.Float; } } } } dockContent.Show(m_dockPanel, state); if (!info.VisibleByDefault) dockContent.Hide(); }
private void tbTemp_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Tag is UserControl) { Type tp = e.Node.Tag.GetType(); var item = Activator.CreateInstance(tp) as UserControl; DockContent dc = new DockContent(); dc.Text = item.ToString(); item.Dock = DockStyle.Fill; dc.Controls.Add(item); dc.Show(this.dockPanel, DockState.Document); } }
public static void ShowDock(DockContent dock, DockPane pane, DockAlignment align, double proportion) { dock.FormClosed += new FormClosedEventHandler(dock_FormClosed); if (m_Docks.Count > 0) dock.Show(m_Docks[0].Pane, m_Docks[0]); else dock.Show(pane, align, proportion); m_Docks.Add(dock); }
void AddWindowToDockPanel(DockContent dc, DockPanel dp, DockStyle dockStyle, DockState dockState, bool isFloat, DockPane dockToPane, int ind) { if (dc.Visible && dc.Pane != null) return; if (dp.DocumentStyle == DocumentStyle.SystemMdi) { dc.MdiParent = this; dc.Show(); } else { dc.Show(dp); } if (dockToPane != null) if (ind == int.MaxValue) dc.Pane.DockTo(dockToPane, dockStyle, dockToPane.Contents.Count - 1); else dc.Pane.DockTo(dockToPane, dockStyle, ind); dc.DockState = dockState; dc.IsFloat = isFloat; }
public void ShowDockContent(DockContent content, DockContent defaultDock) { try { content.FormClosing += new FormClosingEventHandler(content_FormClosing); List<DockContent> typeList; Type type = content.GetType(); if (!DockContents.TryGetValue(type, out typeList)) { typeList = new List<DockContent>(); DockContents.Add(type, typeList); } typeList.Add(content); var handler = DockContentAdded; if (handler != null) { handler(this, new DockContentEventArgs(content)); } if (defaultDock == null) { content.Show(this.dockPanel, DockState.Float); } else { content.Show(defaultDock.Pane, null); if (((defaultDock == DockFiles) || (defaultDock == DockEditors)) && !defaultDock.IsHidden) { defaultDock.Hide(); } } } catch (Exception ex) { Utility.ReportException(ex); } }
internal void ShowContent(DockContent dc, bool activate) { if (activate || dc.Pane == null) dc.Show(); else { IDockContent a = dc.Pane.ActiveContent; dc.Show(); if (a != null) dc.Pane.ActiveContent = a; } }
/// <summary> /// 子フォームを表示します。既に表示されている場合はフォームをある点に移動します。(失踪対策) /// </summary> /// <param name="form"></param> private void ShowForm( DockContent form ) { if ( form.IsFloat && form.Visible ) { form.FloatPane.FloatWindow.Location = new Point( 128, 128 ); } form.Show( MainDockPanel ); }
public void AddPanel(DockContent frm) { frm.Show(this.MainDockPanel); frm.Focus(); }