Implements DebugLn and DbgOut for Windows CE, as well as fixes compiling with VerboseSizeMsg

git-svn-id: trunk@25355 -
This commit is contained in:
sekelsenmat 2010-05-13 11:14:22 +00:00
parent bc8b2d3e23
commit 7850abd2d3
4 changed files with 31 additions and 7 deletions

View File

@ -7847,7 +7847,7 @@ var
NewBounds: TRect;
OldClientRect: TRect;
NewClientRect: TRect;
{$IF defined(VerboseResizeFlicker)}
{$IF defined(VerboseResizeFlicker) or defined(VerboseSizeMsg)}
OldBounds: TRect;
{$ENDIF}
begin
@ -7863,7 +7863,7 @@ begin
exit;
end;
NewBounds:=Bounds(Left, Top, Width, Height);
{$IF defined(VerboseResizeFlicker)}
{$IF defined(VerboseResizeFlicker) or defined(VerboseSizeMsg)}
if HandleAllocated then begin
GetWindowRelativePosition(Handle,OldBounds.Left,OldBounds.Top);
GetWindowSize(Handle,OldBounds.Right,OldBounds.Bottom);

View File

@ -505,7 +505,7 @@ begin
if SizeConstraints.Control is TCustomComboBox then
begin
// wince combo (but not csSimple) has fixed height
FixedHeight := TCustomComboBox(SizeConstraints.Control).Style <> csSimple;
// FixedHeight := TCustomComboBox(SizeConstraints.Control).Style <> csSimple;
end;
{if SizeConstraints.Control is TCustomCalendar then

View File

@ -176,7 +176,8 @@ begin
FlagsEx := FlagsEx or WS_EX_CLIENTEDGE;
{$IFDEF VerboseSizeMsg}
writeln('PrepareCreateWindow ',AWinControl.Name,':',AWinControl.ClassName,' ',Left,',',Top,',',Width,',',Height);
Debugln('PrepareCreateWindow ',AWinControl.Name,':',AWinControl.ClassName,
' ',dbgs(Left),',',dbgs(Top),',',dbgs(Width),',',dbgs(Height));
{$ENDIF}
end;
end;
@ -395,9 +396,9 @@ begin
IntfWidth := AWidth; IntfHeight := AHeight;
LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
{$IFDEF VerboseSizeMsg}
writeln('TWinCEWSWinControl.ResizeWindow A ',AWinControl.Name,':',AWinControl.ClassName,
' LCL=',ALeft,',',ATop,',',AWidth,',',AHeight,
' Win32=',IntfLeft,',',IntfTop,',',IntfWidth,',',IntfHeight,
Debugln('TWinCEWSWinControl.ResizeWindow A ',AWinControl.Name,':',AWinControl.ClassName,
' LCL=',dbgs(ALeft),',',dbgs(ATop),',',dbgs(AWidth)+','+dbgs(AHeight),
' Win32=',dbgs(IntfLeft)+','+dbgs(IntfTop)+','+dbgs(IntfWidth),',',dbgs(IntfHeight),
'');
{$ENDIF}
suppressMove := false;

View File

@ -261,6 +261,7 @@ procedure DebuglnThreadLog(Args: array of const); overload;
procedure DebuglnThreadLog; overload;
procedure DbgSaveData(FileName: String; AData: PChar; ADataSize: PtrUInt);
procedure DbgAppendToFile(FileName, S: String);
procedure DbgAppendToFileWithoutLn(FileName, S: String);
procedure CloseDebugOutput;
@ -2133,8 +2134,12 @@ end;
procedure DebugLn(const s: string);
begin
{$ifdef WinCE}
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log', s);
{$else}
if not Assigned(DebugText) then exit;
writeln(DebugText^, ConvertLineEndings(s));
{$endif}
end;
procedure DebugLn(const s1, s2: string);
@ -2251,8 +2256,12 @@ end;
procedure DBGOut(const s: string);
begin
{$ifdef WinCE}
DbgAppendToFileWithoutLn(ExtractFilePath(ParamStr(0)) + '1.log', s);
{$else}
if Assigned(DebugText) then
write(DebugText^, s);
{$endif}
end;
procedure DBGOut(const s1, s2: string);
@ -2893,6 +2902,20 @@ begin
CloseFile(F);
end;
procedure DbgAppendToFileWithoutLn(FileName, S: String);
var
F: TextFile;
begin
AssignFile(F, FileName);
{$I-}
Append(F);
if IOResult <> 0 then
Rewrite(F);
{$I+}
Write(F, S);
CloseFile(F);
end;
function StripLN(const ALine: String): String;
var
idx: Integer;