Details for context menu related events.
Inheritance: CancelEventArgs
Beispiel #1
0
 /// <summary>
 /// Raises the WndProcHitTest event.
 /// </summary>
 /// <param name="e">A ViewControlHitTestArgs containing the event data.</param>
 protected virtual void OnWndProcHitTest(ViewControlHitTestArgs e)
 {
     if (WndProcHitTest != null)
     {
         WndProcHitTest(this, e);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Process Windows-based messages.
        /// </summary>
        /// <param name="m">A Windows-based message.</param>
        protected override void WndProc(ref Message m)
        {
            // Only interested in intercepting the hit testing
            if (m.Msg == PI.WM_NCHITTEST)
            {
                // Extract the screen point for the hit test
                Point screenPoint = new Point((int)m.LParam.ToInt64());

                // Generate event so message can be processed
                ViewControlHitTestArgs args = new ViewControlHitTestArgs(PointToClient(screenPoint));
                OnWndProcHitTest(args);

                if (!args.Cancel)
                {
                    m.Result = args.Result;
                    return;
                }
            }

            base.WndProc(ref m);
        }
 private void OnChildWndProcHitTest(object sender, ViewControlHitTestArgs e)
 {
     if (_ribbonTabs != null)
     {
         if (_ribbonTabs.GetViewForSpare != null)
         {
             if (_ribbonTabs.GetViewForSpare.ClientRectangle.Contains(e.Point))
             {
                 e.Cancel = false;
                 e.Result = (IntPtr)PI.HTTRANSPARENT;
             }
         }
     }
 }
 /// <summary>
 /// Raises the WndProcHitTest event.
 /// </summary>
 /// <param name="e">A ViewControlHitTestArgs containing the event data.</param>
 protected virtual void OnWndProcHitTest(ViewControlHitTestArgs e)
 {
     WndProcHitTest?.Invoke(this, e);
 }
Beispiel #5
0
        /// <summary>
        /// Process Windows-based messages.
        /// </summary>
        /// <param name="m">A Windows-based message.</param>
        protected override void WndProc(ref Message m)
        {
            // Only interested in intercepting the hit testing
            if (m.Msg == PI.WM_NCHITTEST)
            {
                // Extract the screen point for the hit test
                Point screenPoint = new Point((int)m.LParam.ToInt64());

                // Generate event so message can be processed
                ViewControlHitTestArgs args = new ViewControlHitTestArgs(PointToClient(screenPoint));
                OnWndProcHitTest(args);

                if (!args.Cancel)
                {
                    m.Result = args.Result;
                    return;
                }
            }

            base.WndProc(ref m);
        }
Beispiel #6
0
 /// <summary>
 /// Raises the WndProcHitTest event.
 /// </summary>
 /// <param name="e">A ViewControlHitTestArgs containing the event data.</param>
 protected virtual void OnWndProcHitTest(ViewControlHitTestArgs e)
 {
     if (WndProcHitTest != null)
         WndProcHitTest(this, e);
 }