瀏覽代碼

Added win32 support for replacement TextArea gadgets.

woollybah 9 年之前
父節點
當前提交
4bf1ee80cb
共有 1 個文件被更改,包括 30 次插入3 次删除
  1. 30 3
      win32maxguiex.mod/win32maxguiex.bmx

+ 30 - 3
win32maxguiex.mod/win32maxguiex.bmx

@@ -143,7 +143,11 @@ Type TWindowsGUIDriver Extends TMaxGUIDriver
 			Case GADGET_TEXTFIELD
 				gadget=New TWindowsTextField.Create(group,style,Text)
 			Case GADGET_TEXTAREA
-				gadget=New TWindowsTextArea.Create(group,style)
+				' no custom text area? use the default
+				If Not windowsmaxguiex_textarea Then
+					windowsmaxguiex_textarea = New TWindowsDefaultTextAreaDriver
+				End If
+				gadget = windowsmaxguiex_textarea.CreateTextArea(group,style,Text)
 			Case GADGET_COMBOBOX
 				gadget=New TWindowsComboBox.Create(group,style,Text)
 			Case GADGET_LISTBOX
@@ -3990,7 +3994,7 @@ Type TWindowsTextField Extends TWindowsGadget
 	
 EndType
 
-Type TWindowsTextArea Extends TWindowsGadget
+Type TWindowsDefaultTextArea Extends TWindowsTextArea
 	
 	Global _ClassName:String = Null	'See InitializeLibrary().
 	
@@ -4399,7 +4403,6 @@ End Rem
 		Return AreaText(0,charcount(),TEXTAREA_CHARS)
 	EndMethod
 	
-	Global _oldCursor:Byte Ptr = 0
 	Field _oldSelPos%, _oldSelLen% = 0
 	
 	Method LockText()
@@ -5185,5 +5188,29 @@ Function FindGadgetWindowHwnd:Byte Ptr(g:TGadget)
 	Wend
 EndFunction
 
+Rem
+bbdoc: A base type for text area gadgets.
+about: Implementations are in seperate modules, except for the default TGTKDefaultTextArea
+End Rem
+Type TWindowsTextArea Extends TWindowsGadget
+	Global _oldCursor:Byte Ptr = 0
+
+	Method Create:TWindowsGadget(group:TGadget,style,Text$="") Abstract
+End Type
+
+
+Type TWindowsTextAreaDriver
+	Function CreateTextArea:TWindowsGadget(group:TGadget,style,Text$="") Abstract
+End Type
+
+' default text area driver
+Type TWindowsDefaultTextAreaDriver Extends TWindowsTextAreaDriver
+	Function CreateTextArea:TWindowsGadget(group:TGadget,style,Text$="")
+		Return New TWindowsDefaultTextArea.Create(group, style, Text)
+	End Function
+End Type
+
+Global windowsmaxguiex_textarea:TWindowsTextAreaDriver
+
 ?