/// <summary> /// 选择 /// </summary> /// <param name="treeNodeCollection"></param> /// <param name="isChecked"></param> public static void Checked(TriStateTreeView tstv, bool isChecked) { foreach (TriStateTreeNode node in tstv.Nodes) { node.Checked = isChecked; } tstv.Refresh(); }
public static List <T> GetAllCheckedNodes(TriStateTreeView tree) { List <T> checkedNodes = new List <T>(); foreach (T node in tree.Nodes) { GetCheckedTreeNode(node, checkedNodes); } return(checkedNodes); }
public static List <TreeNode> GetAllNodes(this TriStateTreeView _self) { List <TreeNode> result = new List <TreeNode>(); foreach (TreeNode child in _self.Nodes) { result.AddRange(GetSubNodes(child)); } return(result); }
public override void TestSetup() { base.TestSetup(); m_listOfChecks = new SortedList <ScrCheckKey, IScriptureCheck>(); m_bookFilter = Cache.ServiceLocator.GetInstance <IFilteredScrBookRepository>().GetFilterInstance(m_filterInstance); m_editChecksControl = new EditorialChecksControl( Cache, null, m_bookFilter, "Dummy Caption", "Dummy Project", null, null); m_checksTree = ReflectionHelper.GetField( m_editChecksControl, "m_availableChecksTree") as TriStateTreeView; }
public override void Initialize() { m_inMemoryCache = null; base.Initialize(); m_inMemoryCache.InitializeAnnotationDefs(); m_listOfChecks = new SortedList <ScrCheckKey, IScriptureCheck>(); m_bookFilter = new FilteredScrBooks(Cache, m_filterInstance); m_editChecksControl = new EditorialChecksControl( m_scrInMemoryCache.Cache, m_bookFilter, "Dummy Caption", "Dummy Project", null); m_checksTree = ReflectionHelper.GetField( m_editChecksControl, "m_availableChecksTree") as TriStateTreeView; }
public static TriStateTreeNode GetNodeByName(string name, TriStateTreeView treeview, bool ignoreCase) { TriStateTreeNode findNode = null; foreach (TriStateTreeNode node in treeview.Nodes) { findNode = GetNodeByName(name, node, ignoreCase); if (findNode != null) { break; } } return(findNode); }
public static void SetImageList(TriStateTreeView treeview, System.Windows.Forms.ImageList imageList, int selectedImageIndex = -1, int dirImageIndex = 0, int fileImageIndex = 1, int expandImageIndex = 2, int indexUnchecked = 3, int indexIndeterminate = 4, int indexChecked = 5) { treeview.ImageList = imageList; try { treeview.SelectedImageIndex = selectedImageIndex; treeview.DirImageIndex = dirImageIndex; treeview.FileImageIndex = fileImageIndex; treeview.ExpandImageIndex = expandImageIndex; treeview.UncheckedImageIndex = indexUnchecked; treeview.IndeterminateImageIndex = indexIndeterminate; treeview.CheckedImageIndex = indexChecked; treeview.Refresh(); } catch { } }
//remove public List<string> GetCheckedNodes(TreeNodeCollection nodes, TriStateTreeView list) { List<string> nodeList = new List<string>(); if (nodes == null) { return nodeList; } foreach (TreeNode childNode in nodes) { if (list.GetChecked(childNode) == TriStateTreeView.CheckState.Checked) { nodeList.Add(childNode.Text); } nodeList.AddRange(GetCheckedNodes(childNode.Nodes, list)); } return nodeList; }
private void Initialize() { this.InitializeComponent(); base.MaximizeBox = false; base.MinimizeBox = false; base.FormBorderStyle = FormBorderStyle.FixedDialog; this.txtName = this.xmlComponentLoader1.GetControlByName <AisinoTXT>("txtName"); this.txtDesc = this.xmlComponentLoader1.GetControlByName <AisinoTXT>("txtDesc"); this.tvFunc = this.xmlComponentLoader1.GetControlByName <TriStateTreeView>("tvFunc"); this.btnOK = this.xmlComponentLoader1.GetControlByName <AisinoBTN>("btnOK"); this.btnCancel = this.xmlComponentLoader1.GetControlByName <AisinoBTN>("btnCancel"); this.tvFunc.CheckBoxes = true; this.txtName.KeyPress += new KeyPressEventHandler(this.txtName_KeyPress); this.txtName.TextChanged += new EventHandler(this.txtName_TextChanged); this.txtDesc.TextChanged += new EventHandler(this.txtDesc_TextChanged); this.btnOK.Click += new EventHandler(this.btnOK_Click); this.btnCancel.Click += new EventHandler(this.btnCancel_Click); }
//remove public List <string> GetCheckedNodes(TreeNodeCollection nodes, TriStateTreeView list) { List <string> nodeList = new List <string>(); if (nodes == null) { return(nodeList); } foreach (TreeNode childNode in nodes) { if (list.GetChecked(childNode) == TriStateTreeView.CheckState.Checked) { nodeList.Add(childNode.Text); } nodeList.AddRange(GetCheckedNodes(childNode.Nodes, list)); } return(nodeList); }
private void Initialize() { this.InitializeComponent(); base.MaximizeBox = false; base.MinimizeBox = false; base.FormBorderStyle = FormBorderStyle.FixedDialog; this.txtRoleCreateDate = this.xmlComponentLoader1.GetControlByName <AisinoTXT>("txtRoleCreateDate"); this.txtRoleCreator = this.xmlComponentLoader1.GetControlByName <AisinoTXT>("txtRoleCreator"); this.txtRoleDesc = this.xmlComponentLoader1.GetControlByName <AisinoTXT>("txtRoleDesc"); this.txtRoleName = this.xmlComponentLoader1.GetControlByName <AisinoTXT>("txtRoleName"); this.tvRole = this.xmlComponentLoader1.GetControlByName <AisinoTVW>("tvRole"); this.tvRolePerm = this.xmlComponentLoader1.GetControlByName <TriStateTreeView>("tvRolePerm"); this.tsbtnNewRole = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("tsbtnNewRole"); this.tsbtnNewRole.ToolTipText = "新增角色"; this.tsbtnUpdRole = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("tsbtnUpdRole"); this.tsbtnUpdRole.ToolTipText = "修改角色"; this.tsbtnDelRole = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("tsbtnDelRole"); this.tsbtnDelRole.ToolTipText = "删除角色"; this.tsBtnCancel = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("tsBtnCancel"); this.tsBtnSave = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("tsBtnSave"); this.txtRoleName.KeyPress += new KeyPressEventHandler(this.txtRoleName_KeyPress); this.txtRoleDesc.KeyPress += new KeyPressEventHandler(this.txtRoleDesc_KeyPress); this.txtRoleName.TextChanged += new EventHandler(this.txtRoleName_TextChanged); this.txtRoleDesc.TextChanged += new EventHandler(this.txtRoleDesc_TextChanged); this.tvRole.HideSelection = false; this.tvRolePerm.CheckBoxes = true; this.tsBtnSave.Alignment = ToolStripItemAlignment.Right; this.tsBtnCancel.Alignment = ToolStripItemAlignment.Right; this.tsbtnNewRole.Image = Resources.group_add; this.tsbtnUpdRole.Image = Resources.group_edit; this.tsbtnDelRole.Image = Resources.group_delete; this.tsBtnCancel.Image = Resources.cancel; this.tsBtnSave.Image = Resources.accept; this.tsbtnNewRole.Click += new EventHandler(this.tsbtnNewRole_Click); this.tsbtnUpdRole.Click += new EventHandler(this.tsbtnUpdRole_Click); this.tsbtnDelRole.Click += new EventHandler(this.tsbtnDelRole_Click); this.tvRole.BeforeSelect += new TreeViewCancelEventHandler(this.tvRole_BeforeSelect); this.tvRole.AfterSelect += new TreeViewEventHandler(this.tvRole_AfterSelect); this.tsBtnCancel.Click += new EventHandler(this.tsBtnCancel_Click); this.tsBtnSave.Click += new EventHandler(this.tsBtnSave_Click); }
public void InitialControlCollection() { TriStateTreeView triStateTreeView = new TriStateTreeView(); triStateTreeView.Name = "geoTree"; TriStateTreeView triStateTreeView2 = new TriStateTreeView(); triStateTreeView2.Name = "homeTree"; TriStateTreeView triStateTreeView3 = new TriStateTreeView(); triStateTreeView3.Name = "editTree"; TriStateTreeView triStateTreeView4 = new TriStateTreeView(); triStateTreeView4.Name = "wizardTree"; this.m_ToolStripPanel = new ToolStripPanel(); this.m_ToolStrips = new List <FloatingToolStrip>(); this.MenuItems = new List <IMenuItemOperation>(); this.m_TreeTypeToTreeView = new Dictionary <ProjectExplorerTree, ITriStateTreeViewContorller>(); this.m_TreeTypeToTreeView.Add(ProjectExplorerTree.Edit, triStateTreeView3); this.m_TreeTypeToTreeView.Add(ProjectExplorerTree.Geo, triStateTreeView); this.m_TreeTypeToTreeView.Add(ProjectExplorerTree.Home, triStateTreeView2); this.m_TreeTypeToTreeView.Add(ProjectExplorerTree.Wizard, triStateTreeView4); }
public static void getStatus(System.Windows.Forms.TreeViewEventArgs e) { TriStateTreeView t = new TriStateTreeView(); t.OnAfterCheck(e); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> /// ------------------------------------------------------------------------------------ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.Label label1; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SaveVersionDialog)); System.Windows.Forms.Button m_btnCancel; System.Windows.Forms.Button m_btnHelp; System.Windows.Forms.Label label2; this.m_btnOk = new System.Windows.Forms.Button(); this.m_treeView = new SIL.FieldWorks.Common.Controls.TriStateTreeView(); this.m_description = new System.Windows.Forms.TextBox(); label1 = new System.Windows.Forms.Label(); m_btnCancel = new System.Windows.Forms.Button(); m_btnHelp = new System.Windows.Forms.Button(); label2 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label1 // resources.ApplyResources(label1, "label1"); label1.Name = "label1"; // // m_btnCancel // resources.ApplyResources(m_btnCancel, "m_btnCancel"); m_btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; m_btnCancel.Name = "m_btnCancel"; // // m_btnHelp // resources.ApplyResources(m_btnHelp, "m_btnHelp"); m_btnHelp.Name = "m_btnHelp"; m_btnHelp.Click += new System.EventHandler(this.m_btnHelp_Click); // // label2 // resources.ApplyResources(label2, "label2"); label2.Name = "label2"; // // m_btnOk // resources.ApplyResources(this.m_btnOk, "m_btnOk"); this.m_btnOk.Name = "m_btnOk"; this.m_btnOk.Click += new System.EventHandler(this.OnOk); // // m_treeView // resources.ApplyResources(this.m_treeView, "m_treeView"); this.m_treeView.ItemHeight = 16; this.m_treeView.Name = "m_treeView"; this.m_treeView.NodeCheckChanged += new System.EventHandler(this.m_treeView_NodeCheckChanged); // // m_description // resources.ApplyResources(this.m_description, "m_description"); this.m_description.Name = "m_description"; // // SaveVersionDialog // this.AcceptButton = this.m_btnOk; resources.ApplyResources(this, "$this"); this.CancelButton = m_btnCancel; this.Controls.Add(this.m_description); this.Controls.Add(label2); this.Controls.Add(this.m_treeView); this.Controls.Add(m_btnHelp); this.Controls.Add(m_btnCancel); this.Controls.Add(this.m_btnOk); this.Controls.Add(label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "SaveVersionDialog"; this.ShowInTaskbar = false; this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.axRenderControl1 = new Gvitech.CityMaker.Controls.AxRenderControl(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.treeView1 = new ProjectTree.TriStateTreeView(); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStripButtonSaveProject = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonPackProject = new System.Windows.Forms.ToolStripButton(); this.helpProvider1 = new System.Windows.Forms.HelpProvider(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.ToolStripMenuItemRename = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItemCreateComplexParticleEffect = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItemCreateRenderPolyline = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItemEditPolyline = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripButtonSelect = new System.Windows.Forms.ToolStripButton(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // // axRenderControl1 // this.axRenderControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.axRenderControl1.Enabled = true; this.axRenderControl1.Location = new System.Drawing.Point(141, 3); this.axRenderControl1.Name = "axRenderControl1"; this.axRenderControl1.Size = new System.Drawing.Size(585, 516); this.axRenderControl1.TabIndex = 0; // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.93491F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 81.06509F)); this.tableLayoutPanel1.Controls.Add(this.axRenderControl1, 1, 0); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(729, 522); this.tableLayoutPanel1.TabIndex = 1; // // tableLayoutPanel2 // this.tableLayoutPanel2.ColumnCount = 1; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.Controls.Add(this.treeView1, 0, 1); this.tableLayoutPanel2.Controls.Add(this.toolStrip1, 0, 0); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; this.tableLayoutPanel2.RowCount = 2; this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.Size = new System.Drawing.Size(132, 516); this.tableLayoutPanel2.TabIndex = 1; // // treeView1 // this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; this.treeView1.ImageIndex = 0; this.treeView1.ImageList = this.imageList1; this.treeView1.Location = new System.Drawing.Point(3, 33); this.treeView1.Name = "treeView1"; this.treeView1.SelectedImageIndex = 0; this.treeView1.Size = new System.Drawing.Size(126, 480); this.treeView1.TabIndex = 2; this.treeView1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.treeView1_MouseClick); // // imageList1 // this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; this.imageList1.Images.SetKeyName(0, "group.png"); this.imageList1.Images.SetKeyName(1, "node.png"); this.imageList1.Images.SetKeyName(2, "Tree.png"); // // toolStrip1 // this.toolStrip1.Dock = System.Windows.Forms.DockStyle.Fill; this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripButtonSaveProject, this.toolStripButtonPackProject, this.toolStripButtonSelect}); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(132, 30); this.toolStrip1.TabIndex = 3; this.toolStrip1.Text = "toolStrip1"; // // toolStripButtonSaveProject // this.toolStripButtonSaveProject.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripButtonSaveProject.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonSaveProject.Image"))); this.toolStripButtonSaveProject.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonSaveProject.Name = "toolStripButtonSaveProject"; this.toolStripButtonSaveProject.Size = new System.Drawing.Size(60, 27); this.toolStripButtonSaveProject.Text = "保存工程"; this.toolStripButtonSaveProject.Click += new System.EventHandler(this.toolStripButtonSaveProject_Click); // // toolStripButtonPackProject // this.toolStripButtonPackProject.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripButtonPackProject.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonPackProject.Image"))); this.toolStripButtonPackProject.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonPackProject.Name = "toolStripButtonPackProject"; this.toolStripButtonPackProject.Size = new System.Drawing.Size(36, 27); this.toolStripButtonPackProject.Text = "打包"; this.toolStripButtonPackProject.Click += new System.EventHandler(this.toolStripButtonPackProject_Click); // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ToolStripMenuItemRename, this.ToolStripMenuItemCreateComplexParticleEffect, this.ToolStripMenuItemCreateRenderPolyline, this.ToolStripMenuItemEditPolyline}); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.ShowImageMargin = false; this.contextMenuStrip1.Size = new System.Drawing.Size(148, 92); // // ToolStripMenuItemRename // this.ToolStripMenuItemRename.Name = "ToolStripMenuItemRename"; this.ToolStripMenuItemRename.Size = new System.Drawing.Size(147, 22); this.ToolStripMenuItemRename.Text = "重命名"; this.ToolStripMenuItemRename.Click += new System.EventHandler(this.ToolStripMenuItemRename_Click); // // ToolStripMenuItemCreateComplexParticleEffect // this.ToolStripMenuItemCreateComplexParticleEffect.Name = "ToolStripMenuItemCreateComplexParticleEffect"; this.ToolStripMenuItemCreateComplexParticleEffect.Size = new System.Drawing.Size(147, 22); this.ToolStripMenuItemCreateComplexParticleEffect.Text = "创建组合粒子特效"; this.ToolStripMenuItemCreateComplexParticleEffect.Click += new System.EventHandler(this.ToolStripMenuItemCreateComplexParticleEffect_Click); // // ToolStripMenuItemCreateRenderPolyline // this.ToolStripMenuItemCreateRenderPolyline.Name = "ToolStripMenuItemCreateRenderPolyline"; this.ToolStripMenuItemCreateRenderPolyline.Size = new System.Drawing.Size(147, 22); this.ToolStripMenuItemCreateRenderPolyline.Text = "创建线段"; this.ToolStripMenuItemCreateRenderPolyline.Click += new System.EventHandler(this.ToolStripMenuItemCreateRenderPolyline_Click); // // ToolStripMenuItemEditPolyline // this.ToolStripMenuItemEditPolyline.Name = "ToolStripMenuItemEditPolyline"; this.ToolStripMenuItemEditPolyline.Size = new System.Drawing.Size(147, 22); this.ToolStripMenuItemEditPolyline.Text = "编辑线段"; this.ToolStripMenuItemEditPolyline.Click += new System.EventHandler(this.ToolStripMenuItemEditPolyline_Click); // // toolStripButtonSelect // this.toolStripButtonSelect.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripButtonSelect.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonSelect.Image"))); this.toolStripButtonSelect.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonSelect.Name = "toolStripButtonSelect"; this.toolStripButtonSelect.Size = new System.Drawing.Size(36, 21); this.toolStripButtonSelect.Text = "拾取"; this.toolStripButtonSelect.Click += new System.EventHandler(this.toolStripButtonSelect_Click); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(729, 522); this.Controls.Add(this.tableLayoutPanel1); this.Name = "MainForm"; this.Load += new System.EventHandler(this.MainForm_Load); this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "ProjectTree"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.contextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); }