From 5854a0f095ef9a5dee35b4bdb4fbd2dbc023fa12 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Wed, 5 May 2010 07:49:44 +0000 Subject: [PATCH] Implements RemoveProp in wince git-svn-id: trunk@25203 - --- lcl/alllclunits.pp | 2 +- lcl/interfaces/wince/wincewinapi.inc | 31 ++++++++++++++++----------- lcl/interfaces/wince/wincewinapih.inc | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lcl/alllclunits.pp b/lcl/alllclunits.pp index 6fa2156f8d..b1e364f03f 100644 --- a/lcl/alllclunits.pp +++ b/lcl/alllclunits.pp @@ -22,7 +22,7 @@ unit AllLCLUnits; { At least 2.4.0 is required, except for wince which supports fpc 2.2.0+ too } {$ifdef Wince} - {$if defined(ver1) or (defined(ver2) and (fpc_release<2))}// or (defined(ver2_2) and (fpc_patch<4))} + {$if defined(ver1) or (defined(ver2) and (fpc_release<2))} {$fatal Lazarus for WinCE requires at least FPC 2.2.0} {$endif} {$else} diff --git a/lcl/interfaces/wince/wincewinapi.inc b/lcl/interfaces/wince/wincewinapi.inc index 1d1874f7ec..e61e139816 100644 --- a/lcl/interfaces/wince/wincewinapi.inc +++ b/lcl/interfaces/wince/wincewinapi.inc @@ -2460,18 +2460,6 @@ begin Result := Boolean(Windows.RectVisible(DC, LPRECT(@ARect)^)); end; -{------------------------------------------------------------------------------ - Function: RemoveProp - Params: Handle: Handle of the object - Str: Name of the property to remove - Returns: The handle of the property (0=failure) - - ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.RemoveProp(Handle: hwnd; Str: PChar): THandle; -begin - Result:=inherited RemoveProp(Handle, Str); -end;} - {function TWinCEWidgetSet.RegroupMenuItem(hndMenu: HMENU; GroupIndex: integer ): Boolean; begin @@ -2506,6 +2494,25 @@ begin Assert(False, Format('Trace:< [TWinCEWidgetSet.ReleaseDC] DC:0x%x', [DC])); end; +{------------------------------------------------------------------------------ + Function: RemoveProp + Params: Handle: Handle of the object + Str: Name of the property to remove + Returns: The handle of the property (0=failure) + + ------------------------------------------------------------------------------} +function TWinCEWidgetSet.RemoveProp(Handle: hwnd; Str: PChar): THandle; +var + WideStr: widestring; +begin + WideStr := UTF8Decode(String(str)); + {$ifdef win32} + Result := THandle(Windows.RemovePropW(Handle, PWideChar(WideStr))); + {$else} + Result := THandle(Windows.RemoveProp(Handle, PWideChar(WideStr))); + {$endif} +end; + {------------------------------------------------------------------------------ Method: RestoreDC Params: DC - handle of device context diff --git a/lcl/interfaces/wince/wincewinapih.inc b/lcl/interfaces/wince/wincewinapih.inc index 7596a4fa31..272f4303b8 100644 --- a/lcl/interfaces/wince/wincewinapih.inc +++ b/lcl/interfaces/wince/wincewinapih.inc @@ -184,7 +184,7 @@ function RedrawWindow(Wnd: HWND; lprcUpdate: PRECT; hrgnUpdate: HRGN; flags: UIN {function RegroupMenuItem(hndMenu: HMENU; GroupIndex: integer): Boolean; override;} function ReleaseCapture : Boolean; override; function ReleaseDC(Window: HWND; DC: HDC): Integer; override; -//function RemoveProp(Handle: hwnd; Str: PChar): THandle; override; +function RemoveProp(Handle: hwnd; Str: PChar): THandle; override; function RestoreDC(DC: HDC; SavedDC: Integer): Boolean; override; function RoundRect(DC : hDC; X1, Y1, X2, Y2: Integer; RX,RY : Integer): Boolean; override;