Index: trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.cs
===================================================================
--- trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.cs	(revision 7582)
+++ trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.cs	(revision 7582)
@@ -0,0 +1,153 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Windows.Forms;
+
+namespace HeuristicLab.MainForm.WindowsForms {
+  public partial class ProgressView : HeuristicLab.MainForm.WindowsForms.View {
+    private ContentView parentView;
+    private IProgress progress;
+    public IProgress Progress {
+      get {
+        return this.progress;
+      }
+      set {
+        if (this.progress != value) {
+          if (this.progress != null) {
+            DeregisterProgressEvents();
+          }
+          this.progress = value;
+          RegisterProgressEvents();
+          OnProgressChanged();
+        }
+      }
+    }
+
+    public bool CancelEnabled {
+      get {
+        return cancelButton.Visible;
+      }
+      set {
+        if (InvokeRequired) {
+          Invoke(new Action<bool>((ce) => { CancelEnabled = ce; }), value);
+        } else {
+          cancelButton.Visible = value;
+        }
+      }
+    }
+
+    /// <param name="parentView">This is the View which will be locked if lockParentView is true</param>
+    public ProgressView(ContentView parentView, IProgress progress) {
+      InitializeComponent();
+      this.parentView = parentView;
+      this.Progress = progress;
+
+      this.CancelEnabled = false;
+
+      progressBar.Style = ProgressBarStyle.Marquee;
+
+      this.Left = (parentView.ClientRectangle.Width / 2) - (this.Width / 2);
+      this.Top = (parentView.ClientRectangle.Height / 2) - (this.Height / 2);
+      this.Anchor = AnchorStyles.Left | AnchorStyles.Top;
+
+      LockBackground();
+
+      parentView.Controls.Add(this);
+      this.BringToFront();
+    }
+
+    private void RegisterProgressEvents() {
+      progress.Finished += new EventHandler(progress_Finished);
+      progress.StatusChanged += new EventHandler(progress_StatusChanged);
+      progress.ProgressValueChanged += new EventHandler(progress_ProgressChanged);
+    }
+
+    private void DeregisterProgressEvents() {
+      progress.Finished -= new EventHandler(progress_Finished);
+      progress.StatusChanged -= new EventHandler(progress_StatusChanged);
+      progress.ProgressValueChanged -= new EventHandler(progress_ProgressChanged);
+    }
+
+    void progress_Finished(object sender, EventArgs e) {
+      Finish();
+    }
+
+    void progress_ProgressChanged(object sender, EventArgs e) {
+      if (InvokeRequired) {
+        Invoke(new EventHandler(progress_ProgressChanged), sender, e);
+      } else {
+        progressBar.Style = ProgressBarStyle.Blocks;
+        this.progressBar.Value = Math.Min(this.progressBar.Maximum, (int)(progress.ProgressValue * progressBar.Maximum));
+      }
+    }
+
+    void progress_StatusChanged(object sender, EventArgs e) {
+      if (InvokeRequired) {
+        Invoke(new EventHandler(progress_StatusChanged), sender, e);
+      } else {
+        statusLabel.Text = progress.Status;
+      }
+    }
+
+    private void LockBackground() {
+      if (InvokeRequired) {
+        Invoke(new Action(LockBackground));
+      } else {
+        this.parentView.Locked = true;
+        foreach (Control c in this.parentView.Controls) {
+          c.Enabled = false;
+        }
+        this.Enabled = true;
+        this.ReadOnly = false;
+      }
+    }
+
+    public void Finish() {
+      if (InvokeRequired) {
+        Invoke(new Action(Finish));
+      } else {
+        progressBar.Value = progressBar.Maximum;
+        parentView.Locked = false;
+        foreach (Control c in this.parentView.Controls) {
+          c.Enabled = true;
+        }
+        parentView.Controls.Remove(this);
+        this.Dispose();
+      }
+    }
+
+    private void cancelButton_Click(object sender, EventArgs e) {
+      Finish();
+    }
+
+    private void OnProgressChanged() {
+      progress_StatusChanged(this, EventArgs.Empty);
+      progress_ProgressChanged(this, EventArgs.Empty);
+    }
+
+    public event EventHandler Canceled;
+    protected virtual void OnCanceled() {
+      var handler = Canceled;
+      if (handler != null) Canceled(this, EventArgs.Empty);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.designer.cs
===================================================================
--- trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.designer.cs	(revision 7582)
+++ trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.designer.cs	(revision 7582)
@@ -0,0 +1,96 @@
+﻿
+namespace HeuristicLab.MainForm.WindowsForms {
+  partial class ProgressView : View {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.progressBar = new System.Windows.Forms.ProgressBar();
+      this.statusLabel = new System.Windows.Forms.Label();
+      this.cancelButton = new System.Windows.Forms.Button();
+      this.panel = new System.Windows.Forms.Panel();
+      this.panel.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // progressBar
+      // 
+      this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.progressBar.Location = new System.Drawing.Point(3, 3);
+      this.progressBar.Name = "progressBar";
+      this.progressBar.Size = new System.Drawing.Size(352, 23);
+      this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
+      this.progressBar.TabIndex = 0;
+      // 
+      // statusLabel
+      // 
+      this.statusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.statusLabel.Location = new System.Drawing.Point(3, 33);
+      this.statusLabel.Name = "statusLabel";
+      this.statusLabel.Size = new System.Drawing.Size(352, 17);
+      this.statusLabel.TabIndex = 1;
+      // 
+      // cancelButton
+      // 
+      this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.cancelButton.Location = new System.Drawing.Point(280, 53);
+      this.cancelButton.Name = "cancelButton";
+      this.cancelButton.Size = new System.Drawing.Size(75, 23);
+      this.cancelButton.TabIndex = 2;
+      this.cancelButton.Text = "Cancel";
+      this.cancelButton.UseVisualStyleBackColor = true;
+      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
+      // 
+      // panel
+      // 
+      this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+      this.panel.Controls.Add(this.progressBar);
+      this.panel.Controls.Add(this.cancelButton);
+      this.panel.Controls.Add(this.statusLabel);
+      this.panel.Location = new System.Drawing.Point(0, 0);
+      this.panel.Name = "panel";
+      this.panel.Size = new System.Drawing.Size(360, 88);
+      this.panel.TabIndex = 3;
+      // 
+      // ProgressView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.panel);
+      this.Name = "ProgressView";
+      this.Size = new System.Drawing.Size(360, 88);
+      this.panel.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.ProgressBar progressBar;
+    private System.Windows.Forms.Label statusLabel;
+    private System.Windows.Forms.Button cancelButton;
+    private System.Windows.Forms.Panel panel;
+  }
+}
