wince: fixes dialog sizing

git-svn-id: trunk@21262 -
This commit is contained in:
sekelsenmat 2009-08-17 15:53:27 +00:00
parent 4ea1f0a28b
commit 22afcb3769
2 changed files with 29 additions and 14 deletions

View File

@ -1313,7 +1313,7 @@ end;
function GetWinCEPlatform: TApplicationType; function GetWinCEPlatform: TApplicationType;
{$ifdef Win32} {$ifdef Win32}
begin begin
Result := atDesktop; Result := atPDA; // just for testing, should actually be atDesktop
end; end;
{$else} {$else}
var var

View File

@ -1724,19 +1724,34 @@ begin
// convert top level lcl window coordinaties to win32 coord // convert top level lcl window coordinaties to win32 coord
Style := Windows.GetWindowLongW(Handle, GWL_STYLE); Style := Windows.GetWindowLongW(Handle, GWL_STYLE);
ExStyle := Windows.GetWindowLongW(Handle, GWL_EXSTYLE); ExStyle := Windows.GetWindowLongW(Handle, GWL_EXSTYLE);
if (Style and WS_THICKFRAME) <> 0 then
begin // The borders are not given by the same constants in Win32 and WinCE
// thick, sizing border // Bug http://bugs.freepascal.org/view.php?id=11456
// add twice, top+bottom border //
Dec(Width, 2*Windows.GetSystemMetrics(SM_CXSIZEFRAME)); // SM_CXSIZEFRAME returns 3 in my tests, but the real border
Dec(Height, 2*Windows.GetSystemMetrics(SM_CYSIZEFRAME)); // is only 1 pixel wide, like SM_CXBORDER
end else {$IFDEF WinCE}
if (Style and WS_BORDER) <> 0 then if (Style and WS_BORDER) <> 0 then
begin begin
// thin, non-sizing border // thin, non-sizing border
Dec(Width, 2*Windows.GetSystemMetrics(SM_CXFIXEDFRAME)); Dec(Width, 2*Windows.GetSystemMetrics(SM_CXBORDER));
Dec(Height, 2*Windows.GetSystemMetrics(SM_CYFIXEDFRAME)); Dec(Height, 2*Windows.GetSystemMetrics(SM_CYBORDER));
end; end;
{$ELSE}
if (Style and WS_THICKFRAME) <> 0 then
begin
// thick, sizing border
// add twice, top+bottom border
Dec(Width, 2*Windows.GetSystemMetrics(SM_CXSIZEFRAME));
Dec(Height, 2*Windows.GetSystemMetrics(SM_CYSIZEFRAME));
end else
if (Style and WS_BORDER) <> 0 then
begin
// thin, non-sizing border
Dec(Width, 2*Windows.GetSystemMetrics(SM_CXFIXEDFRAME));
Dec(Height, 2*Windows.GetSystemMetrics(SM_CYFIXEDFRAME));
end;
{$ENDIF}
// ExcludeCaption // ExcludeCaption
if (Style and WS_CAPTION) <> 0 then if (Style and WS_CAPTION) <> 0 then