B2019-029: When a new annotation is created, unless you press save, it isn’t saved. The first fix caused a dialog to come up repeatedly for when save is selected. There is no longer a dialog and this was fixed with this update

This commit is contained in:
Kathy Ruffing 2019-03-28 14:35:21 +00:00
parent 389250bad3
commit a9ad0ed12a
5 changed files with 79 additions and 74 deletions

View File

@ -1653,6 +1653,7 @@ namespace VEPROMS
displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc); displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc);
AnnotationTypeInfoList.ListChanged += new AnnotationTypeInfoListEvent(AnnotationTypeInfoList_ListChanged); AnnotationTypeInfoList.ListChanged += new AnnotationTypeInfoListEvent(AnnotationTypeInfoList_ListChanged);
ctrlAnnotationDetails.SetupAnnotations(displaySearch1); ctrlAnnotationDetails.SetupAnnotations(displaySearch1);
tc.MyAnnotationDetails = ctrlAnnotationDetails;
SetupButtons(); SetupButtons();
displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs
office2007StartButton1.MouseDown += new MouseEventHandler(office2007StartButton1_MouseDown); office2007StartButton1.MouseDown += new MouseEventHandler(office2007StartButton1_MouseDown);

View File

@ -29,7 +29,7 @@ namespace Volian.Controls.Library
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.rtxbComment = new System.Windows.Forms.RichTextBox(); this.rtxbComment = new System.Windows.Forms.RichTextBox();
this.btnSaveAnnotation = new DevComponents.DotNetBar.ButtonX(); this.btnSaveAnnotation = new DevComponents.DotNetBar.ButtonX();
@ -67,25 +67,24 @@ namespace Volian.Controls.Library
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.rtxbComment.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.rtxbComment.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
this.rtxbComment.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.rtxbComment.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtxbComment.Location = new System.Drawing.Point(65, 27); this.rtxbComment.Location = new System.Drawing.Point(87, 33);
this.rtxbComment.Margin = new System.Windows.Forms.Padding(2); this.rtxbComment.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.rtxbComment.Name = "rtxbComment"; this.rtxbComment.Name = "rtxbComment";
this.rtxbComment.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; this.rtxbComment.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.rtxbComment.Size = new System.Drawing.Size(368, 237); this.rtxbComment.Size = new System.Drawing.Size(489, 291);
this.superTooltip1.SetSuperTooltip(this.rtxbComment, new DevComponents.DotNetBar.SuperTooltipInfo("Annotation", "", "Enter the annotation information here.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(this.rtxbComment, new DevComponents.DotNetBar.SuperTooltipInfo("Annotation", "", "Enter the annotation information here.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.rtxbComment.TabIndex = 1; this.rtxbComment.TabIndex = 1;
this.rtxbComment.Text = ""; this.rtxbComment.Text = "";
this.rtxbComment.TextChanged += new System.EventHandler(this.rtxbComment_TextChanged); this.rtxbComment.TextChanged += new System.EventHandler(this.rtxbComment_TextChanged);
this.rtxbComment.Leave += new System.EventHandler(this.rtxbComment_Leave);
// //
// btnSaveAnnotation // btnSaveAnnotation
// //
this.btnSaveAnnotation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnSaveAnnotation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnSaveAnnotation.Enabled = false; this.btnSaveAnnotation.Enabled = false;
this.btnSaveAnnotation.Location = new System.Drawing.Point(368, 3); this.btnSaveAnnotation.Location = new System.Drawing.Point(491, 4);
this.btnSaveAnnotation.Margin = new System.Windows.Forms.Padding(2); this.btnSaveAnnotation.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSaveAnnotation.Name = "btnSaveAnnotation"; this.btnSaveAnnotation.Name = "btnSaveAnnotation";
this.btnSaveAnnotation.Size = new System.Drawing.Size(53, 20); this.btnSaveAnnotation.Size = new System.Drawing.Size(71, 25);
this.superTooltip1.SetSuperTooltip(this.btnSaveAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Save Changes", "", "This will save the new annotation or changes made to an existing annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(this.btnSaveAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Save Changes", "", "This will save the new annotation or changes made to an existing annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnSaveAnnotation.TabIndex = 9; this.btnSaveAnnotation.TabIndex = 9;
this.btnSaveAnnotation.Text = "Save"; this.btnSaveAnnotation.Text = "Save";
@ -95,10 +94,10 @@ namespace Volian.Controls.Library
// //
this.btnCancelAnnoation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnCancelAnnoation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnCancelAnnoation.Enabled = false; this.btnCancelAnnoation.Enabled = false;
this.btnCancelAnnoation.Location = new System.Drawing.Point(301, 3); this.btnCancelAnnoation.Location = new System.Drawing.Point(401, 4);
this.btnCancelAnnoation.Margin = new System.Windows.Forms.Padding(2); this.btnCancelAnnoation.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnCancelAnnoation.Name = "btnCancelAnnoation"; this.btnCancelAnnoation.Name = "btnCancelAnnoation";
this.btnCancelAnnoation.Size = new System.Drawing.Size(52, 20); this.btnCancelAnnoation.Size = new System.Drawing.Size(69, 25);
this.superTooltip1.SetSuperTooltip(this.btnCancelAnnoation, new DevComponents.DotNetBar.SuperTooltipInfo("Cancel", "", "This will cancel the changes made to the annotation text and type selection", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(145, 100))); this.superTooltip1.SetSuperTooltip(this.btnCancelAnnoation, new DevComponents.DotNetBar.SuperTooltipInfo("Cancel", "", "This will cancel the changes made to the annotation text and type selection", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(145, 100)));
this.btnCancelAnnoation.TabIndex = 8; this.btnCancelAnnoation.TabIndex = 8;
this.btnCancelAnnoation.Text = "Cancel"; this.btnCancelAnnoation.Text = "Cancel";
@ -113,11 +112,11 @@ namespace Volian.Controls.Library
this.cbGridAnnoType.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cbGridAnnoType.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cbGridAnnoType.ForeColor = System.Drawing.SystemColors.WindowText; this.cbGridAnnoType.ForeColor = System.Drawing.SystemColors.WindowText;
this.cbGridAnnoType.ItemHeight = 17; this.cbGridAnnoType.ItemHeight = 17;
this.cbGridAnnoType.Location = new System.Drawing.Point(100, 3); this.cbGridAnnoType.Location = new System.Drawing.Point(133, 4);
this.cbGridAnnoType.Margin = new System.Windows.Forms.Padding(2); this.cbGridAnnoType.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cbGridAnnoType.Name = "cbGridAnnoType"; this.cbGridAnnoType.Name = "cbGridAnnoType";
this.cbGridAnnoType.PreventEnterBeep = true; this.cbGridAnnoType.PreventEnterBeep = true;
this.cbGridAnnoType.Size = new System.Drawing.Size(184, 23); this.cbGridAnnoType.Size = new System.Drawing.Size(244, 23);
this.superTooltip1.SetSuperTooltip(this.cbGridAnnoType, new DevComponents.DotNetBar.SuperTooltipInfo("Select Annotation Type", "", "This drop down list contains the possible annotation types.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(this.cbGridAnnoType, new DevComponents.DotNetBar.SuperTooltipInfo("Select Annotation Type", "", "This drop down list contains the possible annotation types.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.cbGridAnnoType.TabIndex = 7; this.cbGridAnnoType.TabIndex = 7;
this.cbGridAnnoType.WatermarkBehavior = DevComponents.DotNetBar.eWatermarkBehavior.HideNonEmpty; this.cbGridAnnoType.WatermarkBehavior = DevComponents.DotNetBar.eWatermarkBehavior.HideNonEmpty;
@ -127,10 +126,10 @@ namespace Volian.Controls.Library
// btnRemoveAnnotation // btnRemoveAnnotation
// //
this.btnRemoveAnnotation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnRemoveAnnotation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnRemoveAnnotation.Location = new System.Drawing.Point(4, 28); this.btnRemoveAnnotation.Location = new System.Drawing.Point(5, 34);
this.btnRemoveAnnotation.Margin = new System.Windows.Forms.Padding(2); this.btnRemoveAnnotation.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnRemoveAnnotation.Name = "btnRemoveAnnotation"; this.btnRemoveAnnotation.Name = "btnRemoveAnnotation";
this.btnRemoveAnnotation.Size = new System.Drawing.Size(53, 20); this.btnRemoveAnnotation.Size = new System.Drawing.Size(71, 25);
this.superTooltip1.SetSuperTooltip(this.btnRemoveAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Remove Annotation", "", "This will remove the currently selected annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(this.btnRemoveAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Remove Annotation", "", "This will remove the currently selected annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnRemoveAnnotation.TabIndex = 4; this.btnRemoveAnnotation.TabIndex = 4;
this.btnRemoveAnnotation.Text = "Remove"; this.btnRemoveAnnotation.Text = "Remove";
@ -139,10 +138,10 @@ namespace Volian.Controls.Library
// btnAddAnnotation // btnAddAnnotation
// //
this.btnAddAnnotation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.btnAddAnnotation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnAddAnnotation.Location = new System.Drawing.Point(4, 3); this.btnAddAnnotation.Location = new System.Drawing.Point(5, 4);
this.btnAddAnnotation.Margin = new System.Windows.Forms.Padding(2); this.btnAddAnnotation.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAddAnnotation.Name = "btnAddAnnotation"; this.btnAddAnnotation.Name = "btnAddAnnotation";
this.btnAddAnnotation.Size = new System.Drawing.Size(53, 20); this.btnAddAnnotation.Size = new System.Drawing.Size(71, 25);
this.superTooltip1.SetSuperTooltip(this.btnAddAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Add New Annotation", "", "This button will create a new annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(this.btnAddAnnotation, new DevComponents.DotNetBar.SuperTooltipInfo("Add New Annotation", "", "This button will create a new annotation.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnAddAnnotation.TabIndex = 3; this.btnAddAnnotation.TabIndex = 3;
this.btnAddAnnotation.Text = "Add"; this.btnAddAnnotation.Text = "Add";
@ -159,10 +158,10 @@ namespace Volian.Controls.Library
this.pannelAnnoEdit.Controls.Add(this.panelAnnoEditBtns); this.pannelAnnoEdit.Controls.Add(this.panelAnnoEditBtns);
this.pannelAnnoEdit.DisabledBackColor = System.Drawing.Color.Empty; this.pannelAnnoEdit.DisabledBackColor = System.Drawing.Color.Empty;
this.pannelAnnoEdit.Dock = System.Windows.Forms.DockStyle.Fill; this.pannelAnnoEdit.Dock = System.Windows.Forms.DockStyle.Fill;
this.pannelAnnoEdit.Location = new System.Drawing.Point(411, 0); this.pannelAnnoEdit.Location = new System.Drawing.Point(548, 0);
this.pannelAnnoEdit.Margin = new System.Windows.Forms.Padding(2); this.pannelAnnoEdit.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pannelAnnoEdit.Name = "pannelAnnoEdit"; this.pannelAnnoEdit.Name = "pannelAnnoEdit";
this.pannelAnnoEdit.Size = new System.Drawing.Size(432, 264); this.pannelAnnoEdit.Size = new System.Drawing.Size(576, 325);
this.pannelAnnoEdit.Style.Alignment = System.Drawing.StringAlignment.Center; this.pannelAnnoEdit.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pannelAnnoEdit.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.pannelAnnoEdit.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.pannelAnnoEdit.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.pannelAnnoEdit.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
@ -182,10 +181,10 @@ namespace Volian.Controls.Library
// //
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelX1.Location = new System.Drawing.Point(70, 6); this.labelX1.Location = new System.Drawing.Point(93, 7);
this.labelX1.Margin = new System.Windows.Forms.Padding(2); this.labelX1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.labelX1.Name = "labelX1"; this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(29, 14); this.labelX1.Size = new System.Drawing.Size(35, 17);
this.labelX1.TabIndex = 10; this.labelX1.TabIndex = 10;
this.labelX1.Text = "Type:"; this.labelX1.Text = "Type:";
// //
@ -197,9 +196,9 @@ namespace Volian.Controls.Library
this.panelAnnoEditBtns.DisabledBackColor = System.Drawing.Color.Empty; this.panelAnnoEditBtns.DisabledBackColor = System.Drawing.Color.Empty;
this.panelAnnoEditBtns.Dock = System.Windows.Forms.DockStyle.Left; this.panelAnnoEditBtns.Dock = System.Windows.Forms.DockStyle.Left;
this.panelAnnoEditBtns.Location = new System.Drawing.Point(0, 0); this.panelAnnoEditBtns.Location = new System.Drawing.Point(0, 0);
this.panelAnnoEditBtns.Margin = new System.Windows.Forms.Padding(2); this.panelAnnoEditBtns.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelAnnoEditBtns.Name = "panelAnnoEditBtns"; this.panelAnnoEditBtns.Name = "panelAnnoEditBtns";
this.panelAnnoEditBtns.Size = new System.Drawing.Size(65, 264); this.panelAnnoEditBtns.Size = new System.Drawing.Size(87, 325);
this.panelAnnoEditBtns.Style.Alignment = System.Drawing.StringAlignment.Center; this.panelAnnoEditBtns.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelAnnoEditBtns.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.panelAnnoEditBtns.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.panelAnnoEditBtns.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.panelAnnoEditBtns.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
@ -234,10 +233,10 @@ namespace Volian.Controls.Library
this.expandableSplitter4.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; this.expandableSplitter4.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.expandableSplitter4.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); this.expandableSplitter4.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255)))));
this.expandableSplitter4.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; this.expandableSplitter4.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
this.expandableSplitter4.Location = new System.Drawing.Point(409, 0); this.expandableSplitter4.Location = new System.Drawing.Point(545, 0);
this.expandableSplitter4.Margin = new System.Windows.Forms.Padding(2); this.expandableSplitter4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.expandableSplitter4.Name = "expandableSplitter4"; this.expandableSplitter4.Name = "expandableSplitter4";
this.expandableSplitter4.Size = new System.Drawing.Size(2, 264); this.expandableSplitter4.Size = new System.Drawing.Size(3, 325);
this.expandableSplitter4.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; this.expandableSplitter4.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007;
this.expandableSplitter4.TabIndex = 15; this.expandableSplitter4.TabIndex = 15;
this.expandableSplitter4.TabStop = false; this.expandableSplitter4.TabStop = false;
@ -249,9 +248,9 @@ namespace Volian.Controls.Library
this.pannelAnnoGrid.DisabledBackColor = System.Drawing.Color.Empty; this.pannelAnnoGrid.DisabledBackColor = System.Drawing.Color.Empty;
this.pannelAnnoGrid.Dock = System.Windows.Forms.DockStyle.Left; this.pannelAnnoGrid.Dock = System.Windows.Forms.DockStyle.Left;
this.pannelAnnoGrid.Location = new System.Drawing.Point(0, 0); this.pannelAnnoGrid.Location = new System.Drawing.Point(0, 0);
this.pannelAnnoGrid.Margin = new System.Windows.Forms.Padding(2); this.pannelAnnoGrid.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pannelAnnoGrid.Name = "pannelAnnoGrid"; this.pannelAnnoGrid.Name = "pannelAnnoGrid";
this.pannelAnnoGrid.Size = new System.Drawing.Size(409, 264); this.pannelAnnoGrid.Size = new System.Drawing.Size(545, 325);
this.pannelAnnoGrid.Style.Alignment = System.Drawing.StringAlignment.Center; this.pannelAnnoGrid.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pannelAnnoGrid.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.pannelAnnoGrid.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.pannelAnnoGrid.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.pannelAnnoGrid.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
@ -275,19 +274,19 @@ namespace Volian.Controls.Library
this.userIDDataGridViewTextBoxColumn, this.userIDDataGridViewTextBoxColumn,
this.searchTextDataGridViewTextBoxColumn}); this.searchTextDataGridViewTextBoxColumn});
this.dgAnnotations.DataSource = this.itemAnnotationsBindingSource; this.dgAnnotations.DataSource = this.itemAnnotationsBindingSource;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgAnnotations.DefaultCellStyle = dataGridViewCellStyle1; this.dgAnnotations.DefaultCellStyle = dataGridViewCellStyle2;
this.dgAnnotations.Dock = System.Windows.Forms.DockStyle.Fill; this.dgAnnotations.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgAnnotations.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229))))); this.dgAnnotations.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
this.dgAnnotations.HighlightSelectedColumnHeaders = false; this.dgAnnotations.HighlightSelectedColumnHeaders = false;
this.dgAnnotations.Location = new System.Drawing.Point(0, 0); this.dgAnnotations.Location = new System.Drawing.Point(0, 0);
this.dgAnnotations.Margin = new System.Windows.Forms.Padding(2); this.dgAnnotations.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.dgAnnotations.MultiSelect = false; this.dgAnnotations.MultiSelect = false;
this.dgAnnotations.Name = "dgAnnotations"; this.dgAnnotations.Name = "dgAnnotations";
this.dgAnnotations.RowHeadersVisible = false; this.dgAnnotations.RowHeadersVisible = false;
@ -296,7 +295,7 @@ namespace Volian.Controls.Library
this.dgAnnotations.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.dgAnnotations.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.dgAnnotations.SelectAllSignVisible = false; this.dgAnnotations.SelectAllSignVisible = false;
this.dgAnnotations.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgAnnotations.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgAnnotations.Size = new System.Drawing.Size(409, 264); this.dgAnnotations.Size = new System.Drawing.Size(545, 325);
this.dgAnnotations.TabIndex = 1; this.dgAnnotations.TabIndex = 1;
this.dgAnnotations.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgAnnotations_CellClick); this.dgAnnotations.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgAnnotations_CellClick);
// //
@ -305,21 +304,21 @@ namespace Volian.Controls.Library
this.myAnnotationTypeDataGridViewTextBoxColumn.DataPropertyName = "MyAnnotationType"; this.myAnnotationTypeDataGridViewTextBoxColumn.DataPropertyName = "MyAnnotationType";
this.myAnnotationTypeDataGridViewTextBoxColumn.HeaderText = "Type"; this.myAnnotationTypeDataGridViewTextBoxColumn.HeaderText = "Type";
this.myAnnotationTypeDataGridViewTextBoxColumn.Name = "myAnnotationTypeDataGridViewTextBoxColumn"; this.myAnnotationTypeDataGridViewTextBoxColumn.Name = "myAnnotationTypeDataGridViewTextBoxColumn";
this.myAnnotationTypeDataGridViewTextBoxColumn.Width = 56; this.myAnnotationTypeDataGridViewTextBoxColumn.Width = 69;
// //
// dTSDataGridViewTextBoxColumn // dTSDataGridViewTextBoxColumn
// //
this.dTSDataGridViewTextBoxColumn.DataPropertyName = "DTS"; this.dTSDataGridViewTextBoxColumn.DataPropertyName = "DTS";
this.dTSDataGridViewTextBoxColumn.HeaderText = "Date"; this.dTSDataGridViewTextBoxColumn.HeaderText = "Date";
this.dTSDataGridViewTextBoxColumn.Name = "dTSDataGridViewTextBoxColumn"; this.dTSDataGridViewTextBoxColumn.Name = "dTSDataGridViewTextBoxColumn";
this.dTSDataGridViewTextBoxColumn.Width = 55; this.dTSDataGridViewTextBoxColumn.Width = 67;
// //
// userIDDataGridViewTextBoxColumn // userIDDataGridViewTextBoxColumn
// //
this.userIDDataGridViewTextBoxColumn.DataPropertyName = "UserID"; this.userIDDataGridViewTextBoxColumn.DataPropertyName = "UserID";
this.userIDDataGridViewTextBoxColumn.HeaderText = "User"; this.userIDDataGridViewTextBoxColumn.HeaderText = "User";
this.userIDDataGridViewTextBoxColumn.Name = "userIDDataGridViewTextBoxColumn"; this.userIDDataGridViewTextBoxColumn.Name = "userIDDataGridViewTextBoxColumn";
this.userIDDataGridViewTextBoxColumn.Width = 54; this.userIDDataGridViewTextBoxColumn.Width = 67;
// //
// searchTextDataGridViewTextBoxColumn // searchTextDataGridViewTextBoxColumn
// //
@ -334,14 +333,14 @@ namespace Volian.Controls.Library
// //
// AnnotationDetails // AnnotationDetails
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.pannelAnnoEdit); this.Controls.Add(this.pannelAnnoEdit);
this.Controls.Add(this.expandableSplitter4); this.Controls.Add(this.expandableSplitter4);
this.Controls.Add(this.pannelAnnoGrid); this.Controls.Add(this.pannelAnnoGrid);
this.Margin = new System.Windows.Forms.Padding(2); this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "AnnotationDetails"; this.Name = "AnnotationDetails";
this.Size = new System.Drawing.Size(843, 264); this.Size = new System.Drawing.Size(1124, 325);
this.pannelAnnoEdit.ResumeLayout(false); this.pannelAnnoEdit.ResumeLayout(false);
this.pannelAnnoEdit.PerformLayout(); this.pannelAnnoEdit.PerformLayout();
this.panelAnnoEditBtns.ResumeLayout(false); this.panelAnnoEditBtns.ResumeLayout(false);

