Compare commits

...

9 Commits

16 changed files with 2415 additions and 1890 deletions

View File

@@ -96,10 +96,10 @@ namespace ROEditor
private System.Windows.Forms.Label lblW2;
private System.Windows.Forms.Label lblW3;
private System.Windows.Forms.Label lblW4;
private System.Windows.Forms.TextBox tbSingleTxtWid;
private System.Windows.Forms.TextBox tbVariableTxtWid;
private System.Windows.Forms.TextBox tbTableWid;
private System.Windows.Forms.TextBox tbXYPlotWid;
private System.Windows.Forms.RichTextBox tbSingleTxtWid; // RO Editor add symbols C2022 - 003
private System.Windows.Forms.RichTextBox tbVariableTxtWid;
private System.Windows.Forms.RichTextBox tbTableWid;
private System.Windows.Forms.RichTextBox tbXYPlotWid;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
/// <summary>
@@ -218,10 +218,10 @@ namespace ROEditor
this.lblFieldName = new System.Windows.Forms.Label();
this.tbFieldName = new System.Windows.Forms.TextBox();
this.gbAlternatives = new System.Windows.Forms.GroupBox();
this.tbXYPlotWid = new System.Windows.Forms.TextBox();
this.tbTableWid = new System.Windows.Forms.TextBox();
this.tbVariableTxtWid = new System.Windows.Forms.TextBox();
this.tbSingleTxtWid = new System.Windows.Forms.TextBox();
this.tbXYPlotWid = new System.Windows.Forms.RichTextBox(); // RO Editor add symbols C2022 - 003
this.tbTableWid = new System.Windows.Forms.RichTextBox();
this.tbVariableTxtWid = new System.Windows.Forms.RichTextBox();
this.tbSingleTxtWid = new System.Windows.Forms.RichTextBox();
this.lblW4 = new System.Windows.Forms.Label();
this.lblW3 = new System.Windows.Forms.Label();
this.lblW2 = new System.Windows.Forms.Label();

File diff suppressed because it is too large Load Diff

View File

@@ -109,6 +109,10 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevComponents.DotNetBar2, Version=14.1.0.37, Culture=neutral, PublicKeyToken=7eb7c3a35b91de04, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\3rdPartyLibraries\DotNetBar\DotNetBar4.6Build\DevComponents.DotNetBar2.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
@@ -124,10 +128,6 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<Reference Include="Volian.Base.Library, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Volian.Base.Library\bin\Debug\Volian.Base.Library.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AboutROEditor.cs">
@@ -168,6 +168,7 @@
<Compile Include="RO_FST.cs">
<SubType>Code</SubType>
</Compile>
<Content Include="Symbols.xml" />
<EmbeddedResource Include="AboutROEditor.resx">
<SubType>Designer</SubType>
<DependentUpon>AboutROEditor.cs</DependentUpon>

View File

@@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACE
CAAAAk1TRnQBSQFMAgEBAgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAAUQBAAFEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -175,7 +175,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAe
CwAAAk1TRnQBSQFMAgEBBgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CwAAAk1TRnQBSQFMAgEBBgEAAUQBAAFEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@@ -101,7 +101,6 @@ using System.Runtime.InteropServices;
using VlnStatus;
using System.Collections.Specialized;
using ROFST_FILE;
using Volian.Base.Library;
//using VlnProfiler; //don't forget to add VlnProfiler to the reference list

View File

