wince interface: several fixes from Christian Ulrich

* closing a application
* window styles
+ GetPixel and SetPixel

git-svn-id: trunk@10207 -
This commit is contained in:
vincents 2006-11-16 12:18:12 +00:00
parent 9757e008dd
commit d4dd6c0196
3 changed files with 43 additions and 20 deletions

View File

@ -135,13 +135,13 @@ End;
procedure TWinCEWidgetSet.DCSetPixel(CanvasHandle: HDC; X, Y: integer; procedure TWinCEWidgetSet.DCSetPixel(CanvasHandle: HDC; X, Y: integer;
AColor: TGraphicsColor); AColor: TGraphicsColor);
begin begin
Windows.SetPixel(CanvasHandle, X, Y, AColor);
end; end;
function TWinCEWidgetSet.DCGetPixel(CanvasHandle: HDC; X, Y: integer function TWinCEWidgetSet.DCGetPixel(CanvasHandle: HDC; X, Y: integer
): TGraphicsColor; ): TGraphicsColor;
begin begin
Result:=clNone; Result := Windows.GetPixel(CanvasHandle, X, Y);
end; end;
procedure TWinCEWidgetSet.DCRedraw(CanvasHandle: HDC); procedure TWinCEWidgetSet.DCRedraw(CanvasHandle: HDC);
@ -298,6 +298,7 @@ end;
procedure TWinCEWidgetSet.AppTerminate; procedure TWinCEWidgetSet.AppTerminate;
begin begin
AppTerminated := True; AppTerminated := True;
PostQuitMessage(0);
end; end;
function TWinCEWidgetSet.InitHintFont(HintFont: TObject): Boolean; function TWinCEWidgetSet.InitHintFont(HintFont: TObject): Boolean;

View File

@ -5,7 +5,8 @@ unit winceproc;
interface interface
uses uses
Windows, Classes, LMessages, LCLType, LCLProc, Controls, Forms, Menus,WinCEWinAPIEmu; Windows, Classes, LMessages, LCLType, LCLProc, Controls, Forms, Menus,
WinCEWinAPIEmu;
Type Type
TEventType = (etNotify, etKey, etKeyPress, etMouseWheel, etMouseUpDown); TEventType = (etNotify, etKey, etKeyPress, etMouseWheel, etMouseUpDown);
@ -283,27 +284,48 @@ end;
function BorderStyleToWin32Flags(Style: TFormBorderStyle): DWORD; function BorderStyleToWin32Flags(Style: TFormBorderStyle): DWORD;
begin begin
Result := WS_CLIPCHILDREN or WS_CLIPSIBLINGS; case Application.ApplicationType of
case Style of atDesktop,atHandheld:
bsSizeable, bsSizeToolWin: begin
Result := Result or (WS_OVERLAPPED or WS_THICKFRAME or WS_CAPTION); Result := WS_CLIPCHILDREN or WS_CLIPSIBLINGS;
bsSingle, bsToolWindow: case Style of
Result := Result or (WS_OVERLAPPED or WS_BORDER or WS_CAPTION); bsSizeable, bsSizeToolWin:
bsDialog: Result := Result or (WS_OVERLAPPED or WS_THICKFRAME or WS_CAPTION);
Result := Result or (WS_POPUP or WS_BORDER or WS_CAPTION); bsSingle, bsToolWindow:
bsNone: Result := Result or (WS_OVERLAPPED or WS_BORDER or WS_CAPTION);
Result := Result or WS_POPUP; bsDialog:
Result := Result or (WS_POPUP or WS_BORDER or WS_CAPTION);
bsNone:
Result := Result or WS_POPUP;
end;
end;
atPDA,atSmartphone,atDefault:
begin
Result := WS_VISIBLE;
end;
end; end;
end; end;
function BorderStyleToWin32FlagsEx(Style: TFormBorderStyle): DWORD; function BorderStyleToWin32FlagsEx(Style: TFormBorderStyle): DWORD;
begin begin
Result := 0; Result := 0;
case Style of case Application.ApplicationType of
bsDialog: atDesktop,atHandheld:
Result := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE; begin
bsToolWindow, bsSizeToolWin: case Style of
Result := WS_EX_TOOLWINDOW; bsDialog:
Result := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE;
bsToolWindow, bsSizeToolWin:
Result := WS_EX_TOOLWINDOW;
end;
end;
atPDA,atSmartphone,atDefault:
begin
case Style of
bsDialog:
Result := WS_EX_CAPTIONOKBTN;
end;
end;
end; end;
end; end;

View File

@ -206,9 +206,9 @@ begin
if GetDesigningBorderStyle(AForm) in [bsNone, bsSingle, bsSizeable] then if GetDesigningBorderStyle(AForm) in [bsNone, bsSingle, bsSizeable] then
begin begin
if biMinimize in BorderIcons then if biMinimize in BorderIcons then
Result := Result or WS_MINIMIZEBOX; Result := Result or WS_MINIMIZE;
if biMaximize in BorderIcons then if biMaximize in BorderIcons then
Result := Result or WS_MAXIMIZEBOX; Result := Result or WS_MAXIMIZE;
end; end;
end; end;