From f9e257cfa5f93028a8c5e85d2fbfc751505b6ca9 Mon Sep 17 00:00:00 2001 From: tfoman Date: Sat, 25 Jul 2015 16:53:57 +0200 Subject: [PATCH] Change of button-places etc. --- CobXmlSupport/CobRow.cs | 43 ++++++++++++++++++++- CobXmlSupport/CobXmlSupport.csproj | 1 + CobXmlSupport/GenCobCode.Designer.cs | 56 ++++++++++++++-------------- CobXmlSupport/GenCobCode.cs | 16 ++++---- CobXmlSupport/S.cs | 52 ++++++++++++++------------ CobXmlSupport/ShowCode.Designer.cs | 1 + CobXmlSupport/savedFile.cs | 33 ++++++++++++++++ 7 files changed, 141 insertions(+), 61 deletions(-) create mode 100644 CobXmlSupport/savedFile.cs diff --git a/CobXmlSupport/CobRow.cs b/CobXmlSupport/CobRow.cs index 43f27d5..2a68542 100644 --- a/CobXmlSupport/CobRow.cs +++ b/CobXmlSupport/CobRow.cs @@ -13,6 +13,8 @@ namespace CobXmlSupport private string __rowSource; private int __startPos; private int __occNum; + private string moveCode; + private string moveFromCode; public CobRow(string rowSource) { @@ -44,11 +46,48 @@ namespace CobXmlSupport public string LocalKey { get; set; } public string SampleStr { get; set; } - public string MoveCode { get; set; } + public string Move_Code + { + get + { + return moveCode; + } + } + + public string MoveCode { + get { + return " *" + S.strX(' ', 72 - 15 - this.FieldName.Length) + "------" + this.FieldName + "\r\n" + + moveCode + + "\r\n *" + S.strX(' ', 72 - 15 - this.FieldName.Length) + "------" + this.FieldName + "\r\n"; + + } + set{ + moveCode = value; + } + } //Holding code-parts used when generating moves, to structure //Could be a Variable, simple or qualified, could be retreival code. //Will replace "MOVE " when generating move sequences - public string MoveFromCode { get; set; } + + public string Move_FromCode + { + get + { + return moveFromCode; + } + } + + + public string MoveFromCode { + get { + return " *" + S.strX(' ', 72 - 15 - this.FieldName.Length) + "------" + this.FieldName + "\r\n" + + moveFromCode + + "\r\n *" + S.strX(' ', 72 - 15 - this.FieldName.Length) + "------" + this.FieldName + "\r\n"; + } + set{ + moveFromCode = value; + } + } //Holding code-parts used when generating moves, from structure //Could be a Variable, simple or qualified, could be retreival code. //Will replace "TO " when generating move sequences diff --git a/CobXmlSupport/CobXmlSupport.csproj b/CobXmlSupport/CobXmlSupport.csproj index df5442b..f72e197 100644 --- a/CobXmlSupport/CobXmlSupport.csproj +++ b/CobXmlSupport/CobXmlSupport.csproj @@ -76,6 +76,7 @@ + Form diff --git a/CobXmlSupport/GenCobCode.Designer.cs b/CobXmlSupport/GenCobCode.Designer.cs index ae4dd71..d885056 100644 --- a/CobXmlSupport/GenCobCode.Designer.cs +++ b/CobXmlSupport/GenCobCode.Designer.cs @@ -94,7 +94,7 @@ this.outText.Multiline = true; this.outText.Name = "outText"; this.outText.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.outText.Size = new System.Drawing.Size(380, 446); + this.outText.Size = new System.Drawing.Size(380, 418); this.outText.TabIndex = 1; this.outText.WordWrap = false; // @@ -104,11 +104,11 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.outCob.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.outCob.Location = new System.Drawing.Point(406, 121); + this.outCob.Location = new System.Drawing.Point(406, 123); this.outCob.Multiline = true; this.outCob.Name = "outCob"; this.outCob.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.outCob.Size = new System.Drawing.Size(527, 446); + this.outCob.Size = new System.Drawing.Size(545, 416); this.outCob.TabIndex = 2; this.outCob.WordWrap = false; this.outCob.KeyDown += new System.Windows.Forms.KeyEventHandler(this.outCob_KeyDown); @@ -136,7 +136,7 @@ // btnClose // this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnClose.Location = new System.Drawing.Point(861, 670); + this.btnClose.Location = new System.Drawing.Point(880, 628); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(72, 23); this.btnClose.TabIndex = 6; @@ -308,7 +308,7 @@ // btnSettings // this.btnSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnSettings.Location = new System.Drawing.Point(9, 26); + this.btnSettings.Location = new System.Drawing.Point(9, 17); this.btnSettings.Margin = new System.Windows.Forms.Padding(2); this.btnSettings.Name = "btnSettings"; this.btnSettings.Size = new System.Drawing.Size(81, 23); @@ -338,7 +338,7 @@ // btnTestThings // this.btnTestThings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnTestThings.Location = new System.Drawing.Point(9, 49); + this.btnTestThings.Location = new System.Drawing.Point(9, 41); this.btnTestThings.Name = "btnTestThings"; this.btnTestThings.Size = new System.Drawing.Size(81, 23); this.btnTestThings.TabIndex = 33; @@ -349,7 +349,7 @@ // btnCrossref // this.btnCrossref.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnCrossref.Location = new System.Drawing.Point(180, 26); + this.btnCrossref.Location = new System.Drawing.Point(93, 17); this.btnCrossref.Name = "btnCrossref"; this.btnCrossref.Size = new System.Drawing.Size(81, 23); this.btnCrossref.TabIndex = 35; @@ -361,7 +361,7 @@ // this.chkBackupVars.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.chkBackupVars.AutoSize = true; - this.chkBackupVars.Location = new System.Drawing.Point(267, 30); + this.chkBackupVars.Location = new System.Drawing.Point(96, 45); this.chkBackupVars.Name = "chkBackupVars"; this.chkBackupVars.Size = new System.Drawing.Size(87, 17); this.chkBackupVars.TabIndex = 36; @@ -392,9 +392,9 @@ this.grpProduce.Controls.Add(this.btnMoveFrom); this.grpProduce.Controls.Add(this.btnMoves); this.grpProduce.Controls.Add(this.btnGenICode); - this.grpProduce.Location = new System.Drawing.Point(406, 568); + this.grpProduce.Location = new System.Drawing.Point(406, 545); this.grpProduce.Name = "grpProduce"; - this.grpProduce.Size = new System.Drawing.Size(527, 77); + this.grpProduce.Size = new System.Drawing.Size(545, 77); this.grpProduce.TabIndex = 38; this.grpProduce.TabStop = false; this.grpProduce.Text = "Producera"; @@ -402,7 +402,7 @@ // btnFrXMLTo // this.btnFrXMLTo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnFrXMLTo.Location = new System.Drawing.Point(279, 49); + this.btnFrXMLTo.Location = new System.Drawing.Point(297, 49); this.btnFrXMLTo.Name = "btnFrXMLTo"; this.btnFrXMLTo.Size = new System.Drawing.Size(92, 22); this.btnFrXMLTo.TabIndex = 43; @@ -414,7 +414,7 @@ // this.chkAttribs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.chkAttribs.AutoSize = true; - this.chkAttribs.Location = new System.Drawing.Point(375, 54); + this.chkAttribs.Location = new System.Drawing.Point(396, 54); this.chkAttribs.Name = "chkAttribs"; this.chkAttribs.Size = new System.Drawing.Size(85, 17); this.chkAttribs.TabIndex = 42; @@ -426,7 +426,7 @@ // this.chkNewArea.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.chkNewArea.AutoSize = true; - this.chkNewArea.Location = new System.Drawing.Point(377, 21); + this.chkNewArea.Location = new System.Drawing.Point(395, 21); this.chkNewArea.Name = "chkNewArea"; this.chkNewArea.Size = new System.Drawing.Size(64, 17); this.chkNewArea.TabIndex = 41; @@ -439,7 +439,7 @@ // this.chkMvToDisp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.chkMvToDisp.AutoSize = true; - this.chkMvToDisp.Location = new System.Drawing.Point(201, 38); + this.chkMvToDisp.Location = new System.Drawing.Point(219, 38); this.chkMvToDisp.Name = "chkMvToDisp"; this.chkMvToDisp.Size = new System.Drawing.Size(71, 17); this.chkMvToDisp.TabIndex = 40; @@ -451,7 +451,7 @@ // this.chkPerform.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.chkPerform.AutoSize = true; - this.chkPerform.Location = new System.Drawing.Point(201, 21); + this.chkPerform.Location = new System.Drawing.Point(219, 21); this.chkPerform.Name = "chkPerform"; this.chkPerform.Size = new System.Drawing.Size(62, 17); this.chkPerform.TabIndex = 39; @@ -464,7 +464,7 @@ this.chkDisplays.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.chkDisplays.AutoSize = true; this.chkDisplays.Enabled = false; - this.chkDisplays.Location = new System.Drawing.Point(378, 38); + this.chkDisplays.Location = new System.Drawing.Point(396, 38); this.chkDisplays.Name = "chkDisplays"; this.chkDisplays.Size = new System.Drawing.Size(71, 17); this.chkDisplays.TabIndex = 38; @@ -476,7 +476,7 @@ // this.btnMoveFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnMoveFrom.Enabled = false; - this.btnMoveFrom.Location = new System.Drawing.Point(279, 26); + this.btnMoveFrom.Location = new System.Drawing.Point(297, 26); this.btnMoveFrom.Name = "btnMoveFrom"; this.btnMoveFrom.Size = new System.Drawing.Size(92, 23); this.btnMoveFrom.TabIndex = 37; @@ -488,7 +488,7 @@ // this.btnMoves.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnMoves.Enabled = false; - this.btnMoves.Location = new System.Drawing.Point(102, 26); + this.btnMoves.Location = new System.Drawing.Point(120, 26); this.btnMoves.Margin = new System.Windows.Forms.Padding(2); this.btnMoves.Name = "btnMoves"; this.btnMoves.Size = new System.Drawing.Size(93, 23); @@ -501,7 +501,7 @@ // this.btnGenICode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnGenICode.Enabled = false; - this.btnGenICode.Location = new System.Drawing.Point(17, 26); + this.btnGenICode.Location = new System.Drawing.Point(35, 26); this.btnGenICode.Margin = new System.Windows.Forms.Padding(2); this.btnGenICode.Name = "btnGenICode"; this.btnGenICode.Size = new System.Drawing.Size(81, 23); @@ -513,11 +513,13 @@ // grpSettings // this.grpSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.grpSettings.Controls.Add(this.btnSaveArea); + this.grpSettings.Controls.Add(this.btnShowWorkFiles); this.grpSettings.Controls.Add(this.chkBackupVars); this.grpSettings.Controls.Add(this.btnSettings); this.grpSettings.Controls.Add(this.btnTestThings); this.grpSettings.Controls.Add(this.btnCrossref); - this.grpSettings.Location = new System.Drawing.Point(20, 568); + this.grpSettings.Location = new System.Drawing.Point(21, 545); this.grpSettings.Name = "grpSettings"; this.grpSettings.Size = new System.Drawing.Size(379, 77); this.grpSettings.TabIndex = 39; @@ -527,19 +529,19 @@ // btnSaveArea // this.btnSaveArea.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSaveArea.Location = new System.Drawing.Point(420, 665); + this.btnSaveArea.Location = new System.Drawing.Point(255, 12); this.btnSaveArea.Name = "btnSaveArea"; - this.btnSaveArea.Size = new System.Drawing.Size(75, 23); + this.btnSaveArea.Size = new System.Drawing.Size(99, 23); this.btnSaveArea.TabIndex = 40; - this.btnSaveArea.Text = "Spara copy"; + this.btnSaveArea.Text = "Spara COB-copy"; this.btnSaveArea.UseVisualStyleBackColor = true; this.btnSaveArea.Click += new System.EventHandler(this.btnSaveArea_Click); // // btnShowWorkFiles // - this.btnShowWorkFiles.Location = new System.Drawing.Point(31, 665); + this.btnShowWorkFiles.Location = new System.Drawing.Point(255, 41); this.btnShowWorkFiles.Name = "btnShowWorkFiles"; - this.btnShowWorkFiles.Size = new System.Drawing.Size(75, 23); + this.btnShowWorkFiles.Size = new System.Drawing.Size(99, 23); this.btnShowWorkFiles.TabIndex = 41; this.btnShowWorkFiles.Text = "Arbetsfiler"; this.btnShowWorkFiles.UseVisualStyleBackColor = true; @@ -549,9 +551,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(945, 705); - this.Controls.Add(this.btnShowWorkFiles); - this.Controls.Add(this.btnSaveArea); + this.ClientSize = new System.Drawing.Size(963, 659); this.Controls.Add(this.grpSettings); this.Controls.Add(this.grpProduce); this.Controls.Add(this.btnRerun); diff --git a/CobXmlSupport/GenCobCode.cs b/CobXmlSupport/GenCobCode.cs index 6bf0974..5142dda 100644 --- a/CobXmlSupport/GenCobCode.cs +++ b/CobXmlSupport/GenCobCode.cs @@ -240,8 +240,8 @@ namespace CobXmlSupport //Debug.WriteLine("Upplagt fält: " + rw.FieldName); } } - if (rw.MoveCode == null) { rw.MoveCode = " "; } - Cc.WorkDicIn[rw.FieldName] = rw.MoveCode; + if (rw.Move_Code == null) { rw.MoveCode = " "; } + Cc.WorkDicIn[rw.FieldName] = rw.Move_Code; if (Cc.WorkDicOut != null && Cc.WorkDicOut.Count > 0) { @@ -254,8 +254,8 @@ namespace CobXmlSupport Cc.WorkDicOut.Add(rw.FieldName, ""); } } - if (rw.MoveFromCode == null) { rw.MoveFromCode = " "; } - Cc.WorkDicOut[rw.FieldName] = rw.MoveFromCode; + if (rw.Move_FromCode == null) { rw.MoveFromCode = " "; } + Cc.WorkDicOut[rw.FieldName] = rw.Move_FromCode; } // Prefill with possibly filled out code if (chkWrap.Checked) @@ -1519,7 +1519,7 @@ namespace CobXmlSupport genExtMoves.CodeShower.Text += "\r\n MOVE "; - if (cr.MoveCode == null || cr.MoveCode.Trim().Length < 1) + if (cr.Move_Code == null || cr.Move_Code.Trim().Length < 1) genExtMoves.CodeShower.Text += "0"; else genExtMoves.CodeShower.Text += "1"; @@ -1548,7 +1548,7 @@ namespace CobXmlSupport //---------------- Changed //if (cr.MoveCode.Length > 1 && cr.MoveCode != " ") - if (cr.MoveCode == null || cr.MoveCode.Trim() == "") + if (cr.Move_Code == null || cr.Move_Code.Trim() == "") { if (cr.FieldDef.ToUpper().IndexOf("X") > -1) { @@ -1771,7 +1771,7 @@ namespace CobXmlSupport fromMoves.CodeShower.Text += "( " + occParRows + " )"; } fromMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + "TO "; - if (cr.MoveFromCode.Trim().Length > 0) + if (cr.Move_FromCode.Trim().Length > 0) { fromMoves.CodeShower.Text += cr.MoveFromCode; } @@ -1795,7 +1795,7 @@ namespace CobXmlSupport fromMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + "Move space to " + S.ettingLogVarName + " "; fromMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + "String "; - if (cr.MoveFromCode.Trim().Length > 0) + if (cr.Move_FromCode.Trim().Length > 0) { fromMoves.CodeShower.Text += "\r\n " + adjustIf(adj) + cr.MoveFromCode + " delimited by \" \" "; } diff --git a/CobXmlSupport/S.cs b/CobXmlSupport/S.cs index ed1d5f1..0e757c4 100644 --- a/CobXmlSupport/S.cs +++ b/CobXmlSupport/S.cs @@ -55,32 +55,38 @@ namespace CobXmlSupport } if (!upd) S.ettingList.Add(f); } - } - - public class savedFile : ICloneable - { - public savedFile() + + public static string strX(char chs, int length) { - idConnect=""; - usageName=""; - directorySaved=""; - fNameSaved=""; - saveDate = DateTime.MinValue; + return new String(chs, length); } - public string idConnect; - public string usageName; - public string directorySaved; - public string fNameSaved; - public DateTime saveDate; - - - public object Clone() - { - savedFile tmpSF = new savedFile(); - tmpSF = (savedFile)this.MemberwiseClone(); - return tmpSF; - } } + //public class savedFile : ICloneable + //{ + // public savedFile() + // { + // idConnect=""; + // usageName=""; + // directorySaved=""; + // fNameSaved=""; + // saveDate = DateTime.MinValue; + // } + + // public string idConnect; + // public string usageName; + // public string directorySaved; + // public string fNameSaved; + // public DateTime saveDate; + + + // public object Clone() + // { + // savedFile tmpSF = new savedFile(); + // tmpSF = (savedFile)this.MemberwiseClone(); + // return tmpSF; + // } + //} + } \ No newline at end of file diff --git a/CobXmlSupport/ShowCode.Designer.cs b/CobXmlSupport/ShowCode.Designer.cs index 7262b96..ab5d955 100644 --- a/CobXmlSupport/ShowCode.Designer.cs +++ b/CobXmlSupport/ShowCode.Designer.cs @@ -102,6 +102,7 @@ // // btnSaveAktualText // + this.btnSaveAktualText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnSaveAktualText.Location = new System.Drawing.Point(12, 642); this.btnSaveAktualText.Name = "btnSaveAktualText"; this.btnSaveAktualText.Size = new System.Drawing.Size(83, 23); diff --git a/CobXmlSupport/savedFile.cs b/CobXmlSupport/savedFile.cs new file mode 100644 index 0000000..4ecdaed --- /dev/null +++ b/CobXmlSupport/savedFile.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CobXmlSupport +{ + public class savedFile : ICloneable + { + public savedFile() + { + idConnect = ""; + usageName = ""; + directorySaved = ""; + fNameSaved = ""; + saveDate = DateTime.MinValue; + } + + public string idConnect; + public string usageName; + public string directorySaved; + public string fNameSaved; + public DateTime saveDate; + + + public object Clone() + { + savedFile tmpSF = new savedFile(); + tmpSF = (savedFile)this.MemberwiseClone(); + return tmpSF; + } + } +}