Improves wince debug info and fixes maximized window showing under wince

git-svn-id: trunk@25484 -
This commit is contained in:
sekelsenmat 2010-05-17 20:18:08 +00:00
parent ba561e84f3
commit 4c7e033ef2
3 changed files with 41 additions and 7 deletions

View File

@ -564,7 +564,8 @@ begin
Windows.SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW or SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_NOOWNERZORDER);
end else begin
Flags := SW_SHOW;
if TControl(Sender) is TCustomForm then
if (TControl(Sender) is TCustomForm) and
(Application.ApplicationType = atDesktop) then
case TCustomForm(Sender).WindowState of
wsMaximized: Flags := SW_SHOWMAXIMIZED;
wsMinimized: Flags := SW_SHOWMINIMIZED;

View File

@ -2061,6 +2061,9 @@ var
R: TRect;
WindowInfo: PWindowInfo;
Style, ExStyle: longint;
{$IFDEF VerboseSizeMsg}
lName: string;
{$ENDIF}
// This is for TCustomFloatSpinEdit
// and the Buddy is the Edit component
@ -2155,9 +2158,12 @@ begin
end;
{$IFDEF VerboseSizeMsg}
if (WindowInfo <> nil) and (WindowInfo^.WinControl <> nil) then
lName := WindowInfo^.WinControl.Name
else lName := 'NIL';
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
Format('[TWinCEWidgetSet.GetWindowSize]: %d:%d',
[Width, Height]));
Format('[TWinCEWidgetSet.GetWindowSize]: Name:%s %d:%d',
[lName, Width, Height]));
{$ENDIF}
end;
@ -3034,6 +3040,9 @@ var
Style, ExStyle: Integer;
OldRect, OldClientRect: Windows.RECT;
WindowInfo: PWindowInfo;
{$IFDEF VerboseSizeMsg}
lName: string;
{$ENDIF}
begin
//debugln('[TWinCEWidgetSet.SetWindowPos] Top=',HWndInsertAfter=HWND_TOP);
Style := Windows.GetWindowLong(HWnd, GWL_STYLE);
@ -3059,6 +3068,15 @@ begin
end;
Result := Boolean(Windows.SetWindowPos(HWnd, HWndInsertAfter, X, Y, CX, CY, UFlags));
{$IFDEF VerboseSizeMsg}
if Assigned(WindowInfo) and (WindowInfo^.AWinControl <> nil) then
lName := WindowInfo^.AWinControl.Name
else lName := 'NIL';
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
Format('[TWinCEWidgetSet.SetWindowPos]: Name:%s HWnd:%d Pos x:%d y:%d w:%d h:%d',
[lName, HWnd, X, Y, CX, CY]));
{$ENDIF}
end;
{------------------------------------------------------------------------------

View File

@ -28,7 +28,7 @@ interface
uses
// RTL, FCL, LCL
Windows,
Windows, LCLProc,
SysUtils, Controls, LCLType, Forms, InterfaceBase,
// Widgetset
winceproc, wincewscontrols,
@ -344,13 +344,19 @@ begin
CalculateDialogPosition(Params, Bounds, lForm);
end;
end;
// Update the position of the window for the LCL
AWinControl.Left := Params.Left;
AWinControl.Top := Params.Top;
AWinControl.Width := Params.Width;
AWinControl.Height := Params.Height;
// create window
FinishCreateWindow(AWinControl, Params, false);
Result := Params.Window;
{$ifdef VerboseWinCE}
WriteLn('Window Handle = ' + IntToStr(Result));
{$if defined(VerboseWinCE) or defined(VerboseSizeMsg)}
DebugLn('Window Handle = ' + IntToStr(Result));
{$endif}
end;
@ -412,6 +418,15 @@ begin
// rect adjusted, pass to inherited to do real work
TWinCEWSWinControl.SetBounds(AWinControl, SizeRect.Left, SizeRect.Top,
SizeRect.Right - SizeRect.Left, SizeRect.Bottom - SizeRect.Top);
{$IFDEF VerboseSizeMsg}
DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
Format('[TWinCEWSCustomForm.SetBounds]: Name:%s Request x:%d y:%d w:%d h:%d'
+ ' SizeRect x:%d y:%d w:%d h:%d',
[AWinControl.Name, ALeft, ATop, AWidth, AHeight,
SizeRect.Left, SizeRect.Top,
SizeRect.Right - SizeRect.Left, SizeRect.Bottom - SizeRect.Top]));
{$ENDIF}
end;
class procedure TWinCEWSCustomForm.SetIcon(const AForm: TCustomForm; const Small, Big: HICON);