public DiagramControlUI() { InitializeComponent(); ClientSize = new Size(640, 480); var node0 = new DiagramControl.BoxNode("Node0") { Position = m4x4.Translation(0, 0, 0) }; var node1 = new DiagramControl.BoxNode { Text = "Node1 is really long\nand contains new lines", Position = m4x4.Translation(100, 100, 0) }; var node2 = new DiagramControl.BoxNode("Node2 - Paul Rulz") { Position = m4x4.Translation(-100, -50, 0) }; node1.Style = new DiagramControl.NodeStyle { Text = Color.Red }; m_diag.Elements.Add(node0); m_diag.Elements.Add(node1); m_diag.Elements.Add(node2); node2.Enabled = false; m_diag.DefaultConnectorStyle.Smooth = true; var conn_type = DiagramControl.Connector.EType.BiDir; m_diag.Elements.Add(new DiagramControl.Connector(node0, node1) { Type = conn_type }); m_diag.Elements.Add(new DiagramControl.Connector(node1, node2) { Type = conn_type }); m_diag.Elements.Add(new DiagramControl.Connector(node2, node0) { Type = conn_type }); var node4 = new DiagramControl.BoxNode("Node4") { PositionXY = new v2(-80, 60) }; var node5 = new DiagramControl.BoxNode("Node5") { PositionXY = new v2(80, -60) }; node4.Diagram = m_diag; node5.Diagram = m_diag; var combo = new ComboBox { DataSource = new[] { "Paul", "Was", "Here" } }; node4.EditControl = new DiagramControl.EditingControl(combo , (elem, form) => combo.SelectedItem = ((DiagramControl.Node)elem).Text , elem => ((DiagramControl.Node)elem).Text = (string)combo.SelectedItem); var conn4 = new DiagramControl.Connector(node4, node2) { Type = conn_type }; var conn5 = new DiagramControl.Connector(node5, node4) { Type = conn_type }; var conn6 = new DiagramControl.Connector(node1, node4) { Type = conn_type }; conn4.Diagram = m_diag; conn5.Diagram = m_diag; conn6.Diagram = m_diag; node5.Dispose(); node5 = null; var lbl1 = new Joypad(); lbl1.Elem = conn5; lbl1.Diagram = m_diag; m_diag.ResetView(); node0.BringToFront(); m_menu_tools_clear.Click += (s, a) => m_diag.ResetDiagram(); m_menu_tools_load.Click += (s, a) => m_diag.ImportXml(m_diag_xml, m_diag.Elements.Count != 0); m_menu_tools_save.Click += (s, a) => m_diag_xml = m_diag.ExportXml().ToString(); m_menu_tools_loadmmapdiag.Click += (s, a) => m_diag.ImportXml(XDocument.Load("\\dump\\mmap_diag.xml").Root, true); m_menu_tools_load_options.Click += (s, a) => m_diag.Options = XDocument.Load("\\dump\\diag_options.xml").Root.Element("options").As <DiagramControl.DiagramOptions>(); m_menu_tools_allowediting.Click += (s, a) => m_menu_tools_allowediting.Checked = m_diag.AllowChanges = !m_diag.AllowChanges; m_toolstripcont.TopToolStripPanel.Controls.Add(m_diag.EditToolstrip); m_diag.EditToolstrip.Visible = true; m_diag.EditToolstrip.ImageScalingSize = new Size(22, 22); m_diag.EditToolstrip.AutoSize = true; m_filter = new Filter(this); Load += (s, a) => Application.AddMessageFilter(m_filter); FormClosed += (s, a) => Application.RemoveMessageFilter(m_filter); m_diag.DiagramChanged += (s, a) => { //switch (a.ChgType) //{ //case DiagramControl.EDiagramChangeType.MoveLinkBegin: // a.Cancel = true; // break; //} }; //const string options_filepath = ; //var xml = new XDocument(); //xml.Add2(new XElement("root")).Add2("options", m_diag.Options, false); //xml.Save(options_filepath); //var tim = new System.Windows.Forms.Timer{Interval = 10}; //tim.Tick += (s,a) => // { // try // { // m_diag.Options = XDocument.Load(options_filepath).Root.Element("options").As<DiagramControl.DiagramOptions>(); // m_diag.ScatterNodes(); // } // catch (Exception) // {} // }; //tim.Start(); }
private void InitializeComponent() { this.m_cb0 = new Rylogic.Gui.WinForms.ComboBox(); this.m_lbl_cb0 = new System.Windows.Forms.Label(); this.m_lbl_selected_item = new System.Windows.Forms.Label(); this.m_tb_selected_item = new System.Windows.Forms.TextBox(); this.m_btn_read = new System.Windows.Forms.Button(); this.SuspendLayout(); // // m_cb0 // this.m_cb0.DisplayProperty = null; this.m_cb0.FormattingEnabled = true; this.m_cb0.Location = new System.Drawing.Point(152, 12); this.m_cb0.Name = "m_cb0"; this.m_cb0.PreserveSelectionThruFocusChange = false; this.m_cb0.Size = new System.Drawing.Size(167, 21); this.m_cb0.TabIndex = 0; // // m_lbl_cb0 // this.m_lbl_cb0.AutoSize = true; this.m_lbl_cb0.Location = new System.Drawing.Point(12, 9); this.m_lbl_cb0.Name = "m_lbl_cb0"; this.m_lbl_cb0.Size = new System.Drawing.Size(134, 39); this.m_lbl_cb0.TabIndex = 1; this.m_lbl_cb0.Text = "Auto complete, selected\r\nitem matches the displayed\r\ntext"; // // m_lbl_selected_item // this.m_lbl_selected_item.AutoSize = true; this.m_lbl_selected_item.Location = new System.Drawing.Point(12, 59); this.m_lbl_selected_item.Name = "m_lbl_selected_item"; this.m_lbl_selected_item.Size = new System.Drawing.Size(75, 13); this.m_lbl_selected_item.TabIndex = 2; this.m_lbl_selected_item.Text = "Selected Item:"; // // m_tb_selected_item // this.m_tb_selected_item.Location = new System.Drawing.Point(152, 56); this.m_tb_selected_item.Name = "m_tb_selected_item"; this.m_tb_selected_item.Size = new System.Drawing.Size(167, 20); this.m_tb_selected_item.TabIndex = 3; // // m_btn_read // this.m_btn_read.Location = new System.Drawing.Point(193, 82); this.m_btn_read.Name = "m_btn_read"; this.m_btn_read.Size = new System.Drawing.Size(126, 23); this.m_btn_read.TabIndex = 4; this.m_btn_read.Text = "Read Selection"; this.m_btn_read.UseVisualStyleBackColor = true; // // ComboBoxUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(331, 309); this.Controls.Add(this.m_btn_read); this.Controls.Add(this.m_tb_selected_item); this.Controls.Add(this.m_lbl_selected_item); this.Controls.Add(this.m_lbl_cb0); this.Controls.Add(this.m_cb0); this.Name = "ComboBoxUI"; this.Text = "combo_box_ui"; this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubclassedControlsUI)); Rylogic.Common.Pattern pattern1 = new Rylogic.Common.Pattern(); this.m_ts = new System.Windows.Forms.ToolStrip(); this.m_btn_test = new System.Windows.Forms.Button(); this.m_timer = new System.Windows.Forms.Timer(this.components); this.m_lbl_vb_value = new System.Windows.Forms.Label(); this.m_vb_value = new Rylogic.Gui.WinForms.ValueBox(); this.m_browse_path = new Rylogic.Gui.WinForms.BrowsePathUI(); this.m_pb = new Rylogic.Gui.WinForms.TextProgressBar(); this.m_rtb = new Rylogic.Gui.WinForms.RichTextBox(); this.m_lb = new Rylogic.Gui.WinForms.ListBox(); this.m_dtp = new Rylogic.Gui.WinForms.DateTimePicker(); this.m_cb = new Rylogic.Gui.WinForms.ComboBox(); this.m_abtn_switch = new Rylogic.Gui.WinForms.AnimCheckBox(); this.m_abtn_images = new System.Windows.Forms.ImageList(this.components); this.m_pattern_filter = new Rylogic.Gui.WinForms.PatternFilter(); this.SuspendLayout(); // // m_ts // this.m_ts.ImageScalingSize = new System.Drawing.Size(20, 20); this.m_ts.Location = new System.Drawing.Point(0, 0); this.m_ts.Name = "m_ts"; this.m_ts.Size = new System.Drawing.Size(380, 25); this.m_ts.TabIndex = 4; this.m_ts.Text = "toolStrip1"; // // m_btn_test // this.m_btn_test.Location = new System.Drawing.Point(12, 206); this.m_btn_test.Name = "m_btn_test"; this.m_btn_test.Size = new System.Drawing.Size(75, 23); this.m_btn_test.TabIndex = 5; this.m_btn_test.Text = "Test"; this.m_btn_test.UseVisualStyleBackColor = true; // // m_lbl_vb_value // this.m_lbl_vb_value.AutoSize = true; this.m_lbl_vb_value.Location = new System.Drawing.Point(245, 263); this.m_lbl_vb_value.Name = "m_lbl_vb_value"; this.m_lbl_vb_value.Size = new System.Drawing.Size(33, 13); this.m_lbl_vb_value.TabIndex = 9; this.m_lbl_vb_value.Text = "value"; // // m_vb_value // this.m_vb_value.BackColorInvalid = System.Drawing.Color.White; this.m_vb_value.BackColorValid = System.Drawing.Color.White; this.m_vb_value.CommitValueOnFocusLost = true; this.m_vb_value.ForeColorInvalid = System.Drawing.Color.Gray; this.m_vb_value.ForeColorValid = System.Drawing.Color.Black; this.m_vb_value.Location = new System.Drawing.Point(93, 260); this.m_vb_value.Name = "m_vb_value"; this.m_vb_value.Size = new System.Drawing.Size(146, 20); this.m_vb_value.TabIndex = 8; this.m_vb_value.UseValidityColours = true; this.m_vb_value.Value = null; // // m_browse_path // this.m_browse_path.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_browse_path.FileFilter = ""; this.m_browse_path.History = new string[0]; this.m_browse_path.Location = new System.Drawing.Point(12, 28); this.m_browse_path.Name = "m_browse_path"; this.m_browse_path.Padding = new System.Windows.Forms.Padding(1); this.m_browse_path.Path = ""; this.m_browse_path.Size = new System.Drawing.Size(356, 32); this.m_browse_path.TabIndex = 7; this.m_browse_path.Title = "Choose a file"; this.m_browse_path.Type = Rylogic.Gui.WinForms.BrowsePathUI.EType.OpenFile; // // m_pb // this.m_pb.ForeColor = System.Drawing.Color.Black; this.m_pb.Location = new System.Drawing.Point(93, 206); this.m_pb.Name = "m_pb"; this.m_pb.Size = new System.Drawing.Size(246, 48); this.m_pb.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.m_pb.TabIndex = 6; // // m_rtb // this.m_rtb.CaretLocation = new System.Drawing.Point(0, 0); this.m_rtb.CurrentLineIndex = 0; this.m_rtb.FirstVisibleLineIndex = 0; this.m_rtb.LineCount = 0; this.m_rtb.Location = new System.Drawing.Point(139, 92); this.m_rtb.Name = "m_rtb"; this.m_rtb.Size = new System.Drawing.Size(200, 108); this.m_rtb.TabIndex = 3; this.m_rtb.Text = ""; // // m_lb // this.m_lb.FormattingEnabled = true; this.m_lb.Location = new System.Drawing.Point(12, 92); this.m_lb.Name = "m_lb"; this.m_lb.Size = new System.Drawing.Size(121, 108); this.m_lb.TabIndex = 2; // // m_dtp // this.m_dtp.Kind = System.DateTimeKind.Unspecified; this.m_dtp.Location = new System.Drawing.Point(139, 66); this.m_dtp.MaxDate = new System.DateTime(9998, 12, 31, 0, 0, 0, 0); this.m_dtp.MinDate = new System.DateTime(1753, 1, 1, 0, 0, 0, 0); this.m_dtp.Name = "m_dtp"; this.m_dtp.Size = new System.Drawing.Size(200, 20); this.m_dtp.TabIndex = 1; this.m_dtp.Value = new System.DateTime(2015, 5, 12, 11, 41, 16, 245); // // m_cb // this.m_cb.BackColorInvalid = System.Drawing.Color.White; this.m_cb.BackColorValid = System.Drawing.Color.White; this.m_cb.CommitValueOnFocusLost = true; this.m_cb.DisplayProperty = null; this.m_cb.ForeColorInvalid = System.Drawing.Color.Gray; this.m_cb.ForeColorValid = System.Drawing.Color.Black; this.m_cb.FormattingEnabled = true; this.m_cb.Location = new System.Drawing.Point(12, 65); this.m_cb.Name = "m_cb"; this.m_cb.PreserveSelectionThruFocusChange = false; this.m_cb.Size = new System.Drawing.Size(121, 21); this.m_cb.TabIndex = 0; this.m_cb.UseValidityColours = true; this.m_cb.Value = null; // // m_abtn_switch // this.m_abtn_switch.FrameRate = 5F; this.m_abtn_switch.ImageAlign = System.Drawing.ContentAlignment.TopCenter; this.m_abtn_switch.ImageIndex = 0; this.m_abtn_switch.ImageList = this.m_abtn_images; this.m_abtn_switch.Location = new System.Drawing.Point(93, 286); this.m_abtn_switch.Name = "m_abtn_switch"; this.m_abtn_switch.Size = new System.Drawing.Size(146, 64); this.m_abtn_switch.TabIndex = 10; this.m_abtn_switch.UseVisualStyleBackColor = true; // // m_abtn_images // this.m_abtn_images.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("m_abtn_images.ImageStream"))); this.m_abtn_images.TransparentColor = System.Drawing.Color.Transparent; this.m_abtn_images.Images.SetKeyName(0, "slide_switch0.png"); this.m_abtn_images.Images.SetKeyName(1, "slide_switch1.png"); this.m_abtn_images.Images.SetKeyName(2, "slide_switch2.png"); this.m_abtn_images.Images.SetKeyName(3, "slide_switch3.png"); this.m_abtn_images.Images.SetKeyName(4, "slide_switch4.png"); // // m_pattern_filter // this.m_pattern_filter.History = new Rylogic.Common.Pattern[0]; this.m_pattern_filter.Location = new System.Drawing.Point(12, 356); this.m_pattern_filter.Name = "m_pattern_filter"; pattern1.Active = true; pattern1.Expr = ""; pattern1.IgnoreCase = false; pattern1.Invert = false; pattern1.PatnType = Rylogic.Common.EPattern.Substring; pattern1.WholeLine = false; this.m_pattern_filter.Pattern = pattern1; this.m_pattern_filter.Size = new System.Drawing.Size(356, 27); this.m_pattern_filter.TabIndex = 11; // // SubclassedControlsUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(380, 415); this.Controls.Add(this.m_pattern_filter); this.Controls.Add(this.m_abtn_switch); this.Controls.Add(this.m_lbl_vb_value); this.Controls.Add(this.m_vb_value); this.Controls.Add(this.m_browse_path); this.Controls.Add(this.m_pb); this.Controls.Add(this.m_btn_test); this.Controls.Add(this.m_ts); this.Controls.Add(this.m_rtb); this.Controls.Add(this.m_lb); this.Controls.Add(this.m_dtp); this.Controls.Add(this.m_cb); this.Name = "SubclassedControlsUI"; this.Text = "Subclassed Controls"; this.ResumeLayout(false); this.PerformLayout(); }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.m_cb_pattern = new Rylogic.Gui.WinForms.ComboBox(); this.m_btn_find_prev = new System.Windows.Forms.Button(); this.m_il = new System.Windows.Forms.ImageList(this.components); this.m_btn_find_next = new System.Windows.Forms.Button(); this.m_chk_ignore_case = new System.Windows.Forms.CheckBox(); this.m_radio_substr = new System.Windows.Forms.RadioButton(); this.m_radio_wildcard = new System.Windows.Forms.RadioButton(); this.m_radio_regexp = new System.Windows.Forms.RadioButton(); this.m_chk_invert = new System.Windows.Forms.CheckBox(); this.m_tt = new System.Windows.Forms.ToolTip(this.components); this.m_grp_find = new System.Windows.Forms.GroupBox(); this.m_grp_find.SuspendLayout(); this.SuspendLayout(); // // m_cb_pattern // this.m_cb_pattern.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_cb_pattern.FormattingEnabled = true; this.m_cb_pattern.Location = new System.Drawing.Point(6, 19); this.m_cb_pattern.Name = "m_cb_pattern"; this.m_cb_pattern.Size = new System.Drawing.Size(206, 21); this.m_cb_pattern.TabIndex = 0; // // m_btn_find_prev // this.m_btn_find_prev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.m_btn_find_prev.ImageKey = "prev"; this.m_btn_find_prev.ImageList = this.m_il; this.m_btn_find_prev.Location = new System.Drawing.Point(216, 13); this.m_btn_find_prev.Name = "m_btn_find_prev"; this.m_btn_find_prev.Size = new System.Drawing.Size(29, 31); this.m_btn_find_prev.TabIndex = 1; this.m_btn_find_prev.UseVisualStyleBackColor = true; // // m_btn_find_next // this.m_btn_find_next.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.m_btn_find_next.ImageKey = "next"; this.m_btn_find_next.ImageList = this.m_il; this.m_btn_find_next.Location = new System.Drawing.Point(245, 13); this.m_btn_find_next.Name = "m_btn_find_next"; this.m_btn_find_next.Size = new System.Drawing.Size(29, 31); this.m_btn_find_next.TabIndex = 2; this.m_btn_find_next.UseVisualStyleBackColor = true; // // m_chk_ignore_case // this.m_chk_ignore_case.AutoSize = true; this.m_chk_ignore_case.Location = new System.Drawing.Point(6, 69); this.m_chk_ignore_case.Name = "m_chk_ignore_case"; this.m_chk_ignore_case.Size = new System.Drawing.Size(83, 17); this.m_chk_ignore_case.TabIndex = 3; this.m_chk_ignore_case.Text = "Ignore Case"; this.m_chk_ignore_case.UseVisualStyleBackColor = true; // // m_radio_substr // this.m_radio_substr.AutoSize = true; this.m_radio_substr.Location = new System.Drawing.Point(4, 46); this.m_radio_substr.Name = "m_radio_substr"; this.m_radio_substr.Size = new System.Drawing.Size(69, 17); this.m_radio_substr.TabIndex = 4; this.m_radio_substr.TabStop = true; this.m_radio_substr.Text = "Substring"; this.m_radio_substr.UseVisualStyleBackColor = true; // // m_radio_wildcard // this.m_radio_wildcard.AutoSize = true; this.m_radio_wildcard.Location = new System.Drawing.Point(79, 46); this.m_radio_wildcard.Name = "m_radio_wildcard"; this.m_radio_wildcard.Size = new System.Drawing.Size(67, 17); this.m_radio_wildcard.TabIndex = 5; this.m_radio_wildcard.TabStop = true; this.m_radio_wildcard.Text = "Wildcard"; this.m_radio_wildcard.UseVisualStyleBackColor = true; // // m_radio_regexp // this.m_radio_regexp.AutoSize = true; this.m_radio_regexp.Location = new System.Drawing.Point(152, 46); this.m_radio_regexp.Name = "m_radio_regexp"; this.m_radio_regexp.Size = new System.Drawing.Size(75, 17); this.m_radio_regexp.TabIndex = 6; this.m_radio_regexp.TabStop = true; this.m_radio_regexp.Text = "Reg. Expr."; this.m_radio_regexp.UseVisualStyleBackColor = true; // // m_chk_invert // this.m_chk_invert.AutoSize = true; this.m_chk_invert.Location = new System.Drawing.Point(95, 67); this.m_chk_invert.Name = "m_chk_invert"; this.m_chk_invert.Size = new System.Drawing.Size(86, 17); this.m_chk_invert.TabIndex = 7; this.m_chk_invert.Text = "Invert Match"; this.m_chk_invert.UseVisualStyleBackColor = true; // // m_grp_find // this.m_grp_find.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_grp_find.Controls.Add(this.m_cb_pattern); this.m_grp_find.Controls.Add(this.m_chk_invert); this.m_grp_find.Controls.Add(this.m_btn_find_prev); this.m_grp_find.Controls.Add(this.m_radio_regexp); this.m_grp_find.Controls.Add(this.m_btn_find_next); this.m_grp_find.Controls.Add(this.m_radio_wildcard); this.m_grp_find.Controls.Add(this.m_chk_ignore_case); this.m_grp_find.Controls.Add(this.m_radio_substr); this.m_grp_find.Location = new System.Drawing.Point(0, -6); this.m_grp_find.Margin = new System.Windows.Forms.Padding(0); this.m_grp_find.Name = "m_grp_find"; this.m_grp_find.Size = new System.Drawing.Size(277, 95); this.m_grp_find.TabIndex = 8; this.m_grp_find.TabStop = false; // // FindUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(277, 89); this.Controls.Add(this.m_grp_find); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.MaximumSize = new System.Drawing.Size(1000, 128); this.MinimumSize = new System.Drawing.Size(250, 128); this.Name = "FindUI"; this.Text = "Find..."; this.m_grp_find.ResumeLayout(false); this.m_grp_find.PerformLayout(); this.ResumeLayout(false); }