Esempio n. 1
0
        unsafe void _NotifyCallback(void *cbParam, ref SCNotification n)
        {
            var code = n.nmhdr.code;

            //if(code != NOTIF.SCN_PAINTED) AOutput.QM2.Write(code.ToString());
            switch (code)
            {
            case NOTIF.SCN_MODIFIED:
                if ((n.modificationType & (MOD.SC_MULTISTEPUNDOREDO | MOD.SC_LASTSTEPINUNDOREDO)) == MOD.SC_MULTISTEPUNDOREDO)
                {
                    return;
                }
                _NotifyModified(n);
                if (ZDisableModifiedNotifications)
                {
                    return;
                }
                break;

            case NOTIF.SCN_HOTSPOTRELEASECLICK:
                ZTags?.OnLinkClick_(n.position, 0 != (n.modifiers & SCMOD_CTRL));
                break;
            }
            ZOnSciNotify(ref n);
        }
Esempio n. 2
0
        protected override void WndProc(ref Message m)
        {
            //if(this.Parent?.Name == "Output") AWnd.More.PrintMsg(m, Api.WM_TIMER, Api.WM_MOUSEMOVE, Api.WM_SETCURSOR, Api.WM_NCHITTEST, Api.WM_PAINT, Api.WM_IME_SETCONTEXT, Api.WM_IME_NOTIFY);
            //if(Focused) AWnd.More.PrintMsg(m, Api.WM_TIMER, Api.WM_MOUSEMOVE, Api.WM_SETCURSOR, Api.WM_NCHITTEST, Api.WM_PAINT, Api.WM_IME_SETCONTEXT, Api.WM_IME_NOTIFY);

            var hwnd = (AWnd)m.HWnd;

            //LPARAM wParam = m.WParam, lParam = m.LParam;

            switch (m.Msg)
            {
            case Api.WM_SETCURSOR:
            //case Api.WM_SETFOCUS: //no, it prevents changing default button etc. Don't remember why it was added here.
            //case Api.WM_KILLFOCUS:
            case Api.WM_LBUTTONUP:
            case Api.WM_LBUTTONDBLCLK:
                _DefWndProc(ref m);
                return;

            case Api.WM_LBUTTONDOWN:
                if (Api.GetFocus() != hwnd)
                {
                    bool setFocus = true;
                    ZTags?.OnLButtonDownWhenNotFocused_(ref m, ref setFocus);                     //Tags may not want to set focus eg when a hotspot clicked
                    if (setFocus && !ZNoMouseLeftSetFocus)
                    {
                        Api.SetFocus(hwnd);
                    }
                }
                _DefWndProc(ref m);
                return;

            case Api.WM_RBUTTONDOWN:
                if (!ZNoMouseRightSetFocus)
                {
                    Api.SetFocus(hwnd);
                }
                _DefWndProc(ref m);
                return;
            }

            base.WndProc(ref m);

            switch (m.Msg)
            {
            case Api.WM_CREATE:             //after inherited classes set styles etc
                if (!_text.NE())
                {
                    Z.SetText(_text, SciSetTextFlags.NoUndoNoNotify);
                }
                break;
            }
        }
Esempio n. 3
0
 protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
 {
     switch (msg)
     {
     case Api.WM_MBUTTONDOWN:             //close file
         int pos = Call(Sci.SCI_POSITIONFROMPOINTCLOSE, Math2.LoShort(lParam), Math2.HiShort(lParam));
         if (ZTags.GetLinkFromPos(pos, out var tag, out var attr) && tag is "+f" or "+ra")
         {
             //print.it(tag, attr);
             var f = App.Model.Find(attr.Split(' ')[0]);
             if (f != null)
             {
                 App.Model.CloseFile(f, selectOther: true, focusEditor: true);
             }
         }
         return(default);                //don't focus
     }
     return(base.WndProc(hwnd, msg, wParam, lParam, ref handled));
 }