diff options
author | 2011-09-20 15:50:49 -0700 | |
---|---|---|
committer | 2011-09-20 15:50:49 -0700 | |
commit | 709c38aca00cdc72cb2e0fedf9f14c940530fd9a (patch) | |
tree | cf46f88cfa6fae761be62867dd6a5e6db8e45715 /Source/ModelViewer/Main.cs | |
parent | 5da11a7db25352dc15b4cbc83afc350b0d6808b9 (diff) |
Tree navigation with left/right arrow
Diffstat (limited to 'Source/ModelViewer/Main.cs')
-rw-r--r-- | Source/ModelViewer/Main.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/ModelViewer/Main.cs b/Source/ModelViewer/Main.cs index a4492c70..f67b8497 100644 --- a/Source/ModelViewer/Main.cs +++ b/Source/ModelViewer/Main.cs @@ -700,6 +700,36 @@ namespace Microsoft.Boogie.ModelViewer {
}
+
+ private void currentStateView_KeyDown(object sender, KeyEventArgs e)
+ {
+ var node = SelectedNode();
+ if (node == null) return;
+
+ if (e.KeyCode == Keys.Right && !node.skel.Expanded && node.skel.Expandable) {
+ node.skel.Expanded = true;
+ SyncCurrentStateView();
+ return;
+ }
+
+ if (e.KeyCode == Keys.Left) {
+ if (node.skel.Expanded) {
+ node.skel.Expanded = false;
+ SyncCurrentStateView();
+ return;
+ } else {
+ var par = node.skel.parent;
+ if (par != null && par.parent != null) {
+ // par.Expanded = false;
+ foreach (DisplayItem it in currentStateView.Items) {
+ it.Selected = it.skel == par;
+ it.Focused = it.skel == par;
+ }
+ SyncCurrentStateView();
+ }
+ }
+ }
+ }
}
internal class DisplayItem : ListViewItem
|