Commit f55d8ae9 authored by Alexander Dietsch's avatar Alexander Dietsch

GUI:

-Put in workaround for not being able to edit text after editing registers
under everything but Windows
-Fixed contents not moving when resizing the window
-Cells now correctly keep their values when edited and then program is run
(formerly a click out of the cell was needed)
parent 5e09be2c
......@@ -89,7 +89,7 @@
this.checkSyntaxToolStripMenuItem1});
this.mSMainMenu.Location = new System.Drawing.Point(0, 0);
this.mSMainMenu.Name = "mSMainMenu";
this.mSMainMenu.Size = new System.Drawing.Size(852, 24);
this.mSMainMenu.Size = new System.Drawing.Size(756, 24);
this.mSMainMenu.TabIndex = 0;
this.mSMainMenu.Text = "mSMainMenu";
//
......@@ -250,7 +250,7 @@
this.tSBStop});
this.tSMainToolStrip.Location = new System.Drawing.Point(0, 24);
this.tSMainToolStrip.Name = "tSMainToolStrip";
this.tSMainToolStrip.Size = new System.Drawing.Size(852, 25);
this.tSMainToolStrip.Size = new System.Drawing.Size(756, 25);
this.tSMainToolStrip.TabIndex = 1;
this.tSMainToolStrip.Text = "tSMainToolStrip";
//
......@@ -333,8 +333,8 @@
// spCMainGUI.Panel2
//
this.spCMainGUI.Panel2.Controls.Add(this.dGVRegisters);
this.spCMainGUI.Size = new System.Drawing.Size(852, 458);
this.spCMainGUI.SplitterDistance = 567;
this.spCMainGUI.Size = new System.Drawing.Size(756, 465);
this.spCMainGUI.SplitterDistance = 502;
this.spCMainGUI.TabIndex = 2;
this.spCMainGUI.Resize += new System.EventHandler(this.MainGUI_Resize);
//
......@@ -359,7 +359,7 @@
this.rTBLineNumbers.Name = "rTBLineNumbers";
this.rTBLineNumbers.ReadOnly = true;
this.rTBLineNumbers.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
this.rTBLineNumbers.Size = new System.Drawing.Size(38, 472);
this.rTBLineNumbers.Size = new System.Drawing.Size(38, 479);
this.rTBLineNumbers.TabIndex = 1;
this.rTBLineNumbers.TabStop = false;
this.rTBLineNumbers.Text = "";
......@@ -375,12 +375,13 @@
this.fCTBProgram.DetectUrls = false;
this.fCTBProgram.Location = new System.Drawing.Point(47, 1);
this.fCTBProgram.Name = "fCTBProgram";
this.fCTBProgram.Size = new System.Drawing.Size(515, 452);
this.fCTBProgram.Size = new System.Drawing.Size(450, 459);
this.fCTBProgram.TabIndex = 0;
this.fCTBProgram.Text = "";
this.fCTBProgram.WordWrap = false;
this.fCTBProgram.SelectionChanged += new System.EventHandler(this.fCTBProgram_SelectionChanged);
this.fCTBProgram.VScroll += new System.EventHandler(this.fCTBProgram_VScroll);
this.fCTBProgram.MouseClick += new System.Windows.Forms.MouseEventHandler(this.fCTBProgram_MouseClick);
this.fCTBProgram.FontChanged += new System.EventHandler(this.fCTBProgram_FontChanged);
this.fCTBProgram.TextChanged += new System.EventHandler(this.fCTBProgram_TextChanged);
//
......@@ -411,7 +412,7 @@
this.dGVRegisters.Name = "dGVRegisters";
this.dGVRegisters.RowHeadersVisible = false;
this.dGVRegisters.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.dGVRegisters.Size = new System.Drawing.Size(277, 454);
this.dGVRegisters.Size = new System.Drawing.Size(246, 461);
this.dGVRegisters.TabIndex = 0;
this.dGVRegisters.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGVRegisters_CellEndEdit);
this.dGVRegisters.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dGVRegisters_CellValidating);
......@@ -443,7 +444,7 @@
// bRevertAllReg
//
this.bRevertAllReg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.bRevertAllReg.Location = new System.Drawing.Point(701, 24);
this.bRevertAllReg.Location = new System.Drawing.Point(605, 24);
this.bRevertAllReg.Name = "bRevertAllReg";
this.bRevertAllReg.Size = new System.Drawing.Size(149, 23);
this.bRevertAllReg.TabIndex = 3;
......@@ -454,7 +455,7 @@
// bRevertReg
//
this.bRevertReg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.bRevertReg.Location = new System.Drawing.Point(573, 24);
this.bRevertReg.Location = new System.Drawing.Point(477, 24);
this.bRevertReg.Name = "bRevertReg";
this.bRevertReg.Size = new System.Drawing.Size(122, 23);
this.bRevertReg.TabIndex = 4;
......@@ -472,7 +473,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(852, 507);
this.ClientSize = new System.Drawing.Size(756, 514);
this.Controls.Add(this.bRevertReg);
this.Controls.Add(this.bRevertAllReg);
this.Controls.Add(this.spCMainGUI);
......
......@@ -57,7 +57,7 @@ namespace LWSimulatorGUI
{
InitializeComponent();
// Remove ugly selection colors (usually cell has blue background => cell is selected)
/* this.dGVRegisters.DefaultCellStyle.SelectionBackColor = SystemColors.Highlight;
/*this.dGVRegisters.DefaultCellStyle.SelectionBackColor = SystemColors.Highlight;
this.dGVRegisters.DefaultCellStyle.SelectionForeColor = SystemColors.HighlightText;*/
simulator = new LWCoordinator();
for (int i = 0; i < simulator.getRegisterAmount(); i++)
......@@ -73,7 +73,7 @@ namespace LWSimulatorGUI
log = new LogWindow(this, simulator);
log.Show();
}
/// <summary>
/// Updates options; Thread safe
/// </summary>
......@@ -235,6 +235,7 @@ namespace LWSimulatorGUI
}
pBIndicateLine.Invalidate();
this.PerformLayout();
this.ResumeLayout();
}
......@@ -512,7 +513,8 @@ namespace LWSimulatorGUI
{
long parsedVal = 0;
if (long.TryParse(e.FormattedValue.ToString(), out parsedVal) == false)
e.Cancel = true;
//e.Cancel = true;
dGVRegisters.CancelEdit();
}
//dGVRegisters.CurrentCell.Selected = false;
}
......@@ -570,8 +572,7 @@ namespace LWSimulatorGUI
{
if (dGVRegisters.IsCurrentCellInEditMode)
{
dGVRegisters.CancelEdit();
dGVRegisters.EndEdit();
dGVRegisters.CurrentCell = null;
dGVRegisters.Columns[1].ReadOnly = true; // Prevent deadlocks by calling this here.
}
simulator.runProgram(fCTBProgram.Text);
......@@ -609,8 +610,7 @@ namespace LWSimulatorGUI
{
if (dGVRegisters.IsCurrentCellInEditMode)
{
dGVRegisters.CancelEdit();
dGVRegisters.EndEdit();
dGVRegisters.CurrentCell = null; // Workaround to validate cell even if run is pressed
dGVRegisters.Columns[1].ReadOnly = true; // Prevent deadlocks by calling this here.
}
simulator.singleStepProgram(fCTBProgram.Text);
......@@ -835,6 +835,15 @@ namespace LWSimulatorGUI
SendKeys.Send(tabReplacement);
}
}
/// <summary>
/// Fix for mono on Linux and MacOS to focus textbox after editing gridview
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void fCTBProgram_MouseClick(object sender, MouseEventArgs e)
{
fCTBProgram.Focus();
}
#endregion
}
......
Everything is located in LWSimulatorCons/bin/Release
To execute the program, type "mono LWSimulatorGUI.exe" in command line.
Alternatively try "mono LWSimulator.exe -G"
\ No newline at end of file
Alternatively try "mono LWSimulator.exe -G"
On Windows Mono is not necessary.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment