Browse Source

Fixed horizontal scrollbar sizing. Fixes #43.

Brucey 5 years ago
parent
commit
febe68f7a8

+ 2 - 1
maxguitextareascintilla.mod/common.bmx

@@ -1,4 +1,4 @@
-' Copyright (c) 2014-2018 Bruce A Henderson
+' Copyright (c) 2014-2020 Bruce A Henderson
 ' 
 ' Permission is hereby granted, free of charge, to any person obtaining a copy
 ' of this software and associated documentation files (the "Software"), to deal
@@ -108,6 +108,7 @@ Extern
 	Function bmx_mgta_scintilla_setbracketmatchingcolor(handle:Byte Ptr, r:Int, g:Int, b:Int, flags:Int)
 	Function bmx_mgta_scintilla_matchbrackets(handle:Byte Ptr)
 
+	Function bmx_mgta_scintilla_resetscrollwidth(handle:Byte Ptr)
 End Extern
 
 Type TSCNotification

+ 5 - 1
maxguitextareascintilla.mod/glue.c

@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2014-2019 Bruce A Henderson
+ Copyright (c) 2014-2020 Bruce A Henderson
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
@@ -562,3 +562,7 @@ void bmx_mgta_scintilla_matchbrackets(SCI_HANDLE sci) {
 		scintilla_send_message(sci, SCI_BRACEBADLIGHT, -1, 0);
 	}
 }
+
+void bmx_mgta_scintilla_resetscrollwidth(SCI_HANDLE sci) {
+	scintilla_send_message(sci, SCI_SETSCROLLWIDTH, 1 , 0);
+}

+ 3 - 1
maxguitextareascintilla.mod/linux_glue.c

@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2014-2019 Bruce A Henderson
+ Copyright (c) 2014-2020 Bruce A Henderson
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
@@ -34,6 +34,8 @@ ScintillaObject * bmx_mgta_scintilla_getsci(void * editor, int id) {
 
 	scintilla_send_message(obj, SCI_SETCODEPAGE, SC_CP_UTF8, 0);
 	scintilla_send_message(obj, SCI_ALLOCATELINECHARACTERINDEX, SC_LINECHARACTERINDEX_UTF16 , 0);
+	scintilla_send_message(obj, SCI_SETSCROLLWIDTH, 1 , 0);
+	scintilla_send_message(obj, SCI_SETSCROLLWIDTHTRACKING, 1 , 0);
 
 	return obj;
 }

+ 6 - 2
maxguitextareascintilla.mod/linuxgtk.bmx

@@ -1,4 +1,4 @@
-' Copyright (c) 2014-2018 Bruce A Henderson
+' Copyright (c) 2014-2020 Bruce A Henderson
 ' 
 ' Permission is hereby granted, free of charge, to any person obtaining a copy
 ' of this software and associated documentation files (the "Software"), to deal
@@ -409,7 +409,11 @@ Type TGTKScintillaTextArea Extends TGTKTextArea
 						PostGuiEvent(EVENT_GADGETACTION, TGadget(obj))
 					End If
 					ta.ignoreChange = False
-					
+
+					If notification.modificationType & SC_MOD_DELETETEXT Then
+						bmx_mgta_scintilla_resetscrollwidth(ta.sciPtr)
+					End If
+
 					bmx_mgta_scintilla_setlinedigits(ta.sciPtr, Varptr ta.lineDigits, ta.showLineNumbers)
 				End If
 		End Select

+ 1 - 1
maxguitextareascintilla.mod/macos_glue.mm

@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2014-2019 Bruce A Henderson
+ Copyright (c) 2014-2020 Bruce A Henderson
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
maxguitextareascintilla.mod/maxguitextareascintilla.bmx

@@ -1,4 +1,4 @@
-' Copyright (c) 2014-2019 Bruce A Henderson
+' Copyright (c) 2014-2020 Bruce A Henderson
 ' 
 ' Permission is hereby granted, free of charge, to any person obtaining a copy
 ' of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
maxguitextareascintilla.mod/source.bmx

@@ -1,4 +1,4 @@
-' Copyright (c) 2014-2019 Bruce A Henderson
+' Copyright (c) 2014-2020 Bruce A Henderson
 ' 
 ' Permission is hereby granted, free of charge, to any person obtaining a copy
 ' of this software and associated documentation files (the "Software"), to deal

+ 5 - 1
maxguitextareascintilla.mod/win32.bmx

@@ -1,4 +1,4 @@
-' Copyright (c) 2014-2019 Bruce A Henderson
+' Copyright (c) 2014-2020 Bruce A Henderson
 ' 
 ' Permission is hereby granted, free of charge, to any person obtaining a copy
 ' of this software and associated documentation files (the "Software"), to deal
@@ -118,6 +118,10 @@ Type TWindowsScintillaTextArea Extends TWindowsTextArea
 					End If
 					ignoreChange = False
 					
+					If notification.modificationType & SC_MOD_DELETETEXT Then
+						bmx_mgta_scintilla_resetscrollwidth(_hwnd)
+					End If
+					
 					bmx_mgta_scintilla_setlinedigits(_hwnd, Varptr lineDigits, showLineNumbers)
 				End If
 		End Select

+ 3 - 1
maxguitextareascintilla.mod/win32_glue.c

@@ -1,5 +1,5 @@
 /*
- Copyright (c) 2014-2019 Bruce A Henderson
+ Copyright (c) 2014-2020 Bruce A Henderson
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
@@ -43,6 +43,8 @@ HWND bmx_mgta_scintilla_getsci(HWND parent) {
 	scintilla_send_message(obj, SCI_SETMODEVENTMASK , SC_MODEVENTMASKALL, 0);
 	scintilla_send_message(obj, SCI_SETEOLMODE, SC_EOL_LF, 0); // the default of CRLF results in double LFs for some reason, which breaks (at least) maxide
 	scintilla_send_message(obj, SCI_ALLOCATELINECHARACTERINDEX, SC_LINECHARACTERINDEX_UTF16 , 0);
+	scintilla_send_message(obj, SCI_SETSCROLLWIDTH, 1 , 0);
+	scintilla_send_message(obj, SCI_SETSCROLLWIDTHTRACKING, 1 , 0);
 
 	return obj;
 }