Forráskód Böngészése

Added bracket matching styling.
Caret line is now draw with alpha (30).

woollybah 6 éve
szülő
commit
a783a521ee

+ 2 - 2
maxgui.mod/gadget.bmx

@@ -824,7 +824,7 @@ Type TGadget
 	End Method
 	Method SetCaretLineBackgroundColor(r:Int, g:Int, b:Int)
 	End Method
-	Method GetCaretLineBackgroundColor:int()
+	Method GetCaretLineBackgroundColor:Int()
 	End Method
 	Method HasCharEventSupressionFixup:Int()
 	End Method
@@ -836,7 +836,7 @@ Type TGadget
 	End Method
 	Method HasBracketMatching:Int()
 	End Method
-	Method SetBracketMatchingColor(r:Int, g:Int, b:Int)
+	Method SetBracketMatchingColor(r:Int, g:Int, b:Int, flags:Int)
 	End Method
 	Method MatchBrackets()
 	End Method

+ 6 - 6
maxgui.mod/maxgui.bmx

@@ -1820,16 +1820,16 @@ Function TextAreaSetCaretLineVisible(textarea:TGadget, enabled:Int)
 	textarea.SetCaretLineVisible(enabled)
 End Function
 
-Function TextAreaGetCaretLineVisible:int(textarea:TGadget)
-	return textarea.GetCaretLineVisible()
+Function TextAreaGetCaretLineVisible:Int(textarea:TGadget)
+	Return textarea.GetCaretLineVisible()
 End Function
 
 Function TextAreaSetCaretLineBackgroundColor(textarea:TGadget, red:Int, green:Int, blue:Int)
 	textarea.SetCaretLineBackgroundColor(red, green, blue)
 End Function
 
-Function TextAreaGetCaretLineBackgroundColor:int(textarea:TGadget)
-	return textarea.GetCaretLineBackgroundColor()
+Function TextAreaGetCaretLineBackgroundColor:Int(textarea:TGadget)
+	Return textarea.GetCaretLineBackgroundColor()
 End Function
 
 Function TextAreaHasCharEventSupressionFixup:Int(textarea:TGadget)
@@ -1852,8 +1852,8 @@ Function TextAreaHasBracketMatching:Int(textarea:TGadget)
 	Return textarea.HasBracketMatching()
 End Function
 
-Function TextAreaSetBracketMatchingColor(textarea:TGadget, red:Int, green:Int, blue:Int)
-	textarea.SetBracketMatchingColor(red, green, blue)
+Function TextAreaSetBracketMatchingColor(textarea:TGadget, red:Int, green:Int, blue:Int, flags:Int)
+	textarea.SetBracketMatchingColor(red, green, blue, flags)
 End Function
 
 Function TextAreaMatchBrackets(textarea:TGadget)

+ 2 - 2
maxguitextareascintilla.mod/common.bmx

@@ -78,7 +78,7 @@ Extern
 	Function bmx_mgta_scintilla_setcaretwidth(handle:Byte Ptr, width:Int)
 	Function bmx_mgta_scintilla_setcaretcolor(handle:Byte Ptr, r:Int, g:Int, b:Int)
 	Function bmx_mgta_scintilla_startendfromchar(handle:Byte Ptr, pos:Int, length:Int, startPos:Int Var, endPos:Int Var)
-	Function bmx_mgta_scintilla_setcaretlinevisible(handle:Byte Ptr, enable:int)
+	Function bmx_mgta_scintilla_setcaretlinevisible(handle:Byte Ptr, enable:Int)
 	Function bmx_mgta_scintilla_getcaretlinevisible:Int(handle:Byte Ptr)
 	Function bmx_mgta_scintilla_setcaretlineback:Int(handle:Byte Ptr, r:Int, g:Int, b:Int)
 	Function bmx_mgta_scintilla_getcaretlineback:Int(handle:Byte Ptr)
@@ -105,7 +105,7 @@ Extern
 	Function bmx_mgta_scintilla_beginundoaction(handle:Byte Ptr)
 	Function bmx_mgta_scintilla_endundoaction(handle:Byte Ptr)
 
