mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 08:20:21 +02:00
cocoa: debugging routines
git-svn-id: trunk@61301 -
This commit is contained in:
parent
d884d16510
commit
949c132c96
@ -157,6 +157,9 @@ function CocoaModifiersToKeyState(AModifiers: NSUInteger): PtrInt;
|
|||||||
function CocoaPressedMouseButtonsToKeyState(AMouseButtons: NSUInteger): PtrInt;
|
function CocoaPressedMouseButtonsToKeyState(AMouseButtons: NSUInteger): PtrInt;
|
||||||
function CocoaModifiersToShiftState(AModifiers: NSUInteger; AMouseButtons: NSUInteger): TShiftState;
|
function CocoaModifiersToShiftState(AModifiers: NSUInteger; AMouseButtons: NSUInteger): TShiftState;
|
||||||
|
|
||||||
|
function NSObjectDebugStr(obj: NSObject): string;
|
||||||
|
function CallbackDebugStr(cb: ICommonCallback): string;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -1734,5 +1737,30 @@ begin
|
|||||||
Result := cb.GetTarget;
|
Result := cb.GetTarget;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function NSObjectDebugStr(obj: NSObject): string;
|
||||||
|
begin
|
||||||
|
Result := IntToStr(PtrUInt(obj));
|
||||||
|
if Assigned(obj) then
|
||||||
|
Result := Result +' '+obj.lclClassName+' lcl: '+CallbackDebugStr(obj.lclGetCallback);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CallbackDebugStr(cb: ICommonCallback): string;
|
||||||
|
var
|
||||||
|
trg : TObject;
|
||||||
|
begin
|
||||||
|
Result := IntToStr(PtrUInt(cb));
|
||||||
|
if Assigned(cb) then
|
||||||
|
begin
|
||||||
|
trg := cb.GetTarget;
|
||||||
|
Result := Result + ' trg: '+IntToStr(PtrUInt(trg));
|
||||||
|
if Assigned(trg) then
|
||||||
|
begin
|
||||||
|
Result := Result + ' '+trg.ClassName;
|
||||||
|
if trg is TWinControl then
|
||||||
|
Result := Result +' '+TWinControl(trg).Name;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user