Commit 4c0c49d9 authored by Alexander Dietsch's avatar Alexander Dietsch

LWSimulatorGUI:

-Small fix when highlighting a text bigger than the window

Dissertation:
-Added import pre-execution command
-Added section of macros
parent dc077841
......@@ -489,6 +489,7 @@ namespace LWSimulatorGUI
int topLeftChar = fCTBProgram.GetCharFromPosition(new Point(0, 0));
int currentSelect = fCTBProgram.SelectionStart;
int currentSelectLength = fCTBProgram.SelectionLength;
int toScrollChar = fCTBProgram.GetCharIndexFromPosition(new Point(0, fCTBProgram.Location.Y));
this.SuspendLayout();
/*
// Incredibly complicated replacement because "fCTBProgram.rtf = tmpRTB.rtf;" does change the rtf in Mono
......@@ -525,7 +526,12 @@ namespace LWSimulatorGUI
fCTBProgram.SuspendLayout();
if (focused)
fCTBProgram.Focus();
fCTBProgram.Rtf = tmpRTB.Rtf;
this.SuspendLayout();
fCTBProgram.SuspendLayout();
fCTBProgram.Rtf = tmpRTB.Rtf;
fCTBProgram.Select(toScrollChar, 0); //Scroll correctly
fCTBProgram.ScrollToCaret();
fCTBProgram.Select(currentSelect, currentSelectLength);
AddLineNumbers();
fCTBProgram.PerformLayout();
......@@ -662,9 +668,12 @@ namespace LWSimulatorGUI
*/
int currentSelect = fCTBProgram.SelectionStart;
int currentSelectLength = fCTBProgram.SelectionLength;
int toScrollChar = fCTBProgram.GetCharIndexFromPosition(new Point(0, fCTBProgram.Location.Y));
this.SuspendLayout();
fCTBProgram.SuspendLayout();
fCTBProgram.Rtf = tmpRTB.Rtf;
fCTBProgram.Select(toScrollChar, 0); //Scroll correctly
fCTBProgram.ScrollToCaret();
fCTBProgram.Select(currentSelect, currentSelectLength);
if (focused)
fCTBProgram.Focus();
......
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