public RowControl(SplitterPanel parent) { panel = new Panel(); panel.Size = new Size(600, 27); panel.Parent = parent; panel.Dock = DockStyle.Top; panel.BringToFront(); initControl(); addSourceItems(); addModeItems(); addCycelItems(); }
private IVsWindowFrame CreateChildEditorFrame(Guid guidEditorFactory, SplitterPanel panel) { ThreadHelper.ThrowIfNotOnUIThread(); IVsUIShellOpenDocument vsUISHOD = GetService(typeof(SVsUIShellOpenDocument)) as IVsUIShellOpenDocument; IVsWindowFrame childFrame = null; IVsUIHierarchy vsUIHier; uint itemid; int fOpen; Guid guidLogEditorView = Guid.Empty; IOleServiceProvider oleServiceProvider; int hr = vsUISHOD.IsSpecificDocumentViewOpen((IVsUIHierarchy)this.vsHierarchy, this.itemid, this.fileName, ref guidEditorFactory, null, 0, out vsUIHier, out itemid, out childFrame, out fOpen); if (ErrorHandler.Succeeded(hr) && fOpen != 0) { // if already open, create a copy hr = vsUISHOD.OpenCopyOfStandardEditor(childFrame, ref guidLogEditorView, out childFrame); } else { hr = vsUISHOD.OpenDocumentViaProjectWithSpecific(fileName, (uint)__VSSPECIFICEDITORFLAGS.VSSPECIFICEDITOR_UseEditor | (uint)__VSSPECIFICEDITORFLAGS.VSSPECIFICEDITOR_DoOpen, ref guidEditorFactory, null, ref guidLogEditorView, out oleServiceProvider, out vsUIHier, out itemid, out childFrame); } if (ErrorHandler.Failed(hr)) { Debug.Fail("Failed to create/open editor!!!"); Marshal.ThrowExceptionForHR(hr); } IVsWindowFrame parentFrame = GetService(typeof(SVsWindowFrame)) as IVsWindowFrame; if (parentFrame == null) { throw new System.InvalidOperationException("could not retrieve the parent Window Frame"); } childFrame.SetProperty((int)__VSFPROPID2.VSFPROPID_ParentFrame, parentFrame); childFrame.SetProperty((int)__VSFPROPID.VSFPROPID_ViewHelper, this); childFrame.SetProperty((int)__VSFPROPID3.VSFPROPID_NotifyOnActivate, true); childFrame.SetProperty((int)__VSFPROPID5.VSFPROPID_DontAutoOpen, true); childFrame.SetProperty((int)__VSFPROPID2.VSFPROPID_ParentHwnd, panel.Handle); Guid cmdUITextEditorGuid = VSConstants.GUID_TextEditorFactory; childFrame.SetGuidProperty((int)__VSFPROPID.VSFPROPID_InheritKeyBindings, ref cmdUITextEditorGuid); return(childFrame); }
public static void DrawProcesses(SplitterPanel splitterPanel) { for (int it = 0; it < ProcessesLabels.Count; it++) { Tuple <int, int, int> label = ProcessesLabels[it]; Label newBar = new Label(); newBar.AutoSize = false; newBar.BackColor = ProcessesColors[label.Item1 - 1]; newBar.Size = new Size((label.Item3 - label.Item2) * 40, 30); newBar.Location = new Point(label.Item2 * 40, 47 + (label.Item1 - 1) * 30); splitterPanel.Controls.Add(newBar); } }
public override void InitPane(ViewsManager views, View ownerView, SplitterPanel panel, RibbonTab tab) { base.InitPane(views, ownerView, panel, tab); _views.MainForm.sourceDocuments.CurrentChanged += OnCurrentDocumentChanged; _views.MainForm.sourceRegExp.CurrentItemChanged += OnRegExpChanged; _views.MainForm.sourceColRegExp.CurrentItemChanged += OnColRegExpChanged; _browser = new ChromiumWebBrowser(); _browser.Dock = DockStyle.Fill; this.htmlPanel.Controls.Add(_browser); }
public void SplitterPanel_Name_Set_GetReturnsExpected(string value, string expected) { using var control = new SplitterPanel(null) { Name = value }; Assert.Equal(expected, control.Name); Assert.False(control.IsHandleCreated); // Get again. control.Name = value; Assert.Equal(expected, control.Name); Assert.False(control.IsHandleCreated); }
public void SplitterPanel_Parent_Set_GetReturnsExpected(Control value) { using var control = new SplitterPanel(null) { Parent = value }; Assert.Same(value, control.Parent); Assert.False(control.IsHandleCreated); // Set same. control.Parent = value; Assert.Same(value, control.Parent); Assert.False(control.IsHandleCreated); }
public void SplitterPanel_Dock_Set_GetReturnsExpected(DockStyle value) { using var control = new SplitterPanel(null) { Dock = value }; Assert.Equal(value, control.Dock); Assert.Equal(AnchorStyles.Top | AnchorStyles.Left, control.Anchor); // Set same. control.Dock = value; Assert.Equal(value, control.Dock); Assert.Equal(AnchorStyles.Top | AnchorStyles.Left, control.Anchor); }
public void SplitterPanel_Height_Set_ThrowsNotSupportedException(int value) { using var control = new SplitterPanel(null); int layoutCallCount = 0; int resizeCallCount = 0; int sizeChangedCallCount = 0; int clientSizeChangedCallCount = 0; control.Layout += (sender, e) => layoutCallCount++; control.Resize += (sender, e) => resizeCallCount++; control.SizeChanged += (sender, e) => sizeChangedCallCount++; control.ClientSizeChanged += (sender, e) => clientSizeChangedCallCount++; Assert.Throws <NotSupportedException>(() => control.Height = value); Assert.Equal(new Size(200, 100), control.ClientSize); Assert.Equal(new Rectangle(0, 0, 200, 100), control.ClientRectangle); Assert.Equal(new Rectangle(0, 0, 200, 100), control.DisplayRectangle); Assert.Equal(new Size(200, 100), control.Size); Assert.Equal(0, control.Left); Assert.Equal(200, control.Right); Assert.Equal(0, control.Top); Assert.Equal(100, control.Bottom); Assert.Equal(200, control.Width); Assert.Equal(100, control.Height); Assert.Equal(new Rectangle(0, 0, 200, 100), control.Bounds); Assert.Equal(0, layoutCallCount); Assert.Equal(0, resizeCallCount); Assert.Equal(0, sizeChangedCallCount); Assert.Equal(0, clientSizeChangedCallCount); Assert.False(control.IsHandleCreated); // Call again. Assert.Throws <NotSupportedException>(() => control.Height = value); Assert.Equal(new Size(200, 100), control.ClientSize); Assert.Equal(new Rectangle(0, 0, 200, 100), control.ClientRectangle); Assert.Equal(new Rectangle(0, 0, 200, 100), control.DisplayRectangle); Assert.Equal(new Size(200, 100), control.Size); Assert.Equal(0, control.Left); Assert.Equal(200, control.Right); Assert.Equal(0, control.Top); Assert.Equal(100, control.Bottom); Assert.Equal(200, control.Width); Assert.Equal(100, control.Height); Assert.Equal(new Rectangle(0, 0, 200, 100), control.Bounds); Assert.Equal(0, layoutCallCount); Assert.Equal(0, resizeCallCount); Assert.Equal(0, sizeChangedCallCount); Assert.Equal(0, clientSizeChangedCallCount); Assert.False(control.IsHandleCreated); }
public void SplitterPanel_AutoSizeMode_Set_GetReturnsExpected(AutoSizeMode value) { using var control = new SplitterPanel(null) { AutoSizeMode = value }; Assert.Equal(AutoSizeMode.GrowOnly, control.AutoSizeMode); Assert.False(control.IsHandleCreated); // Set same. control.AutoSizeMode = value; Assert.Equal(AutoSizeMode.GrowOnly, control.AutoSizeMode); Assert.False(control.IsHandleCreated); }
public void SplitterPanel_BorderStyle_Set_GetReturnsExpected(BorderStyle value) { using var control = new SplitterPanel(null) { BorderStyle = value }; Assert.Equal(value, control.BorderStyle); Assert.False(control.IsHandleCreated); // Set same. control.BorderStyle = value; Assert.Equal(value, control.BorderStyle); Assert.False(control.IsHandleCreated); }
public override void InitPane(ViewsManager views, View ownerView, SplitterPanel panel, RibbonTab tab) { base.InitPane(views, ownerView, panel, tab); regExpDataGridView.AutoGenerateColumns = false; regExpDataGridView.DataSource = _views.MainForm.sourceRegExp; regExpDataGridView.Tag = _views; splitter.BorderStyle = BorderStyle.Fixed3D; InitializeGridColumns(); InitializeRegExpEditor(true); }
public void SplitterPanel_Text_Set_GetReturnsExpected(string value, string expected) { using var control = new SplitterPanel(null) { Text = value }; Assert.Equal(expected, control.Text); Assert.False(control.IsHandleCreated); // Set same. control.Text = value; Assert.Equal(expected, control.Text); Assert.False(control.IsHandleCreated); }
public void control() { int i = 0; flp_display_product.Controls.Clear(); foreach (Product p in Database.productList) { string temp = p.ProductID + " " + p.Name + " " + p.Price.ToString(); if (temp == cb_search_items.Text || cb_search_items.Text == "") { // product image PictureBox pb = new PictureBox(); pb.Height = 200; pb.Width = 200; pb.SizeMode = PictureBoxSizeMode.StretchImage; pb.BackColor = Color.Black; string imgLoc = "resources/images/product_images/" + p.ProductID + ".jpg"; pb.Tag = p.ProductID; pb.ImageLocation = imgLoc; pb.Click += new System.EventHandler((o, a) => clickedTiles(pb.Tag.ToString())); // product label Label l = new Label(); l.Click += new System.EventHandler((o, a) => clickedTiles(pb.Tag.ToString())); l.Tag = p.ProductID; l.Width = 200; l.Text = "ID: " + p.ProductID + " Brand: " + p.Name + " RM " + p.Price.ToString(); // place product image and label together SplitContainer s = new SplitContainer(); s.Tag = p.ProductID; s.Click += new System.EventHandler((o, a) => clickedTiles(pb.Tag.ToString())); s.Size = new System.Drawing.Size(200, 220); s.BorderStyle = BorderStyle.FixedSingle; s.Panel1MinSize = 200; s.Panel2MinSize = 20; s.SplitterWidth = 1; s.IsSplitterFixed = true; s.Orientation = Orientation.Horizontal; SplitterPanel topPanel = s.Panel1; SplitterPanel bottomPanel = s.Panel2; topPanel.Controls.Add(pb); bottomPanel.Controls.Add(l); // place splitcontainer into flowLayoutPanel flp_display_product.Controls.Add(s); i++; } } }
public void SplitterPanel_TabIndex_Set_GetReturnsExpected(int value) { using var control = new SplitterPanel(null) { TabIndex = value }; Assert.Equal(value, control.TabIndex); Assert.False(control.IsHandleCreated); // Set same. control.TabIndex = value; Assert.Equal(value, control.TabIndex); Assert.False(control.IsHandleCreated); }
protected override void FormatControl(Control ctl) { if ((ctl.Tag != null) && (ctl.Tag.ToString().ToUpper() == Resources.Consts.NO_FORMAT)) { return; } if ((ctl is ToolStrip)) { ((ToolStrip)ctl).GripStyle = ToolStripGripStyle.Hidden; ((ToolStrip)ctl).BackColor = System.Drawing.Color.Gainsboro; ((ToolStrip)ctl).RenderMode = ToolStripRenderMode.System; foreach (ToolStripItem item in ((ToolStrip)ctl).Items) { if (((ToolStrip)ctl).Items.IndexOf(item) == 0) { item.Margin = new Padding(10, 1, 0, 2); } else { item.Margin = new Padding(0, 1, 0, 2); } } } else if ((ctl is SplitContainer)) { SplitterPanel panel = ((SplitContainer)ctl).Panel1; if ((panel.Controls.Count > 0) && (panel.Controls[0] is ToolStrip)) { ((SplitContainer)ctl).BackColor = System.Drawing.Color.Gainsboro; ((SplitContainer)ctl).FixedPanel = FixedPanel.None; ((SplitContainer)ctl).IsSplitterFixed = false; ((SplitContainer)ctl).Panel1MinSize = 36; ((SplitContainer)ctl).SplitterDistance = 36; ((SplitContainer)ctl).SplitterWidth = 1; ((SplitContainer)ctl).FixedPanel = FixedPanel.Panel1; ((SplitContainer)ctl).IsSplitterFixed = true; } else { base.FormatControl(ctl); } } else { base.FormatControl(ctl); } }
ObjectsTree CreateObjectTree(SplitterPanel panel, string name, string label) { ObjectsTree result = new ObjectsTree(name == "allObjectsTree"); result.tree.ContextMenuStrip = this.tableContextMenu; if (result.parseTree != null) { result.parseTree.ContextMenuStrip = this.parseTreeMenu; } result.Dock = System.Windows.Forms.DockStyle.Fill; result.Location = new System.Drawing.Point(0, 0); result.Name = name; result.Size = new System.Drawing.Size(300, 300); return(result); }
private void InitialiseStartPage_MiddlePanel(SplitterPanel parent, ParentForm parentForm) { parent.BackColor = Color.Silver; spContentForm = new StartPageContentForm(parent, parentForm); spWalkthroughForm = new StartPageWalkthroughForm(parent); spWhatsNewForm = new StartPageWhatsNewForm(parent); spContentForm.Visible = true; spContentForm.BringToFront(); parent.SizeChanged += delegate { spContentForm.Size = new Size(parent.Width, parent.Height); }; }
private void aWSToARMToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("AWS To ARM has not been finalized in this newer MigAz tool. Continue to use the stand alone AWS To ARM MigAz tool for AWS."); return; SplitterPanel parent = (SplitterPanel)splitContainer2.Panel1; AwsToArm awsToArm = new AwsToArm(StatusProvider, LogProvider, propertyPanel1); awsToArm.Bind(); parent.Controls.Add(awsToArm); newMigrationToolStripMenuItem.Enabled = false; closeMigrationToolStripMenuItem.Enabled = true; }
public override void MsdnNamePropertyTest() { SplitContainer splitContainer = new SplitContainer(); SplitterPanel splitterPanel = new SplitterPanel(splitContainer); AutomationElement child = GetAutomationElementFromControl(splitterPanel); Assert.AreEqual(splitterPanel.Name, child.GetCurrentPropertyValue(AutomationElementIdentifiers.NameProperty, true), "NameProperty"); splitterPanel.Name = "Unhappy splitterPanel"; Assert.AreEqual(splitterPanel.Name, child.GetCurrentPropertyValue(AutomationElementIdentifiers.NameProperty, true), "NameProperty"); }
/// <summary> /// called in ContentViewManager when a ContentViewer is attached /// </summary> public void AttachViewer(IVidget viewer, Action onShowAction) { if (viewer == null) { return; } var backend = viewer.Backend; if (backend == null) { return; } var control = backend.ToSwf(); var currentDisplayBackend = this.Frontend.CurrentDisplay.ToSwf(); SplitterPanel panel = null; if (currentDisplayBackend != control) { if (SplitContainer.Panel1.Controls.Cast <Control>().Contains(currentDisplayBackend)) { panel = SplitContainer.Panel2; } else if (SplitContainer.Panel2.Controls.Cast <Control>().Contains(currentDisplayBackend)) { panel = SplitContainer.Panel1; } } else { Trace.WriteLine("SplitViewBackend.AttachBackend: currentDisplayBackend == control"); return; } if (panel != null && !panel.Controls.Cast <Control>().Contains(control)) { panel.SuspendLayout(); panel.Controls.Clear(); panel.Controls.Add(control); control.Dock = DockStyle.Fill; panel.ResumeLayout(); } if (onShowAction != null) { onShowAction(); } }
public override void InitPane(ViewsManager views, View ownerView, SplitterPanel panel, RibbonTab tab) { base.InitPane(views, ownerView, panel, tab); _views.MainForm.sourceDocuments.CurrentChanged += OnCurrentDocumentChanged; _views.MainForm.sourceColRegExp.CurrentChanged += OnCurrentRegExpChanged; _views.MainForm.sourceColRegExp.CurrentItemChanged += OnCurrentItemChanged; _views.OnMatchNavigate += OnMatchNavigate; _views.OnFontChanged += this.OnTextBoxFontChanged; _views.OnLineSpacingChanged += this.OnLineSpacingChanged; this.OnTextBoxFontChanged(); this.OnLineSpacingChanged(); }
protected override void UpdateContentCore() { base.UpdateContentCore(); DockTarget adornedElement = base.AdornedElement as DockTarget; if (adornedElement != null) { this.DockSiteType = adornedElement.DockSiteType; SplitterItem splitterItem = adornedElement.FindAncestor <SplitterItem>(); if (splitterItem != null) { this.IsFirst = SplitterPanel.GetIsFirst(splitterItem); this.IsLast = SplitterPanel.GetIsLast(splitterItem); } } }
private void treeOptions_AfterSelect(object sender, TreeViewEventArgs e) { SplitterPanel optionPanel = splitMain.Panel2; for (Int32 i = 0; i < optionPanel.Controls.Count; i++) { if (optionPanel.Controls[i].Name.ToString() == e.Node.Tag.ToString()) { optionPanel.Controls[i].Visible = true; } else { optionPanel.Controls[i].Visible = false; } } }
public void SplitterPanel_Anchor_Set_GetReturnsExpected(AnchorStyles value, AnchorStyles expected) { using var control = new SplitterPanel(null) { Anchor = value }; Assert.Equal(expected, control.Anchor); Assert.Equal(DockStyle.None, control.Dock); Assert.False(control.IsHandleCreated); // Set same. control.Anchor = value; Assert.Equal(expected, control.Anchor); Assert.Equal(DockStyle.None, control.Dock); Assert.False(control.IsHandleCreated); }
public static void AddTimeLabelsOnChart(SplitterPanel splitterPanel) { int itStop = Global.Scheduler.KeyTimes.Count - 1; for (int it = 0; it < itStop; it++) { var newTimeLabel = new Label(); newTimeLabel.AutoSize = false; newTimeLabel.Size = new Size(40, 42); newTimeLabel.Location = new Point(it * 40, 0); newTimeLabel.Text = it.ToString(); newTimeLabel.TextAlign = ContentAlignment.MiddleLeft; newTimeLabel.BorderStyle = BorderStyle.FixedSingle; splitterPanel.Controls.Add(newTimeLabel); } }
public override void InitPane(ViewsManager views, View ownerView, SplitterPanel panel, RibbonTab tab) { try { base.InitPane(views, ownerView, panel, tab); if (!Cef.IsInitialized) { Cef.Initialize(new CefSettings()); } } catch (Exception ex) { MainForm.ShowExceptionMessage(ex); } }
public ThumbListLoader(List <String> _fileNames, SplitterPanel _panel, VideoFile _PlayerServer) { m_FileNames = _fileNames; m_Panel = _panel; m_VideoFile = _PlayerServer; m_iTotalFilesToLoad = _fileNames.Count; m_InfosThumbnailQueue = new List <InfosThumbnail>(); m_bgThumbsLoader = new BackgroundWorker(); m_bgThumbsLoader.WorkerReportsProgress = true; m_bgThumbsLoader.WorkerSupportsCancellation = true; m_bgThumbsLoader.DoWork += new DoWorkEventHandler(bgThumbsLoader_DoWork); m_bgThumbsLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgThumbsLoader_RunWorkerCompleted); m_bgThumbsLoader.ProgressChanged += new ProgressChangedEventHandler(bgThumbsLoader_ProgressChanged); }
private void DestroySplitterPanel(SplitterPanel panel) { var child = panel.Controls[0]; if (child is SplitContainer) { var container = child as SplitContainer; DestroySplitterPanel(container.Panel1); DestroySplitterPanel(container.Panel2); } else { (child as IDestroyable)?.Destroy(); Views.Remove(child); } }
private void ResetPermissions(SplitterPanel splitPanel) { foreach (Panel panel in splitPanel.Controls.OfType <Panel>()) { panel.BackColor = Color.DarkGray; TextBox privLabel = (TextBox)Helper.FindByTagEndsWith(panel, "Label"); privLabel.BackColor = Color.DarkGray; privLabel.Text = ""; var flow = Helper.FindByTagEndsWith(panel, "Flow") as FlowLayoutPanel; if (flow != null) { flow.Controls.Clear(); } } }
public static void AddProcessesLabelsOnChart(SplitterPanel splitterPanel) { int itStop = Global.Scheduler.ProcessesList.Count; for (int it = 0; it < itStop; it++) { var newProcessLabel = new Label(); newProcessLabel.AutoSize = false; newProcessLabel.Size = new Size(47, 30); newProcessLabel.Location = new Point(0, it * 30); newProcessLabel.Text = "P" + it.ToString(); newProcessLabel.TextAlign = ContentAlignment.MiddleLeft; newProcessLabel.BorderStyle = BorderStyle.FixedSingle; splitterPanel.Controls.Add(newProcessLabel); } }