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
ctx : TCocoaContext;
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);
Result:=Assigned(ctx);
if not Result then Exit;
@ -473,7 +477,7 @@ const
SName = 'TCarbonWidgetSet.SelectObject';
begin
{$IFDEF VerboseWinAPI}
DebugLn('TCocoaWidgetSet.SelectObject DC: ' + DbgS(DC) + ' GDIObj: ' + DbgS(GDIObj));
DebugLn(Format('TCocoaWidgetSet.SelectObject DC: %x GDIObj: %x', [ADC, GDIObj]));
{$ENDIF}
Result := 0;
@ -508,7 +512,7 @@ begin
if Assigned(gdi) then gdi.AddRef;
{$IFDEF VerboseWinAPI}
DebugLn('TCocoaWidgetSet.SelectObject Result: ' + DbgS(Result));
DebugLn(Format('TCocoaWidgetSet.SelectObject Result: %x', [Result]));
{$ENDIF}
end;

View File

@ -8,9 +8,9 @@ interface
uses
Types,
MacOSAll, CocoaAll,
Classes,
Controls,
WSControls, LCLType,
Classes, Controls, SysUtils,
//
WSControls, LCLType, LCLProc,
CocoaPrivate, CocoaGDIObjects, CocoaUtils, LCLMessageGlue;
type
@ -146,10 +146,17 @@ begin
if not Assigned(Context) then Context:=TCocoaContext.Create;
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);
struct.hdc := HDC(Context);
{$IFDEF VerboseWinAPI}
DebugLn(Format('[TLCLCommonCallback.Draw] OnPaint event started context: %x', [HDC(context)]));
{$ENDIF}
LCLSendPaintMsg(Target, HDC(Context), @struct);
{$IFDEF VerboseWinAPI}
DebugLn('[TLCLCommonCallback.Draw] OnPaint event ended');
{$ENDIF}
end;
end;