-
-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
…ls to Scintilla.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ TScintEdit = class(TWinControl) | |
FAutoCompleteFontSize: Integer; | ||
FCodePage: Integer; | ||
FDirectPtr: Pointer; | ||
FDirectStatusFunction: SciFnDirectStatus; | ||
FEffectiveCodePage: Integer; | ||
FEffectiveCodePageDBCS: Boolean; | ||
FFillSelectionToEdge: Boolean; | ||
|
@@ -532,19 +533,20 @@ procedure TScintEdit.BeginUndoAction; | |
end; | ||
|
||
function TScintEdit.Call(Msg: Cardinal; WParam: Longint; LParam: Longint): Longint; | ||
var | ||
ErrorStatus: LRESULT; | ||
|
||
begin | ||
HandleNeeded; | ||
if FDirectPtr = nil then | ||
Error('Call: FDirectPtr is nil'); | ||
Result := Scintilla_DirectFunction(FDirectPtr, Msg, WParam, LParam); | ||
if not Assigned(FDirectStatusFunction) then | ||
Error('Call: FDirectStatusFunction is nil'); | ||
var ErrorStatus: Integer; | ||
Result := FDirectStatusFunction(FDirectPtr, Msg, WParam, LParam, ErrorStatus); | ||
|
||
ErrorStatus := Scintilla_DirectFunction(FDirectPtr, SCI_GETSTATUS, 0, 0); | ||
if ErrorStatus <> 0 then begin | ||
Scintilla_DirectFunction(FDirectPtr, SCI_SETSTATUS, 0, 0); | ||
ErrorFmt('Error status %d returned after Call(%u, %d, %d) = %d', | ||
[ErrorStatus, Msg, WParam, LParam, Result]); | ||
FDirectStatusFunction(FDirectPtr, SCI_SETSTATUS, 0, 0, ErrorStatus); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
martijnlaan
Author
Member
|
||
end; | ||
end; | ||
|
||
|
@@ -679,10 +681,15 @@ procedure TScintEdit.CreateParams(var Params: TCreateParams); | |
|
||
procedure TScintEdit.CreateWnd; | ||
begin | ||
if IsscintLibary = 0 then | ||
Error('CreateWnd: IsscintLibary is 0'); | ||
inherited; | ||
FDirectPtr := Pointer(SendMessage(Handle, SCI_GETDIRECTPOINTER, 0, 0)); | ||
if FDirectPtr = nil then | ||
Error('CreateWnd: FDirectPtr is nil'); | ||
FDirectStatusFunction := SciFnDirectStatus(SendMessage(Handle, SCI_GETDIRECTSTATUSFUNCTION, WPARAM(FDirectPtr), 0)); | ||
if not Assigned(FDirectStatusFunction) then | ||
Error('CreateWnd: FDirectStatusFunction is nil'); | ||
This comment has been minimized.
Sorry, something went wrong.
jordanrussell
Member
|
||
UpdateCodePage; | ||
Call(SCI_SETCOMMANDEVENTS, 0, 0); | ||
Call(SCI_SETMODEVENTMASK, SC_MOD_INSERTTEXT or SC_MOD_DELETETEXT, 0); | ||
|
@@ -1967,6 +1974,7 @@ procedure TScintEdit.CNNotify(var Message: TWMNotify); | |
procedure TScintEdit.WMDestroy(var Message: TWMDestroy); | ||
begin | ||
FDirectPtr := nil; | ||
FDirectStatusFunction := nil; | ||
inherited; | ||
end; | ||
|
||
|
ErrorFmt
raises an exception, so that ordering won't work. If you were to go back to usingScintilla_DirectFunction
forSCI_SETSTATUS
then you wouldn't have to load the DLL manually?(And why isn't there a
Scintilla_DirectStatusFunction
export??)