From d4dd6c019685a1ff84da4eea8e7ea575340e9bc9 Mon Sep 17 00:00:00 2001 From: vincents Date: Thu, 16 Nov 2006 12:18:12 +0000 Subject: [PATCH] wince interface: several fixes from Christian Ulrich * closing a application * window styles + GetPixel and SetPixel git-svn-id: trunk@10207 - --- lcl/interfaces/wince/winceobject.inc | 5 +-- lcl/interfaces/wince/winceproc.pp | 54 +++++++++++++++++++--------- lcl/interfaces/wince/wincewsforms.pp | 4 +-- 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/lcl/interfaces/wince/winceobject.inc b/lcl/interfaces/wince/winceobject.inc index d91999fa3c..ae8917a7dc 100644 --- a/lcl/interfaces/wince/winceobject.inc +++ b/lcl/interfaces/wince/winceobject.inc @@ -135,13 +135,13 @@ End; 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); @@ -298,6 +298,7 @@ end; procedure TWinCEWidgetSet.AppTerminate; begin AppTerminated := True; + PostQuitMessage(0); end; function TWinCEWidgetSet.InitHintFont(HintFont: TObject): Boolean; diff --git a/lcl/interfaces/wince/winceproc.pp b/lcl/interfaces/wince/winceproc.pp index 24f4c11406..242c598f0e 100644 --- a/lcl/interfaces/wince/winceproc.pp +++ b/lcl/interfaces/wince/winceproc.pp @@ -5,7 +5,8 @@ unit winceproc; interface uses - Windows, Classes, LMessages, LCLType, LCLProc, Controls, Forms, Menus,WinCEWinAPIEmu; + Windows, Classes, LMessages, LCLType, LCLProc, Controls, Forms, Menus, + WinCEWinAPIEmu; Type TEventType = (etNotify, etKey, etKeyPress, etMouseWheel, etMouseUpDown); @@ -283,27 +284,48 @@ end; 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; + case Application.ApplicationType of + atDesktop,atHandheld: + 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; + end; + atPDA,atSmartphone,atDefault: + begin + Result := WS_VISIBLE; + end; end; end; function BorderStyleToWin32FlagsEx(Style: TFormBorderStyle): DWORD; begin Result := 0; - case Style of - bsDialog: - Result := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE; - bsToolWindow, bsSizeToolWin: - Result := WS_EX_TOOLWINDOW; + case Application.ApplicationType of + atDesktop,atHandheld: + begin + case Style of + 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; diff --git a/lcl/interfaces/wince/wincewsforms.pp b/lcl/interfaces/wince/wincewsforms.pp index 36dfc3849b..0e6b556ffd 100644 --- a/lcl/interfaces/wince/wincewsforms.pp +++ b/lcl/interfaces/wince/wincewsforms.pp @@ -206,9 +206,9 @@ begin 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;