瀏覽代碼

Re-applied the filter stuff and introduced new fixup for filtering issues in maxide.

woollybah 6 年之前
父節點
當前提交
784c3c5b45
共有 3 個文件被更改,包括 19 次插入0 次删除
  1. 2 0
      maxgui.mod/gadget.bmx
  2. 4 0
      maxgui.mod/maxgui.bmx
  3. 13 0
      maxguitextareascintilla.mod/win32.bmx

+ 2 - 0
maxgui.mod/gadget.bmx

@@ -815,6 +815,8 @@ Type TGadget
 	End Method
 	Method SetLineNumberForeColor(r:Int, g:Int, b:Int)
 	End Method
+	Method HasCharEventSupressionFixup:Int()
+	End Method
 ' progbar
 	Method SetValue(value#)
 	End Method	

+ 4 - 0
maxgui.mod/maxgui.bmx

@@ -1812,6 +1812,10 @@ Function TextAreaSetLineNumberForeColor(textarea:TGadget, red:Int, green:Int, bl
 	textarea.SetLineNumberForeColor(red, green, blue)
 End Function
 
+Function TextAreaHasCharEventSupressionFixup:Int(textarea:TGadget)
+	Return textarea.HasCharEventSupressionFixup()
+End Function
+
 ' gadget lists
 
 Rem

+ 13 - 0
maxguitextareascintilla.mod/win32.bmx

@@ -70,6 +70,11 @@ Type TWindowsScintillaTextArea Extends TWindowsTextArea
 		Select msg
 			'Case WM_MOUSEWHEEL
 			'	If (Long(wp)&MK_CONTROL) Then SendMessageW _hwnd, EM_SETZOOM, 0, 0
+			Case WM_KEYDOWN
+				If eventfilter<>Null
+					event=CreateEvent(EVENT_KEYDOWN,Self,Int(wp),keymods())
+					If Not eventfilter(event,context) Return True
+				EndIf
 				
 			Case WM_KILLFOCUS
 				PostGuiEvent EVENT_GADGETLOSTFOCUS
@@ -78,6 +83,10 @@ Type TWindowsScintillaTextArea Extends TWindowsTextArea
 				If (keymods()&MODIFIER_CONTROL) Then
 					Return 1
 				End If
+				If eventfilter<>Null
+					event=CreateEvent(EVENT_KEYCHAR,Self,Int(wp),keymods())
+					If Not eventfilter(event,context) Return True
+				EndIf
 
 		End Select
 		
@@ -470,6 +479,10 @@ Type TWindowsScintillaTextArea Extends TWindowsTextArea
 		bmx_mgta_scintilla_setlinenumberforecolor(_hwnd, r | g Shl 8 | b Shl 16)
 	End Method
 
+	Method HasCharEventSupressionFixup:Int()
+		Return True
+	End Method
+
 End Type