Changeset 2834 for trunk/sources/HeuristicLab.Core.Views/3.3
- Timestamp:
- 02/19/10 06:19:16 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.Designer.cs
r2826 r2834 54 54 this.startButton = new System.Windows.Forms.Button(); 55 55 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 56 this.newProblemButton = new System.Windows.Forms.Button();57 this.openProblemButton = new System.Windows.Forms.Button();58 this.saveProblemButton = new System.Windows.Forms.Button();59 56 this.newOperatorGraphButton = new System.Windows.Forms.Button(); 60 57 this.openOperatorGraphButton = new System.Windows.Forms.Button(); … … 64 61 this.operatorGraphViewHost = new HeuristicLab.Core.Views.ViewHost(); 65 62 this.globalScopeTabPage = new System.Windows.Forms.TabPage(); 66 this.problemTabPage = new System.Windows.Forms.TabPage();67 this.problemViewHost = new HeuristicLab.Core.Views.ViewHost();68 63 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 69 64 this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); … … 71 66 this.operatorGraphTabPage.SuspendLayout(); 72 67 this.globalScopeTabPage.SuspendLayout(); 73 this.problemTabPage.SuspendLayout();74 68 this.SuspendLayout(); 75 69 // … … 142 136 this.startButton.Click += new System.EventHandler(this.startButton_Click); 143 137 // 144 // newProblemButton145 //146 this.newProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;147 this.newProblemButton.Location = new System.Drawing.Point(6, 6);148 this.newProblemButton.Name = "newProblemButton";149 this.newProblemButton.Size = new System.Drawing.Size(24, 24);150 this.newProblemButton.TabIndex = 0;151 this.toolTip.SetToolTip(this.newProblemButton, "Create New Problem");152 this.newProblemButton.UseVisualStyleBackColor = true;153 this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click);154 //155 // openProblemButton156 //157 this.openProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;158 this.openProblemButton.Location = new System.Drawing.Point(36, 6);159 this.openProblemButton.Name = "openProblemButton";160 this.openProblemButton.Size = new System.Drawing.Size(24, 24);161 this.openProblemButton.TabIndex = 1;162 this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");163 this.openProblemButton.UseVisualStyleBackColor = true;164 this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click);165 //166 // saveProblemButton167 //168 this.saveProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;169 this.saveProblemButton.Location = new System.Drawing.Point(66, 6);170 this.saveProblemButton.Name = "saveProblemButton";171 this.saveProblemButton.Size = new System.Drawing.Size(24, 24);172 this.saveProblemButton.TabIndex = 2;173 this.toolTip.SetToolTip(this.saveProblemButton, "Save Problem");174 this.saveProblemButton.UseVisualStyleBackColor = true;175 this.saveProblemButton.Click += new System.EventHandler(this.saveProblemButton_Click);176 //177 138 // newOperatorGraphButton 178 139 // … … 215 176 this.tabControl.Controls.Add(this.operatorGraphTabPage); 216 177 this.tabControl.Controls.Add(this.globalScopeTabPage); 217 this.tabControl.Controls.Add(this.problemTabPage);218 178 this.tabControl.Location = new System.Drawing.Point(0, 0); 219 179 this.tabControl.Name = "tabControl"; … … 258 218 this.globalScopeTabPage.Text = "Global Scope"; 259 219 this.globalScopeTabPage.UseVisualStyleBackColor = true; 260 //261 // problemTabPage262 //263 this.problemTabPage.Controls.Add(this.saveProblemButton);264 this.problemTabPage.Controls.Add(this.openProblemButton);265 this.problemTabPage.Controls.Add(this.newProblemButton);266 this.problemTabPage.Controls.Add(this.problemViewHost);267 this.problemTabPage.Location = new System.Drawing.Point(4, 22);268 this.problemTabPage.Name = "problemTabPage";269 this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);270 this.problemTabPage.Size = new System.Drawing.Size(794, 584);271 this.problemTabPage.TabIndex = 2;272 this.problemTabPage.Text = "Problem";273 this.problemTabPage.UseVisualStyleBackColor = true;274 //275 // problemViewHost276 //277 this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)278 | System.Windows.Forms.AnchorStyles.Left)279 | System.Windows.Forms.AnchorStyles.Right)));280 this.problemViewHost.Content = null;281 this.problemViewHost.Location = new System.Drawing.Point(6, 36);282 this.problemViewHost.Name = "problemViewHost";283 this.problemViewHost.Size = new System.Drawing.Size(782, 542);284 this.problemViewHost.TabIndex = 3;285 this.problemViewHost.ViewType = null;286 220 // 287 221 // openFileDialog … … 315 249 this.operatorGraphTabPage.ResumeLayout(false); 316 250 this.globalScopeTabPage.ResumeLayout(false); 317 this.problemTabPage.ResumeLayout(false);318 251 this.ResumeLayout(false); 319 252 this.PerformLayout(); … … 332 265 protected System.Windows.Forms.TabControl tabControl; 333 266 protected System.Windows.Forms.TabPage globalScopeTabPage; 334 protected System.Windows.Forms.TabPage problemTabPage;335 protected ViewHost problemViewHost;336 protected System.Windows.Forms.Button newProblemButton;337 protected System.Windows.Forms.Button saveProblemButton;338 protected System.Windows.Forms.Button openProblemButton;339 267 protected System.Windows.Forms.OpenFileDialog openFileDialog; 340 268 protected System.Windows.Forms.SaveFileDialog saveFileDialog; -
trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.cs
r2826 r2834 62 62 protected override void DeregisterContentEvents() { 63 63 Content.OperatorGraphChanged -= new EventHandler(Content_OperatorGraphChanged); 64 Content.ProblemChanged -= new EventHandler(Content_ProblemChanged);65 64 Content.Prepared -= new EventHandler(Content_Prepared); 66 65 Content.Started -= new EventHandler(Content_Started); … … 78 77 base.RegisterContentEvents(); 79 78 Content.OperatorGraphChanged += new EventHandler(Content_OperatorGraphChanged); 80 Content.ProblemChanged += new EventHandler(Content_ProblemChanged);81 79 Content.Prepared += new EventHandler(Content_Prepared); 82 80 Content.Started += new EventHandler(Content_Started); … … 97 95 operatorGraphViewHost.Enabled = false; 98 96 scopeView.Enabled = false; 99 newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false;100 problemViewHost.Enabled = false;101 97 startButton.Enabled = resetButton.Enabled = false; 102 98 executionTimeTextBox.Enabled = false; … … 107 103 scopeView.Content = Content.GlobalScope; 108 104 scopeView.Enabled = true; 109 newProblemButton.Enabled = openProblemButton.Enabled = true;110 saveProblemButton.Enabled = Content.Problem != null;111 problemViewHost.Content = Content.Problem;112 problemViewHost.Enabled = true;113 105 startButton.Enabled = !Content.Finished; 114 106 resetButton.Enabled = true; … … 124 116 else 125 117 operatorGraphViewHost.Content = Content.OperatorGraph; 126 }127 protected void Content_ProblemChanged(object sender, EventArgs e) {128 if (InvokeRequired)129 Invoke(new EventHandler(Content_ProblemChanged), sender, e);130 else {131 saveProblemButton.Enabled = Content.Problem != null;132 problemViewHost.Content = Content.Problem;133 }134 118 } 135 119 protected virtual void Content_Prepared(object sender, EventArgs e) { … … 140 124 operatorGraphViewHost.Enabled = true; 141 125 scopeView.Enabled = true; 142 newProblemButton.Enabled = openProblemButton.Enabled = true;143 saveProblemButton.Enabled = Content.Problem != null;144 problemViewHost.Enabled = true;145 126 startButton.Enabled = !Content.Finished; 146 127 stopButton.Enabled = false; … … 157 138 operatorGraphViewHost.Enabled = false; 158 139 scopeView.Enabled = false; 159 newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false;160 problemViewHost.Enabled = false;161 140 startButton.Enabled = false; 162 141 stopButton.Enabled = true; … … 172 151 operatorGraphViewHost.Enabled = true; 173 152 scopeView.Enabled = true; 174 newProblemButton.Enabled = openProblemButton.Enabled = true;175 saveProblemButton.Enabled = Content.Problem != null;176 problemViewHost.Enabled = true;177 153 startButton.Enabled = !Content.Finished; 178 154 stopButton.Enabled = false; … … 230 206 } 231 207 } 232 protected void newProblemButton_Click(object sender, EventArgs e) {233 if (typeSelectorDialog == null) {234 typeSelectorDialog = new TypeSelectorDialog();235 }236 typeSelectorDialog.Caption = "Select Problem";237 typeSelectorDialog.TypeSelector.Configure(typeof(IProblem), false, false);238 239 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {240 Content.Problem = (IProblem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();241 }242 }243 protected void openProblemButton_Click(object sender, EventArgs e) {244 openFileDialog.Title = "Open Problem";245 if (openFileDialog.ShowDialog(this) == DialogResult.OK) {246 IProblem problem = null;247 try {248 problem = XmlParser.Deserialize(openFileDialog.FileName) as IProblem;249 }250 catch (Exception ex) {251 Auxiliary.ShowErrorMessageBox(ex);252 }253 if (problem == null)254 MessageBox.Show(this, "Selected file does not contain a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);255 else256 Content.Problem = problem;257 }258 }259 protected void saveProblemButton_Click(object sender, EventArgs e) {260 saveFileDialog.Title = "Save Problem";261 if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {262 try {263 if (saveFileDialog.FilterIndex == 1)264 XmlGenerator.Serialize(Content.Problem, saveFileDialog.FileName, 0);265 else266 XmlGenerator.Serialize(Content.Problem, saveFileDialog.FileName, 9);267 }268 catch (Exception ex) {269 Auxiliary.ShowErrorMessageBox(ex);270 }271 }272 }273 208 protected virtual void startButton_Click(object sender, EventArgs e) { 274 209 Content.Start(); -
trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj
r2805 r2834 131 131 <DependentUpon>OperatorTreeView.cs</DependentUpon> 132 132 </Compile> 133 <Compile Include="ProblemView.cs">134 <SubType>UserControl</SubType>135 </Compile>136 <Compile Include="ProblemView.Designer.cs">137 <DependentUpon>ProblemView.cs</DependentUpon>138 </Compile>139 133 <Compile Include="TypeSelectorDialog.cs"> 140 134 <SubType>Form</SubType>
Note: See TracChangeset
for help on using the changeset viewer.