コード例 #1
0
        protected override void WndProc(ref Message m)
        {
            //	Uh-oh. Code based on undocumented unsupported .NET behavior coming up!
            //	Windows Forms Sends Notify messages back to the originating
            //	control ORed with 0x2000. This is way cool becuase we can listen for
            //	WM_NOTIFY messages originating form our own hWnd (from Scintilla)
            if ((m.Msg ^ 0x2000) != NativeMethods.WM_NOTIFY)
            {
                base.WndProc(ref m);
                return;
            }

            SCNotification scnotification = (SCNotification)Marshal.PtrToStructure(m.LParam, typeof(SCNotification));

            // dispatch to listeners of the native event first
            // this allows listeners to get the raw event if they really wish
            // but ideally, they'd just use the .NET event
            if (Events[_nativeEventKey] != null)
            {
                ((EventHandler <NativeScintillaEventArgs>)Events[_nativeEventKey])(this, new NativeScintillaEventArgs(m, scnotification));
            }

            DispatchScintillaEvent(scnotification);
            base.WndProc(ref m);
        }
コード例 #2
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
        internal AutoCSelectionEventArgs(SCNotification eventSource)
        {
            _wordStartPosition = (int)eventSource.lParam;

            //	I'm pretty sure this is bad, but not positive. I don't quite know which of the
            //	which of Scintilla's strings support non-ANSI besides the main document text
            _text = Marshal.PtrToStringAnsi(eventSource.text);
        }
コード例 #3
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal ModifiedEventArgs(SCNotification eventSource)
     : this(eventSource.modificationType)
 {
     _foldLevelNow    = eventSource.foldLevelNow;
     _foldLevelPrev   = eventSource.foldLevelPrev;
     _length          = eventSource.length;
     _line            = eventSource.line;
     _linesAddedCount = eventSource.linesAdded;
     _position        = eventSource.position;
     _text            = Utilities.PtrToStringUtf8(eventSource.text, eventSource.length);
 }
コード例 #4
0
ファイル: ScintillaControl.cs プロジェクト: writeescape/ags
        public void StyleDialog(SCNotification notify) //THIS NEED REFACTORING OUT OF THIS CLASS
        {
            if (!IsDialog)
            {
                return;
            }

            int line_number = SendMessageDirect(Constants.SCI_LINEFROMPOSITION, SendMessageDirect(Constants.SCI_GETENDSTYLED));
            int end_pos     = notify.position;

            Style(line_number, end_pos);
        }
コード例 #5
0
ファイル: ScintillaControl.cs プロジェクト: mo-g/ags
        protected override void WndProc(ref Message m)
        {
            //	If we get a destroy message we make this window
            //	a message-only window so that it doesn't actually
            //	get destroyed, causing Scintilla to wipe out all
            //	its settings associated with this window handle.
            //	We do send a WM_DESTROY message to Scintilla in the
            //	Dispose() method so that it does clean up its
            //	resources when this control is actually done with.
            //	Solution was taken from QuickSharp.
            if (m.Msg == WinAPI.WM_DESTROY)
            {
                if (this.IsHandleCreated)
                {
                    WinAPI.SetParent(this.Handle, WinAPI.HWND_MESSAGE);
                    return;
                }
            }
            // [AVD] moving this above WM_NOTIFY fixes cursor flickering and cpu usage on W10
            else if (m.Msg == WinAPI.WM_SETCURSOR)
            {
                base.DefWndProc(ref m); // Make sure message is sent to Scintilla
                return;
            }
            //	Uh-oh. Code based on undocumented unsupported .NET behavior coming up!
            //	Windows Forms Sends Notify messages back to the originating
            //	control ORed with 0x2000. This is way cool becuase we can listen for
            //	WM_NOTIFY messages originating form our own hWnd (from Scintilla)
            else if ((m.Msg ^ 0x2000) != WinAPI.WM_NOTIFY)
            {
                base.WndProc(ref m);
                return;
            }


            SCNotification scnotification = (SCNotification)Marshal.PtrToStructure(m.LParam, typeof(SCNotification));

            // dispatch to listeners of the native event first
            // this allows listeners to get the raw event if they really wish
            // but ideally, they'd just use the .NET event
            if (Events[_nativeEventKey] != null)
            {
                ((EventHandler <NativeScintillaEventArgs>)Events[_nativeEventKey])(this, new NativeScintillaEventArgs(m, scnotification));
            }

            DispatchScintillaEvent(scnotification);
            base.WndProc(ref m);
        }
