diff --git a/PROMS/VEPROMS User Interface/frmSI.Designer.cs b/PROMS/VEPROMS User Interface/frmSI.Designer.cs index df6ea8ad..6b2b5c2b 100644 --- a/PROMS/VEPROMS User Interface/frmSI.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmSI.Designer.cs @@ -32,12 +32,6 @@ namespace VEPROMS this.btnOk = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.panelSI = new System.Windows.Forms.Panel(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.fwdCMClipBoard = new System.Windows.Forms.ToolStripMenuItem(); - this.fwdCMCbCut = new System.Windows.Forms.ToolStripMenuItem(); - this.fwdCMCbCopy = new System.Windows.Forms.ToolStripMenuItem(); - this.fwdCMCbPaste = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // // btnOk @@ -71,45 +65,7 @@ namespace VEPROMS this.panelSI.Name = "panelSI"; this.panelSI.Size = new System.Drawing.Size(262, 167); this.panelSI.TabIndex = 2; - // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fwdCMClipBoard}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(153, 48); - // - // fwdCMClipBoard - // - this.fwdCMClipBoard.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fwdCMCbCut, - this.fwdCMCbCopy, - this.fwdCMCbPaste}); - this.fwdCMClipBoard.Name = "fwdCMClipBoard"; - this.fwdCMClipBoard.Size = new System.Drawing.Size(152, 22); - this.fwdCMClipBoard.Text = "Clip Board"; - // - // fwdCMCbCut - // - this.fwdCMCbCut.Name = "fwdCMCbCut"; - this.fwdCMCbCut.Size = new System.Drawing.Size(152, 22); - this.fwdCMCbCut.Text = "Cut"; - this.fwdCMCbCut.Click += new System.EventHandler(this.fwdCMCbCut_Click); - // - // fwdCMCbCopy - // - this.fwdCMCbCopy.Name = "fwdCMCbCopy"; - this.fwdCMCbCopy.Size = new System.Drawing.Size(152, 22); - this.fwdCMCbCopy.Text = "Copy"; - this.fwdCMCbCopy.Click += new System.EventHandler(this.fwdCMCbCopy_Click); - // - // fwdCMCbPaste - // - this.fwdCMCbPaste.Name = "fwdCMCbPaste"; - this.fwdCMCbPaste.Size = new System.Drawing.Size(152, 22); - this.fwdCMCbPaste.Text = "Paste"; - this.fwdCMCbPaste.Click += new System.EventHandler(this.fwdCMCbPaste_Click); - // + // // frmSI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -123,7 +79,6 @@ namespace VEPROMS this.Name = "frmSI"; this.Text = "frmSI"; this.TopMost = true; - this.contextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); } @@ -133,10 +88,5 @@ namespace VEPROMS private System.Windows.Forms.Button btnOk; private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Panel panelSI; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; - private System.Windows.Forms.ToolStripMenuItem fwdCMClipBoard; - private System.Windows.Forms.ToolStripMenuItem fwdCMCbCut; - private System.Windows.Forms.ToolStripMenuItem fwdCMCbCopy; - private System.Windows.Forms.ToolStripMenuItem fwdCMCbPaste; } } \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmSI.cs b/PROMS/VEPROMS User Interface/frmSI.cs index 9cccd99f..2f409572 100644 --- a/PROMS/VEPROMS User Interface/frmSI.cs +++ b/PROMS/VEPROMS User Interface/frmSI.cs @@ -66,10 +66,11 @@ namespace VEPROMS string mystr = tb.FontTable; _DicStepRtb.Add(fld.name, tb); tb.MyItemInfo = null; // pi as ItemInfo; - tb.FieldToEdit = E_FieldToEdit.Text;//E_FieldToEdit.PSI; + // C2021-043: have Proms specific context menu, i.e. with Hard space, styles and symbols rather than Windows clipboard + // (Removed the frmSI specific contextmenustrip1) + tb.FieldToEdit = E_FieldToEdit.PSI; tb.BorderStyle = BorderStyle.FixedSingle; tb.Enter += new System.EventHandler(this.FieldStepRTB_Enter); - tb.ContextMenuStrip = contextMenuStrip1; // B2017-024 clipboard context menu // see if config has data for this field, i.e. search for the 'name' // B2019-133 continuation of B2018-057 Replace non-breaking hyphen with hyphen. string val = (DoFolder ? folderConfig.GetValue("SI", fld.name) : dvConfig.GetValue("SI", fld.name)).Replace("\\u8209?", "-"); @@ -125,7 +126,8 @@ namespace VEPROMS } private void FieldStepRTB_Enter(object sender, EventArgs e) { - // _MyStepTabRibbon.MyStepRTB = (StepRTB)sender; + // C2021-043: have Proms specific context menu, when entering the field, need to set the MyStepRTB so that context menus is available + _MyStepTabRibbon.MyStepRTB = (StepRTB)sender; } private void btnOk_Click(object sender, EventArgs e) { diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 638c5112..e121f00f 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -652,9 +652,22 @@ namespace Volian.Controls.Library MyFlexGrid.CopyOptionChanged += new VlnFlexGridEvent(MyFlexGrid_CopyOptionChanged); MyFlexGrid.SelChange+=new EventHandler(MyFlexGrid_SelChange); } - // Add symbols into the tab ribbon based on format selection. For now, only add symbols once - // because all symbols are same!!! If we start defining different symbols in different formats - // this will have to change, i.e. remove the second part of 'if' statement. + // C2021-043: have Proms specific context menu, i.e. with Hard space, styles and symbols rather than Windows clipboard + // The frmSI dialog uses a StepRTB that ends up in this code to work with the symbol list. This occurs when the + // MyItemInfo is null. + if (MyItemInfo == null) + { + // get base symbol list & add. + FormatInfo fmt = FormatInfo.Get(1); + SymbolList sl = fmt.PlantFormat.FormatData.SymbolList; + if (sl == null || sl.Count <= 0) + { + FlexibleMessageBox.Show("No symbols are available, check with administrator"); + return; + } + BuildSymbolGallery(sl, galleryContainerSymbolsCM, galleryContainerSymbolsCM3, galleryContainerSymbolsGrid, galleryContainerSymbolsCM4); + return; + } if (MyItemInfo.ActiveFormat.FormatID != _MyLastFormatID && _MyLastFormatID == -1) { // Add symbols to the tabribbon & also to the context menu getting info from the format file...