/// <summary> /// Imports the toolStripContainer with all his nice controls into the given form /// also adds the controls from this.pnlContentHolder to masterFormContents.pnlContentHolder /// </summary> public static void InitializeContent(Form newForm, Label lblTooltip, ToolStripContainer toolStripContainer, Panel pnlContentHolder, CNNProjectHolder cnnProjectHolder) { MasterForm masterFormContents = new MasterForm(newForm, cnnProjectHolder); // import toolStripContainer = masterFormContents.toolStripContainer1; newForm.Controls.Add(toolStripContainer); // control replacement newForm.Controls.Remove(pnlContentHolder); newForm.Controls.Remove(lblTooltip); masterFormContents.pnlContentHolder.Controls.Clear(); foreach (Control control in pnlContentHolder.Controls) { masterFormContents.pnlContentHolder.Controls.Add(control); } int time = (cnnProjectHolder.CNNProject.ExpertMode) ? 1 : 5000; masterFormContents.ShowPictureBoxBalloon(lblTooltip.Text, time, newForm, true); masterFormContents.lblHeading.Text = newForm.Text; }
public MasterForm(Form parentForm, CNNProjectHolder cnnProjectHolder) { InitializeComponent(); _parentForm = parentForm; _cnnProjectHolder = cnnProjectHolder; }
/// <summary> /// Initializes a new instance of the <see cref="CollectForm"/> class. /// </summary> public CollectForm() { this._cnnProjectHolder = new CNNProjectHolder(); if (_cnnProjectHolder.CNNProject.ExpertMode == false) { WelcomeForm welcomeForm = new WelcomeForm(); welcomeForm.ShowDialog(); } InitializeComponent(); MasterForm.InitializeContent( this, this.lblTooltip, this._toolStripContainer, this.pnlContentHolder, this._cnnProjectHolder); this.cmbImageProvider.Items.AddRange(ImageProvider.GetAvailableProviders()); this.cmbImageProvider.SelectedIndex = 0; this._cnnProjectHolder.ProjectChanged += new CNNProjectHolder.ProjectChangedDelegate(CnnProjectHolder_ProjectChanged); this.lvMatching.SmallImageList = this._cnnProjectHolder.CNNProject.Matching; this.lvNotMatching.SmallImageList = this._cnnProjectHolder.CNNProject.NotMatching; // formats column with to the exact needed space try { lvMatching.Columns[0].Width = this._cnnProjectHolder.CNNProject.ImagePatternSize.Width + 40; lvNotMatching.Columns[0].Width = this._cnnProjectHolder.CNNProject.ImagePatternSize.Width + 40; } catch (Exception) { } }
public MasterFormExample() { InitializeComponent(); this._cnnProjectHolder = new CNNProjectHolder(); MasterForm.InitializeContent( this, this.lblTooltip, this._toolStripContainer, this.pnlContentHolder, this._cnnProjectHolder); }
/// <summary> /// Initializes a new instance of the <see cref="TrainForm"/> class. /// </summary> /// <param name="cnnProjectHolder">The CNN project holder.</param> /// <param name="parentForm">The parent form.</param> public TrainForm(CNNProjectHolder cnnProjectHolder, CollectForm parentForm) { InitializeComponent(); this._cnnProjectHolder = cnnProjectHolder; this._parentForm = parentForm; MasterForm.InitializeContent( this, this.lblTooltip, this._toolStripContainer, this.pnlContentHolder, this._cnnProjectHolder); this._cnnProjectHolder.ProjectChanged += new CNNProjectHolder.ProjectChangedDelegate(CnnProjectHolder_ProjectChanged); }
/// <summary> /// Initializes a new instance of the <see cref="DetectForm"/> class. /// </summary> public DetectForm(CNNProjectHolder cnnProjectHolder, TrainForm parentForm) { InitializeComponent(); this._cnnProjectHolder = cnnProjectHolder; this._parentForm = parentForm; MasterForm.InitializeContent( this, this.lblTooltip, this._toolStripContainer, this.pnlContentHolder, this._cnnProjectHolder); this.cmbImageProvider.Items.AddRange(ImageProvider.GetAvailableProviders()); this.cmbImageProvider.SelectedIndex = 0; this._cnnProjectHolder.ProjectChanged += new CNNProjectHolder.ProjectChangedDelegate(CnnProjectHolder_ProjectChanged); }