mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:19:47 +02:00
customdrawnws: Fixes the compilation of the Cocoa backend and adds a skeleton for the arrow component
git-svn-id: trunk@33845 -
This commit is contained in:
parent
b42b7bd0dd
commit
f9adbfe391
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5469,6 +5469,7 @@ lcl/interfaces/customdrawn/customdrawnwinapi_cocoa.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwinapi_win.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwinapi_x11.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwinapih.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwsarrow.pas svneol=native#text/plain
|
||||
lcl/interfaces/customdrawn/customdrawnwscontrols.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwscontrols.pp svneol=native#text/plain
|
||||
lcl/interfaces/customdrawn/customdrawnwscontrols_win.inc svneol=native#text/pascal
|
||||
|
@ -6,7 +6,7 @@ uses
|
||||
//win32wsdialogs,
|
||||
//win32extra,
|
||||
//win32wsextdlgs,
|
||||
//win32wsarrow,
|
||||
customdrawnwsarrow,
|
||||
//win32wschecklst,
|
||||
//win32wsstdctrls,
|
||||
//win32wscalendar,
|
||||
|
@ -32,7 +32,7 @@ uses
|
||||
Types, Classes, SysUtils, Math,
|
||||
fpimage, fpcanvas, fpimgcanv, ctypes,
|
||||
{$ifdef CD_Windows}Windows, customdrawn_WinProc,{$endif}
|
||||
{$ifdef CD_Cocoa}MacOSAll, CocoaAll, CocoaPrivate,{$endif}
|
||||
{$ifdef CD_Cocoa}MacOSAll, CocoaAll, CocoaPrivate, CocoaGDIObjects,{$endif}
|
||||
{$ifdef CD_X11}X, XLib, XUtil, customdrawn_x11proc,{unitxft, Xft font support}{$endif}
|
||||
{$ifdef CD_Android}
|
||||
cmem, customdrawn_androidproc, jni, bitmap, log,
|
||||
|
@ -484,6 +484,14 @@ function TCDWidgetSet.GetLCLCapability(ACapability: TLCLCapability): PtrUInt;
|
||||
begin
|
||||
case ACapability of
|
||||
lcCanDrawOutsideOnPaint: Result := LCL_CAPABILITY_NO;
|
||||
{$ifdef CD_Cocoa}
|
||||
lcNeedMininimizeAppWithMainForm,
|
||||
lcApplicationTitle,
|
||||
lcFormIcon,
|
||||
lcReceivesLMClearCutCopyPasteReliably:
|
||||
Result := LCL_CAPABILITY_NO;
|
||||
{$endif}
|
||||
lcAntialiasingEnabledByDefault: Result := LCL_CAPABILITY_NO;
|
||||
else
|
||||
Result := inherited GetLCLCapability(ACapability);
|
||||
end;
|
||||
|
@ -172,7 +172,10 @@ end;
|
||||
|
||||
procedure TCDWidgetSet.AppSetIcon(const Small, Big: HICON);
|
||||
begin
|
||||
|
||||
if Big <> 0 then
|
||||
NSApp.setApplicationIconImage(TCocoaBitmap(Big).image)
|
||||
else
|
||||
NSApp.setApplicationIconImage(nil);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -523,20 +523,20 @@ begin
|
||||
Height:=R.Bottom-R.Top;
|
||||
end else
|
||||
Result:=False;
|
||||
end;
|
||||
end;*)
|
||||
|
||||
function TCocoaWidgetSet.InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean): Boolean;
|
||||
function TCDWidgetSet.InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean): Boolean;
|
||||
begin
|
||||
if aHandle<>0 then begin
|
||||
(* if aHandle<>0 then begin
|
||||
Result:=True;
|
||||
if Assigned(Rect)
|
||||
then NSObject(aHandle).lclInvalidateRect(Rect^)
|
||||
else NSObject(aHandle).lclInvalidate;
|
||||
end else
|
||||
end else*)
|
||||
Result:=False;
|
||||
end;
|
||||
|
||||
function TCocoaWidgetSet.UpdateWindow(Handle: HWND): Boolean;
|
||||
(*function TCocoaWidgetSet.UpdateWindow(Handle: HWND): Boolean;
|
||||
begin
|
||||
Result:=InvalidateRect(Handle, nil, false);
|
||||
end;
|
||||
|
56
lcl/interfaces/customdrawn/customdrawnwsarrow.pas
Normal file
56
lcl/interfaces/customdrawn/customdrawnwsarrow.pas
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
*****************************************************************************
|
||||
* CustomDrawnWSArrow.pp *
|
||||
* ------------ *
|
||||
* *
|
||||
* *
|
||||
*****************************************************************************
|
||||
|
||||
*****************************************************************************
|
||||
* *
|
||||
* This file is part of the Lazarus Component Library (LCL) *
|
||||
* *
|
||||
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
|
||||
* for details about the copyright. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* *
|
||||
*****************************************************************************
|
||||
}
|
||||
unit CustomDrawnWSArrow;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
//{$I qtdefines.inc}
|
||||
|
||||
uses
|
||||
Types,
|
||||
// LCL
|
||||
SysUtils, Controls, LCLType, LCLProc, Graphics, Arrow,
|
||||
// widgetset
|
||||
WSArrow, WSLCLClasses;
|
||||
|
||||
type
|
||||
|
||||
{ TCDWSArrow }
|
||||
|
||||
// The default implementation is good enough, but we need to register this
|
||||
// class anyway because otherwise we get crashes
|
||||
TCDWSArrow = class(TWSArrow)
|
||||
published
|
||||
{class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class procedure SetType(const AArrow: TArrow; const AArrowType: TArrowType;
|
||||
const AShadowType: TShadowType); override;
|
||||
class procedure DrawArrow(const AArrow: TArrow; const ACanvas: TCanvas);
|
||||
override;}
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
@ -98,8 +98,8 @@ function RegisterCustomRubberBand: Boolean;
|
||||
|
||||
implementation
|
||||
uses
|
||||
{ WinCEWSArrow,
|
||||
WinCEWSButtons,
|
||||
CustomDrawnWSArrow,
|
||||
{ WinCEWSButtons,
|
||||
WinCEWSCalendar,
|
||||
WinCEWSCheckLst,
|
||||
WinCEWSComCtrls,}
|
||||
@ -450,8 +450,8 @@ end;
|
||||
// Arrow
|
||||
function RegisterArrow: Boolean; alias : 'WSRegisterArrow';
|
||||
begin
|
||||
// RegisterWSComponent(TArrow, TWinCEWSArrow);
|
||||
Result := False;
|
||||
RegisterWSComponent(TArrow, TCDWSArrow);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
// CheckLst
|
||||
|
Loading…
Reference in New Issue
Block a user