Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/30/10 16:33:41 (13 years ago)
Author:
epitzer
Message:

replace parameter view with context menu to access variable values in execution context view (#47)

Location:
branches/HeuristicLab.DebugEngine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DebugEngine/OperationContentView.Designer.cs

    r4998 r5003  
    4848      this.groupBox = new System.Windows.Forms.GroupBox();
    4949      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    50       this.splitContainer2 = new System.Windows.Forms.SplitContainer();
    5150      this.executionContextGroupBox = new System.Windows.Forms.GroupBox();
    5251      this.executionContextTreeView = new System.Windows.Forms.TreeView();
    5352      this.executionContextImageList = new System.Windows.Forms.ImageList(this.components);
    54       this.parametersGroupBox = new System.Windows.Forms.GroupBox();
    55       this.parameterListView = new System.Windows.Forms.ListView();
    56       this.parameterColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    57       this.parametersImageList = new System.Windows.Forms.ImageList(this.components);
    5853      this.scopeGroupBox = new System.Windows.Forms.GroupBox();
    5954      this.scopeTreeView = new System.Windows.Forms.TreeView();
     
    6358      this.atomicLabel = new System.Windows.Forms.Label();
    6459      this.collectionLabel = new System.Windows.Forms.Label();
     60      this.parametersImageList = new System.Windows.Forms.ImageList(this.components);
     61      this.executionContextConextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
     62      this.showValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    6563      this.groupBox.SuspendLayout();
    6664      this.splitContainer1.Panel1.SuspendLayout();
    6765      this.splitContainer1.Panel2.SuspendLayout();
    6866      this.splitContainer1.SuspendLayout();
    69       this.splitContainer2.Panel1.SuspendLayout();
    70       this.splitContainer2.Panel2.SuspendLayout();
    71       this.splitContainer2.SuspendLayout();
    7267      this.executionContextGroupBox.SuspendLayout();
    73       this.parametersGroupBox.SuspendLayout();
    7468      this.scopeGroupBox.SuspendLayout();
     69      this.executionContextConextMenu.SuspendLayout();
    7570      this.SuspendLayout();
    7671      //
     
    9287      // splitContainer1
    9388      //
    94       this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    95                   | System.Windows.Forms.AnchorStyles.Left)
    96                   | System.Windows.Forms.AnchorStyles.Right)));
     89      this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     90            | System.Windows.Forms.AnchorStyles.Left)
     91            | System.Windows.Forms.AnchorStyles.Right)));
    9792      this.splitContainer1.Location = new System.Drawing.Point(6, 45);
    9893      this.splitContainer1.Name = "splitContainer1";
     
    10095      // splitContainer1.Panel1
    10196      //
    102       this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
     97      this.splitContainer1.Panel1.Controls.Add(this.executionContextGroupBox);
    10398      //
    10499      // splitContainer1.Panel2
     
    109104      this.splitContainer1.TabIndex = 4;
    110105      //
    111       // splitContainer2
    112       //
    113       this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
    114       this.splitContainer2.Location = new System.Drawing.Point(0, 0);
    115       this.splitContainer2.Name = "splitContainer2";
    116       this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
    117       //
    118       // splitContainer2.Panel1
    119       //
    120       this.splitContainer2.Panel1.Controls.Add(this.executionContextGroupBox);
    121       //
    122       // splitContainer2.Panel2
    123       //
    124       this.splitContainer2.Panel2.Controls.Add(this.parametersGroupBox);
    125       this.splitContainer2.Size = new System.Drawing.Size(242, 361);
    126       this.splitContainer2.SplitterDistance = 180;
    127       this.splitContainer2.TabIndex = 1;
    128       //
    129106      // executionContextGroupBox
    130107      //
     
    133110      this.executionContextGroupBox.Location = new System.Drawing.Point(0, 0);
    134111      this.executionContextGroupBox.Name = "executionContextGroupBox";
    135       this.executionContextGroupBox.Size = new System.Drawing.Size(242, 180);
     112      this.executionContextGroupBox.Size = new System.Drawing.Size(242, 361);
    136113      this.executionContextGroupBox.TabIndex = 0;
    137114      this.executionContextGroupBox.TabStop = false;
     
    140117      // executionContextTreeView
    141118      //
     119      this.executionContextTreeView.ContextMenuStrip = this.executionContextConextMenu;
    142120      this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
    143121      this.executionContextTreeView.ImageIndex = 0;
     
    147125      this.executionContextTreeView.SelectedImageIndex = 0;
    148126      this.executionContextTreeView.ShowNodeToolTips = true;
    149       this.executionContextTreeView.Size = new System.Drawing.Size(236, 161);
     127      this.executionContextTreeView.Size = new System.Drawing.Size(236, 342);
    150128      this.executionContextTreeView.TabIndex = 0;
    151129      this.executionContextTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseClick);
     
    157135      this.executionContextImageList.ImageSize = new System.Drawing.Size(16, 16);
    158136      this.executionContextImageList.TransparentColor = System.Drawing.Color.Transparent;
    159       //
    160       // parametersGroupBox
    161       //
    162       this.parametersGroupBox.Controls.Add(this.parameterListView);
    163       this.parametersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    164       this.parametersGroupBox.Location = new System.Drawing.Point(0, 0);
    165       this.parametersGroupBox.Name = "parametersGroupBox";
    166       this.parametersGroupBox.Size = new System.Drawing.Size(242, 177);
    167       this.parametersGroupBox.TabIndex = 0;
    168       this.parametersGroupBox.TabStop = false;
    169       this.parametersGroupBox.Text = "Parameters";
    170       //
    171       // parameterListView
    172       //
    173       this.parameterListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
    174             this.parameterColumn});
    175       this.parameterListView.Dock = System.Windows.Forms.DockStyle.Fill;
    176       this.parameterListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    177       this.parameterListView.HideSelection = false;
    178       this.parameterListView.Location = new System.Drawing.Point(3, 16);
    179       this.parameterListView.Name = "parameterListView";
    180       this.parameterListView.ShowItemToolTips = true;
    181       this.parameterListView.Size = new System.Drawing.Size(236, 158);
    182       this.parameterListView.SmallImageList = this.parametersImageList;
    183       this.parameterListView.TabIndex = 0;
    184       this.parameterListView.UseCompatibleStateImageBehavior = false;
    185       this.parameterListView.View = System.Windows.Forms.View.Details;
    186       this.parameterListView.ItemActivate += new System.EventHandler(this.parameterListView_ItemActivate);
    187       //
    188       // parametersImageList
    189       //
    190       this.parametersImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
    191       this.parametersImageList.ImageSize = new System.Drawing.Size(16, 16);
    192       this.parametersImageList.TransparentColor = System.Drawing.Color.Transparent;
    193137      //
    194138      // scopeGroupBox
     
    224168      // nameTextBox
    225169      //
    226       this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    227                   | System.Windows.Forms.AnchorStyles.Right)));
     170      this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     171            | System.Windows.Forms.AnchorStyles.Right)));
    228172      this.nameTextBox.Cursor = System.Windows.Forms.Cursors.Default;
    229173      this.nameTextBox.Location = new System.Drawing.Point(6, 19);
     
    266210      this.collectionLabel.TabIndex = 0;
    267211      this.collectionLabel.Text = "Collection";
     212      //
     213      // parametersImageList
     214      //
     215      this.parametersImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     216      this.parametersImageList.ImageSize = new System.Drawing.Size(16, 16);
     217      this.parametersImageList.TransparentColor = System.Drawing.Color.Transparent;
     218      //
     219      // executionContextConextMenu
     220      //
     221      this.executionContextConextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     222            this.showValueToolStripMenuItem});
     223      this.executionContextConextMenu.Name = "executionContextConextMenu";
     224      this.executionContextConextMenu.Size = new System.Drawing.Size(169, 48);
     225      this.executionContextConextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.executionContextConextMenu_Opening);
     226      //
     227      // showValueToolStripMenuItem
     228      //
     229      this.showValueToolStripMenuItem.Name = "showValueToolStripMenuItem";
     230      this.showValueToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
     231      this.showValueToolStripMenuItem.Text = "show actual value";
     232      this.showValueToolStripMenuItem.ToolTipText = "Try to obtain the parameter\'s actual value in the current execution context and o" +
     233    "pen it in a new view.";
     234      this.showValueToolStripMenuItem.Click += new System.EventHandler(this.ShowValue_Click);
    268235      //
    269236      // OperationContentView
     
    279246      this.splitContainer1.Panel2.ResumeLayout(false);
    280247      this.splitContainer1.ResumeLayout(false);
    281       this.splitContainer2.Panel1.ResumeLayout(false);
    282       this.splitContainer2.Panel2.ResumeLayout(false);
    283       this.splitContainer2.ResumeLayout(false);
    284248      this.executionContextGroupBox.ResumeLayout(false);
    285       this.parametersGroupBox.ResumeLayout(false);
    286249      this.scopeGroupBox.ResumeLayout(false);
     250      this.executionContextConextMenu.ResumeLayout(false);
    287251      this.ResumeLayout(false);
    288252
     
    297261    private System.Windows.Forms.Label collectionLabel;
    298262    private System.Windows.Forms.SplitContainer splitContainer1;
    299     private System.Windows.Forms.ListView parameterListView;
    300263    private System.Windows.Forms.TreeView scopeTreeView;
    301     private System.Windows.Forms.SplitContainer splitContainer2;
    302     private System.Windows.Forms.GroupBox executionContextGroupBox;
    303     private System.Windows.Forms.TreeView executionContextTreeView;
    304     private System.Windows.Forms.GroupBox parametersGroupBox;
    305264    private System.Windows.Forms.GroupBox scopeGroupBox;
    306265    private System.Windows.Forms.ImageList executionContextImageList;
    307266    private System.Windows.Forms.ImageList parametersImageList;
    308267    private System.Windows.Forms.ImageList scopeImageList;
    309     private System.Windows.Forms.ColumnHeader parameterColumn;
     268    private System.Windows.Forms.GroupBox executionContextGroupBox;
     269    private System.Windows.Forms.TreeView executionContextTreeView;
     270    private System.Windows.Forms.ContextMenuStrip executionContextConextMenu;
     271    private System.Windows.Forms.ToolStripMenuItem showValueToolStripMenuItem;
    310272  }
    311273}
  • branches/HeuristicLab.DebugEngine/OperationContentView.cs

    r4998 r5003  
    3434  [View("Operation Content View")]
    3535  [Content(typeof(OperationContent), IsDefaultView = true)]
    36   public sealed partial class OperationContentView : AsynchronousContentView {
     36  public partial class OperationContentView : AsynchronousContentView {
    3737    public new OperationContent Content {
    3838      get { return (OperationContent)base.Content; }
     
    5151        atomicLabel.ForeColor = SystemColors.ControlDark;
    5252        collectionLabel.ForeColor = SystemColors.ControlDark;
    53         parameterListView.Items.Clear();
    5453        scopeTreeView.Nodes.Clear();
    5554        executionContextTreeView.Nodes.Clear();
     
    5958        collectionLabel.ForeColor = Content.IsCollection ? Color.Black : SystemColors.ControlDark;
    6059        nameTextBox.Text = Content.Name;
    61         UpdateParameters();
    6260        UpdateScopeTree();
    6361        UpdateExecutionContext();
    6462      }
    65     }
    66 
    67     private void UpdateParameters() {
    68       parameterListView.BeginUpdate();
    69       parameterListView.Items.Clear();
    70       parameterListView.SmallImageList.Images.Clear();
    71       if (Content.IsAtomic) {
    72         foreach (var param in Content.AtomicOperation.Operator.Parameters) {
    73           ListViewItem item = parameterListView.Items.Add(
    74             string.Format("{0} = {1}", param.Name, GetParameterValue(param, Content.ExecutionContext)));
    75           item.Tag = param;
    76           parameterListView.SmallImageList.Images.Add(param.ItemImage ?? VS2008ImageLibrary.Nothing);
    77           item.ImageIndex = parameterListView.SmallImageList.Images.Count - 1;
    78           item.ToolTipText = string.Format("{0}{1}{1}{2}",
    79             Utils.TypeName(param), Environment.NewLine,
    80             Utils.Wrap(param.Description ?? param.ItemDescription, 60));
    81         }
    82       }
    83       if (parameterListView.Items.Count > 0) {
    84         for (int i = 0; i < parameterListView.Columns.Count; i++)
    85           parameterListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
    86       }
    87       parameterListView.EndUpdate();
    8863    }
    8964
     
    187162    #region Event Handlers (child controls)
    188163
    189     private void parameterListView_ItemActivate(object sender, EventArgs e) {
    190       if (parameterListView.SelectedItems.Count > 0) {
    191         IParameter param = parameterListView.SelectedItems[0].Tag as IParameter;
    192         if (param != null) {
    193           MainFormManager.MainForm.ShowContent((IContent)GetParameterValue(param, Content.ExecutionContext));
    194         }
    195       }
    196     }
    197 
    198164    private void executionContextTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) {
    199165      if (e.Node != null) {
     
    264230    }
    265231
     232    private void ShowValue_Click(object sender, EventArgs e) {
     233      if (executionContextTreeView.SelectedNode == null)
     234        return;
     235      IParameter param = executionContextTreeView.SelectedNode.Tag as IParameter;
     236      if (param != null)
     237        MainFormManager.MainForm.ShowContent(GetParameterValue(param, Content.ExecutionContext) as IContent);
     238    }
     239
    266240    #endregion
     241
     242    private void executionContextConextMenu_Opening(object sender, System.ComponentModel.CancelEventArgs e) {
     243      bool isParameter = executionContextTreeView.SelectedNode.Tag as IParameter != null;
     244      showValueToolStripMenuItem.Enabled = isParameter;
     245      e.Cancel = !isParameter;
     246    }
     247
     248
     249
    267250  }
    268251}
Note: See TracChangeset for help on using the changeset viewer.