/// <summary> /// Raises <see cref="PenChanged"/> event, when /// new pen is selected in the underlying control. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void penSelectControl_PenChanged(object sender, PenChangedEventArgs e) { if (PenChanged != null) { PenChanged(this, new PenChangedEventArgs((Pen)e.Pen.Clone(), e.ElementGroup)); } }
private void OnPenChanged(PenChangedEventArgs e) { if (PenChanged != null) { // Invokes the delegates. PenChanged(this, e); } }
/// <summary> /// <see cref="OgamaControls.Dialogs.PenStyleDlg.PenChanged"/> event handler. /// Updates all graphic elements from the given group /// with the new pen. /// </summary> /// <param name="sender"> /// Source of the event. /// </param> /// <param name="e"> /// A <see cref="PenChangedEventArgs"/> that hold new group and pen /// </param> public void PenChanged(object sender, PenChangedEventArgs e) { var sublist = this.Elements.FindAllGroupMembers(e.ElementGroup); foreach (VGElement element in sublist) { element.Pen = e.Pen; } this.DrawForeground(true); switch (e.ElementGroup) { case VGStyleGroup.RPL_PEN_GAZE_CURSOR: this.penGazeCursor = e.Pen; break; case VGStyleGroup.RPL_PEN_GAZE_PATH: this.penGazePath = e.Pen; break; case VGStyleGroup.RPL_PEN_GAZE_FIX: this.penGazeFixation = e.Pen; break; case VGStyleGroup.RPL_PEN_GAZE_FIXCON: this.penGazeFixationConnection = e.Pen; break; case VGStyleGroup.RPL_PEN_GAZE_NODATA: this.penGazeNoData = e.Pen; break; case VGStyleGroup.RPL_PEN_MOUSE_CURSOR: this.penMouseCursor = e.Pen; break; case VGStyleGroup.RPL_PEN_MOUSE_PATH: this.penMousePath = e.Pen; break; case VGStyleGroup.RPL_PEN_MOUSE_FIX: this.penMouseFixation = e.Pen; break; case VGStyleGroup.RPL_PEN_MOUSE_FIXCON: this.penMouseFixationConnection = e.Pen; break; default: this.penGazeCursor = e.Pen; break; } }
/// <summary> /// Eventhandler for the <see cref="OgamaControls.Dialogs.PenStyleDlg.PenChanged"/> event. /// Updates all graphic elements from the given group /// with the new pen. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">A <see cref="PenChangedEventArgs"/> that hold new group and pen</param> public void PenChanged(object sender, PenChangedEventArgs e) { VGElementCollection sublist = this.Elements.FindAllGroupMembers(e.ElementGroup); foreach (VGElement element in sublist) { element.Pen = e.Pen; } this.DrawForeground(false); switch (e.ElementGroup) { case VGStyleGroup.FIX_GAZE_ELEMENT: this.gazeFixationsPen = e.Pen; break; case VGStyleGroup.FIX_MOUSE_ELEMENT: this.mouseFixationsPen = e.Pen; break; } }
/// <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="OgamaControls.Dialogs.PenStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenStyleDlg"/>. /// Updates picture by invoking the pictures pen changed event handler. /// </summary> /// <param name="sender">Source of the event</param> /// <param name="e">A <see cref="PenChangedEventArgs"/> with group and pen to switch.</param> private void dlgMouseFixConStyle_PenChanged(object sender, PenChangedEventArgs e) { e.ElementGroup = VGStyleGroup.RPL_PEN_MOUSE_FIXCON; this.replayPicture.PenChanged(sender, e); }
/// <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="OgamaControls.Dialogs.PenStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenStyleDlg"/>. /// Updates picture by invoking the pictures pen changed event handler. /// </summary> /// <param name="sender">Source of the event</param> /// <param name="e">A <see cref="PenChangedEventArgs"/> with group and pen to switch.</param> private void dlgMouseCursorPenStyle_PenChanged(object sender, PenChangedEventArgs e) { e.ElementGroup = VGStyleGroup.RPL_PEN_MOUSE_CURSOR; this.replayPicture.PenChanged(sender, e); }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnMousePenStyle"/>. /// Opens a <see cref="PenAndFontStyleDlg"/> and wires update events to /// member methods <see cref="OnPenChanged"/> and <see cref="OnFontStyleChanged"/> /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnMousePenStyle_Click(object sender, EventArgs e) { Pen backupPen = this.fixationsPicture.MouseFixationsPen; Font backupFont = this.fixationsPicture.MouseFixationsFont; SolidBrush backupBrush = new SolidBrush(this.fixationsPicture.MouseFixationsFontColor); PenAndFontStyleDlg dlgFixationStyle = new PenAndFontStyleDlg(); dlgFixationStyle.Text = "Set mouse fixations pen and font style..."; dlgFixationStyle.Pen = this.fixationsPicture.MouseFixationsPen; dlgFixationStyle.CustomFont = this.fixationsPicture.MouseFixationsFont; dlgFixationStyle.CustomFontBrush = new SolidBrush(this.fixationsPicture.MouseFixationsFontColor); dlgFixationStyle.PenChanged += new EventHandler<PenChangedEventArgs>(this.OnPenChanged); dlgFixationStyle.FontStyleChanged += new EventHandler<FontChangedEventArgs>(this.OnFontStyleChanged); if (dlgFixationStyle.ShowDialog() == DialogResult.Cancel) { PenChangedEventArgs ea = new PenChangedEventArgs(backupPen, VGStyleGroup.FIX_MOUSE_ELEMENT); FontChangedEventArgs eaf = new FontChangedEventArgs(backupFont, backupBrush.Color, VGAlignment.Center, VGStyleGroup.FIX_MOUSE_ELEMENT); this.fixationsPicture.PenChanged(this, ea); this.fixationsPicture.FontStyleChanged(this, eaf); } }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnStyleTarget"/>. /// Shows a <see cref="PenAndFontStyleDlg"/> for the target areas of interest. /// </summary> /// <param name="sender"> /// Source of the event. /// </param> /// <param name="e"> /// An empty <see cref="EventArgs"/> /// </param> private void btnStyleTarget_Click(object sender, EventArgs e) { Pen backupPen = this.aoiPicture.TargetPen; Font backupFont = this.aoiPicture.TargetFont; var backupBrush = new SolidBrush(this.aoiPicture.TargetFontColor); VGAlignment backupAlignment = this.aoiPicture.TargetTextAlignment; var dlgTargetStyle = new PenAndFontStyleDlg(); dlgTargetStyle.Text = "Set target AOI pen and font style..."; dlgTargetStyle.Pen = this.aoiPicture.TargetPen; dlgTargetStyle.CustomFont = this.aoiPicture.TargetFont; dlgTargetStyle.CustomFontBrush = new SolidBrush(this.aoiPicture.TargetFontColor); dlgTargetStyle.CustomFontTextAlignment = this.aoiPicture.TargetTextAlignment; dlgTargetStyle.PenChanged += this.dlgTargetStyle_PenChanged; dlgTargetStyle.FontStyleChanged += this.dlgTargetStyle_FontStyleChanged; if (dlgTargetStyle.ShowDialog() == DialogResult.Cancel) { var ea = new PenChangedEventArgs(backupPen, VGStyleGroup.AOI_TARGET); var eaf = new FontChangedEventArgs(backupFont, backupBrush.Color, backupAlignment, VGStyleGroup.AOI_TARGET); this.aoiPicture.PenChanged(this, ea); this.aoiPicture.FontStyleChanged(this, eaf); } }
/// <summary> /// The protected OnPenStyleChanged method raises the progress event by invoking /// the delegates /// </summary> /// <param name="e">A <see cref="PenChangedEventArgs"/> with the event arguments</param> protected virtual void OnPenStyleChanged(PenChangedEventArgs e) { if (PenStyleChanged != null) { // Invokes the delegates. PenStyleChanged(this, e); } }
private void penSelectControl_PenChanged(object sender, PenChangedEventArgs e) { OnPenChanged(e); }
/// <summary> /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/> /// for the default shapes. /// Updates pictures elements by calling the pictures pen changed event handler. /// </summary> /// <param name="sender"> /// Source of the event /// </param> /// <param name="e"> /// A <see cref="PenChangedEventArgs"/> with group and pen to change. /// </param> private void dlgTargetStyle_PenChanged(object sender, PenChangedEventArgs e) { e.ElementGroup = VGStyleGroup.AOI_TARGET; this.aoiPicture.PenChanged(sender, e); }
/// <summary> /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/> /// for the search rectangles. /// Updates pictures elements by calling the pictures pen changed event handler. /// </summary> /// <param name="sender"> /// Source of the event /// </param> /// <param name="e"> /// A <see cref="PenChangedEventArgs"/> with group and pen to change. /// </param> private void dlgSearchRectStyle_PenChanged(object sender, PenChangedEventArgs e) { e.ElementGroup = VGStyleGroup.AOI_SEARCHRECT; this.aoiPicture.PenChanged(sender, e); }
/// <summary> /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>. /// Updates pictures elements by calling the pictures pen changed event handler. /// </summary> /// <param name="sender"> /// Source of the event /// </param> /// <param name="e"> /// A <see cref="PenChangedEventArgs"/> with group and pen to change. /// </param> private void dlgDefaultStyle_PenChanged(object sender, PenChangedEventArgs e) { e.ElementGroup = VGStyleGroup.AOI_NORMAL; this.aoiPicture.PenChanged(sender, e); }
/// <summary> /// The <see cref="OgamaControls.Dialogs.PenStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>. /// Updates pictures elements by calling the pictures pen changed event handler. /// </summary> /// <param name="sender"> /// Source of the event /// </param> /// <param name="e"> /// A <see cref="PenChangedEventArgs"/> with group and pen to change. /// </param> private void dlgBubbleStyle_PenChanged(object sender, PenChangedEventArgs e) { this.UpdateStatisticProperties( e.Pen, this.aoiPicture.BubbleBrush, this.aoiPicture.BubbleFont, this.aoiPicture.BubbleFontColor, this.aoiPicture.BubbleTextAlignment, VGStyleGroup.AOI_STATISTICS_BUBBLE); }
/// <summary> /// The <see cref="OgamaControls.Dialogs.PenStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>. /// Updates pictures elements by calling the pictures pen changed event handler. /// </summary> /// <param name="sender"> /// Source of the event /// </param> /// <param name="e"> /// A <see cref="PenChangedEventArgs"/> with group and pen to change. /// </param> private void dlgArrowStyle_PenChanged(object sender, PenChangedEventArgs e) { this.UpdateStatisticProperties( e.Pen, this.aoiPicture.ArrowBrush, this.aoiPicture.ArrowFont, this.aoiPicture.ArrowFontColor, this.aoiPicture.ArrowTextAlignment, VGStyleGroup.AOI_STATISTICS_ARROW); }
/// <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="OgamaControls.Dialogs.PenStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenStyleDlg"/>. /// Updates picture by invoking the pictures pen changed event handler. /// </summary> /// <param name="sender">Source of the event</param> /// <param name="e">A <see cref="PenChangedEventArgs"/> with group and pen to switch.</param> private void dlgGazeFixStyle_PenChanged(object sender, PenChangedEventArgs e) { e.ElementGroup = VGStyleGroup.RPL_PEN_GAZE_FIX; this.replayPicture.PenChanged(sender, e); }
/// <summary> /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.PenChanged"/> /// event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>. /// Updates pictures elements by calling the pictures pen changed event handler. /// </summary> /// <param name="sender">Source of the event</param> /// <param name="e">A <see cref="PenChangedEventArgs"/> with group and pen to change.</param> private void OnPenChanged(object sender, PenChangedEventArgs e) { e.ElementGroup = VGStyleGroup.FIX_GAZE_ELEMENT; this.fixationsPicture.PenChanged(sender, e); }
/// <summary> /// Eventhandler for the PenChanged event. /// Updates all graphic elements from the given group /// with the new pen. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">A <see cref="PenChangedEventArgs"/> that hold new group and pen</param> public void PenChanged(object sender, PenChangedEventArgs e) { VGElementCollection sublist = this.Elements.FindAllGroupMembers(e.ElementGroup); foreach (VGElement element in sublist) { element.Pen = e.Pen; } this.DrawForeground(true); switch (e.ElementGroup) { case VGStyleGroup.AOI_NORMAL: this.defaultPen = e.Pen; break; case VGStyleGroup.AOI_TARGET: this.targetPen = e.Pen; break; case VGStyleGroup.AOI_SEARCHRECT: this.searchRectPen = e.Pen; break; default: this.defaultPen = e.Pen; break; } }