コード例 #6
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal CharAddedEventArgs(SCNotification eventSource)
     : this(eventSource.ch)
 {
 }
コード例 #7
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal StyleChangedEventArgs(SCNotification eventSource)
     : base(eventSource)
 {
 }
コード例 #8
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal HotspotClickEventArgs(SCNotification eventSource)
     : this(eventSource.modifiers, eventSource.position)
 {
 }
コード例 #9
0
 internal UriDroppedEventArgs(SCNotification eventSource)
 {
 }
コード例 #10
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal FoldChangedEventArgs(SCNotification eventSource)
     : this(eventSource.line, eventSource.foldLevelNow, eventSource.foldLevelPrev, eventSource.modificationType)
 {
 }
コード例 #11
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal UserListSelectionEventArgs(SCNotification eventSource) : base(eventSource)
 {
     _listType = (int)eventSource.wParam;
 }
コード例 #12
0
        internal SCKeyEventArgs(SCNotification eventSource)
			: this(eventSource.ch, eventSource.modifiers){}
コード例 #13
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal ModifyAttemptROEventArgs(SCNotification eventSource)
 {
 }
コード例 #14
0
 internal ModifyAttemptROEventArgs(SCNotification eventSource)
 {
 }
コード例 #15
0
        internal SCDoubleClickEventArgs(SCNotification eventSource)
			: this(eventSource.position, eventSource.line){}
コード例 #16
0
 internal SavePointLeftEventArgs(SCNotification eventSource)
 {
 }
コード例 #17
0
 internal SavePointReachedEventArgs(SCNotification eventSource)
 {
 }
コード例 #18
0
		internal AutoCSelectionEventArgs(SCNotification eventSource)
		{
			_wordStartPosition = (int)eventSource.lParam;

			//	I'm pretty sure this is bad, but not positive. I don't quite know which of the
			//	which of Scintilla's strings support non-ANSI besides the main document text
			_text = Marshal.PtrToStringAnsi(eventSource.text);
		}
コード例 #19
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal UriDroppedEventArgs(SCNotification eventSource)
 {
 }
コード例 #20
0
 internal UpdateUIEventArgs(SCNotification eventSource)
 {
 }
コード例 #21
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal SavePointReachedEventArgs(SCNotification eventSource)
 {
 }
コード例 #22
0
        internal MacroRecordEventArgs(SCNotification eventSource)
        {
			_message		= new Message();
			_message.HWnd	= eventSource.nmhdr.hwndFrom;
			_message.LParam = eventSource.lParam;
			_message.WParam = eventSource.wParam;
        }
コード例 #23
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal SCKeyEventArgs(SCNotification eventSource)
     : this(eventSource.ch, eventSource.modifiers)
 {
 }
コード例 #24
0
        internal MarginClickEventArgs(SCNotification eventSource)
			: this(eventSource.modifiers, eventSource.position, eventSource.margin){}
コード例 #25
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal NeedShownEventArgs(SCNotification eventSource)
 {
     _position = eventSource.position;
     _length   = eventSource.length;
 }
コード例 #26
0
		internal FoldChangedEventArgs(SCNotification eventSource) 
			: this(eventSource.line, eventSource.foldLevelNow, eventSource.foldLevelPrev, eventSource.modificationType){}
コード例 #27
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal DwellEndEventArgs(SCNotification eventSource) : base(eventSource)
 {
 }
コード例 #28
0
        internal NeedShownEventArgs(SCNotification eventSource)
        {
			_position	= eventSource.position;
			_length		= eventSource.length;
        }
コード例 #29
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal CallTipClickEventArgs(SCNotification eventSource)
     : this(eventSource.position)
 {
 }
コード例 #30
0
        internal PaintedEventArgs(SCNotification eventSource)
        {

        }
コード例 #31
0
		internal StyleChangedEventArgs(SCNotification eventSource)
			: base(eventSource){}
コード例 #32
0
        internal UserListSelectionEventArgs(SCNotification eventSource) : base(eventSource)
        {
			_listType = (int)eventSource.wParam;
        }
コード例 #33
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal NativeScintillaEventArgs(Message Msg, SCNotification notification)
 {
     _msg          = Msg;
     _notification = notification;
 }
コード例 #34
0
		internal DwellEventArgs(SCNotification eventSource) 
			: this(eventSource.position, eventSource.x, eventSource.y) { }
コード例 #35
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal StyleNeededEventArgs(SCNotification eventSource)
 {
     _position = eventSource.position;
 }
