diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index a63e97ffb9..3b3f9ea8c1 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -2706,7 +2706,7 @@ end; ------------------------------------------------------------------------------} function TWin32WidgetSet.SetROP2(DC: HDC; Mode: Integer): Integer; begin - result := Windows.SetROP2(DC, Mode); + result := Windows.SetROP2(DC, Mode); end; {------------------------------------------------------------------------------ diff --git a/lcl/interfaces/wince/wincewinapi.inc b/lcl/interfaces/wince/wincewinapi.inc index dca6afd58a..24d8709c84 100644 --- a/lcl/interfaces/wince/wincewinapi.inc +++ b/lcl/interfaces/wince/wincewinapi.inc @@ -440,14 +440,6 @@ begin Assert(False, Format('Trace:< [TWinCEWidgetSet.CreateBitmap] --> 0x%x', [Integer(Result)])); end; -{ -function TWinCEWidgetSet.CreateBitmapFromRawImage(const RawImage: TRawImage; - var Bitmap, MaskBitmap: HBitmap; AlwaysCreateMask: boolean): boolean; -begin - Result:=inherited CreateBitmapFromRawImage(RawImage, Bitmap, MaskBitmap, - AlwaysCreateMask); -end;} - function TWinCEWidgetSet.CreateBrushIndirect(const LogBrush: TLogBrush): HBRUSH; var LB: Windows.LogBrush; @@ -697,10 +689,10 @@ end; Destroys the caret but doesn't free the bitmap. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.DestroyCaret(Handle: HWND): Boolean; +function TWinCEWidgetSet.DestroyCaret(Handle: HWND): Boolean; begin - Result:=inherited DestroyCaret(Handle); -end;} + Result := Boolean(Windows.DestroyCaret); +end; {------------------------------------------------------------------------------ Method: DestroyCursor @@ -730,7 +722,7 @@ var Flags: dword; begin // flat button border cannot be drawn by DrawFrameControl, draw ourselves - if (UType = DFC_BUTTON) or ((UState and DFCS_FLAT) <> 0) then + if (UType = DFC_BUTTON) and ((UState and DFCS_FLAT) <> 0) then begin if (UState and DFCS_PUSHED) <> 0 then Flags := BDR_SUNKENOUTER @@ -770,7 +762,7 @@ end; ------------------------------------------------------------------------------} function TWinCEWidgetSet.DrawText(DC: HDC; Str: PChar; Count: Integer; var Rect: TRect; Flags: Cardinal): Integer; var -WideStr : PWideChar; + WideStr : PWideChar; begin Assert(False, Format('trace:> [TWinCEWidgetSet.DrawText] DC:0x%x, Str:''%s'', Count: %d, Rect = %d,%d,%d,%d, Flags:%d', [DC, Str, Count, Rect.Left, Rect.Top, Rect.Right, Rect.Bottom, Flags])); @@ -793,10 +785,10 @@ end; Use Ellipse to draw a filled circle or ellipse. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.Ellipse(DC: HDC; x1, y1, x2, y2: Integer): Boolean; +function TWinCEWidgetSet.Ellipse(DC: HDC; x1, y1, x2, y2: Integer): Boolean; begin - Result:=inherited Ellipse(DC, x1, y1, x2, y2); -end;} + Result := Boolean(Windows.Ellipse(DC, X1, Y1, X2, Y2)); +end; {------------------------------------------------------------------------------ Method: EnableScrollBar Params: Wnd - handle to window or scroll bar @@ -1022,10 +1014,10 @@ end;} Retrieves the handle of the window (if any) that has captured the mouse. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.GetCapture: HWND; +function TWinCEWidgetSet.GetCapture: HWND; begin - Result:=inherited GetCapture; -end;} + Result := Windows.GetCapture; +end; {------------------------------------------------------------------------------ Method: GetCaretPos @@ -1034,12 +1026,12 @@ end;} Gets the caret's position, in client coordinates. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.GetCaretPos(var lpPoint: TPoint): Boolean; +function TWinCEWidgetSet.GetCaretPos(var lpPoint: TPoint): Boolean; begin - Result:=inherited GetCaretPos(lpPoint); + Result := Boolean(Windows.GetCaretPos(@LPPoint)); end; -function TWinCEWidgetSet.GetCaretRespondToFocus(handle: HWND; +{function TWinCEWidgetSet.GetCaretRespondToFocus(handle: HWND; var ShowHideOnFocus: boolean): Boolean; begin Result:=inherited GetCaretRespondToFocus(handle, ShowHideOnFocus); @@ -1391,12 +1383,16 @@ end; Retrieves a pointer to data from the property list of the given window. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.GetProp(Handle: hwnd; Str: PChar): Pointer; +function TWinCEWidgetSet.GetProp(Handle: hwnd; Str: PChar): Pointer; +var + WideStr: PWideChar; begin - Result:=inherited GetProp(Handle, Str); + WideStr := StringToPWideChar(String(str)); + Result := Pointer(Windows.GetProp(Handle, WideStr)); + FreeMem(WideStr); end; -function TWinCEWidgetSet.GetRawImageFromDevice(SrcDC: HDC; +{function TWinCEWidgetSet.GetRawImageFromDevice(SrcDC: HDC; const SrcRect: TRect; var NewRawImage: TRawImage): boolean; begin Result:=inherited GetRawImageFromDevice(SrcDC, SrcRect, NewRawImage); @@ -1425,10 +1421,10 @@ end;} ------------------------------------------------------------------------------} {function TWinCEWidgetSet.GetROP2(DC: HDC): Integer; begin - Result:=inherited GetROP2(DC); -end; + Result := Windows.GetROP2(DC); // not found +end;} -function TWinCEWidgetSet.GetScrollBarSize(Handle: HWND; BarKind: Integer +{function TWinCEWidgetSet.GetScrollBarSize(Handle: HWND; BarKind: Integer ): integer; begin Result:=inherited GetScrollBarSize(Handle, BarKind); @@ -1741,17 +1737,10 @@ end;} Removes the caret from the screen. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.HideCaret(hWnd: HWND): Boolean; +function TWinCEWidgetSet.HideCaret(hWnd: HWND): Boolean; begin - Result:=inherited HideCaret(hWnd); + Result := Boolean(Windows.HideCaret(hWnd)); end; -} - - - - - - {------------------------------------------------------------------------------ Method: InvalidateRect @@ -2070,10 +2059,10 @@ end;} The ReleaseCapture function releases the mouse capture from a window and restores normal mouse input processing. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.ReleaseCapture: Boolean; +function TWinCEWidgetSet.ReleaseCapture: Boolean; begin - Result:=inherited ReleaseCapture; -end;} + Result := Boolean(Windows.ReleaseCapture); +end; {------------------------------------------------------------------------------ Method: ReleaseDC @@ -2090,8 +2079,6 @@ begin Assert(False, Format('Trace:< [TWinCEWidgetSet.ReleaseDC] DC:0x%x', [DC])); end; - - {------------------------------------------------------------------------------ Method: RestoreDC Params: DC - handle of device context @@ -2288,6 +2275,7 @@ begin Result:=inherited SetComboMinDropDownSize(Handle, MinItemsWidth, MinItemsHeight, MinItemCount); end;} + {------------------------------------------------------------------------------ Method: SetCapture Params: Value - Handle of window to capture @@ -2295,10 +2283,11 @@ end;} Sets the mouse capture to the specified window. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.SetCapture(AHandle: HWND): HWND; +function TWinCEWidgetSet.SetCapture(AHandle: HWND): HWND; begin - Result:=inherited SetCapture(AHandle); -end;} + Result := Windows.SetCapture(AHandle); +end; + {------------------------------------------------------------------------------ Method: SetCaretPos Params: new position x, y @@ -2306,10 +2295,10 @@ end;} Moves the caret to the specified coordinates. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.SetCaretPos(X, Y: Integer): Boolean; +function TWinCEWidgetSet.SetCaretPos(X, Y: Integer): Boolean; begin - Result:=inherited SetCaretPos(X, Y); -end;} + Result := Boolean(Windows.SetCaretPos(X, Y)); +end; {------------------------------------------------------------------------------ Method: SetCaretPosEx Params: Handle - handle of window @@ -2319,12 +2308,12 @@ end;} Moves the caret to the specified coordinates in the specified window. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.SetCaretPosEx(Handle: HWnd; X, Y: Integer): Boolean; +function TWinCEWidgetSet.SetCaretPosEx(Handle: HWnd; X, Y: Integer): Boolean; begin - Result:=inherited SetCaretPosEx(Handle, X, Y); + Result := Windows.SetCaretPos(X, Y); end; -function TWinCEWidgetSet.SetCaretRespondToFocus(handle: HWND; +{function TWinCEWidgetSet.SetCaretRespondToFocus(handle: HWND; ShowHideOnFocus: boolean): Boolean; begin Result:=inherited SetCaretRespondToFocus(handle, ShowHideOnFocus); @@ -2375,11 +2364,14 @@ end; MWE: that is not really needed anymore since the RemoveProp is now implemented ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.SetProp(Handle: hwnd; Str: PChar; Data: Pointer - ): Boolean; +function TWinCEWidgetSet.SetProp(Handle: hwnd; Str: PChar; Data: Pointer): Boolean; +var + WideStr: PWideChar; begin - Result:=inherited SetProp(Handle, Str, Data); -end;} + WideStr := StringToPWideChar(String(str)); + Result := Boolean(Windows.SetProp(Handle, WideStr, Windows.HANDLE(Data))); + FreeMem(WideStr); +end; {------------------------------------------------------------------------------ Method: SetROP2 Params: DC - Device Context @@ -2544,10 +2536,10 @@ end;} Makes the caret visible on the screen at the caret's current position. ------------------------------------------------------------------------------} -{function TWinCEWidgetSet.ShowCaret(hWnd: HWND): Boolean; +function TWinCEWidgetSet.ShowCaret(hWnd: HWND): Boolean; begin - Result:=inherited ShowCaret(hWnd); -end;} + Result := Boolean(Windows.ShowCaret(HWnd)); +end; {------------------------------------------------------------------------------ Method: ShowScrollBar Params: Handle - handle of window with scroll bar diff --git a/lcl/interfaces/wince/wincewinapih.inc b/lcl/interfaces/wince/wincewinapih.inc index 3ddd473610..791131099e 100644 --- a/lcl/interfaces/wince/wincewinapih.inc +++ b/lcl/interfaces/wince/wincewinapih.inc @@ -63,7 +63,6 @@ function ClipboardRegisterFormat(const AMimeType: string): TClipboardFormat; ove function CombineRgn(Dest, Src1, Src2 : HRGN; fnCombineMode : Longint) : Longint; override; function ComboBoxDropDown(Handle: HWND; DropDown: boolean): boolean; override; function CreateBitmap(Width, Height: Integer; Planes, BitCount: Longint; BitmapBits: Pointer): HBITMAP; override; -//function CreateBitmapFromRawImage(const RawImage: TRawImage; var Bitmap, MaskBitmap: HBitmap; AlwaysCreateMask: boolean): boolean; override; function CreateBrushIndirect(const LogBrush: TLogBrush): HBRUSH; override; function CreateCaret(Handle : HWND; Bitmap : hBitmap; width, Height : Integer) : Boolean; override; function CreateCompatibleBitmap(DC: HDC; Width, Height: Integer): HBITMAP; override; @@ -82,14 +81,14 @@ function CreateRectRgn(X1,Y1,X2,Y2 : Integer): HRGN; override; procedure DeleteCriticalSection(var CritSection: TCriticalSection); override; function DeleteDC(hDC: HDC): Boolean; override; function DeleteObject(GDIObject: HGDIOBJ): Boolean; override; -//function DestroyCaret(Handle : HWND): Boolean; override; +function DestroyCaret(Handle : HWND): Boolean; override; function DrawFrameControl(DC: HDC; const Rect : TRect; uType, uState : Cardinal) : Boolean; override; function DestroyCursor(Handle: hCursor): Boolean; override; function DrawEdge(DC: HDC; var ARect: TRect; Edge: Cardinal; grfFlags: Cardinal): Boolean; override; function DrawText(DC: HDC; Str: PChar; Count: Integer; var Rect: TRect; Flags: Cardinal): Integer; override; -{function Ellipse(DC: HDC; x1,y1,x2,y2: Integer): Boolean; override; -function EnableScrollBar(Wnd: HWND; wSBflags, wArrows: Cardinal): Boolean; override;} +function Ellipse(DC: HDC; x1,y1,x2,y2: Integer): Boolean; override; +{function EnableScrollBar(Wnd: HWND; wSBflags, wArrows: Cardinal): Boolean; override;} function EnableWindow(hWnd: HWND; bEnable: Boolean): Boolean; override; function EndPaint(Handle : hwnd; var PS : TPaintStruct): Integer; override; procedure EnterCriticalSection(var CritSection: TCriticalSection); override; @@ -107,9 +106,9 @@ function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; override; function GetActiveWindow : HWND; override; //function GetBitmapBits(Bitmap: HBITMAP; Count: Longint; Bits: Pointer): Longint; override; -{function GetCapture: HWND; override; +function GetCapture: HWND; override; function GetCaretPos(var lpPoint: TPoint): Boolean; override; -function GetCaretRespondToFocus(handle: HWND; var ShowHideOnFocus: boolean): Boolean; override; +{function GetCaretRespondToFocus(handle: HWND; var ShowHideOnFocus: boolean): Boolean; override; function GetCharABCWidths(DC: HDC; p2, p3: UINT; const ABCStructs): Boolean; override;} function GetClientBounds(handle : HWND; var Rect : TRect) : Boolean; override; function GetClientRect(handle : HWND; var Rect : TRect) : Boolean; override; @@ -128,10 +127,10 @@ function GetForegroundWindow: HWND; override; //function GetKeyState(nVirtKey: Integer): Smallint; override; function GetObject(GDIObj: HGDIOBJ; BufSize: Integer; Buf: Pointer): Integer; override; function GetParent(Handle : HWND): HWND; override; -{function GetProp(Handle : hwnd; Str : PChar): Pointer; override; -function GetRgnBox(RGN : HRGN; lpRect : PRect) : Longint; override;} -{function GetROP2(DC: HDC): Integer; override; -function GetScrollBarSize(Handle: HWND; BarKind: Integer): integer; override; +function GetProp(Handle : hwnd; Str : PChar): Pointer; override; +{function GetRgnBox(RGN : HRGN; lpRect : PRect) : Longint; override;} +//function GetROP2(DC: HDC): Integer; override; +{function GetScrollBarSize(Handle: HWND; BarKind: Integer): integer; override; function GetScrollbarVisible(Handle: HWND; SBStyle: Integer): boolean; override;} function GetScrollInfo(Handle: HWND; BarFlag: Integer; var ScrollInfo: TScrollInfo): Boolean;override; function GetStockObject(Value: Integer): THandle; override; @@ -147,9 +146,9 @@ function GetWindowRelativePosition(Handle : hwnd; var Left, Top: integer): boole function GetWindowSize(Handle : hwnd; var Width, Height: integer): boolean; override; { function GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices : Longint; - Meshes: Pointer; NumMeshes : Longint; Mode : Longint): Boolean; override; + Meshes: Pointer; NumMeshes : Longint; Mode : Longint): Boolean; override;} -function HideCaret(hWnd: HWND): Boolean; override;} +function HideCaret(hWnd: HWND): Boolean; override; procedure InitializeCriticalSection(var CritSection: TCriticalSection); override; function IntersectClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer; override; @@ -174,8 +173,8 @@ function RadialChord(DC: HDC; x,y,width,height,sx,sy,ex,ey : Integer): Boolean; function RealizePalette(DC: HDC): Cardinal; override;} function Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): Boolean; override; function RectVisible(dc : hdc; const ARect: TRect) : Boolean; override; -{function RegroupMenuItem(hndMenu: HMENU; GroupIndex: integer): Boolean; override; -function ReleaseCapture : Boolean; override;} +{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 RestoreDC(DC: HDC; SavedDC: Integer): Boolean; override; @@ -191,15 +190,15 @@ function SendMessage(HandleWnd: HWND; Msg: Cardinal; wParam: WParam; lParam: LPa function SetActiveWindow(Window: HWND): HWND; override; function SetBkColor(DC: HDC; Color: TColorRef): TColorRef; override; function SetBkMode(DC: HDC; bkMode : Integer) : Integer; override; -{function SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean; override; +{function SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean; override;} function SetCapture(AHandle: HWND): HWND; override; function SetCaretPos(X, Y: Integer): Boolean; override; function SetCaretPosEx(Handle: HWnd; X, Y: Integer): Boolean; override; -function SetCaretRespondToFocus(handle: HWND; ShowHideOnFocus: boolean): Boolean; override;} +{function SetCaretRespondToFocus(handle: HWND; ShowHideOnFocus: boolean): Boolean; override;} function SetCursor(hCursor: HICON): HCURSOR; override; //function SetCursorPos(X, Y: Integer): Boolean; override; function SetFocus(hWnd: HWND): HWND; override; -//function SetProp(Handle: hwnd; Str : PChar; Data : Pointer) : Boolean; override; +function SetProp(Handle: hwnd; Str : PChar; Data : Pointer) : Boolean; override; function SetROP2(DC: HDC; Mode: Integer): Integer; override; function SetScrollInfo(Handle : HWND; SBStyle : Integer; ScrollInfo: TScrollInfo; bRedraw : Boolean): Integer; override; function SetSysColors(cElements: Integer; const lpaElements; const lpaRgbValues): Boolean; override; @@ -209,8 +208,8 @@ function SetWindowLong(Handle: HWND; Idx: Integer; NewLong: PtrInt): PtrInt; ove function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; OldPoint: PPoint) : Boolean; override; function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; X, Y, cx, cy: Integer; uFlags: UINT): Boolean; override; -{function ShowCaret(hWnd: HWND): Boolean; override; -function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;} +function ShowCaret(hWnd: HWND): Boolean; override; +{function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;} function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override; function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; ROp: Cardinal): Boolean; override; function StretchMaskBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Mask: HBITMAP; XMask, YMask: Integer; Rop: DWORD): Boolean; override;