@@ -263,6 +263,7 @@ using System.Collections.Specialized;
using Org.Mentalis.Files;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace RODBInterface
@@ -1909,6 +1910,8 @@ namespace RODBInterface
string Info = DBE.GetString(3);
//B2022-043 &pos; was missing the ;
Info = Info.Replace("&apos;", "\'"); // B2021-071: crash when getting/saving field names
Info = Regex.Replace(Info, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003
node.SetAttribute("HasChild", "True");
// Store data in the VlnXmlElement as a subgroup
@@ -1972,6 +1975,7 @@ namespace RODBInterface
elem.SetAttribute("RecID", RecID);
elem.SetAttribute("ParentID", node.GetAttribute("RecID"));
elem.SetAttribute("Table", node.GetAttribute("Table"));
AccPageID = Regex.Replace(AccPageID, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003
elem.SetAttribute("AccPageID", AccPageID);
}
}
@@ -2182,10 +2186,13 @@ namespace RODBInterface
parent.SetAttribute("ChildLoaded", "True");
}
string xmlstr = GenerateXmlString(ro, false);
string wraccid = null;
if (ro.HasAttribute("AccPageID"))
{
string accid = ro.GetAttribute("AccPageID");
int quote = accid.IndexOf("'");
if (quote >= 0)
wraccid = accid.Insert(quote, "'");

View File

@@ -39,7 +39,7 @@ namespace ctlXMLEditLib
{
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TextBox tbZoom;
private System.Windows.Forms.RichTextBox tbZoom; // RO Editor add symbols C2022 - 003
/// <summary>
/// Required designer variable.
/// </summary>
@@ -88,7 +88,7 @@ namespace ctlXMLEditLib
/// </summary>
private void InitializeComponent()
{
this.tbZoom = new System.Windows.Forms.TextBox();
this.tbZoom = new System.Windows.Forms.RichTextBox(); // RO Editor add symbols C2022 - 003
this.btnSave = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
@@ -99,7 +99,7 @@ namespace ctlXMLEditLib
this.tbZoom.Location = new System.Drawing.Point(24, 16);
this.tbZoom.Multiline = true;
this.tbZoom.Name = "tbZoom";
this.tbZoom.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbZoom.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; // RO Editor add symbols C2022 - 003
this.tbZoom.Size = new System.Drawing.Size(576, 392);
this.tbZoom.TabIndex = 0;
//

View File

@@ -200,7 +200,10 @@ using System.Xml.Schema;
using System.Text;
using RODBInterface;
using Org.Mentalis.Files;
//using IniFileIO;
using System.Windows;
using System.Text.RegularExpressions;
using System.Linq;
@@ -221,6 +224,7 @@ namespace ctlXMLEditLib
///
///
/// </summary>
public class ctlXMLEdit : System.Windows.Forms.UserControl
{
/// <summary>
@@ -237,12 +241,12 @@ namespace ctlXMLEditLib
private bool dosaveflag;
private VlnXmlElement editelem;
private XmlDocument editdoc;
private TextBox zoomtextbox;
private RichTextBox zoomtextbox;
// the following is used for handling images. Note that if we want to have more
// than one image defined in an ro, this should be become a list.
private TextBox GraphicsFiletextbox;
private TextBox GraphicsWdtextbox;
private TextBox GraphicsHttextbox;
private RichTextBox GraphicsFiletextbox;
private RichTextBox GraphicsWdtextbox;
private RichTextBox GraphicsHttextbox;
private System.Windows.Forms.Button btnFindFile;
private string GraphicsText;
private ToolTip zmtooltip;
@@ -265,6 +269,19 @@ namespace ctlXMLEditLib
private GroupBox pcGrpBox = null;
/** end C2021-026 **/
public string _RO_IDEN;
public string RO_IDEN
{
get
{
return _RO_IDEN;
}
set
{
_RO_IDEN = value;
}
}
// use this struct to define attributes for the text box fields, storing
// the pattern, radio button association, required field flag, etc.
struct TextBoxAttrTag
@@ -311,10 +328,19 @@ namespace ctlXMLEditLib
public string GetParentHTId { get { return parenthtid; } }
public void SetParentHTId(string id) { this.parenthtid = id; }
}
private RichTextBox _TextBoxFocus; // RO Editor add symbols C2022 - 003
public RichTextBox TextBoxFocus
{
get { return _TextBoxFocus; }
set
{
_TextBoxFocus = value;
}
}
public ctlXMLEdit(VlnXmlElement myelem, XmlSchema myschema, ArrayList reqfields, ArrayList fldsWithApplic, string [] pckids)
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
FieldsWithApplic = fldsWithApplic;
PCChildren = pckids; //C2021-026 list of Parent/Child children
@@ -359,11 +385,12 @@ namespace ctlXMLEditLib
// Set required fields based on list. (can add message later).
SetRequiredFields(reqfields);
dosaveflag=true;
RO_IDEN = myelem.GetAccPageIDTemplate();
}
// set the required fields tag on those fields which are included in the passed
// in required fields list.
private void DoSet(TextBox hwnd, string msg)
private void DoSet(RichTextBox hwnd, string msg) // RO Editor add symbols C2022 - 003
{
if (hwnd == null) return;
if (hwnd.Tag != null)
@@ -378,7 +405,7 @@ namespace ctlXMLEditLib
private void SetRequiredFields(ArrayList reqfields)
{
Object o;
TextBox hwnd;
RichTextBox hwnd;
string field, msg;
int indx;
foreach (string strfld in reqfields)
@@ -397,15 +424,15 @@ namespace ctlXMLEditLib
o = myHT[field+"a"];
if (o != null) // set all combo types required, the checker
{
DoSet((TextBox)o,msg);
DoSet((TextBox)myHT[field+"b"],msg);
DoSet((TextBox)myHT[field+"c"],msg);
DoSet((TextBox)myHT[field+"d"],msg);
DoSet((RichTextBox)o,msg);
DoSet((RichTextBox)myHT[field+"b"],msg);
DoSet((RichTextBox)myHT[field+"c"],msg);
DoSet((RichTextBox)myHT[field+"d"],msg);
}
}
else if (o != null)
{
hwnd = (TextBox) o;
hwnd = (RichTextBox) o;
if (hwnd.Tag != null)
{
TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag;
@@ -419,7 +446,7 @@ namespace ctlXMLEditLib
// C2021-026 If this is a Parent/Child field that has no value saved in the database
// then use the parent's value and display it as grey colored text.
private void GetDefaultParentValue(TextBox tb, XmlNode node, string chldName)
private void GetDefaultParentValue(RichTextBox tb, XmlNode node, string chldName)
{
XmlNode parentNode = null;
// PCChildren contains a list strings reprenting the Children setup in the current Working Draft Parent/Child property
@@ -463,21 +490,23 @@ namespace ctlXMLEditLib
private void DisplayFieldContents(XmlNode node)
{
Object o;
TextBox hwnd;
RichTextBox hwnd;
XmlNode nd;
// if we have an image, check it for validity, i.e. file exists, etc.??
foreach (string str in myHT.Keys)
{
o = myHT[str];
hwnd = (TextBox) o;
hwnd = (RichTextBox)o;
nd = node.SelectSingleNode(str);
// if not found with just the string, search the tree.
if (nd==null)nd = node.SelectSingleNode("*/"+str);
if (nd == null || nd.InnerText.Length==0) // B2024-004 use Parent value if Child text length is zero
GetDefaultParentValue(hwnd, node, str); // C2021-026 Parent/Child Field has no value so use parent's value
else
{
hwnd.Text = nd.InnerText; // set the field's text from XML
{
hwnd.Text = Regex.Replace(nd.InnerText, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // set the field's text from XML
Size size = hwnd.Size;
// check if this window has a button name as part of its tag. If
// so it's a combo type & the radio button/visibility may need to
@@ -546,7 +575,7 @@ namespace ctlXMLEditLib
// height/width data of the image.
if (GraphicsFiletextbox != null && GraphicsFiletextbox.Text != "") UpdateHtWd();
}
public TextBox GetGraphicsFiletextbox()
public RichTextBox GetGraphicsFiletextbox()
{
return GraphicsFiletextbox;
}
@@ -585,13 +614,13 @@ namespace ctlXMLEditLib
{
dosaveflag=false;
mysavexml=false;
TextBox hwnd;
RichTextBox hwnd;
// first, clear out all of the text boxes.
foreach (string str in myHT.Keys)
{
object o = myHT[str];
hwnd = (TextBox) o;
hwnd = (RichTextBox) o;
hwnd.Text = "";
TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag;
RadioButton radio;
@@ -623,7 +652,7 @@ namespace ctlXMLEditLib
// to the parent's value, then clear the child's textbox so that nothing is saved
// to the database. This allow us to know that a specific value was not set
// for this Parent/Child child
private void RemovePCChildTextIfSameAsParent(XmlNode node, TextBox tb, string chldName)
private void RemovePCChildTextIfSameAsParent(XmlNode node, RichTextBox tb, string chldName)
{
XmlNode parentNode = null;
// if this is a child node get the parent's value
@@ -656,22 +685,47 @@ namespace ctlXMLEditLib
}
}
// SaveData saves the data in the element which had been sent to the control. Return
// true if success, false if fail.
// Note that the Parent and Child XML node variables below are not coding for Parent/Child Applicabily Fields
public bool SaveData()
{
if (mysavexml)
{
TextBox hwnd;
RichTextBox hwnd;
TextBoxAttrTag tag;
string imgdate;
//go thru the hash table to get textboxes. Find the ones that have text.
foreach (string str in myHT.Keys)
foreach (string str in myHT.Keys) // RO Editor add symbols C2022 - 003
{
object o = myHT[str];
hwnd = (TextBox) o;
hwnd = (RichTextBox) o;
string result1 = "";
string Str = "";
char[] chrAry = hwnd.Text.ToCharArray();
foreach (int chr in chrAry)
{
if (chr > 166)
{
Str = $"\\u{(int)chr}?";
result1 = result1 + Str;
}
else
{
result1 = result1 + (char)chr;
}
}
hwnd.Text = result1;
imgdate = null;
// if this is a required field and there is no text, put out an error
// message and get out of here.
@@ -788,6 +842,7 @@ namespace ctlXMLEditLib
return (false);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
@@ -858,7 +913,7 @@ namespace ctlXMLEditLib
// 'normalizedString') or a multiline text box(type is 'string'). Also, a radio
// button is passed in if this was called to handle an element within a combo type.
// This button is saved for a given text box so that initialization of these combo types can occur.
private string DisplayXmlSchemaSimpleType(XmlSchemaSimpleType simpleType, TextBox mytextbox, RadioButton radio,
private string DisplayXmlSchemaSimpleType(XmlSchemaSimpleType simpleType, RichTextBox mytextbox, RadioButton radio,
bool img, string imgname)
{
// set up for text box tag, which stores whether field is required and
@@ -888,12 +943,17 @@ namespace ctlXMLEditLib
if (getannot.IndexOf("Lines")>=0)
{
GraphicsHttextbox = mytextbox;
Size size = GraphicsHttextbox.Size;
mytextbox.LostFocus += new System.EventHandler(this.GraphicsHt_lostfocus);
}
if (getannot.IndexOf("Character")>=0)
{
GraphicsWdtextbox = mytextbox;
mytextbox.LostFocus += new System.EventHandler(this.GraphicsWd_lostfocus);
}
}
}
@@ -904,14 +964,17 @@ namespace ctlXMLEditLib
{
// A Schema Type Restriction is used to define single or multi-line boxes.
XmlSchemaSimpleTypeRestriction myRestrictions = (XmlSchemaSimpleTypeRestriction) simpleType.Content;
if (myRestrictions.BaseTypeName.Name == "normalizedString")
if (myRestrictions.BaseTypeName.Name == "normalizedString")
{
mytextbox.Multiline = false;
mytextbox.Size = new Size(300, 40);
}
else
{
mytextbox.Multiline = true;
mytextbox.AcceptsReturn = true;
mytextbox.Height = (int) mytextbox.Font.GetHeight() * 4;
mytextbox.ScrollBars = ScrollBars.Vertical;
mytextbox.AcceptsTab = true;
mytextbox.Height = (int)mytextbox.Font.GetHeight() * 4;
mytextbox.ScrollBars = RichTextBoxScrollBars.Vertical;
zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom");
}
@@ -992,7 +1055,8 @@ namespace ctlXMLEditLib
radio.CheckedChanged += new System.EventHandler(this.radiocheckchg);
gbox.Controls.Add(radio);
TextBox tb = new TextBox();
RichTextBox tb = new RichTextBox();
Size size3 = tb.Size;
tb.Location = new Point(boxx+20, y+25);
if (!first) tb.Visible = false;
myHT.Add(element.Name,tb);
@@ -1001,7 +1065,7 @@ namespace ctlXMLEditLib
// the groupbox.
Controls.Add(tb);
tb.TextChanged += new System.EventHandler(this.textbox_change);
tb.GotFocus += new System.EventHandler(this.textbox_zoombtn);
tb.GotFocus += new System.EventHandler(this.currentTextBox);
tb.KeyDown += new KeyEventHandler(MyOnKeyDown);
gbox.Contains(tb);
// the following will set attributes on the text boxes such as maxlength, multiline, etc.
@@ -1144,8 +1208,9 @@ namespace ctlXMLEditLib
}
else
{
TextBox mytextbox;
mytextbox = new TextBox();
RichTextBox mytextbox;
mytextbox = new RichTextBox();
Size size3 = mytextbox.Size;
mytextbox.Location = new Point(screenx+indent, screeny);
string tFieldName = (pcChildIdx == 0) ? CvtUserFldToFld(element.Name) : CvtUserFldToFld(pcChildFldName);
mytextbox.Name = tFieldName;
@@ -1155,7 +1220,7 @@ namespace ctlXMLEditLib
screeny = screeny + 10;
mytextbox.TextChanged += new System.EventHandler(this.textbox_change);
mytextbox.Validating += new System.ComponentModel.CancelEventHandler(this.textbox_Validating);
mytextbox.GotFocus += new System.EventHandler(this.textbox_zoombtn);
mytextbox.GotFocus += new System.EventHandler(this.currentTextBox);
mytextbox.KeyDown += new KeyEventHandler(MyOnKeyDown);
if (pcChildIdx > 0)
{
@@ -1192,9 +1257,18 @@ namespace ctlXMLEditLib
// the following is needed to load the control.
private void ctlXMLEdit_Load(object sender, System.EventArgs e)
{
}
public delegate void ctlXMLEditEvent(object sender, ctlXMLEditEventArgs args); // RO Editor add symbols C2022 - 003 for turning off symbols btn for RO ID field.
public event ctlXMLEditEvent EnableDisableSymbolsBtn;
private void OnEnableDisableSymbolsBtn(ctlXMLEditEventArgs args)
{
if (EnableDisableSymbolsBtn != null)
EnableDisableSymbolsBtn(this, args);
}
// when data in a text box has changed, flag it (except for when this
// happens during loading of original data). This flag will be used
// later to know whether to save data.
@@ -1264,7 +1338,7 @@ namespace ctlXMLEditLib
private void radiocheckchg(object sender, System.EventArgs e)
{
RadioButton btnsel = (RadioButton) sender;
TextBox assocbox;
RichTextBox assocbox;
string btntext, str;
if(dosaveflag)mysavexml = true;
@@ -1277,7 +1351,7 @@ namespace ctlXMLEditLib
str = btnsel.Name.Replace(btntext,"");
object o = myHT[str];
if (o == null) return;
assocbox = (TextBox) o;
assocbox = (RichTextBox) o;
// make the text box visible if checked, otherwise, invisible
assocbox.Visible = btnsel.Checked;
// C2021-026 show or hide the Parent/Child appicability group box
@@ -1391,7 +1465,7 @@ namespace ctlXMLEditLib
// The following can be used to validate the text, i.e. check the text against
// the pattern. this needs written yet (5/16/02)
private void MyValidatingCode(TextBox tb)
private void MyValidatingCode(RichTextBox tb)
{
//get the text box's tag which contains a flag for whether this is required &
//if it has a pattern. If it has a pattern, validate the field against the pattern.
@@ -1420,20 +1494,35 @@ namespace ctlXMLEditLib
}
// save which box we're on, for zoom processing.
private void textbox_zoombtn(object sender, System.EventArgs e)
private void currentTextBox(object sender, System.EventArgs e)
{
TextBox textbox = (TextBox) sender;
RichTextBox textbox = (RichTextBox) sender;
if (textbox.Multiline == true || textbox == GraphicsFiletextbox)
zoomtextbox = textbox;
else
zoomtextbox = null;
TextBoxFocus = textbox;
string RO_IDENDITY = RO_IDEN.Substring(1, RO_IDEN.Length - 2); // RO Editor add symbols C2022 - 003 for turning off symbols btn for RO ID.
if (textbox.Name == RO_IDENDITY)
{
//ROEditor.rbtnSymbols.Enabled = false;
OnEnableDisableSymbolsBtn(new ctlXMLEditEventArgs(DisplaySymBolBtn:false));
}
else
{
//ROEditor.rbtnSymbols.Enabled = true;
OnEnableDisableSymbolsBtn(new ctlXMLEditEventArgs(DisplaySymBolBtn:true));
}
}
private void textbox_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
try
{
MyValidatingCode((TextBox) sender);
MyValidatingCode((RichTextBox) sender);
}
catch(Exception ex)
@@ -1460,7 +1549,7 @@ namespace ctlXMLEditLib
btnZoom_click(null, null);
}
}
public void btnZoom_click(object sender, System.EventArgs e)
{
//TextBox tb = (TextBox) sender;
@@ -1888,7 +1977,7 @@ namespace ctlXMLEditLib
* and overload a couple of it's functions in order to use it.
* - called in CalculatePromsDate() above.
*/
public class ThisTimeZone : TimeZone
public class ThisTimeZone : TimeZone
{
private TimeZone curTZ;
public TimeSpan SpanTZ;
@@ -1929,5 +2018,43 @@ namespace ctlXMLEditLib
return curTZ.GetDaylightChanges(year);
}
}
public class ctlXMLEditEventArgs : EventArgs // RO Editor add symbols C2022 - 003 for turning off symbols btn for RO ID.
{
public ctlXMLEditEventArgs() {; }
public ctlXMLEditEventArgs(bool DisplaySymBolBtn)
{
_DisplaySymBolBtn = DisplaySymBolBtn;
}
private bool _DisplaySymBolBtn;
public bool DisplaySymBolBtn
{
get { return _DisplaySymBolBtn; }
set { _DisplaySymBolBtn = value; }
}
}
public static class RichTextBoxExtensions // RO Editor add symbols C2022 - 003
{
public static void InsertSymbol(this RichTextBox richTextBox, int symbcode)
{
int position = richTextBox.SelectionStart;
string sym = string.Format(symbcode < 256 ? "\'{0:X2}" : @"\u{0}", symbcode);
string RtfPrefixForSymbols = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 FreeMono; } {\f1\fnil\fcharset0 FreeMono; } } {\colortbl;\red255\green0\blue0;\red0\green0\blue255; } \viewkind4\uc1\pard\fs24 \f1\fs24 ";
richTextBox.SelectedRtf = RtfPrefixForSymbols + sym + @"}";
richTextBox.SelectedRtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033\uc1 }";
richTextBox.Select(position, 0);
}
}
public enum E_FontStyle : byte
{
FS_NONE = 0,
FS_BOLD = 0x01,
FS_UNDERLINE = 0x02,
FS_ITALIC = 0x04,
FS_SUPERSCRIPT = 0x08,
FS_SUBSCRIPT = 0x10
}
}

View File

@@ -494,6 +494,8 @@ namespace VEPROMS.CSLA.Library
{
roid = FormatRoidKey(roid, true);
string retval = GetRoChild(roid).value;
if (string.IsNullOrEmpty(retval))
@@ -2152,8 +2154,15 @@ namespace VEPROMS.CSLA.Library
if (string.IsNullOrEmpty(s2))
return s2;
var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003
if (Regex.IsMatch(s2, pattern))
s2 = s2.Replace(@"\u160?", "<HSP>"); // convert hard spaces bug fix: B2016-206
s2 = s2.Replace(@"\", @"\u9586?"); // convert backslashes to a backslash symbol
if (!Regex.IsMatch(s2, pattern)) // RO Editor add symbols C2022 - 003
{
s2 = s2.Replace(@"\", @"\u9586?"); // convert backslashes to a backslash symbol
}
s2 = s2.Replace("<HSP>", @"\u160?"); // convert hard spaces bug fix: B2016-206
s2 = s2.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days.
s2 = s2.Replace("\xf8", @"\'b0"); // convert \xf8 to degree.

View File

@@ -81,7 +81,7 @@ namespace Volian.Controls.Library
this.lbROId.Dock = System.Windows.Forms.DockStyle.Left;
this.lbROId.ForeColor = System.Drawing.SystemColors.Highlight;
this.lbROId.Location = new System.Drawing.Point(48, 24);
this.lbROId.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.lbROId.Margin = new System.Windows.Forms.Padding(2);
this.lbROId.Name = "lbROId";
this.lbROId.Size = new System.Drawing.Size(183, 33);
this.superTooltip1.SetSuperTooltip(this.lbROId, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here. Double-Click to open" +
@@ -97,7 +97,7 @@ namespace Volian.Controls.Library
this.lblROID.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblROID.Dock = System.Windows.Forms.DockStyle.Left;
this.lblROID.Location = new System.Drawing.Point(0, 24);
this.lblROID.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.lblROID.Margin = new System.Windows.Forms.Padding(2);
this.lblROID.Name = "lblROID";
this.lblROID.Size = new System.Drawing.Size(48, 33);
this.superTooltip1.SetSuperTooltip(this.lblROID, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80)));
@@ -139,7 +139,7 @@ namespace Volian.Controls.Library
this.btnGoToRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnGoToRO.Enabled = false;
this.btnGoToRO.Location = new System.Drawing.Point(0, 55);
this.btnGoToRO.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnGoToRO.Margin = new System.Windows.Forms.Padding(2);
this.btnGoToRO.Name = "btnGoToRO";
this.btnGoToRO.Size = new System.Drawing.Size(233, 18);
this.btnGoToRO.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -155,7 +155,7 @@ namespace Volian.Controls.Library
this.btnPreviewRO.Dock = System.Windows.Forms.DockStyle.Top;
this.btnPreviewRO.Enabled = false;
this.btnPreviewRO.Location = new System.Drawing.Point(0, 37);
this.btnPreviewRO.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnPreviewRO.Margin = new System.Windows.Forms.Padding(2);
this.btnPreviewRO.Name = "btnPreviewRO";
this.btnPreviewRO.Size = new System.Drawing.Size(233, 18);
this.superTooltip1.SetSuperTooltip(this.btnPreviewRO, new DevComponents.DotNetBar.SuperTooltipInfo("Preview", "", "This will Preview the selected RO Table, X/Y Plot, or Image.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80)));
@@ -263,6 +263,7 @@ namespace Volian.Controls.Library
this.Controls.Add(this.tvROFST);
this.Controls.Add(this.lbFound);
this.Controls.Add(this.panelValue);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "DisplayRO";
this.Size = new System.Drawing.Size(233, 507);
this.panelValue.ResumeLayout(false);

View File

@@ -1,18 +1,18 @@
using DevComponents.DotNetBar;
using JR.Utils.GUI.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using XYPlots;
using DevComponents.DotNetBar;
using System.Text.RegularExpressions;
using Volian.Base.Library;
using JR.Utils.GUI.Forms;
using System.Linq;
using XYPlots;
namespace Volian.Controls.Library
{
@@ -372,8 +372,7 @@ namespace Volian.Controls.Library
{
// B2022-088: [JPR] Find Doc Ro button not working in Word Sections
// B2022-098: [JPR] ROs not being resolved in Word Sections
if (e.Node.Tag is ROFSTLookup.rochild)
{
if (e.Node.Tag is ROFSTLookup.rochild){
ROFSTLookup.rochild chld = (ROFSTLookup.rochild)e.Node.Tag;
selectedChld = chld;
@@ -770,9 +769,15 @@ namespace Volian.Controls.Library
}
else
{
tmp = new TreeNode(roc.title);
tmp.Tag = roc;
if (tmp.Text.IndexOf("\\u") > -1) // RO Editor add symbols C2022 - 003
{
tmp.Text = Regex.Replace(tmp.Text, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString());
}
if (roc.roid.Length == 16)
{
tn.Nodes.Add(tmp);
@@ -921,11 +926,12 @@ namespace Volian.Controls.Library
// Pad to 16 to store in the RoUsage table.
string padroid = ROFSTLookup.FormatRoidKey(roc.roid, true);
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", padroid, MyROFST.RODbID);
// Resolve symbols and scientific notation in the RO return value
string valtxt = MyROFSTLookup.GetTranslatedRoValue(padroid, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues, false, MyRTB.MyItemInfo);
MyRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, selectedChld.value, linktxt, padroid, MyROFST.RODbID));
// Resolve symbols and scientific notation in the RO return value
string valtxt = MyROFSTLookup.GetTranslatedRoValue(padroid, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues, false, MyRTB.MyItemInfo);
MyRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, selectedChld.value, linktxt, padroid, MyROFST.RODbID));
}
}

View File

@@ -112,20 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="btnSaveRO.SuperTooltip" xml:space="preserve">
<value>For Step Editor sections:
- This will place the selected RO at the cursor position.
- This will replace an RO with the selected RO.
For Word sections
- This will place the needed RO ID on the clipboard.</value>
</data>
</root>

View File

@@ -1400,9 +1400,13 @@ namespace Volian.Controls.Library
if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null);
int position = SelectionStart;
SelectionLength = 0;
linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 ");
linkValue = linkValue.Replace("\\u9586?", "\\f1\\u9586?\\f0 "); // backslash symbol
linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 ");
var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003
foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase))
{
linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + " \\f0");
}
linkValue = linkValue.Replace(@"{", @"\{");
linkValue = linkValue.Replace(@"}", @"\}");
SelectedRtf = @"{\rtf1\ansi" + FontTable + @"{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}\v" + FontSize + @" <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"[END>\v0 }";

View File

@@ -723,6 +723,7 @@ namespace Volian.Controls.Library
}
}
}
private void SetBtnInsSupInfoVisible()
{
if (MyItemInfo == null) return;

File diff suppressed because it is too large Load Diff