public UserControlCommonBase PopOut(PanelInformation.PanelIDs selected) { Forms.UserControlForm tcf = usercontrolsforms.NewForm(); tcf.Icon = Properties.Resources.edlogo_3mo_icon; UserControlCommonBase ctrl = PanelInformation.Create(selected); PanelInformation.PanelInfo poi = PanelInformation.GetPanelInfoByPanelID(selected); if (ctrl != null && poi != null) { int numopened = usercontrolsforms.CountOf(ctrl.GetType()) + 1; string windowtitle = poi.WindowTitle + " " + ((numopened > 1) ? numopened.ToString() : ""); string refname = poi.WindowRefName + numopened.ToString(); System.Diagnostics.Trace.WriteLine("PO:Make " + windowtitle + " ucf " + ctrl.GetType().Name); //System.Diagnostics.Debug.WriteLine("TCF init"); tcf.Init(ctrl, windowtitle, discoveryform.theme.WindowsFrame, refname, discoveryform.TopMost, poi.DefaultTransparent, discoveryform.theme.LabelColor, discoveryform.theme.SPanelColor); //System.Diagnostics.Debug.WriteLine("UCCB init of " + ctrl.GetType().Name); ctrl.Init(discoveryform, UserControls.UserControlCommonBase.DisplayNumberPopOuts + numopened - 1); discoveryform.theme.ApplyStd(tcf); // apply theming/scaling to form before shown, so that it restored back to correct position (done in UCF::onLoad) //System.Diagnostics.Debug.WriteLine("Show"); tcf.Show(); // this ends up, via Form Shown, calls LoadLayout in the UCCB. discoveryform.ActionRun(Actions.ActionEventEDList.onPopUp, null, new BaseUtils.Variables(new string[] { "PopOutName", refname, "PopOutTitle", windowtitle, "PopOutIndex", numopened.ToString() })); } return(ctrl); }
public UserControlCommonBase PopOut(PanelInformation.PanelIDs selected) { Forms.UserControlForm tcf = usercontrolsforms.NewForm(); tcf.Icon = Properties.Resources.edlogo_3mo_icon; UserControlCommonBase ctrl = PanelInformation.Create(selected); PanelInformation.PanelInfo poi = PanelInformation.GetPanelInfoByPanelID(selected); if (ctrl != null && poi != null) { int numopened = usercontrolsforms.CountOf(ctrl.GetType()) + 1; string windowtitle = poi.WindowTitle + " " + ((numopened > 1) ? numopened.ToString() : ""); string refname = poi.WindowRefName + numopened.ToString(); System.Diagnostics.Trace.WriteLine("PO:Make " + windowtitle + " ucf " + ctrl.GetType().Name); //System.Diagnostics.Debug.WriteLine("TCF init"); tcf.Init(ctrl, windowtitle, discoveryform.theme.WindowsFrame, refname, discoveryform.TopMost, poi.DefaultTransparent, discoveryform.theme.LabelColor, discoveryform.theme.SPanelColor); //System.Diagnostics.Debug.WriteLine("UCCB init of " + ctrl.GetType().Name); ctrl.Init(discoveryform, UserControls.UserControlCommonBase.DisplayNumberPopOuts + numopened - 1); //System.Diagnostics.Debug.WriteLine("Show"); tcf.Show(); // this ends up, via Form Shown, calls LoadLayout in the UCCB. if (tcf.UserControl != null) { tcf.UserControl.Font = discoveryform.theme.GetFont; // Important. Apply font autoscaling to the user control } // ApplyToForm does not apply the font to the actual UC, only // specific children controls. The TabControl in the discoveryform ends up autoscaling most stuff // the children directly attached to the discoveryform are not autoscaled discoveryform.theme.ApplyToForm(tcf); discoveryform.ActionRun(Actions.ActionEventEDList.onPopUp, null, new BaseUtils.Variables(new string[] { "PopOutName", refname, "PopOutTitle", windowtitle, "PopOutIndex", numopened.ToString() })); } return(ctrl); }