bmx-ng/maxgui.mod

[MaxGUITextAreaScintilla.mod] TSCNotification misses fields

GWRon opened this issue · 2 comments

GWRon commented

A Scintilla SCNotification has a multitude of properties.

It is filled there:

	Function OnSciNotify(widget:Byte Ptr, id:Int, notificationPtr:Byte Ptr, obj:Object)
		Local ta:TGTKScintillaTextArea = TGTKScintillaTextArea(obj)
'FILLED HERE
		bmx_mgta_scintilla_notifcation_update(ta.notification, notificationPtr)

		Select ta.notification.code
			Case SCN_UPDATEUI
				If ta.notification.updated & SC_UPDATE_SELECTION Then
					PostGuiEvent(EVENT_GADGETSELECT, TGadget(obj))
				End If
			Case SCN_MODIFIED
				If ta.notification.modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT) Then
					If Not ta.ignoreChange Then
						PostGuiEvent(EVENT_GADGETSELECT, TGadget(obj))
						PostGuiEvent(EVENT_GADGETACTION, TGadget(obj))
					End If
					ta.ignoreChange = False
					
					bmx_mgta_scintilla_setlinedigits(ta.sciPtr, Varptr ta.lineDigits, ta.showLineNumbers)
				End If
		End Select

	End Function

Which in the end calls this inbetween:

void bmx_mgta_scintilla_notifcation_update(BBObject * obj, struct SCNotification * notification) {
#ifdef BMX_NG
	maxgui_maxguitextareascintilla_common_TSCNotification__update(obj, notification->nmhdr.code, notification->modificationType, notification->updated);
#else
	_maxgui_maxguitextareascintilla_TSCNotification__update(obj, notification->nmhdr.code, notification->modificationType, notification->updated);
#endif
}

As you see it only passes 3 params: the code, the modificationtype and "updated".
With the new features of NG - could we just pass the whole struct or so?

For "legacy" one could append the desired other properties (eg. "text" - so you can check what was dropped to for example add URIs to the source code you currently are editing).

The struct is too complex really. If you tell me specifically which bits you need access to...

GWRon commented