Changeset 13258
- Timestamp:
- 11/18/15 16:33:27 (9 years ago)
- Location:
- stable
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj
r11920 r13258 123 123 <ItemGroup> 124 124 <None Include="Plugin.cs.frame" /> 125 <Compile Include="BreadcrumbViewHost.cs"> 126 <SubType>UserControl</SubType> 127 </Compile> 128 <Compile Include="BreadcrumbViewHost.Designer.cs"> 129 <DependentUpon>BreadcrumbViewHost.cs</DependentUpon> 130 </Compile> 125 131 <Compile Include="CheckedItemCollectionView.cs"> 126 132 <SubType>UserControl</SubType> -
stable/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.Designer.cs
r12009 r13258 129 129 #endregion 130 130 131 pr ivateSystem.Windows.Forms.Label viewsLabel;131 protected System.Windows.Forms.Label viewsLabel; 132 132 private System.Windows.Forms.Label messageLabel; 133 133 private System.Windows.Forms.ToolTip toolTip; -
stable/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
r12009 r13258 29 29 namespace HeuristicLab.MainForm.WindowsForms { 30 30 [Content(typeof(IContent))] 31 public sealedpartial class ViewHost : AsynchronousContentView {31 public partial class ViewHost : AsynchronousContentView { 32 32 public ViewHost() { 33 33 InitializeComponent(); … … 93 93 if (view != null) { 94 94 view.Visible = true; 95 if (ViewsLabelVisible) { 96 view.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; 97 view.Size = new Size(Width - this.viewsLabel.Width - this.viewsLabel.Margin.Left - this.viewsLabel.Margin.Right, this.Height); 98 } else view.Dock = DockStyle.Fill; 95 ConfigureViewLayout(view); 99 96 if (!Controls.Contains((view))) Controls.Add(view); 100 97 view.OnShown(new ViewShownEventArgs(view, false)); … … 108 105 } 109 106 } 107 } 108 109 protected virtual void ConfigureViewLayout(View view) { 110 if (ViewsLabelVisible) { 111 view.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; 112 view.Size = new Size(Width - viewsLabel.Width - viewsLabel.Margin.Left - viewsLabel.Margin.Right, Height); 113 } else view.Dock = DockStyle.Fill; 110 114 } 111 115 -
stable/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.Designer.cs
r12009 r13258 61 61 this.selectButton = new System.Windows.Forms.Button(); 62 62 this.detailsGroupBox = new System.Windows.Forms.GroupBox(); 63 this.detailsViewHost = new HeuristicLab. MainForm.WindowsForms.ViewHost();63 this.detailsViewHost = new HeuristicLab.Core.Views.BreadcrumbViewHost(); 64 64 this.buttonToolTip = new System.Windows.Forms.ToolTip(this.components); 65 65 this.shapeContextMenu.SuspendLayout(); … … 235 235 | System.Windows.Forms.AnchorStyles.Right))); 236 236 this.detailsViewHost.Content = null; 237 this.detailsViewHost.EnableBreadcrumbs = true; 237 238 this.detailsViewHost.Location = new System.Drawing.Point(3, 16); 238 239 this.detailsViewHost.Name = "detailsViewHost"; … … 270 271 private System.Windows.Forms.SplitContainer splitContainer; 271 272 private System.Windows.Forms.GroupBox detailsGroupBox; 272 private HeuristicLab. MainForm.WindowsForms.ViewHost detailsViewHost;273 private HeuristicLab.Core.Views.BreadcrumbViewHost detailsViewHost; 273 274 private System.Windows.Forms.Button selectButton; 274 275 private System.Windows.Forms.Button zoomOutButton; -
stable/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.cs
r12009 r13258 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Core.Views; 27 28 using HeuristicLab.MainForm; 28 29 using HeuristicLab.MainForm.WindowsForms; … … 140 141 if (shapeInfo != null) { 141 142 IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 142 IContentView view = MainFormManager.MainForm.ShowContent(op); 143 if (view != null) { 144 view.ReadOnly = this.ReadOnly; 145 view.Locked = this.Locked; 143 IOperatorGraphOperator graphOp = op as IOperatorGraphOperator; 144 145 Control c = this; 146 BreadcrumbViewHost vh; 147 148 do { 149 c = c.Parent; 150 vh = c as BreadcrumbViewHost; 151 } while ((vh == null || !vh.EnableBreadcrumbs) && c != null); 152 153 if (graphOp != null && vh != null) { 154 vh.AddBreadcrumbs(vh.Content); 155 vh.AddBreadcrumb(graphOp.Name, graphOp.OperatorGraph); 156 vh.Content = graphOp.OperatorGraph; 157 vh.ReadOnly = ReadOnly; 158 vh.Locked = Locked; 159 } else { 160 IContentView view = MainFormManager.MainForm.ShowContent(op); 161 if (view != null) { 162 view.ReadOnly = ReadOnly; 163 view.Locked = Locked; 164 } 146 165 } 166 147 167 HandledMouseEventArgs eventArgs = e as HandledMouseEventArgs; 148 168 if (eventArgs != null) -
stable/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/Plugin.cs.frame
r12751 r13258 29 29 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 30 30 [PluginDependency("HeuristicLab.Core", "3.3")] 31 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 31 32 [PluginDependency("HeuristicLab.MainForm", "3.3")] 32 33 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] -
stable/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.Designer.cs
r12009 r13258 50 50 this.engineViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 51 51 this.operatorGraphTabPage = new System.Windows.Forms.TabPage(); 52 this.openOperatorGraphButton = new System.Windows.Forms.Button(); 53 this.newOperatorGraphButton = new System.Windows.Forms.Button(); 54 this.operatorGraphViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 52 this.operatorGraphViewHost = new HeuristicLab.Core.Views.BreadcrumbViewHost(); 55 53 this.tabControl.SuspendLayout(); 56 54 this.parametersTabPage.SuspendLayout(); … … 219 217 // operatorGraphTabPage 220 218 // 221 this.operatorGraphTabPage.Controls.Add(this.openOperatorGraphButton);222 this.operatorGraphTabPage.Controls.Add(this.newOperatorGraphButton);223 219 this.operatorGraphTabPage.Controls.Add(this.operatorGraphViewHost); 224 220 this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22); … … 229 225 this.operatorGraphTabPage.UseVisualStyleBackColor = true; 230 226 // 231 // openOperatorGraphButton232 //233 this.openOperatorGraphButton.Enabled = false;234 this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;235 this.openOperatorGraphButton.Location = new System.Drawing.Point(33, 3);236 this.openOperatorGraphButton.Name = "openOperatorGraphButton";237 this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24);238 this.openOperatorGraphButton.TabIndex = 1;239 this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");240 this.openOperatorGraphButton.UseVisualStyleBackColor = true;241 //242 // newOperatorGraphButton243 //244 this.newOperatorGraphButton.Enabled = false;245 this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;246 this.newOperatorGraphButton.Location = new System.Drawing.Point(3, 3);247 this.newOperatorGraphButton.Name = "newOperatorGraphButton";248 this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24);249 this.newOperatorGraphButton.TabIndex = 1;250 this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph");251 this.newOperatorGraphButton.UseVisualStyleBackColor = true;252 //253 227 // operatorGraphViewHost 254 228 // … … 258 232 this.operatorGraphViewHost.Caption = "View"; 259 233 this.operatorGraphViewHost.Content = null; 234 this.operatorGraphViewHost.EnableBreadcrumbs = true; 260 235 this.operatorGraphViewHost.Enabled = false; 261 this.operatorGraphViewHost.Location = new System.Drawing.Point( 3, 33);236 this.operatorGraphViewHost.Location = new System.Drawing.Point(6, 6); 262 237 this.operatorGraphViewHost.Name = "operatorGraphViewHost"; 263 238 this.operatorGraphViewHost.ReadOnly = true; 264 this.operatorGraphViewHost.Size = new System.Drawing.Size(699, 431); 239 this.operatorGraphViewHost.ShowSingle = true; 240 this.operatorGraphViewHost.Size = new System.Drawing.Size(693, 455); 265 241 this.operatorGraphViewHost.TabIndex = 0; 266 242 this.operatorGraphViewHost.ViewsLabelVisible = true; … … 295 271 protected HeuristicLab.MainForm.WindowsForms.ViewHost engineViewHost; 296 272 protected System.Windows.Forms.TabPage operatorGraphTabPage; 297 protected HeuristicLab.MainForm.WindowsForms.ViewHost operatorGraphViewHost; 298 protected System.Windows.Forms.Button openOperatorGraphButton; 299 protected System.Windows.Forms.Button newOperatorGraphButton; 273 protected HeuristicLab.Core.Views.BreadcrumbViewHost operatorGraphViewHost; 300 274 301 275 } -
stable/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs
r12009 r13258 95 95 base.SetEnabledStateOfControls(); 96 96 engineViewHost.Enabled = Content != null; 97 newOperatorGraphButton.Enabled = false;98 openOperatorGraphButton.Enabled = false;99 97 operatorGraphViewHost.Enabled = Content != null; 100 98 operatorGraphViewHost.ReadOnly = true; -
stable/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs
r12009 r13258 65 65 // 66 66 this.engineViewHost.Size = new System.Drawing.Size(693, 402); 67 //68 // openOperatorGraphButton69 //70 this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");71 this.openOperatorGraphButton.Click += new System.EventHandler(openOperatorGraphButton_Click);72 //73 // newOperatorGraphButton74 //75 this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph");76 this.newOperatorGraphButton.Click += new System.EventHandler(newOperatorGraphButton_Click);77 67 // 78 68 // tabControl -
stable/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs
r12009 r13258 57 57 base.SetEnabledStateOfControls(); 58 58 globalScopeView.Enabled = Content != null; 59 newOperatorGraphButton.Enabled = Content != null && !ReadOnly;60 openOperatorGraphButton.Enabled = Content != null && !ReadOnly;61 59 operatorGraphViewHost.ReadOnly = Content == null || ReadOnly; 62 }63 64 private void newOperatorGraphButton_Click(object sender, EventArgs e) {65 Content.OperatorGraph = new OperatorGraph();66 }67 private void openOperatorGraphButton_Click(object sender, EventArgs e) {68 openFileDialog.Title = "Open Operator Graph";69 if (openFileDialog.ShowDialog(this) == DialogResult.OK) {70 newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = false;71 operatorGraphViewHost.Enabled = false;72 73 ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {74 try {75 if (error != null) throw error;76 OperatorGraph operatorGraph = content as OperatorGraph;77 if (operatorGraph == null)78 MessageBox.Show(this, "The selected file does not contain an operator graph.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);79 else80 Content.OperatorGraph = operatorGraph;81 }82 catch (Exception ex) {83 ErrorHandling.ShowErrorDialog(this, ex);84 }85 finally {86 Invoke(new Action(delegate() {87 operatorGraphViewHost.Enabled = true;88 newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = true;89 }));90 }91 });92 }93 60 } 94 61 }
Note: See TracChangeset
for help on using the changeset viewer.