-	Function bmx_mgta_scintilla_setbracketmatchingcolor(handle:Byte Ptr, r:Int, g:Int, b:Int)
+	Function bmx_mgta_scintilla_setbracketmatchingcolor(handle:Byte Ptr, r:Int, g:Int, b:Int, flags:Int)
 	Function bmx_mgta_scintilla_matchbrackets(handle:Byte Ptr)
 
 End Extern

+ 18 - 1
maxguitextareascintilla.mod/glue.c

@@ -353,6 +353,7 @@ int bmx_mgta_scintilla_getcaretlinevisible(SCI_HANDLE sci) {
 
 void bmx_mgta_scintilla_setcaretlineback(SCI_HANDLE sci, int r, int g, int b) {
 	scintilla_send_message(sci, SCI_SETCARETLINEBACK, r | (g << 8) | (b << 16), 0);
+	scintilla_send_message(sci, SCI_SETCARETLINEBACKALPHA, 30, 0);
 }
 
 int bmx_mgta_scintilla_getcaretlineback(SCI_HANDLE sci) {
@@ -532,8 +533,24 @@ void bmx_mgta_scintilla_endundoaction(SCI_HANDLE sci) {
 	scintilla_send_message(sci, SCI_ENDUNDOACTION, 0, 0);
 }
 
-void bmx_mgta_scintilla_setbracketmatchingcolor(SCI_HANDLE sci, int r, int g, int b) {
+void bmx_mgta_scintilla_setbracketmatchingcolor(SCI_HANDLE sci, int r, int g, int b, int flags) {
 	scintilla_send_message(sci, SCI_STYLESETFORE, STYLE_BRACELIGHT, r | (g << 8) | (b << 16));
+
+	scintilla_send_message(sci, SCI_STYLESETBOLD, STYLE_BRACELIGHT, 0);
+	scintilla_send_message(sci, SCI_STYLESETITALIC, STYLE_BRACELIGHT, 0);
+	scintilla_send_message(sci, SCI_STYLESETUNDERLINE, STYLE_BRACELIGHT, 0);
+
+	if (flags & TEXTFORMAT_BOLD) {
+		scintilla_send_message(sci, SCI_STYLESETBOLD, STYLE_BRACELIGHT, 1);
+	}
+
+	if (flags & TEXTFORMAT_ITALIC) {
+		scintilla_send_message(sci, SCI_STYLESETITALIC, STYLE_BRACELIGHT, 1);
+	}
+
+	if (flags & TEXTFORMAT_UNDERLINE) {
+		scintilla_send_message(sci, SCI_STYLESETUNDERLINE, STYLE_BRACELIGHT, 1);
+	}
 }
 
 void bmx_mgta_scintilla_matchbrackets(SCI_HANDLE sci) {

+ 2 - 2
maxguitextareascintilla.mod/linuxgtk.bmx

@@ -529,8 +529,8 @@ Type TGTKScintillaTextArea Extends TGTKTextArea
 		Return True
 	End Method
 	
-	Method SetBracketMatchingColor(r:Int, g:Int, b:Int)
-		bmx_mgta_scintilla_setbracketmatchingcolor(sciPtr, r, g, b)
+	Method SetBracketMatchingColor(r:Int, g:Int, b:Int, flags:Int)
+		bmx_mgta_scintilla_setbracketmatchingcolor(sciPtr, r, g, b, flags)
 	End Method
 	
 	Method MatchBrackets()

+ 2 - 2
maxguitextareascintilla.mod/win32.bmx

@@ -514,8 +514,8 @@ Type TWindowsScintillaTextArea Extends TWindowsTextArea
 		Return True
 	End Method
 	
-	Method SetBracketMatchingColor(r:Int, g:Int, b:Int)
-		bmx_mgta_scintilla_setbracketmatchingcolor(_hwnd, r, g, b)
+	Method SetBracketMatchingColor(r:Int, g:Int, b:Int, flags:Int)
+		bmx_mgta_scintilla_setbracketmatchingcolor(_hwnd, r, g, b, flags)
 	End Method
 	
 	Method MatchBrackets()