This patch fixes Window Styles for Wince (always maximized windows as
they are in wince with close or ok buttons in the taskbar).
A little bit dirty Hack for fixing the Close Bug and Get and SetPixel
for the Canvases.
VirtualTreeview runs fine on Windows Mobile 5.0 with this changes :)
regards
Christian
Index: winceobject.inc
===================================================================
--- winceobject.inc (revision 10177)
+++ winceobject.inc (working copy)
@@ -135,13 +135,13 @@
procedure TWinCEWidgetSet.DCSetPixel(CanvasHandle: HDC; X, Y: integer;
AColor: TGraphicsColor);
begin
-
+ Windows.SetPixel(CanvasHandle, X, Y, AColor);
end;
function TWinCEWidgetSet.DCGetPixel(CanvasHandle: HDC; X, Y: integer
): TGraphicsColor;
begin
- Result:=clNone;
+ Result := Windows.GetPixel(CanvasHandle, X, Y);
end;
procedure TWinCEWidgetSet.DCRedraw(CanvasHandle: HDC);
@@ -297,6 +297,7 @@
procedure TWinCEWidgetSet.AppTerminate;
begin
+ PostQuitMessage(0);
AppTerminated := True;
end;
Index: winceproc.pp
===================================================================
--- winceproc.pp (revision 10177)
+++ winceproc.pp (working copy)
@@ -283,17 +283,7 @@
function BorderStyleToWin32Flags(Style: TFormBorderStyle): DWORD;
begin
- Result := WS_CLIPCHILDREN or WS_CLIPSIBLINGS;
- case Style of
- bsSizeable, bsSizeToolWin:
- Result := Result or (WS_OVERLAPPED or WS_THICKFRAME or WS_CAPTION);
- bsSingle, bsToolWindow:
- Result := Result or (WS_OVERLAPPED or WS_BORDER or WS_CAPTION);
- bsDialog:
- Result := Result or (WS_POPUP or WS_BORDER or WS_CAPTION);
- bsNone:
- Result := Result or WS_POPUP;
- end;
+ Result := WS_VISIBLE;
end;
function BorderStyleToWin32FlagsEx(Style: TFormBorderStyle): DWORD;
@@ -301,9 +291,7 @@
Result := 0;
case Style of
bsDialog:
- Result := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE;
- bsToolWindow, bsSizeToolWin:
- Result := WS_EX_TOOLWINDOW;
+ Result := WS_EX_CAPTIONOKBTN;
end;
end;
Index: wincewsforms.pp
===================================================================
--- wincewsforms.pp (revision 10177)
+++ wincewsforms.pp (working copy)
@@ -206,9 +206,9 @@
if GetDesigningBorderStyle(AForm) in [bsNone, bsSingle, bsSizeable] then
begin
if biMinimize in BorderIcons then
- Result := Result or WS_MINIMIZEBOX;
+ Result := Result or WS_MINIMIZE;
if biMaximize in BorderIcons then
- Result := Result or WS_MAXIMIZEBOX;
+ Result := Result or WS_MAXIMIZE;
end;
end;