コード例 #36
0
		internal DwellEndEventArgs(SCNotification eventSource) : base(eventSource) { }
コード例 #37
0
ファイル: EventArgs.cs プロジェクト: writeescape/ags
 public DwellStartEventArgs(SCNotification eventSource)
 {
     _x        = eventSource.x;
     _y        = eventSource.y;
     _position = eventSource.position;
 }
コード例 #38
0
 internal SCZoomEventArgs(SCNotification eventSource)
 {
 }
コード例 #39
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal SavePointLeftEventArgs(SCNotification eventSource)
 {
 }
コード例 #40
0
        internal HotspotClickEventArgs(SCNotification eventSource)
			: this(eventSource.modifiers, eventSource.position){}
コード例 #41
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal SCDoubleClickEventArgs(SCNotification eventSource)
     : this(eventSource.position, eventSource.line)
 {
 }
コード例 #42
0
		internal HotspotDoubleClickEventArgs(SCNotification eventSource) : base(eventSource) { }
コード例 #43
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal UpdateUIEventArgs(SCNotification eventSource)
 {
 }
コード例 #44
0
        internal CallTipClickEventArgs(SCNotification eventSource)
	       : this(eventSource.position){}
コード例 #45
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal MarginClickEventArgs(SCNotification eventSource)
     : this(eventSource.modifiers, eventSource.position, eventSource.margin)
 {
 }
コード例 #46
0
ファイル: EventArgs.cs プロジェクト: smarinel/ags-web
 public DwellStartEventArgs(SCNotification eventSource)
 {
     _x = eventSource.x;
     _y = eventSource.y;
     _position = eventSource.position;
 }
コード例 #47
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal PaintedEventArgs(SCNotification eventSource)
 {
 }
コード例 #48
0
ファイル: EventArgs.cs プロジェクト: smarinel/ags-web
 public MarginClickEventArgs(SCNotification eventSource, int lineNumber)
 {
     _margin = eventSource.margin;
     _lineNumber = lineNumber;
 }
コード例 #49
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal DwellEventArgs(SCNotification eventSource)
     : this(eventSource.position, eventSource.x, eventSource.y)
 {
 }
コード例 #50
0
ファイル: ScintillaControl.cs プロジェクト: Aquilon96/ags
        public void StyleDialog(SCNotification notify) //THIS NEED REFACTORING OUT OF THIS CLASS
        {
            if (!IsDialog) return;

            int line_number = SendMessageDirect(Constants.SCI_LINEFROMPOSITION, SendMessageDirect(Constants.SCI_GETENDSTYLED));
            int end_pos = notify.position;
                             
            Style(line_number, end_pos);


                        
    

        }
コード例 #51
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal SCZoomEventArgs(SCNotification eventSource)
 {
 }
コード例 #52
0
 internal CharAddedEventArgs(SCNotification eventSource)
     : this(eventSource.ch) { }
コード例 #53
0
ファイル: EventArgs.cs プロジェクト: kirillsk1/Generator
 internal HotspotDoubleClickEventArgs(SCNotification eventSource) : base(eventSource)
 {
 }
コード例 #54
0
ファイル: EventArgs.cs プロジェクト: writeescape/ags
 public MarginClickEventArgs(SCNotification eventSource, int lineNumber)
 {
     _margin     = eventSource.margin;
     _lineNumber = lineNumber;
 }
コード例 #55
0
ファイル: EventArgs.cs プロジェクト: smarinel/ags-web
 public NativeScintillaEventArgs(Message Msg, SCNotification notification)
 {
     _msg = Msg;
     _notification = notification;
 }
コード例 #56
0
        internal StyleNeededEventArgs(SCNotification eventSource)
        {
			_position = eventSource.position;
        }
