cocoa: Improves the debug information

git-svn-id: trunk@30312 -
This commit is contained in:
sekelsenmat 2011-04-16 11:32:59 +00:00
parent 7433cc4a85
commit 2e674fc5f5
2 changed files with 17 additions and 6 deletions

View File

@ -274,6 +274,10 @@ function TCocoaWidgetSet.Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): Boolean;
var var
ctx : TCocoaContext; ctx : TCocoaContext;
begin begin
{$IFDEF VerboseWinAPI}
DebugLn('[TCocoaWidgetSet.Rectangle] DC: %x X1: %d Y1: %d X2: %d Y2: %d',
[DC, X1, Y1, X2, Y2]);
{$ENDIF}
ctx:=CheckDC(DC); ctx:=CheckDC(DC);
Result:=Assigned(ctx); Result:=Assigned(ctx);
if not Result then Exit; if not Result then Exit;
@ -473,7 +477,7 @@ const
SName = 'TCarbonWidgetSet.SelectObject'; SName = 'TCarbonWidgetSet.SelectObject';
begin begin
{$IFDEF VerboseWinAPI} {$IFDEF VerboseWinAPI}
DebugLn('TCocoaWidgetSet.SelectObject DC: ' + DbgS(DC) + ' GDIObj: ' + DbgS(GDIObj)); DebugLn(Format('TCocoaWidgetSet.SelectObject DC: %x GDIObj: %x', [ADC, GDIObj]));
{$ENDIF} {$ENDIF}
Result := 0; Result := 0;
@ -508,7 +512,7 @@ begin
if Assigned(gdi) then gdi.AddRef; if Assigned(gdi) then gdi.AddRef;
{$IFDEF VerboseWinAPI} {$IFDEF VerboseWinAPI}
DebugLn('TCocoaWidgetSet.SelectObject Result: ' + DbgS(Result)); DebugLn(Format('TCocoaWidgetSet.SelectObject Result: %x', [Result]));
{$ENDIF} {$ENDIF}
end; end;

View File

@ -8,9 +8,9 @@ interface
uses uses
Types, Types,
MacOSAll, CocoaAll, MacOSAll, CocoaAll,
Classes, Classes, Controls, SysUtils,
Controls, //
WSControls, LCLType, WSControls, LCLType, LCLProc,
CocoaPrivate, CocoaGDIObjects, CocoaUtils, LCLMessageGlue; CocoaPrivate, CocoaGDIObjects, CocoaUtils, LCLMessageGlue;
type type
@ -146,10 +146,17 @@ begin
if not Assigned(Context) then Context:=TCocoaContext.Create; if not Assigned(Context) then Context:=TCocoaContext.Create;
Context.ctx:=ControlContext; Context.ctx:=ControlContext;
if Context.InitDraw(Round(bounds.size.width), Round(bounds.size.height)) then begin if Context.InitDraw(Round(bounds.size.width), Round(bounds.size.height)) then
begin
FillChar(struct, SizeOf(TPaintStruct), 0); FillChar(struct, SizeOf(TPaintStruct), 0);
struct.hdc := HDC(Context); struct.hdc := HDC(Context);
{$IFDEF VerboseWinAPI}
DebugLn(Format('[TLCLCommonCallback.Draw] OnPaint event started context: %x', [HDC(context)]));
{$ENDIF}
LCLSendPaintMsg(Target, HDC(Context), @struct); LCLSendPaintMsg(Target, HDC(Context), @struct);
{$IFDEF VerboseWinAPI}
DebugLn('[TLCLCommonCallback.Draw] OnPaint event ended');
{$ENDIF}
end; end;
end; end;