Example #1
0
 /// <summary>
 /// The PenStyle has been modified, notify the callback host if any
 /// </summary>
 private void OnFontChanged(FontChangedEventArgs e)
 {
   if (FontStyleChanged != null)
   {
     // Invokes the delegates. 
     FontStyleChanged(this, e);
   }
 }
Example #2
0
 private void fontSelectControl1_FontStyleChanged(object sender, FontChangedEventArgs e)
 {
   OnFontChanged(e);
 }
Example #3
0
 /// <summary>
 /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.FontStyleChanged"/> 
 /// event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>.
 /// Updates picture elements by calling the pictures font changed event handler.
 /// </summary>
 /// <param name="sender">Source of the event</param>
 /// <param name="e">A <see cref="FontChangedEventArgs"/> with group and font to change.</param>
 private void OnFontStyleChanged(object sender, FontChangedEventArgs e)
 {
   e.ElementGroup = VGStyleGroup.FIX_GAZE_ELEMENT;
   this.fixationsPicture.FontStyleChanged(sender, e);
 }
Example #4
0
 /// <summary>
 /// Eventhandler. Updates the line sample with the new pen.
 /// </summary>
 /// <param name="sender">message sender</param>
 /// <param name="e">Pen change event arguments that hold new pen</param>
 public void ThisFontChanged(object sender, FontChangedEventArgs e)
 {
   this.Font = e.Font;
   this.FontColor = e.FontColor;
   this.FontAlignment = e.FontAlignment;
   OnFontStyleChanged(e);
   Invalidate();
 }
Example #5
0
    /// <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);
      }
    }
Example #6
0
    /// <summary>
    /// Eventhandler for the <see cref="OgamaControls.Dialogs.FontStyleDlg.FontStyleChanged"/> event. 
    /// Updates all graphic elements from the given group
    /// with the new font.
    /// </summary>
    /// <param name="sender">message sender</param>
    /// <param name="e">Font change event arguments that hold new group and font and brush</param>
    public void FontStyleChanged(object sender, FontChangedEventArgs e)
    {
      VGElementCollection sublist = this.Elements.FindAllGroupMembers(e.ElementGroup);
      foreach (VGElement element in sublist)
      {
        element.Font = e.Font;
        element.FontColor = e.FontColor;
      }

      this.DrawForeground(false);

      switch (e.ElementGroup)
      {
        case VGStyleGroup.FIX_GAZE_ELEMENT:
          this.gazeFixationsFont = e.Font;
          this.gazeFixationsFontColor = e.FontColor;
          break;
        case VGStyleGroup.FIX_MOUSE_ELEMENT:
          this.mouseFixationsFont = e.Font;
          this.mouseFixationsFontColor = e.FontColor;
          break;
      }
    }
Example #7
0
 /// <summary>
 /// The protected OnFontStyleChanged method raises the progress event by invoking 
 /// the delegates
 /// </summary>
 /// <param name="e">FontChanged event arguments</param>
 protected virtual void OnFontStyleChanged(FontChangedEventArgs e)
 {
   if (FontStyleChanged != null)
   {
     // Invokes the delegates. 
     FontStyleChanged(this, e);
   }
 }
Example #8
0
 /// <summary>
 /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.FontStyleChanged"/>
 ///   event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>.
 ///   Updates picture elements by calling the pictures font changed event handler.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="FontChangedEventArgs"/> with group and font to change.
 /// </param>
 private void dlgSearchRectStyle_FontStyleChanged(object sender, FontChangedEventArgs e)
 {
   e.ElementGroup = VGStyleGroup.AOI_SEARCHRECT;
   this.aoiPicture.FontStyleChanged(sender, e);
 }
