mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 03:49:20 +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_win.inc svneol=native#text/pascal
|
||||||
lcl/interfaces/customdrawn/customdrawnwinapi_x11.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/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.inc svneol=native#text/pascal
|
||||||
lcl/interfaces/customdrawn/customdrawnwscontrols.pp svneol=native#text/plain
|
lcl/interfaces/customdrawn/customdrawnwscontrols.pp svneol=native#text/plain
|
||||||
lcl/interfaces/customdrawn/customdrawnwscontrols_win.inc svneol=native#text/pascal
|
lcl/interfaces/customdrawn/customdrawnwscontrols_win.inc svneol=native#text/pascal
|
||||||
|
@ -6,7 +6,7 @@ uses
|
|||||||
//win32wsdialogs,
|
//win32wsdialogs,
|
||||||
//win32extra,
|
//win32extra,
|
||||||
//win32wsextdlgs,
|
//win32wsextdlgs,
|
||||||
//win32wsarrow,
|
customdrawnwsarrow,
|
||||||
//win32wschecklst,
|
//win32wschecklst,
|
||||||
//win32wsstdctrls,
|
//win32wsstdctrls,
|
||||||
//win32wscalendar,
|
//win32wscalendar,
|
||||||
|
@ -32,7 +32,7 @@ uses
|
|||||||
Types, Classes, SysUtils, Math,
|
Types, Classes, SysUtils, Math,
|
||||||
fpimage, fpcanvas, fpimgcanv, ctypes,
|
fpimage, fpcanvas, fpimgcanv, ctypes,
|
||||||
{$ifdef CD_Windows}Windows, customdrawn_WinProc,{$endif}
|
{$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_X11}X, XLib, XUtil, customdrawn_x11proc,{unitxft, Xft font support}{$endif}
|
||||||
{$ifdef CD_Android}
|
{$ifdef CD_Android}
|
||||||
cmem, customdrawn_androidproc, jni, bitmap, log,
|
cmem, customdrawn_androidproc, jni, bitmap, log,
|
||||||
|
@ -484,6 +484,14 @@ function TCDWidgetSet.GetLCLCapability(ACapability: TLCLCapability): PtrUInt;
|
|||||||
begin
|
begin
|
||||||
case ACapability of
|
case ACapability of
|
||||||
lcCanDrawOutsideOnPaint: Result := LCL_CAPABILITY_NO;
|
lcCanDrawOutsideOnPaint: Result := LCL_CAPABILITY_NO;
|
||||||
|
{$ifdef CD_Cocoa}
|
||||||
|
lcNeedMininimizeAppWithMainForm,
|
||||||
|
lcApplicationTitle,
|
||||||
|
lcFormIcon,
|
||||||
|
lcReceivesLMClearCutCopyPasteReliably:
|
||||||
|
Result := LCL_CAPABILITY_NO;
|
||||||
|
{$endif}
|
||||||
|
lcAntialiasingEnabledByDefault: Result := LCL_CAPABILITY_NO;
|
||||||
else
|
else
|
||||||
Result := inherited GetLCLCapability(ACapability);
|
Result := inherited GetLCLCapability(ACapability);
|
||||||
end;
|
end;
|
||||||
|
@ -172,7 +172,10 @@ end;
|
|||||||
|
|
||||||
procedure TCDWidgetSet.AppSetIcon(const Small, Big: HICON);
|
procedure TCDWidgetSet.AppSetIcon(const Small, Big: HICON);
|
||||||
begin
|
begin
|
||||||
|
if Big <> 0 then
|
||||||
|
NSApp.setApplicationIconImage(TCocoaBitmap(Big).image)
|
||||||
|
else
|
||||||
|
NSApp.setApplicationIconImage(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -523,20 +523,20 @@ begin
|
|||||||
Height:=R.Bottom-R.Top;
|
Height:=R.Bottom-R.Top;
|
||||||
end else
|
end else
|
||||||
Result:=False;
|
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
|
begin
|
||||||
if aHandle<>0 then begin
|
(* if aHandle<>0 then begin
|
||||||
Result:=True;
|
Result:=True;
|
||||||
if Assigned(Rect)
|
if Assigned(Rect)
|
||||||
then NSObject(aHandle).lclInvalidateRect(Rect^)
|
then NSObject(aHandle).lclInvalidateRect(Rect^)
|
||||||
else NSObject(aHandle).lclInvalidate;
|
else NSObject(aHandle).lclInvalidate;
|
||||||
end else
|
end else*)
|
||||||
Result:=False;
|
Result:=False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCocoaWidgetSet.UpdateWindow(Handle: HWND): Boolean;
|
(*function TCocoaWidgetSet.UpdateWindow(Handle: HWND): Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=InvalidateRect(Handle, nil, false);
|
Result:=InvalidateRect(Handle, nil, false);
|
||||||
end;
|
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
|
implementation
|
||||||
uses
|
uses
|
||||||
{ WinCEWSArrow,
|
CustomDrawnWSArrow,
|
||||||
WinCEWSButtons,
|
{ WinCEWSButtons,
|
||||||
WinCEWSCalendar,
|
WinCEWSCalendar,
|
||||||
WinCEWSCheckLst,
|
WinCEWSCheckLst,
|
||||||
WinCEWSComCtrls,}
|
WinCEWSComCtrls,}
|
||||||
@ -450,8 +450,8 @@ end;
|
|||||||
// Arrow
|
// Arrow
|
||||||
function RegisterArrow: Boolean; alias : 'WSRegisterArrow';
|
function RegisterArrow: Boolean; alias : 'WSRegisterArrow';
|
||||||
begin
|
begin
|
||||||
// RegisterWSComponent(TArrow, TWinCEWSArrow);
|
RegisterWSComponent(TArrow, TCDWSArrow);
|
||||||
Result := False;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// CheckLst
|
// CheckLst
|
||||||
|
Loading…
Reference in New Issue
Block a user