예제 #1
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            if (selectedButton == null)
            {
                return;
            }

            Capture = false;

            isInside = false;

            if (!RedrawAfterEvent)
            {
                UpdateButton(selectedButton);
            }

            if (selectedButton == HitTest(e.X, e.Y))
            {
                if (SipButtonClick != null)
                {
                    SipButtonClick(this, new SipEventArgs(selectedButton.Key));
                }
            }

            if (RedrawAfterEvent)
            {
                UpdateButton(selectedButton);
            }

            selectedButton = null;
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="button"></param>
        public void UpdateButton(SipButton button)
        {
            if (button == null)
            {
                throw new ArgumentNullException("button");
            }

            using (var g = CreateGraphics())
            {
                button.Draw(g, (selectedButton == button) && isInside);
            }
        }
예제 #3
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            Focus();

            selectedButton = HitTest(e.X, e.Y);
            if (selectedButton == null)
            {
                return;
            }

            isInside = true;

            Capture = true;

            UpdateButton(selectedButton);
        }