- Timestamp:
- 08/23/13 17:52:50 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs
r9894 r9907 25 25 namespace HeuristicLab.MainForm.WindowsForms { 26 26 internal sealed partial class ProgressView : UserControl { 27 private const int defaultControlHeight = 88; 28 private const int collapsedControlHeight = 55; 29 27 30 private readonly Control control; 28 31 public Control Control { … … 80 83 return; 81 84 } 85 int height = Content.CanBeCanceled ? Height : collapsedControlHeight; 86 82 87 Left = (Control.ClientRectangle.Width / 2) - (Width / 2); 83 Top = (Control.ClientRectangle.Height / 2) - ( Height / 2);88 Top = (Control.ClientRectangle.Height / 2) - (height / 2); 84 89 Anchor = AnchorStyles.None; 85 90 … … 127 132 cancelButton.Visible = content != null && content.CanBeCanceled; 128 133 cancelButton.Enabled = content != null && content.CanBeCanceled; 134 135 if (content != null && content.CanBeCanceled) { 136 Height = defaultControlHeight; 137 } else if (content != null && !content.CanBeCanceled) { 138 Height = collapsedControlHeight; 139 } 129 140 } 130 141 -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.designer.cs
r9894 r9907 35 35 /// </summary> 36 36 private void InitializeComponent() { 37 this.components = new System.ComponentModel.Container();38 37 this.progressBar = new System.Windows.Forms.ProgressBar(); 39 38 this.statusLabel = new System.Windows.Forms.Label(); … … 45 44 // progressBar 46 45 // 47 this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 48 46 this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 47 | System.Windows.Forms.AnchorStyles.Right))); 49 48 this.progressBar.Location = new System.Drawing.Point(3, 3); 50 49 this.progressBar.Name = "progressBar"; … … 55 54 // statusLabel 56 55 // 57 this.statusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 58 56 this.statusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 57 | System.Windows.Forms.AnchorStyles.Right))); 59 58 this.statusLabel.Location = new System.Drawing.Point(3, 33); 60 59 this.statusLabel.Name = "statusLabel"; … … 75 74 // panel 76 75 // 77 this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 78 | System.Windows.Forms.AnchorStyles.Right))); 76 this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 77 | System.Windows.Forms.AnchorStyles.Left) 78 | System.Windows.Forms.AnchorStyles.Right))); 79 79 this.panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 80 80 this.panel.Controls.Add(this.progressBar); … … 94 94 this.panel.ResumeLayout(false); 95 95 this.ResumeLayout(false); 96 96 97 } 97 98 -
trunk/sources/HeuristicLab.Optimizer/3.3/StartPage.Designer.cs
r9456 r9907 50 50 this.titleLabel = new System.Windows.Forms.Label(); 51 51 this.samplesGroupBox = new System.Windows.Forms.GroupBox(); 52 this.loadingPanel = new System.Windows.Forms.Panel();53 this.loadingProgressBar = new System.Windows.Forms.ProgressBar();54 this.loadingLabel = new System.Windows.Forms.Label();55 52 this.samplesListView = new System.Windows.Forms.ListView(); 56 this.nameColumnHeader = new System.Windows.Forms.ColumnHeader();57 this.descriptionColumnHeader = new System.Windows.Forms.ColumnHeader();53 this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 54 this.descriptionColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 58 55 this.imageList = new System.Windows.Forms.ImageList(this.components); 59 56 this.splitContainer = new System.Windows.Forms.SplitContainer(); 60 57 this.samplesGroupBox.SuspendLayout(); 61 this.loadingPanel.SuspendLayout();58 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 62 59 this.splitContainer.Panel1.SuspendLayout(); 63 60 this.splitContainer.Panel2.SuspendLayout(); … … 80 77 // firstStepsRichTextBox 81 78 // 82 this.firstStepsRichTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 83 | System.Windows.Forms.AnchorStyles.Left)84 79 this.firstStepsRichTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 80 | System.Windows.Forms.AnchorStyles.Left) 81 | System.Windows.Forms.AnchorStyles.Right))); 85 82 this.firstStepsRichTextBox.BackColor = System.Drawing.SystemColors.Control; 86 83 this.firstStepsRichTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; … … 96 93 // titleLabel 97 94 // 98 this.titleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 99 95 this.titleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 96 | System.Windows.Forms.AnchorStyles.Right))); 100 97 this.titleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 101 98 this.titleLabel.Location = new System.Drawing.Point(-1, 0); … … 108 105 // samplesGroupBox 109 106 // 110 this.samplesGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 111 | System.Windows.Forms.AnchorStyles.Left) 112 | System.Windows.Forms.AnchorStyles.Right))); 113 this.samplesGroupBox.Controls.Add(this.loadingPanel); 107 this.samplesGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 108 | System.Windows.Forms.AnchorStyles.Left) 109 | System.Windows.Forms.AnchorStyles.Right))); 114 110 this.samplesGroupBox.Controls.Add(this.samplesListView); 115 111 this.samplesGroupBox.Location = new System.Drawing.Point(0, 3); … … 119 115 this.samplesGroupBox.TabStop = false; 120 116 this.samplesGroupBox.Text = "Samples"; 121 //122 // loadingPanel123 //124 this.loadingPanel.Anchor = System.Windows.Forms.AnchorStyles.None;125 this.loadingPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;126 this.loadingPanel.Controls.Add(this.loadingProgressBar);127 this.loadingPanel.Controls.Add(this.loadingLabel);128 this.loadingPanel.Enabled = false;129 this.loadingPanel.Location = new System.Drawing.Point(189, 89);130 this.loadingPanel.Name = "loadingPanel";131 this.loadingPanel.Size = new System.Drawing.Size(350, 62);132 this.loadingPanel.TabIndex = 1;133 //134 // loadingProgressBar135 //136 this.loadingProgressBar.Anchor = System.Windows.Forms.AnchorStyles.None;137 this.loadingProgressBar.Location = new System.Drawing.Point(101, 19);138 this.loadingProgressBar.Name = "loadingProgressBar";139 this.loadingProgressBar.Size = new System.Drawing.Size(229, 23);140 this.loadingProgressBar.Step = 1;141 this.loadingProgressBar.TabIndex = 1;142 //143 // loadingLabel144 //145 this.loadingLabel.Anchor = System.Windows.Forms.AnchorStyles.None;146 this.loadingLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));147 this.loadingLabel.Location = new System.Drawing.Point(12, 19);148 this.loadingLabel.Name = "loadingLabel";149 this.loadingLabel.Size = new System.Drawing.Size(83, 23);150 this.loadingLabel.TabIndex = 0;151 this.loadingLabel.Text = "Loading ...";152 117 // 153 118 // samplesListView … … 168 133 this.samplesListView.UseCompatibleStateImageBehavior = false; 169 134 this.samplesListView.View = System.Windows.Forms.View.Details; 135 this.samplesListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.samplesListView_ItemDrag); 170 136 this.samplesListView.DoubleClick += new System.EventHandler(this.samplesListView_DoubleClick); 171 this.samplesListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.samplesListView_ItemDrag);172 137 // 173 138 // nameColumnHeader … … 189 154 // splitContainer 190 155 // 191 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 192 | System.Windows.Forms.AnchorStyles.Left)193 156 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 157 | System.Windows.Forms.AnchorStyles.Left) 158 | System.Windows.Forms.AnchorStyles.Right))); 194 159 this.splitContainer.Location = new System.Drawing.Point(0, 0); 195 160 this.splitContainer.Name = "splitContainer"; … … 210 175 // StartPage 211 176 // 212 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);213 177 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 214 178 this.Controls.Add(this.splitContainer); … … 217 181 this.Size = new System.Drawing.Size(728, 640); 218 182 this.samplesGroupBox.ResumeLayout(false); 219 this.loadingPanel.ResumeLayout(false);220 183 this.splitContainer.Panel1.ResumeLayout(false); 221 184 this.splitContainer.Panel2.ResumeLayout(false); 185 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 222 186 this.splitContainer.ResumeLayout(false); 223 187 this.ResumeLayout(false); … … 236 200 private System.Windows.Forms.ImageList imageList; 237 201 private System.Windows.Forms.ColumnHeader descriptionColumnHeader; 238 private System.Windows.Forms.Panel loadingPanel;239 private System.Windows.Forms.ProgressBar loadingProgressBar;240 private System.Windows.Forms.Label loadingLabel;241 202 private System.Windows.Forms.SplitContainer splitContainer; 242 203 } -
trunk/sources/HeuristicLab.Optimizer/3.3/StartPage.cs
r9456 r9907 34 34 [View("Start Page")] 35 35 public partial class StartPage : HeuristicLab.MainForm.WindowsForms.View { 36 private IProgress progress; 37 36 38 public StartPage() { 37 39 InitializeComponent(); … … 67 69 68 70 private void LoadSamples(object state) { 71 progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(samplesListView, "Loading..."); 69 72 Assembly assembly = Assembly.GetExecutingAssembly(); 70 73 var samples = assembly.GetManifestResourceNames().Where(x => x.EndsWith(".hl")); … … 77 80 WriteStreamToTempFile(stream, path); 78 81 INamedItem item = XmlParser.Deserialize<INamedItem>(path); 79 OnSampleLoaded(item, loadingProgressBar.Maximum/ count);82 OnSampleLoaded(item, 1.0 / count); 80 83 } 81 84 } 82 catch (Exception) { } 85 catch (Exception) { 86 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(samplesListView); 87 } 83 88 } 84 89 OnAllSamplesLoaded(); 85 90 } 86 private void OnSampleLoaded(INamedItem sample, intprogress) {91 private void OnSampleLoaded(INamedItem sample, double progress) { 87 92 if (InvokeRequired) 88 Invoke(new Action<INamedItem, int>(OnSampleLoaded), sample, progress);93 Invoke(new Action<INamedItem, double>(OnSampleLoaded), sample, progress); 89 94 else { 90 95 ListViewItem item = new ListViewItem(new string[] { sample.Name, sample.Description }); … … 94 99 item.Tag = sample; 95 100 samplesListView.Items.Add(item); 96 loadingProgressBar.Value += progress;101 this.progress.ProgressValue += progress; 97 102 } 98 103 } … … 106 111 samplesListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 107 112 } 108 loadingPanel.Visible = false;113 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(samplesListView); 109 114 } 110 115 }
Note: See TracChangeset
for help on using the changeset viewer.