Add previous/next drawcall buttons to event browser. Refs #389

* They also have the global shortcut ctrl-left arrow and ctrl-right.
* Also a couple of tweaks to find behaviour to act more intuitively to
  what other applications do - allow F3/shift-F3 without the find box
  highlighted, and don't clear out the find text when closing it.
This commit is contained in:
baldurk
2016-10-13 16:49:28 +02:00
parent 7764192a3c
commit cb406f67a9
4 changed files with 157 additions and 69 deletions
+82 -48
View File
@@ -30,25 +30,27 @@
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.ToolStripLabel toolStripLabel3;
TreelistView.TreeListColumn treeListColumn1 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("EID", "EID")));
TreelistView.TreeListColumn treeListColumn2 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("Drawcall", "Draw #")));
TreelistView.TreeListColumn treeListColumn3 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("Name", "Name")));
TreelistView.TreeListColumn treeListColumn4 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("Duration", "Duration (µs)")));
System.Windows.Forms.ToolStripLabel toolStripLabel4;
TreelistView.TreeListColumn treeListColumn1 = new TreelistView.TreeListColumn("EID", "EID");
TreelistView.TreeListColumn treeListColumn2 = new TreelistView.TreeListColumn("Drawcall", "Draw #");
TreelistView.TreeListColumn treeListColumn3 = new TreelistView.TreeListColumn("Name", "Name");
TreelistView.TreeListColumn treeListColumn4 = new TreelistView.TreeListColumn("Duration", "Duration (µs)");
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.eventView = new TreelistView.TreeListView();
this.eventViewRightClick = new System.Windows.Forms.ContextMenuStrip(this.components);
this.selectVisibleColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.expandAll = new System.Windows.Forms.ToolStripMenuItem();
this.collapseAll = new System.Windows.Forms.ToolStripMenuItem();
this.selectVisibleColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.findEventButton = new System.Windows.Forms.ToolStripButton();
this.jumpEventButton = new System.Windows.Forms.ToolStripButton();
this.timeDraws = new System.Windows.Forms.ToolStripButton();
this.selectColumnsButton = new System.Windows.Forms.ToolStripButton();
this.toggleBookmark = new System.Windows.Forms.ToolStripButton();
this.export = new System.Windows.Forms.ToolStripButton();
this.jumpStrip = new System.Windows.Forms.ToolStrip();
this.jumpToEID = new renderdocui.Controls.ToolStripSpringTextBox();
this.findStrip = new System.Windows.Forms.ToolStrip();
@@ -56,12 +58,13 @@
this.closeFind = new System.Windows.Forms.ToolStripButton();
this.findNext = new System.Windows.Forms.ToolStripButton();
this.findPrev = new System.Windows.Forms.ToolStripButton();
this.findHighlight = new System.Windows.Forms.Timer(this.components);
this.bookmarkStrip = new System.Windows.Forms.ToolStrip();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toggleBookmark = new System.Windows.Forms.ToolStripButton();
this.export = new System.Windows.Forms.ToolStripButton();
this.findHighlight = new System.Windows.Forms.Timer(this.components);
this.exportDialog = new System.Windows.Forms.SaveFileDialog();
this.prevDraw = new System.Windows.Forms.ToolStripButton();
this.nextDraw = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
toolStripLabel4 = new System.Windows.Forms.ToolStripLabel();
this.toolStripContainer1.ContentPanel.SuspendLayout();
@@ -81,6 +84,13 @@
toolStripLabel3.Size = new System.Drawing.Size(47, 22);
toolStripLabel3.Text = "Controls";
//
// toolStripLabel4
//
toolStripLabel4.Image = global::renderdocui.Properties.Resources.asterisk_orange;
toolStripLabel4.Name = "toolStripLabel4";
toolStripLabel4.Size = new System.Drawing.Size(74, 22);
toolStripLabel4.Text = "Bookmarks";
//
// toolStripLabel1
//
this.toolStripLabel1.Image = global::renderdocui.Properties.Resources.flag_green;
@@ -160,17 +170,9 @@
this.collapseAll,
this.selectVisibleColumnsToolStripMenuItem});
this.eventViewRightClick.Name = "contextMenuStrip1";
this.eventViewRightClick.Size = new System.Drawing.Size(179, 92);
this.eventViewRightClick.Size = new System.Drawing.Size(179, 70);
this.eventViewRightClick.Opening += new System.ComponentModel.CancelEventHandler(this.eventViewRightClick_Opening);
//
// selectVisibleColumnsToolStripMenuItem
//
this.selectVisibleColumnsToolStripMenuItem.Image = global::renderdocui.Properties.Resources.timeline_marker;
this.selectVisibleColumnsToolStripMenuItem.Name = "selectVisibleColumnsToolStripMenuItem";
this.selectVisibleColumnsToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
this.selectVisibleColumnsToolStripMenuItem.Text = "Select &Visible Columns";
this.selectVisibleColumnsToolStripMenuItem.Click += new System.EventHandler(this.selectVisibleColumnsToolStripMenuItem_Click);
//
// expandAll
//
this.expandAll.Image = global::renderdocui.Properties.Resources.fit_window;
@@ -187,6 +189,14 @@
this.collapseAll.Text = "&Collapse All";
this.collapseAll.Click += new System.EventHandler(this.collapseAll_Click);
//
// selectVisibleColumnsToolStripMenuItem
//
this.selectVisibleColumnsToolStripMenuItem.Image = global::renderdocui.Properties.Resources.timeline_marker;
this.selectVisibleColumnsToolStripMenuItem.Name = "selectVisibleColumnsToolStripMenuItem";
this.selectVisibleColumnsToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
this.selectVisibleColumnsToolStripMenuItem.Text = "Select &Visible Columns";
this.selectVisibleColumnsToolStripMenuItem.Click += new System.EventHandler(this.selectVisibleColumnsToolStripMenuItem_Click);
//
// toolStrip1
//
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
@@ -194,6 +204,9 @@
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
toolStripLabel3,
this.toolStripSeparator1,
this.prevDraw,
this.nextDraw,
this.toolStripSeparator3,
this.findEventButton,
this.jumpEventButton,
this.timeDraws,
@@ -255,6 +268,26 @@
this.selectColumnsButton.Text = "Select visible columns";
this.selectColumnsButton.Click += new System.EventHandler(this.selectColumnsButton_Click);
//
// toggleBookmark
//
this.toggleBookmark.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toggleBookmark.Image = global::renderdocui.Properties.Resources.asterisk_orange;
this.toggleBookmark.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toggleBookmark.Name = "toggleBookmark";
this.toggleBookmark.Size = new System.Drawing.Size(23, 22);
this.toggleBookmark.Text = "Toggle Bookmark";
this.toggleBookmark.Click += new System.EventHandler(this.toggleBookmark_Click);
//
// export
//
this.export.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.export.Image = global::renderdocui.Properties.Resources.save;
this.export.ImageTransparentColor = System.Drawing.Color.Magenta;
this.export.Name = "export";
this.export.Size = new System.Drawing.Size(23, 22);
this.export.Text = "Export";
this.export.Click += new System.EventHandler(this.export_Click);
//
// jumpStrip
//
this.jumpStrip.Dock = System.Windows.Forms.DockStyle.None;
@@ -299,8 +332,8 @@
this.findEvent.Size = new System.Drawing.Size(108, 25);
this.findEvent.ToolTipText = "Find an event by type or name";
this.findEvent.Leave += new System.EventHandler(this.jumpFind_Leave);
this.findEvent.KeyDown += new System.Windows.Forms.KeyEventHandler(this.findEvent_KeyDown);
this.findEvent.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.findEvent_KeyPress);
this.findEvent.KeyDown += new System.Windows.Forms.KeyEventHandler(findEvent_KeyDown);
this.findEvent.TextChanged += new System.EventHandler(this.findEvent_TextChanged);
//
// closeFind
@@ -334,11 +367,6 @@
this.findPrev.Text = "Find Previous Match";
this.findPrev.Click += new System.EventHandler(this.findPrev_Click);
//
// findHighlight
//
this.findHighlight.Interval = 400;
this.findHighlight.Tick += new System.EventHandler(this.findHighlight_Tick);
//
// bookmarkStrip
//
this.bookmarkStrip.Dock = System.Windows.Forms.DockStyle.None;
@@ -357,32 +385,10 @@
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
//
// toolStripLabel4
// findHighlight
//
toolStripLabel4.Image = global::renderdocui.Properties.Resources.asterisk_orange;
toolStripLabel4.Name = "toolStripLabel4";
toolStripLabel4.Size = new System.Drawing.Size(74, 22);
toolStripLabel4.Text = "Bookmarks";
//
// toggleBookmarkButton
//
this.toggleBookmark.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toggleBookmark.Image = global::renderdocui.Properties.Resources.asterisk_orange;
this.toggleBookmark.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toggleBookmark.Name = "toggleBookmarkButton";
this.toggleBookmark.Size = new System.Drawing.Size(23, 22);
this.toggleBookmark.Text = "Toggle Bookmark";
this.toggleBookmark.Click += new System.EventHandler(this.toggleBookmark_Click);
//
// export
//
this.export.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.export.Image = global::renderdocui.Properties.Resources.save;
this.export.ImageTransparentColor = System.Drawing.Color.Magenta;
this.export.Name = "export";
this.export.Size = new System.Drawing.Size(23, 22);
this.export.Text = "Export";
this.export.Click += new System.EventHandler(this.export_Click);
this.findHighlight.Interval = 400;
this.findHighlight.Tick += new System.EventHandler(this.findHighlight_Tick);
//
// exportDialog
//
@@ -390,6 +396,31 @@
this.exportDialog.Filter = "Text Files (*.txt)|*.txt";
this.exportDialog.Title = "Save Event List";
//
// prevDraw
//
this.prevDraw.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.prevDraw.Image = global::renderdocui.Properties.Resources.back;
this.prevDraw.ImageTransparentColor = System.Drawing.Color.Magenta;
this.prevDraw.Name = "prevDraw";
this.prevDraw.Size = new System.Drawing.Size(23, 22);
this.prevDraw.Text = "Go to Previous Drawcall";
this.prevDraw.Click += new System.EventHandler(this.prevDraw_Click);
//
// nextDraw
//
this.nextDraw.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.nextDraw.Image = global::renderdocui.Properties.Resources.forward;
this.nextDraw.ImageTransparentColor = System.Drawing.Color.Magenta;
this.nextDraw.Name = "nextDraw";
this.nextDraw.Size = new System.Drawing.Size(23, 22);
this.nextDraw.Text = "Go To Next Drawcall";
this.nextDraw.Click += new System.EventHandler(this.nextDraw_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
//
// EventBrowser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -450,6 +481,9 @@
private System.Windows.Forms.ToolStripMenuItem collapseAll;
private System.Windows.Forms.ToolStripButton export;
private System.Windows.Forms.SaveFileDialog exportDialog;
private System.Windows.Forms.ToolStripButton prevDraw;
private System.Windows.Forms.ToolStripButton nextDraw;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
}
}
+52 -18
View File
@@ -412,6 +412,9 @@ namespace renderdocui.Windows
m_FrameNode = null;
eventView.EndUpdate();
prevDraw.Enabled = false;
nextDraw.Enabled = false;
ClearBookmarks();
findEventButton.Enabled = false;
@@ -429,6 +432,9 @@ namespace renderdocui.Windows
toggleBookmark.Enabled = true;
export.Enabled = true;
prevDraw.Enabled = false;
nextDraw.Enabled = false;
ClearBookmarks();
eventView.BeginUpdate();
@@ -663,10 +669,20 @@ namespace renderdocui.Windows
private void eventView_AfterSelect(object sender, TreeViewEventArgs e)
{
prevDraw.Enabled = false;
nextDraw.Enabled = false;
if (eventView.SelectedNode.Tag != null)
{
DeferredEvent def = eventView.SelectedNode.Tag as DeferredEvent;
m_Core.SetEventID(this, def.eventID);
FetchDrawcall draw = m_Core.CurDrawcall;
if (draw != null && draw.previous != null)
prevDraw.Enabled = true;
if (draw != null && draw.next != null)
nextDraw.Enabled = true;
}
HighlightBookmarks();
@@ -685,12 +701,12 @@ namespace renderdocui.Windows
private void ShowFind()
{
HideJumpAndFind();
if(!findStrip.Visible)
HideJumpAndFind();
jumpStrip.Visible = false;
findStrip.Visible = true;
findEvent.Text = "";
findEvent.Focus();
findEvent.BackColor = SystemColors.Window;
}
@@ -698,19 +714,23 @@ namespace renderdocui.Windows
private void HideJumpAndFind()
{
jumpStrip.Visible = false;
findStrip.Visible = false;
if (findEvent.Text.Length == 0)
{
findStrip.Visible = false;
ClearFindIcons();
}
ClearFindIcons();
}
private void eventView_KeyDown(object sender, KeyEventArgs e)
{
if (!m_Core.LogLoaded) return;
if (e.KeyCode == Keys.F3)
{
if(e.Shift)
Find(false);
else
Find(true);
}
if(e.Control)
{
Keys[] digits = { Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5,
@@ -830,7 +850,10 @@ namespace renderdocui.Windows
}
private void jumpFind_Leave(object sender, EventArgs e)
{
HideJumpAndFind();
if (findEvent.Text == "")
{
HideJumpAndFind();
}
}
private void jumpToEID_TextChanged(object sender, EventArgs e)
@@ -885,10 +908,9 @@ namespace renderdocui.Windows
if (e.KeyCode == Keys.F3)
{
if (findHighlight.Enabled)
{
findHighlight.Enabled = false;
findHighlight_Tick(sender, null);
}
findHighlight_Tick(sender, null);
if (findEvent.Text.Length > 0)
{
@@ -905,7 +927,6 @@ namespace renderdocui.Windows
if (e.KeyChar == '\0')
{
findHighlight.Enabled = false;
findEvent.Text = "";
HideJumpAndFind();
@@ -916,10 +937,9 @@ namespace renderdocui.Windows
if (e.KeyChar == '\n' || e.KeyChar == '\r')
{
if (findHighlight.Enabled)
{
findHighlight.Enabled = false;
findHighlight_Tick(sender, null);
}
findHighlight_Tick(sender, null);
if (findEvent.Text.Length > 0)
{
@@ -957,8 +977,6 @@ namespace renderdocui.Windows
private void closeFind_Click(object sender, EventArgs e)
{
findEvent.Text = "";
HideJumpAndFind();
eventView.Focus();
@@ -979,6 +997,22 @@ namespace renderdocui.Windows
Find(false);
}
private void prevDraw_Click(object sender, EventArgs e)
{
FetchDrawcall draw = m_Core.CurDrawcall;
if (draw != null && draw.previous != null)
SelectEvent(draw.previous.eventID);
}
private void nextDraw_Click(object sender, EventArgs e)
{
FetchDrawcall draw = m_Core.CurDrawcall;
if (draw != null && draw.next != null)
SelectEvent(draw.next.eventID);
}
private void Find(bool forward)
{
if (findEvent.Text.Length == 0)
+3 -3
View File
@@ -120,6 +120,9 @@
<metadata name="toolStripLabel3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="toolStripLabel4.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="eventViewRightClick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>308, 17</value>
</metadata>
@@ -135,9 +138,6 @@
<metadata name="bookmarkStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>573, 17</value>
</metadata>
<metadata name="toolStripLabel4.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="findHighlight.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>459, 17</value>
</metadata>
+20
View File
@@ -1654,6 +1654,26 @@ namespace renderdocui.Windows
}
}
}
if (keyData == (Keys.Control | Keys.Left))
{
FetchDrawcall draw = m_Core.CurDrawcall;
if (draw != null && draw.previous != null)
m_Core.SetEventID(null, draw.previous.eventID);
return true;
}
if (keyData == (Keys.Control | Keys.Right))
{
FetchDrawcall draw = m_Core.CurDrawcall;
if (draw != null && draw.next != null)
m_Core.SetEventID(null, draw.next.eventID);
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}