Example #9
0
 /// <summary>
 /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.FontStyleChanged"/>
 ///   event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>
 ///   for the targets.
 ///   Updates picture elements by calling the pictures font changed event handler.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="FontChangedEventArgs"/> with group and font to change.
 /// </param>
 private void dlgTargetStyle_FontStyleChanged(object sender, FontChangedEventArgs e)
 {
   e.ElementGroup = VGStyleGroup.AOI_TARGET;
   this.aoiPicture.FontStyleChanged(sender, e);
 }
Example #10
0
    ///////////////////////////////////////////////////////////////////////////////
    // Eventhandler for Custom Defined Events                                    //
    ///////////////////////////////////////////////////////////////////////////////

    /// <summary>
    /// The <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg.FontStyleChanged"/>
    ///   event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>.
    ///   Updates picture elements by calling the pictures font changed event handler.
    /// </summary>
    /// <param name="sender">
    /// Source of the event
    /// </param>
    /// <param name="e">
    /// A <see cref="FontChangedEventArgs"/> with group and font to change.
    /// </param>
    private void dlgDefaultStyle_FontStyleChanged(object sender, FontChangedEventArgs e)
    {
      e.ElementGroup = VGStyleGroup.AOI_NORMAL;
      this.aoiPicture.FontStyleChanged(sender, e);
    }
Example #11
0
 /// <summary>
 /// The <see cref="OgamaControls.Dialogs.FontStyleDlg.FontStyleChanged"/>
 ///   event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>.
 ///   Updates picture elements by calling the pictures font changed event handler.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="FontChangedEventArgs"/> with group and font to change.
 /// </param>
 private void dlgBubbleStyle_FontStyleChanged(object sender, FontChangedEventArgs e)
 {
   this.UpdateStatisticProperties(
     this.aoiPicture.BubblePen, 
     this.aoiPicture.BubbleBrush, 
     e.Font, 
     e.FontColor, 
     e.FontAlignment, 
     VGStyleGroup.AOI_STATISTICS_BUBBLE);
 }
Example #12
0
 /// <summary>
 /// The <see cref="OgamaControls.Dialogs.FontStyleDlg.FontStyleChanged"/>
 ///   event handler for the <see cref="OgamaControls.Dialogs.PenAndFontStyleDlg"/>.
 ///   Updates picture elements by calling the pictures font changed event handler.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="FontChangedEventArgs"/> with group and font to change.
 /// </param>
 private void dlgArrowStyle_FontStyleChanged(object sender, FontChangedEventArgs e)
 {
   this.UpdateStatisticProperties(
     this.aoiPicture.ArrowPen, 
     this.aoiPicture.ArrowBrush, 
     e.Font, 
     e.FontColor, 
     e.FontAlignment, 
     VGStyleGroup.AOI_STATISTICS_ARROW);
 }
Example #13
0
    /// <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);
      }
    }
Example #14
0
    /// <summary>
    /// Eventhandler for the FontStyleChanged event. 
    /// Updates all graphic elements from the given group
    /// with the new font.
    /// </summary>
    /// <param name="sender">message sender</param>
    /// <param name="e">Font change event arguments that hold new group and font and brush</param>
    public void FontStyleChanged(object sender, FontChangedEventArgs e)
    {
      VGElementCollection sublist = this.Elements.FindAllGroupMembers(e.ElementGroup);
      foreach (VGElement element in sublist)
      {
        element.Font = e.Font;
        element.FontColor = e.FontColor;
        element.TextAlignment = e.FontAlignment;
      }

      this.DrawForeground(true);

      switch (e.ElementGroup)
      {
        case VGStyleGroup.AOI_NORMAL:
          this.defaultFont = e.Font;
          this.defaultFontColor = e.FontColor;
          break;
        case VGStyleGroup.AOI_TARGET:
          this.targetFont = e.Font;
          this.targetFontColor = e.FontColor;
          break;
        case VGStyleGroup.AOI_SEARCHRECT:
          this.searchRectFont = e.Font;
          this.searchRectFontColor = e.FontColor;
          break;
        default:
          this.defaultFont = e.Font;
          this.defaultFontColor = e.FontColor;
          break;
      }
    }