/////////////////////////////////////////////////////////////////////////////// // Eventhandler for Custom Defined Events // /////////////////////////////////////////////////////////////////////////////// #region CUSTOMEVENTHANDLER #endregion //CUSTOMEVENTHANDLER #endregion //EVENTS /////////////////////////////////////////////////////////////////////////////// // Methods and Eventhandling for Background tasks // /////////////////////////////////////////////////////////////////////////////// #region BACKGROUNDWORKER #endregion //BACKGROUNDWORKER /////////////////////////////////////////////////////////////////////////////// // Inherited methods // /////////////////////////////////////////////////////////////////////////////// #region OVERRIDES #endregion //OVERRIDES /////////////////////////////////////////////////////////////////////////////// // Methods for doing main class job // /////////////////////////////////////////////////////////////////////////////// #region METHODS /// <summary> /// Opens <see cref="PenStyleDlg"/> and updates application settings and /// given pen style area when new pen style is choosen. /// </summary> /// <param name="psa">A <see cref="PenStyleArea"/> that visualizes the changed pen.</param> /// <param name="colorToSet">Out. An Application Setting Pen <see cref="Color"/>.</param> /// <param name="styleToSet">Out. An Application Setting Pen <see cref="DashStyle"/>.</param> /// <param name="widthToSet">Out. An <see cref="Single"/> with the Application Setting Pen Width</param> /// <returns><strong>True</strong>, if style should be applied to settings, /// otherwise <strong>false</strong> (User cancelled dialog)</returns> private bool btnPenStyleClicked( PenStyleArea psa, out Color colorToSet, out DashStyle styleToSet, out float widthToSet) { PenStyleDlg dlgStyle = new PenStyleDlg(); dlgStyle.Text = "Set pen style..."; dlgStyle.Pen = psa.Pen; dlgStyle.Icon = Properties.Resources.RPLCursorPenIcon; if (dlgStyle.ShowDialog() == DialogResult.OK) { psa.Pen = dlgStyle.Pen; psa.Refresh(); colorToSet = dlgStyle.Pen.Color; styleToSet = dlgStyle.Pen.DashStyle; widthToSet = dlgStyle.Pen.Width; return true; } else { colorToSet = Color.Empty; styleToSet = DashStyle.Custom; widthToSet = 0; return false; } }
/////////////////////////////////////////////////////////////////////////////// // Eventhandler // /////////////////////////////////////////////////////////////////////////////// #region EVENTS /////////////////////////////////////////////////////////////////////////////// // Eventhandler for UI, Menu, Buttons, Toolbars etc. // /////////////////////////////////////////////////////////////////////////////// #region WINDOWSEVENTHANDLER /// <summary> /// <see cref="Control.Click"/> event handler /// for the <see cref="Button"/> <see cref="btnPenStyle"/> /// Raises a <see cref="PenStyleDlg"/>. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">A empty <see cref="EventArgs"/></param> private void btnPenStyle_Click(object sender, EventArgs e) { PenStyleDlg dlgStyle = new PenStyleDlg(); dlgStyle.Text = "Set pen style ..."; dlgStyle.Pen = psaLinestyle.Pen; if (dlgStyle.ShowDialog() == DialogResult.OK) { psaLinestyle.Pen = dlgStyle.Pen; OnShapePropertiesChanged(new ShapePropertiesChangedEventArgs(GetDrawAction(), this.NewPen, this.NewBrush, this.NewFont, this.NewFontColor, this.NewName, this.textAlignment)); } }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnMouseFixConPenStyle"/>. /// Shows pen style selection dialog for the mouse fixation connections. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnMouseFixConPenStyle_Click(object sender, EventArgs e) { Pen backupPen = this.replayPicture.PenMouseFixationConnection; PenStyleDlg dlgMouseFixConStyle = new PenStyleDlg(); dlgMouseFixConStyle.PenChanged += new EventHandler<PenChangedEventArgs>(this.dlgMouseFixConStyle_PenChanged); dlgMouseFixConStyle.Text = "Set mouse fixation connections pen style..."; dlgMouseFixConStyle.Pen = this.replayPicture.PenMouseFixationConnection; dlgMouseFixConStyle.Icon = Properties.Resources.RPLFixConPenIcon; if (dlgMouseFixConStyle.ShowDialog() == DialogResult.Cancel) { PenChangedEventArgs ea = new PenChangedEventArgs(backupPen, VGStyleGroup.RPL_PEN_MOUSE_FIXCON); this.replayPicture.PenChanged(this, ea); } }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnMouseCursorPenStyle"/>. /// Shows pen style selection dialog for the mouse cursor. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnMouseCursorPenStyle_Click(object sender, EventArgs e) { Pen backupPen = this.replayPicture.PenMouseCursor; PenStyleDlg dlgMouseCursorStyle = new PenStyleDlg(); dlgMouseCursorStyle.PenChanged += new EventHandler<PenChangedEventArgs>(this.dlgMouseCursorPenStyle_PenChanged); dlgMouseCursorStyle.Text = "Set mouse cursor pen style..."; dlgMouseCursorStyle.Pen = this.replayPicture.PenMouseCursor; dlgMouseCursorStyle.Icon = Properties.Resources.RPLCursorPenIcon; if (dlgMouseCursorStyle.ShowDialog() == DialogResult.Cancel) { PenChangedEventArgs ea = new PenChangedEventArgs(backupPen, VGStyleGroup.RPL_PEN_MOUSE_CURSOR); this.replayPicture.PenChanged(this, ea); } }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnGazePathPenStyle"/>. /// Shows pen style selection dialog for the gaze path. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnGazePathPenStyle_Click(object sender, EventArgs e) { Pen backupPen = this.replayPicture.PenGazePath; PenStyleDlg dlgGazePathStyle = new PenStyleDlg(); dlgGazePathStyle.Text = "Set gaze path pen style..."; dlgGazePathStyle.Pen = this.replayPicture.PenGazePath; dlgGazePathStyle.Icon = Properties.Resources.RPLPathPenIcon; dlgGazePathStyle.PenChanged += new EventHandler<PenChangedEventArgs>(this.dlgGazePathStyle_PenChanged); if (dlgGazePathStyle.ShowDialog() == DialogResult.Cancel) { PenChangedEventArgs ea = new PenChangedEventArgs(backupPen, VGStyleGroup.RPL_PEN_GAZE_PATH); this.replayPicture.PenChanged(this, ea); } }
/// <summary> /// The <see cref="Control.Click"/> event handler for /// the <see cref="Button"/> <see cref="btnConnectionsStyle"/>. /// Updates the colorization property of the selected subject or group /// with the changes made in the <see cref="PenStyleDlg"/> for /// the fixation connection pen. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnConnectionsStyle_Click(object sender, EventArgs e) { if (this.trvSubjects.SelectedNode != null) { PenStyleDlg dlg = new PenStyleDlg(); dlg.Pen = this.selectedConnectionsPen; if (dlg.ShowDialog() == DialogResult.OK) { this.selectedConnectionsPen = dlg.Pen; this.SubmitStyleToSubjectOrCategory(); } } }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnArrowPen"/>. /// Shows a <see cref="PenStyleDlg"/> for the arrow shapes. /// </summary> /// <param name="sender"> /// Source of the event. /// </param> /// <param name="e"> /// An empty <see cref="EventArgs"/> /// </param> private void BtnArrowPenClick(object sender, EventArgs e) { Pen backupPen = this.aoiPicture.ArrowPen; var dlgArrowStyle = new PenStyleDlg(); dlgArrowStyle.Text = "Define arrow pen style..."; dlgArrowStyle.Pen = this.aoiPicture.ArrowPen; dlgArrowStyle.PenChanged += this.dlgArrowStyle_PenChanged; if (dlgArrowStyle.ShowDialog() == DialogResult.Cancel) { this.UpdateStatisticProperties( backupPen, this.aoiPicture.ArrowBrush, this.aoiPicture.ArrowFont, this.aoiPicture.ArrowFontColor, this.aoiPicture.ArrowTextAlignment, VGStyleGroup.AOI_STATISTICS_ARROW); } }