mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Fixes for pull request #101
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.ToolStripContainer toolStripContainer1;
|
||||
System.Windows.Forms.ToolStrip toolStrip1;
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PythonShell));
|
||||
@@ -50,6 +51,7 @@
|
||||
this.saveDialog = new System.Windows.Forms.SaveFileDialog();
|
||||
this.openDialog = new System.Windows.Forms.OpenFileDialog();
|
||||
this.newScript = new System.Windows.Forms.ToolStripButton();
|
||||
this.linenumTimer = new System.Windows.Forms.Timer(this.components);
|
||||
toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
|
||||
toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
toolStripContainer1.ContentPanel.SuspendLayout();
|
||||
@@ -301,6 +303,11 @@
|
||||
this.newScript.Text = "New";
|
||||
this.newScript.Click += new System.EventHandler(this.newScript_Click);
|
||||
//
|
||||
// linenumTimer
|
||||
//
|
||||
this.linenumTimer.Interval = 500;
|
||||
this.linenumTimer.Tick += new System.EventHandler(this.linenumTimer_Tick);
|
||||
//
|
||||
// PythonShell
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
@@ -356,6 +363,7 @@
|
||||
private System.Windows.Forms.SaveFileDialog saveDialog;
|
||||
private System.Windows.Forms.OpenFileDialog openDialog;
|
||||
private System.Windows.Forms.ToolStripButton newScript;
|
||||
private System.Windows.Forms.Timer linenumTimer;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -287,9 +287,9 @@ namespace renderdocui.Windows.Dialogs
|
||||
{
|
||||
if (result == "exception")
|
||||
{
|
||||
System.Diagnostics.Trace.WriteLine("On line " + frame.f_lineno.ToString());
|
||||
linenum = (int)frame.f_lineno - 1;
|
||||
System.Diagnostics.Trace.WriteLine("On line " + frame.f_lineno.ToString());
|
||||
}
|
||||
linenum = (int)frame.f_lineno - 1;
|
||||
|
||||
stdoutwriter.Flush();
|
||||
stdout.Seek(0, SeekOrigin.Begin);
|
||||
@@ -339,6 +339,9 @@ namespace renderdocui.Windows.Dialogs
|
||||
|
||||
EnableButtons(false);
|
||||
|
||||
linenumTimer.Enabled = true;
|
||||
linenumTimer.Start();
|
||||
|
||||
Thread th = Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
pythonengine.SetTrace(PythonTrace);
|
||||
@@ -346,6 +349,7 @@ namespace renderdocui.Windows.Dialogs
|
||||
// ignore output, the trace handler above will print output
|
||||
string output = Execute(pythonengine, scriptscope, script);
|
||||
|
||||
linenumTimer.Stop();
|
||||
pythonengine.SetTrace(null);
|
||||
|
||||
this.BeginInvoke(new Action(() =>
|
||||
@@ -439,5 +443,10 @@ namespace renderdocui.Windows.Dialogs
|
||||
|
||||
scriptEditor.Text = scriptEditor.Text.Replace("\n", Environment.NewLine);
|
||||
}
|
||||
|
||||
private void linenumTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
SetLineNumber(linenum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,4 +166,7 @@
|
||||
<metadata name="openDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>318, 16</value>
|
||||
</metadata>
|
||||
<metadata name="linenumTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>433, 16</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Reference in New Issue
Block a user