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:
sekelsenmat 2011-11-29 07:55:28 +00:00
parent b42b7bd0dd
commit f9adbfe391
8 changed files with 80 additions and 12 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -6,7 +6,7 @@ uses
//win32wsdialogs,
//win32extra,
//win32wsextdlgs,
//win32wsarrow,
customdrawnwsarrow,
//win32wschecklst,
//win32wsstdctrls,
//win32wscalendar,

View File

@ -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,

View File

@ -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;

View File

@ -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;
{------------------------------------------------------------------------------

View File

@ -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;

View 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.

View File

@ -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