/// <summary> /// This function unchecks all the main tabs (except for the one specified) /// </summary> private void UncheckTabs(ctlTitle seltitle) { if (ctlTitle3dView != seltitle) ctlTitle3dView.Checked = false; if (ctlTitleViewSlice != seltitle) ctlTitleViewSlice.Checked = false; if (ctlTitleViewControls != seltitle) ctlTitleViewControls.Checked = false; if (ctlTitleConfigure != seltitle) ctlTitleConfigure.Checked = false; seltitle.Checked = true; }
Control CreateTabItem(GuiLayout gl, FlowLayoutPanel flp) { Control shownControl = null; if (gl.subLayouts.Count == 1) { shownControl = CreateLayoutRecurse(gl.subLayouts[0]); } else { shownControl = new Panel(); //shownControl.Name = gl.name + "-Content"; //AddControl(shownControl); //Controls[shownControl.Name] = shownControl; CreateSublayouts(gl, shownControl); AddLayoutControl(gl.name + "-Content", shownControl); } if (shownControl == null) return null; shownControl.Dock = DockStyle.Fill; shownControl.Visible = gl.isSelected.IsExplicit() && gl.isSelected; Control tabctl = null; if (gl.control.IsExplicit() && !guiConf.PreviewMode) tabctl = GetControlOrButton(gl.control); if (tabctl == null) { string cmd = String.Format("GMActivateTab {0} {1}", gl.name, shownControl.Name); if (!gl.text.IsExplicit()) { // if no text, create image button AddButton(gl.name, new ctlImageButton()); ctlImageButton butt = Buttons[gl.name]; butt.BringToFront(); if (gl.image.IsExplicit()) { butt.GLImage = gl.image; butt.Image = guiConf.GetImage(gl.image, null); } butt.OnClickCallback = cmd; tabctl = butt; } else { // text valid, create title control ctlTitle ttl = new ctlTitle(); ttl.Image = guiConf.GetImage(gl.image, null); ttl.Text = gl.text; ttl.Name = gl.name; ttl.OnClickCallback = cmd; ttl.CheckImage = guiConf.GetImage("buttChecked", null); ttl.Size = new Size(180, 40); Controls[gl.name] = ttl; tabctl = ttl; } CheckTab(tabctl, gl.isSelected.IsExplicit() && gl.isSelected); } AddLayoutControl(gl.name, tabctl); flp.Controls.Add(tabctl); return shownControl; }
public tabview(string name, ctlTitle title, Control pcontrol) { m_name = name; m_title = title; m_panel = pcontrol; m_tabidx = idxgen++; }
Control CreateTabItem(GuiLayout gl, FlowLayoutPanel flp) { Control shownControl = null; if (gl.subLayouts.Count == 1) { shownControl = CreateLayoutRecurse(gl.subLayouts[0]); } else { shownControl = new Panel(); shownControl.Name = gl.name + "Content"; //AddControl(shownControl); Controls[shownControl.Name] = shownControl; CreateSublayouts(gl, shownControl); } if (shownControl == null) { return(null); } shownControl.Dock = DockStyle.Fill; shownControl.Visible = gl.isSelected.IsExplicit() && gl.isSelected; Control tabctl = null; if (gl.control.IsExplicit()) { tabctl = GetControlOrButton(gl.control); } if (tabctl == null) { string cmd = String.Format("GMActivateTab {0} {1}", gl.name, shownControl.Name); if (!gl.text.IsExplicit()) { // if no text, create image button AddButton(gl.name, new ctlImageButton()); ctlImageButton butt = Buttons[gl.name]; butt.BringToFront(); if (gl.image.IsExplicit()) { butt.GLImage = gl.image; butt.Image = guiConf.GetImage(gl.image, null); } butt.OnClickCallback = cmd; tabctl = butt; } else { // text valid, create title control ctlTitle ttl = new ctlTitle(); ttl.Image = guiConf.GetImage(gl.image, null); ttl.Text = gl.text; ttl.Name = gl.name; ttl.OnClickCallback = cmd; ttl.CheckImage = guiConf.GetImage("buttChecked", null); ttl.Size = new Size(180, 40); Controls[gl.name] = ttl; tabctl = ttl; } CheckTab(tabctl, gl.isSelected.IsExplicit() && gl.isSelected); } flp.Controls.Add(tabctl); return(shownControl); }
public void AddTabView(string name, ctlTitle title, Control view) { m_lsttabs.Add(new tabview(name, title, view)); }