View File

@ -200,7 +200,7 @@ namespace Volian.Controls.Library
} }
private bool _AnnotationDirty = false; private bool _AnnotationDirty = false;
private bool AnnotationDirty public bool AnnotationDirty
{ {
get { return _AnnotationDirty; } get { return _AnnotationDirty; }
set set
@ -334,33 +334,27 @@ namespace Volian.Controls.Library
if (!_LoadingAnnotation) if (!_LoadingAnnotation)
AnnotationDirty = true; AnnotationDirty = true;
} }
// B2019-029: Ask user if they want to save an annotation, if it was added (new) and the user did not click to save and moved to a
// new step
private void rtxbComment_Leave(object sender, EventArgs e)
{
if (this.AnnotationDirty && (Annotations == null || Annotations.Count == 0))
{
if (FlexibleMessageBox.Show(this, "Do you want to save the annotation?", "Confirm Annotation Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
SaveAnnotation();
}
}
}
#endregion #endregion
#region LoadControlData #region LoadControlData
public void SetupAnnotations(DisplaySearch annosrch) public void SetupAnnotations(DisplaySearch annosrch)
{ {
_LoadingAnnotation = true; _LoadingAnnotation = true;
_AnnotationSearch = annosrch; // reference the Annotation Search to update its lists _AnnotationSearch = annosrch; // reference the Annotation Search to update its lists
cbGridAnnoType.DisplayMember = "Name"; cbGridAnnoType.DisplayMember = "Name";
cbGridAnnoType.ValueMember = "TypeId"; cbGridAnnoType.ValueMember = "TypeId";
cbGridAnnoType.DataSource = AnnotationTypeInfoList.Get().Clone(); cbGridAnnoType.DataSource = AnnotationTypeInfoList.Get().Clone();
cbGridAnnoType.SelectedIndex = -1; //don't pre-select an annotation type // If there are no annotatons, then selected index is -1 (not defined), otherwise select the first.
_LoadingAnnotation = false; // This was done so that it could be saved if there was text entered but user moves to another steprtb without selecting save button
} // so that annotation gets saved.
if (cbGridAnnoType.Items.Count == 0)
cbGridAnnoType.SelectedIndex = -1;
else
cbGridAnnoType.SelectedIndex = 0;
_LoadingAnnotation = false;
}
private void InitializeAnnotation() private void InitializeAnnotation()
{ {
@ -368,7 +362,10 @@ namespace Volian.Controls.Library
_LoadingAnnotation = true; _LoadingAnnotation = true;
if (CurrentAnnotation == null) if (CurrentAnnotation == null)
{ {
cbGridAnnoType.SelectedIndex = -1; if (cbGridAnnoType.Items.Count == 0) // see comment for SetupAnnotations
cbGridAnnoType.SelectedIndex = -1;
else
cbGridAnnoType.SelectedIndex = 0;
AnnotationText = ""; AnnotationText = "";
} }
else else
@ -653,7 +650,7 @@ namespace Volian.Controls.Library
} }
} }
private void SaveAnnotation() public void SaveAnnotation()
{ {
if (cbGridAnnoType.SelectedIndex == -1) return; if (cbGridAnnoType.SelectedIndex == -1) return;
if (rtxbComment.Text == string.Empty) return; if (rtxbComment.Text == string.Empty) return;

View File

@ -798,6 +798,12 @@ namespace Volian.Controls.Library
} }
#endregion #endregion
#region Public Properties #region Public Properties
private AnnotationDetails _MyAnnotationDetails;
public AnnotationDetails MyAnnotationDetails // B2019-029: added to find annotation details for saving w/o btnsave click
{
get { return _MyAnnotationDetails; }
set { _MyAnnotationDetails = value; }
}
private SessionInfo _MySessionInfo; private SessionInfo _MySessionInfo;
public SessionInfo MySessionInfo public SessionInfo MySessionInfo
{ {

View File

@ -183,6 +183,8 @@ namespace Volian.Controls.Library
private void StepTabPanel_Enter(object sender, EventArgs e) private void StepTabPanel_Enter(object sender, EventArgs e)
{ {
if (_ShowingItem) return; if (_ShowingItem) return;
// B2019-029: added to save a dirty annotation when the btnsave was not clicked (user just moves to another steprtb but had added annotationi text):
if (MyDisplayTabControl.MyAnnotationDetails.AnnotationDirty) MyDisplayTabControl.MyAnnotationDetails.SaveAnnotation();
_ShowingItem = true; _ShowingItem = true;
//if (ItemSelected != null) //if (ItemSelected != null)
_MyStepPanel.ItemShow(); _MyStepPanel.ItemShow();