예제 #1
0
파일: PenStyleDlg.cs 프로젝트: DeSciL/Ogama
 /// <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));
   }
 }
예제 #2
0
 private void OnPenChanged(PenChangedEventArgs e)
 {
   if (PenChanged != null)
   {
     // Invokes the delegates. 
     PenChanged(this, e);
   }
 }
예제 #3
0
    /// <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;
      }
    }
예제 #4
0
    /// <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;
      }
    }
예제 #5
0
 /// <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);
   }
 }
예제 #6
0
 /// <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);
 }
예제 #7
0
 /// <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);
   }
 }
예제 #8
0
 /// <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);
 }
예제 #9
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);
      }
    }
예제 #10
0
파일: AOIModule.cs 프로젝트: DeSciL/Ogama
    /// <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);
      }
    }
예제 #11
0
 /// <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);
   }
 }
예제 #12
0
 private void penSelectControl_PenChanged(object sender, PenChangedEventArgs e)
 {
   OnPenChanged(e);
 }
예제 #13
0
파일: AOIModule.cs 프로젝트: DeSciL/Ogama
 /// <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);
 }
예제 #14
0
파일: AOIModule.cs 프로젝트: DeSciL/Ogama
 /// <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);
 }
예제 #15
0
파일: AOIModule.cs 프로젝트: DeSciL/Ogama
 /// <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);
 }
예제 #16
0
파일: AOIModule.cs 프로젝트: DeSciL/Ogama
 /// <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);
 }
예제 #17
0
파일: AOIModule.cs 프로젝트: DeSciL/Ogama
 /// <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);
 }
예제 #18
0
 /// <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);
   }
 }
예제 #19
0
 /// <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);
 }
예제 #20
0
 /// <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);
 }
예제 #21
0
    /// <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;
      }
    }