コード例 #57
0
ファイル: ScintillaControl.cs プロジェクト: Aquilon96/ags
        protected void DispatchScintillaEvent(SCNotification notification)
        {
            switch (notification.nmhdr.code)
            {

                case Scintilla.Enums.Events.StyleNeeded:

                        
                        StyleDialog(notification);
                       

                    break;
                    
                case Scintilla.Enums.Events.MarginClick:

                    int lineNumber = SendMessageDirect(Constants.SCI_LINEFROMPOSITION, notification.position, 0);                                   
                      MarginClick(this, new MarginClickEventArgs(notification, lineNumber));
                    break;
                case Scintilla.Enums.Events.AutoCSelection:
                    if (Events[Scintilla.Enums.Events.AutoCSelection] != null)
                        ((EventHandler<AutoCSelectionEventArgs>)Events[Scintilla.Enums.Events.AutoCSelection])(this, new AutoCSelectionEventArgs(notification));
                    break;

                case Scintilla.Enums.Events.SavePointLeft:
                    if (SavePointLeft != null)
                    {
                        SavePointLeft(this, null);
                    }
                    break;

                case Scintilla.Enums.Events.SavePointReached:
                    if (SavePointReached != null)
                    {
                        SavePointReached(this, null);
                    }
                    break;

                case Scintilla.Enums.Events.CharAdded:
                    if (CharAdded != null)
                    {
                        CharAdded(this, new CharAddedEventArgs(notification.ch));
                    }
                    break;

                case Scintilla.Enums.Events.UpdateUI:
                    if (UpdateUI != null)
                    {
                        UpdateUI(this, null);
                    }
                    break;

                case Scintilla.Enums.Events.ModifyAttemptRO:
                    if (ModifyAttemptOnReadOnly != null)
                    {
                        ModifyAttemptOnReadOnly(this, null);
                    }
                    break;

                case Scintilla.Enums.Events.Modified:
                    if (TextModified != null)
                    {
                        TextModified(this, new TextModifiedEventArgs(notification));
                    }
                    break;

                case Scintilla.Enums.Events.DwellStart:
                    if (DwellStart != null)
                    {
                        DwellStart(this, new DwellStartEventArgs(notification));
                    }
                    break;
                case Scintilla.Enums.Events.DwellEnd:
                    if (DwellEnd != null)
                    {
                        DwellEnd(this, null);
                    }
                    break;
            }
        }
コード例 #58
0
ファイル: EventArgs.cs プロジェクト: smarinel/ags-web
 public TextModifiedEventArgs(SCNotification notification)
     : base(notification.modificationType)
 {
     _position = notification.position;
     _length = notification.length;
     _isUserChange = (notification.position & 0x10) != 0;
 }
コード例 #59
0
ファイル: ScintillaControl.cs プロジェクト: writeescape/ags
        protected void DispatchScintillaEvent(SCNotification notification)
        {
            switch (notification.nmhdr.code)
            {
            case Scintilla.Enums.Events.StyleNeeded:


                StyleDialog(notification);


                break;

            case Scintilla.Enums.Events.MarginClick:

                int lineNumber = SendMessageDirect(Constants.SCI_LINEFROMPOSITION, notification.position, 0);
                MarginClick(this, new MarginClickEventArgs(notification, lineNumber));
                break;

            case Scintilla.Enums.Events.AutoCSelection:
                if (Events[Scintilla.Enums.Events.AutoCSelection] != null)
                {
                    ((EventHandler <AutoCSelectionEventArgs>)Events[Scintilla.Enums.Events.AutoCSelection])(this, new AutoCSelectionEventArgs(notification));
                }
                break;

            case Scintilla.Enums.Events.SavePointLeft:
                if (SavePointLeft != null)
                {
                    SavePointLeft(this, null);
                }
                break;

            case Scintilla.Enums.Events.SavePointReached:
                if (SavePointReached != null)
                {
                    SavePointReached(this, null);
                }
                break;

            case Scintilla.Enums.Events.CharAdded:
                if (CharAdded != null)
                {
                    CharAdded(this, new CharAddedEventArgs(notification.ch));
                }
                break;

            case Scintilla.Enums.Events.UpdateUI:
                if (UpdateUI != null)
                {
                    UpdateUI(this, null);
                }
                break;

            case Scintilla.Enums.Events.ModifyAttemptRO:
                if (ModifyAttemptOnReadOnly != null)
                {
                    ModifyAttemptOnReadOnly(this, null);
                }
                break;

            case Scintilla.Enums.Events.Modified:
                if (TextModified != null)
                {
                    TextModified(this, new TextModifiedEventArgs(notification));
                }
                break;

            case Scintilla.Enums.Events.DwellStart:
                if (DwellStart != null)
                {
                    DwellStart(this, new DwellStartEventArgs(notification));
                }
                break;

            case Scintilla.Enums.Events.DwellEnd:
                if (DwellEnd != null)
                {
                    DwellEnd(this, null);
                }
                break;
            }
        }
コード例 #60
0
ファイル: EventArgs.cs プロジェクト: smarinel/ags-web
 public AutoCSelectionEventArgs(SCNotification eventSource)
 {
     _text = Utilities.PtrToStringUtf8( eventSource.text , eventSource.length );
 }