예제 #1
0
        ///////////////////////////////////////////////////////////////////////////////
        // Eventhandler                                                              //
        ///////////////////////////////////////////////////////////////////////////////
        #region EVENTS

        ///////////////////////////////////////////////////////////////////////////////
        // Eventhandler for UI, Menu, Buttons, Toolbars etc.                         //
        ///////////////////////////////////////////////////////////////////////////////
        #region WINDOWSEVENTHANDLER

        /// <summary>
        /// OnClick event handler. Initializes the <see cref="PositionSelector"/>
        /// and shows it.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">Empty <see cref="EventArgs"/></param>
        private void PositionButton_Click(object sender, EventArgs e)
        {
            PositionSelector posSelector = new PositionSelector(
                base.Parent.PointToScreen(new Point(base.Left, base.Bottom)),
                this, this._position, this._stimulusScreenSize);

            posSelector.Alignment = this._alignment;
            if (posSelector.ShowDialog() == DialogResult.OK)
            {
                this.CurrentPosition = this._position;
            }
        }
예제 #2
0
        /// <summary>
        /// On mouse down event handler. Shows color selection panel of type <see cref="ColorPanel"/>.
        /// </summary>
        /// <param name="e">A <see cref="MouseEventArgs"/> that contains the event data.</param>
        protected override void OnMouseDown(MouseEventArgs e)
        {
            //Open Position Selector.
            PositionSelector posSelector = new PositionSelector(
                base.Parent.PointToScreen(new Point(base.Bounds.Left, base.Bounds.Bottom)),
                this, this._position, this._stimulusScreenSize);

            posSelector.Alignment = this._alignment;
            if (posSelector.ShowDialog() == DialogResult.OK)
            {
                this.CurrentPosition = this._position;
            }
        }
예제 #3
0
 /// <summary>
 /// On mouse down event handler. Shows color selection panel of type <see cref="ColorPanel"/>.
 /// </summary>
 /// <param name="e">A <see cref="MouseEventArgs"/> that contains the event data.</param>
 protected override void OnMouseDown(MouseEventArgs e)
 {
   //Open Position Selector.
   PositionSelector posSelector = new PositionSelector(
       base.Parent.PointToScreen(new Point(base.Bounds.Left, base.Bounds.Bottom)),
       this, this._position, this._stimulusScreenSize);
   posSelector.Alignment = this._alignment;
   if (posSelector.ShowDialog() == DialogResult.OK)
   {
     this.CurrentPosition = this._position;
   }
 }
예제 #4
0
    ///////////////////////////////////////////////////////////////////////////////
    // Eventhandler                                                              //
    ///////////////////////////////////////////////////////////////////////////////
    #region EVENTS

    ///////////////////////////////////////////////////////////////////////////////
    // Eventhandler for UI, Menu, Buttons, Toolbars etc.                         //
    ///////////////////////////////////////////////////////////////////////////////
    #region WINDOWSEVENTHANDLER

    /// <summary>
    /// OnClick event handler. Initializes the <see cref="PositionSelector"/>
    /// and shows it.
    /// </summary>
    /// <param name="sender">Source of the event.</param>
    /// <param name="e">Empty <see cref="EventArgs"/></param>
    private void PositionButton_Click(object sender, EventArgs e)
    {
      PositionSelector posSelector = new PositionSelector(
        base.Parent.PointToScreen(new Point(base.Left, base.Bottom)),
        this, this._position, this._stimulusScreenSize);
      posSelector.Alignment = this._alignment;
      if (posSelector.ShowDialog() == DialogResult.OK)
      {
        this.CurrentPosition = this._position;
      }
    }