Fixes compilation of the wince interface under win32 operating system.

git-svn-id: trunk@18985 -
This commit is contained in:
sekelsenmat 2009-03-14 00:10:37 +00:00
parent 41ff1a63f0
commit 3393bef1b3
3 changed files with 25 additions and 8 deletions

View File

@ -979,13 +979,7 @@ begin
Dec(ORect.Right, ARect.Right); Dec(ORect.Right, ARect.Right);
Dec(ORect.Bottom, ARect.Bottom); Dec(ORect.Bottom, ARect.Bottom);
end; end;
{
if (GetWindowLong(Handle, GWL_EXSTYLE) and WS_EX_CLIENTEDGE) <> 0 then
begin
Dec(LeftOffset, Windows.GetSystemMetrics(SM_CXEDGE));
Dec(TopOffset, Windows.GetSystemMetrics(SM_CYEDGE));
end;
}
Result := True; Result := True;
end; end;
@ -1159,7 +1153,11 @@ begin
New(WindowInfo); New(WindowInfo);
FillChar(WindowInfo^, sizeof(WindowInfo^), 0); FillChar(WindowInfo^, sizeof(WindowInfo^), 0);
WindowInfo^.DrawItemIndex := -1; WindowInfo^.DrawItemIndex := -1;
{$ifdef win32}
Windows.SetPropW(Window, PWideChar(DWord(WindowInfoAtom)), DWord(WindowInfo));
{$else}
Windows.SetProp(Window, PWideChar(DWord(WindowInfoAtom)), DWord(WindowInfo)); Windows.SetProp(Window, PWideChar(DWord(WindowInfoAtom)), DWord(WindowInfo));
{$endif}
Result := WindowInfo; Result := WindowInfo;
end; end;
@ -1167,15 +1165,24 @@ function DisposeWindowInfo(Window: HWND): boolean;
var var
WindowInfo: PWindowInfo; WindowInfo: PWindowInfo;
begin begin
{$ifdef win32}
WindowInfo := PWindowInfo(Windows.GetPropW(Window, PWideChar(DWord(WindowInfoAtom))));
Result := Windows.RemovePropW(Window, PWideChar(DWord(WindowInfoAtom)))<>0;
{$else}
WindowInfo := PWindowInfo(Windows.GetProp(Window, PWideChar(DWord(WindowInfoAtom)))); WindowInfo := PWindowInfo(Windows.GetProp(Window, PWideChar(DWord(WindowInfoAtom))));
Result := Windows.RemoveProp(Window, PWideChar(DWord(WindowInfoAtom)))<>0; Result := Windows.RemoveProp(Window, PWideChar(DWord(WindowInfoAtom)))<>0;
{$endif}
if Result then if Result then
Dispose(WindowInfo); Dispose(WindowInfo);
end; end;
function GetWindowInfo(Window: HWND): PWindowInfo; function GetWindowInfo(Window: HWND): PWindowInfo;
begin begin
{$ifdef win32}
Result := PWindowInfo(Windows.GetPropW(Window, PWideChar(DWord(WindowInfoAtom))));
{$else}
Result := PWindowInfo(Windows.GetProp(Window, PWideChar(DWord(WindowInfoAtom)))); Result := PWindowInfo(Windows.GetProp(Window, PWideChar(DWord(WindowInfoAtom))));
{$endif}
if Result = nil then if Result = nil then
Result := @DefaultWindowInfo; Result := @DefaultWindowInfo;
end; end;

View File

@ -62,7 +62,11 @@ var
begin begin
init.dwSize := Sizeof(TINITCOMMONCONTROLSEX); init.dwSize := Sizeof(TINITCOMMONCONTROLSEX);
init.dwICC := ICC_DATE_CLASSES; init.dwICC := ICC_DATE_CLASSES;
{$ifdef win32}
InitCommonControlsEx(init);
{$else}
InitCommonControlsEx(@init); InitCommonControlsEx(@init);
{$endif}
// general initialization of Params // general initialization of Params
PrepareCreateWindow(AWinControl, Params); PrepareCreateWindow(AWinControl, Params);
// customization of Params // customization of Params

View File

@ -193,7 +193,8 @@ begin
end; end;
end; end;
procedure CalcFormWindowFlags(const AForm: TCustomForm; var Flags, FlagsEx: dword); procedure CalcFormWindowFlags(const AForm: TCustomForm;
var Flags, FlagsEx: dword);
var var
BorderStyle: TFormBorderStyle; BorderStyle: TFormBorderStyle;
begin begin
@ -207,6 +208,11 @@ begin
Flags := Flags or CalcBorderIconsFlags(AForm); Flags := Flags or CalcBorderIconsFlags(AForm);
end; end;
{
This routine fills SizeRect with
the necessary window size to have it's
BoundsRect.
}
procedure AdjustFormBounds(const AForm: TCustomForm; var SizeRect: TRect); procedure AdjustFormBounds(const AForm: TCustomForm; var SizeRect: TRect);
begin begin
// the LCL defines the size of a form without border, win32 with. // the LCL defines the size of a form without border, win32 with.