From 2205d5125c134fc8453347636cb24c87a16d11a8 Mon Sep 17 00:00:00 2001 From: skalogryz Date: Tue, 13 Apr 2010 12:05:58 +0000 Subject: [PATCH] richmemo: register customrichmemo if none registered. updated samples's resouce usage git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1198 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/richmemo/richmemo.pas | 1 - components/richmemo/richmemofactory.pas | 11 +- .../richmemo/samples/testsimple/project1.lpi | 211 +++++++++++------- .../richmemo/samples/testsimple/project1.lpr | 2 - 4 files changed, 142 insertions(+), 83 deletions(-) diff --git a/components/richmemo/richmemo.pas b/components/richmemo/richmemo.pas index eea6fc08b..4523deb4a 100644 --- a/components/richmemo/richmemo.pas +++ b/components/richmemo/richmemo.pas @@ -298,6 +298,5 @@ begin Result := false; end; - end. diff --git a/components/richmemo/richmemofactory.pas b/components/richmemo/richmemofactory.pas index 56ab557f4..03d3fd8a3 100644 --- a/components/richmemo/richmemofactory.pas +++ b/components/richmemo/richmemofactory.pas @@ -7,22 +7,27 @@ interface uses WSLCLClasses, - RichMemo + RichMemo, + WSRichMemo {$ifdef LCLWin32},Win32RichMemo{$endif} {$ifdef LCLCarbon},CarbonRichMemo{$endif} {$ifdef LCLGtk2},Gtk2RichMemo{$endif} ; function RegisterCustomRichMemo: Boolean; - + implementation function RegisterCustomRichMemo: Boolean; alias : 'WSRegisterCustomRichMemo'; +var + cls : TWSLCLComponentClass; begin + Result := True; {$ifdef LCLWin32}RegisterWSComponent(TCustomRichMemo, TWin32WSCustomRichMemo);{$endif} {$ifdef LCLCarbon}RegisterWSComponent(TCustomRichMemo, TCarbonWSCustomRichMemo);{$endif} {$ifdef LCLGtk2}RegisterWSComponent(TCustomRichMemo, TGtk2WSCustomRichMemo);{$endif} - Result := False; + cls:=FindWSComponentClass(TCustomRichMemo); + if not Assigned(cls) then RegisterWSComponent(TCustomRichMemo, TWSCustomRichMemo); end; diff --git a/components/richmemo/samples/testsimple/project1.lpi b/components/richmemo/samples/testsimple/project1.lpi index 056218530..579b40051 100644 --- a/components/richmemo/samples/testsimple/project1.lpi +++ b/components/richmemo/samples/testsimple/project1.lpi @@ -6,10 +6,10 @@ - + - + @@ -32,14 +32,18 @@ - + - - + + + + + + @@ -47,94 +51,95 @@ - - + + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -144,8 +149,8 @@ - + @@ -155,274 +160,302 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - - + + + - + - + - + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -487,6 +520,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/richmemo/samples/testsimple/project1.lpr b/components/richmemo/samples/testsimple/project1.lpr index a381d4e08..f484b4d76 100644 --- a/components/richmemo/samples/testsimple/project1.lpr +++ b/components/richmemo/samples/testsimple/project1.lpr @@ -9,8 +9,6 @@ uses Interfaces, // this includes the LCL widgetset Forms, Unit1, richmemopackage; -{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF} - begin Application.Initialize; Application.CreateForm(TForm1, Form1);