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
This commit is contained in:
skalogryz
2010-04-13 12:05:58 +00:00
parent 4bda1c0662
commit 2205d5125c
4 changed files with 142 additions and 83 deletions

View File

@ -298,6 +298,5 @@ begin
Result := false;
end;
end.

View File

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

View File

@ -6,10 +6,10 @@
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="1"/>
<ActiveWindowIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
@ -32,14 +32,18 @@
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="54">
<Units Count="56">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<CursorPos X="12" Y="6"/>
<TopLine Value="6"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="12"/>
<UsageCount Value="70"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
@ -47,94 +51,95 @@
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<CursorPos X="19" Y="56"/>
<TopLine Value="48"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="48"/>
<CursorPos X="19" Y="56"/>
<UsageCount Value="70"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="../RichMemo/carbon/carbonrichmemo.pas"/>
<UnitName Value="CarbonRichMemo"/>
<CursorPos X="31" Y="137"/>
<TopLine Value="114"/>
<CursorPos X="31" Y="137"/>
<UsageCount Value="11"/>
</Unit2>
<Unit3>
<Filename Value="../RichMemo/win32/win32richmemo.pas"/>
<UnitName Value="Win32RichMemo"/>
<CursorPos X="1" Y="32"/>
<TopLine Value="15"/>
<CursorPos X="1" Y="32"/>
<UsageCount Value="5"/>
</Unit3>
<Unit4>
<Filename Value="../RichMemo/richmemofactory.pas"/>
<UnitName Value="RichMemoFactory"/>
<CursorPos X="20" Y="22"/>
<TopLine Value="1"/>
<CursorPos X="20" Y="22"/>
<UsageCount Value="5"/>
</Unit4>
<Unit5>
<Filename Value="../RichMemo/wsrichmemo.pas"/>
<UnitName Value="WSRichMemo"/>
<CursorPos X="32" Y="18"/>
<TopLine Value="1"/>
<CursorPos X="32" Y="18"/>
<UsageCount Value="5"/>
</Unit5>
<Unit6>
<Filename Value="../lazarus/lcl/widgetset/wsstdctrls.pp"/>
<UnitName Value="WSStdCtrls"/>
<CursorPos X="32" Y="140"/>
<TopLine Value="126"/>
<CursorPos X="32" Y="140"/>
<UsageCount Value="5"/>
</Unit6>
<Unit7>
<Filename Value="../lazarus/lcl/widgetset/wscontrols.pp"/>
<UnitName Value="WSControls"/>
<CursorPos X="33" Y="115"/>
<TopLine Value="100"/>
<CursorPos X="33" Y="115"/>
<UsageCount Value="5"/>
</Unit7>
<Unit8>
<Filename Value="../lazarus/lcl/lcltype.pp"/>
<UnitName Value="LCLType"/>
<CursorPos X="3" Y="2330"/>
<TopLine Value="2316"/>
<CursorPos X="3" Y="2330"/>
<UsageCount Value="6"/>
</Unit8>
<Unit9>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbonedits.pp"/>
<UnitName Value="CarbonEdits"/>
<CursorPos X="3" Y="140"/>
<TopLine Value="124"/>
<CursorPos X="3" Y="140"/>
<UsageCount Value="11"/>
</Unit9>
<Unit10>
<Filename Value="../lazarus/lcl/widgetset/wscomctrls.pp"/>
<UnitName Value="WSComCtrls"/>
<CursorPos X="1" Y="144"/>
<TopLine Value="144"/>
<CursorPos X="1" Y="144"/>
<UsageCount Value="5"/>
</Unit10>
<Unit11>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbonwsstdctrls.pp"/>
<UnitName Value="CarbonWSStdCtrls"/>
<CursorPos X="20" Y="39"/>
<TopLine Value="30"/>
<CursorPos X="20" Y="39"/>
<UsageCount Value="9"/>
</Unit11>
<Unit12>
<Filename Value="../fpc/packages/univint/src/MacOSAll.pas"/>
<UnitName Value="MacOSAll"/>
<CursorPos X="3" Y="35065"/>
<TopLine Value="35051"/>
<CursorPos X="3" Y="35065"/>
<UsageCount Value="10"/>
</Unit12>
<Unit13>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbongdiobjects.pp"/>
<UnitName Value="CarbonGDIObjects"/>
<CursorPos X="3" Y="1109"/>
<TopLine Value="1100"/>
<CursorPos X="3" Y="1109"/>
<UsageCount Value="35"/>
<Bookmarks Count="1">
<Item0 X="25" Y="150" ID="1"/>
@ -144,8 +149,8 @@
<Unit14>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbonproc.pp"/>
<UnitName Value="CarbonProc"/>
<CursorPos X="13" Y="554"/>
<TopLine Value="538"/>
<CursorPos X="13" Y="554"/>
<UsageCount Value="9"/>
<Bookmarks Count="2">
<Item0 X="25" Y="151" ID="1"/>
@ -155,274 +160,302 @@
<Unit15>
<Filename Value="../lazarus/lcl/controls.pp"/>
<UnitName Value="Controls"/>
<CursorPos X="3" Y="2457"/>
<TopLine Value="2448"/>
<CursorPos X="3" Y="2457"/>
<UsageCount Value="8"/>
</Unit15>
<Unit16>
<Filename Value="../fpc/rtl/objpas/sysutils/sysutilh.inc"/>
<CursorPos X="17" Y="34"/>
<TopLine Value="2"/>
<CursorPos X="17" Y="34"/>
<UsageCount Value="6"/>
</Unit16>
<Unit17>
<Filename Value="../fpc/rtl/bsd/system.pp"/>
<UnitName Value="System"/>
<CursorPos X="64" Y="52"/>
<TopLine Value="29"/>
<CursorPos X="64" Y="52"/>
<UsageCount Value="6"/>
</Unit17>
<Unit18>
<Filename Value="../fpc/rtl/amiga/sysosh.inc"/>
<CursorPos X="22" Y="18"/>
<TopLine Value="7"/>
<CursorPos X="22" Y="18"/>
<UsageCount Value="6"/>
</Unit18>
<Unit19>
<Filename Value="../RichMemo/richmemo.pas"/>
<UnitName Value="RichMemo"/>
<CursorPos X="15" Y="39"/>
<TopLine Value="23"/>
<CursorPos X="15" Y="39"/>
<UsageCount Value="10"/>
</Unit19>
<Unit20>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbonprivate.pp"/>
<UnitName Value="CarbonPrivate"/>
<CursorPos X="17" Y="649"/>
<TopLine Value="640"/>
<CursorPos X="17" Y="649"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbonprivatecontrol.inc"/>
<CursorPos X="42" Y="499"/>
<TopLine Value="495"/>
<CursorPos X="42" Y="499"/>
<UsageCount Value="7"/>
</Unit21>
<Unit22>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbondef.pp"/>
<UnitName Value="CarbonDef"/>
<CursorPos X="17" Y="649"/>
<TopLine Value="640"/>
<CursorPos X="17" Y="649"/>
<UsageCount Value="7"/>
</Unit22>
<Unit23>
<Filename Value="../lazarus/lcl/graphics.pp"/>
<UnitName Value="Graphics"/>
<CursorPos X="3" Y="59"/>
<TopLine Value="45"/>
<CursorPos X="3" Y="59"/>
<UsageCount Value="7"/>
</Unit23>
<Unit24>
<Filename Value="../lazarus/lcl/interfaces/carbon/carbondbgconsts.pp"/>
<UnitName Value="CarbonDbgConsts"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<UsageCount Value="6"/>
</Unit24>
<Unit25>
<Filename Value="Unit1.lrs"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<UsageCount Value="6"/>
</Unit25>
<Unit26>
<Filename Value="../../../lazarus/ide/keymapping.pp"/>
<UnitName Value="KeyMapping"/>
<CursorPos X="74" Y="1565"/>
<TopLine Value="1558"/>
<CursorPos X="74" Y="1565"/>
<UsageCount Value="6"/>
</Unit26>
<Unit27>
<Filename Value="../../richmemo.pas"/>
<UnitName Value="RichMemo"/>
<CursorPos X="15" Y="57"/>
<TopLine Value="48"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="31"/>
<CursorPos X="3" Y="45"/>
<UsageCount Value="31"/>
<Loaded Value="True"/>
</Unit27>
<Unit28>
<Filename Value="../../wsrichmemo.pas"/>
<UnitName Value="WSRichMemo"/>
<CursorPos X="1" Y="2"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="2"/>
<UsageCount Value="25"/>
</Unit28>
<Unit29>
<Filename Value="../../carbon/carbonrichmemo.pas"/>
<UnitName Value="CarbonRichMemo"/>
<CursorPos X="16" Y="2"/>
<TopLine Value="1"/>
<CursorPos X="16" Y="2"/>
<UsageCount Value="17"/>
</Unit29>
<Unit30>
<Filename Value="../../../fpc/packages/univint/src/MacOSAll.pas"/>
<UnitName Value="MacOSAll"/>
<CursorPos X="39" Y="220678"/>
<TopLine Value="220670"/>
<CursorPos X="39" Y="220678"/>
<UsageCount Value="16"/>
</Unit30>
<Unit31>
<Filename Value="../../../fpc/rtl/objpas/sysutils/osutilsh.inc"/>
<CursorPos X="10" Y="34"/>
<TopLine Value="20"/>
<CursorPos X="10" Y="34"/>
<UsageCount Value="8"/>
</Unit31>
<Unit32>
<Filename Value="../../../fpc/rtl/objpas/classes/classesh.inc"/>
<CursorPos X="19" Y="728"/>
<TopLine Value="714"/>
<CursorPos X="19" Y="728"/>
<UsageCount Value="8"/>
</Unit32>
<Unit33>
<Filename Value="../../../fpc/rtl/objpas/classes/streams.inc"/>
<CursorPos X="8" Y="147"/>
<TopLine Value="140"/>
<CursorPos X="8" Y="147"/>
<UsageCount Value="8"/>
</Unit33>
<Unit34>
<Filename Value="../../../../wnlibsvn/CarbonPaste.pas"/>
<Filename Value="C:/wnlibsvn/CarbonPaste.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="CarbonPaste"/>
<CursorPos X="43" Y="9"/>
<TopLine Value="1"/>
<CursorPos X="43" Y="9"/>
<UsageCount Value="54"/>
</Unit34>
<Unit35>
<Filename Value="../../../fpc/rtl/objpas/sysutils/sysutilh.inc"/>
<CursorPos X="13" Y="185"/>
<TopLine Value="169"/>
<CursorPos X="13" Y="185"/>
<UsageCount Value="7"/>
</Unit35>
<Unit36>
<Filename Value="../../../lazarus/lcl/widgetset/wsstdctrls.pp"/>
<UnitName Value="WSStdCtrls"/>
<CursorPos X="20" Y="145"/>
<TopLine Value="138"/>
<CursorPos X="20" Y="145"/>
<UsageCount Value="13"/>
</Unit36>
<Unit37>
<Filename Value="../../richmemotypes.pas"/>
<UnitName Value="RichMemoTypes"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<UsageCount Value="8"/>
</Unit37>
<Unit38>
<Filename Value="../../win32/win32richmemo.pas"/>
<UnitName Value="Win32RichMemo"/>
<CursorPos X="1" Y="231"/>
<TopLine Value="216"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="15"/>
<CursorPos X="13" Y="37"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit38>
<Unit39>
<Filename Value="../../win32/win32richmemoproc.pas"/>
<UnitName Value="Win32RichMemoProc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<UsageCount Value="21"/>
<Bookmarks Count="1">
<Item0 X="1" Y="121" ID="2"/>
</Bookmarks>
</Unit39>
<Unit40>
<Filename Value="../../../../../fpc/packages/winunits-base/src/richedit.pp"/>
<Filename Value="C:/fpc/packages/winunits-base/src/richedit.pp"/>
<UnitName Value="richedit"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<UsageCount Value="11"/>
<Bookmarks Count="1">
<Item0 X="98" Y="366" ID="3"/>
</Bookmarks>
</Unit40>
<Unit41>
<Filename Value="../../../../../fpc/rtl/win/wininc/base.inc"/>
<CursorPos X="1" Y="211"/>
<Filename Value="C:/fpc/rtl/win/wininc/base.inc"/>
<TopLine Value="211"/>
<CursorPos X="1" Y="211"/>
<UsageCount Value="11"/>
</Unit41>
<Unit42>
<Filename Value="../../../../../fpc/rtl/objpas/classes/classesh.inc"/>
<CursorPos X="1" Y="791"/>
<Filename Value="C:/fpc/rtl/objpas/classes/classesh.inc"/>
<TopLine Value="782"/>
<CursorPos X="1" Y="791"/>
<UsageCount Value="9"/>
</Unit42>
<Unit43>
<Filename Value="../../../../../fpc/rtl/objpas/classes/streams.inc"/>
<CursorPos X="3" Y="465"/>
<Filename Value="C:/fpc/rtl/objpas/classes/streams.inc"/>
<TopLine Value="462"/>
<CursorPos X="3" Y="465"/>
<UsageCount Value="9"/>
</Unit43>
<Unit44>
<Filename Value="../../../../../fpc/rtl/win/wininc/ascdef.inc"/>
<CursorPos X="120" Y="182"/>
<Filename Value="C:/fpc/rtl/win/wininc/ascdef.inc"/>
<TopLine Value="167"/>
<CursorPos X="120" Y="182"/>
<UsageCount Value="9"/>
</Unit44>
<Unit45>
<Filename Value="../../../../../Lazarus/lcl/stdctrls.pp"/>
<Filename Value="C:/Lazarus/lcl/stdctrls.pp"/>
<UnitName Value="StdCtrls"/>
<CursorPos X="33" Y="677"/>
<TopLine Value="662"/>
<CursorPos X="33" Y="677"/>
<UsageCount Value="10"/>
</Unit45>
<Unit46>
<Filename Value="../../../../../Lazarus/lcl/interfaces/win32/win32def.pp"/>
<Filename Value="C:/Lazarus/lcl/interfaces/win32/win32def.pp"/>
<UnitName Value="Win32Def"/>
<CursorPos X="1" Y="10"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="10"/>
<UsageCount Value="9"/>
</Unit46>
<Unit47>
<Filename Value="../../../../../Lazarus/lcl/interfaces/win32/win32wsstdctrls.pp"/>
<Filename Value="C:/Lazarus/lcl/interfaces/win32/win32wsstdctrls.pp"/>
<UnitName Value="Win32WSStdCtrls"/>
<CursorPos X="26" Y="83"/>
<TopLine Value="67"/>
<CursorPos X="26" Y="83"/>
<UsageCount Value="10"/>
</Unit47>
<Unit48>
<Filename Value="../../../../../Lazarus/lcl/widgetset/wsstdctrls.pp"/>
<Filename Value="C:/Lazarus/lcl/widgetset/wsstdctrls.pp"/>
<UnitName Value="WSStdCtrls"/>
<CursorPos X="36" Y="53"/>
<TopLine Value="39"/>
<CursorPos X="36" Y="53"/>
<UsageCount Value="10"/>
</Unit48>
<Unit49>
<Filename Value="../../../../../Lazarus/lcl/widgetset/wscontrols.pp"/>
<Filename Value="C:/Lazarus/lcl/widgetset/wscontrols.pp"/>
<UnitName Value="WSControls"/>
<CursorPos X="30" Y="100"/>
<TopLine Value="85"/>
<CursorPos X="30" Y="100"/>
<UsageCount Value="10"/>
</Unit49>
<Unit50>
<Filename Value="../../../../../Lazarus/lcl/interfaces/win32/win32wscontrols.pp"/>
<Filename Value="C:/Lazarus/lcl/interfaces/win32/win32wscontrols.pp"/>
<UnitName Value="Win32WSControls"/>
<CursorPos X="1" Y="450"/>
<TopLine Value="434"/>
<CursorPos X="1" Y="450"/>
<UsageCount Value="10"/>
</Unit50>
<Unit51>
<Filename Value="../../../../../Lazarus/lcl/include/customlabel.inc"/>
<CursorPos X="3" Y="229"/>
<Filename Value="C:/Lazarus/lcl/include/customlabel.inc"/>
<TopLine Value="227"/>
<CursorPos X="3" Y="229"/>
<UsageCount Value="10"/>
</Unit51>
<Unit52>
<Filename Value="../../../../../Lazarus/lcl/controls.pp"/>
<Filename Value="C:/Lazarus/lcl/controls.pp"/>
<UnitName Value="Controls"/>
<CursorPos X="24" Y="1784"/>
<TopLine Value="1769"/>
<CursorPos X="24" Y="1784"/>
<UsageCount Value="10"/>
</Unit52>
<Unit53>
<Filename Value="../../../../../Lazarus/lcl/include/wincontrol.inc"/>
<CursorPos X="5" Y="4342"/>
<Filename Value="C:/Lazarus/lcl/include/wincontrol.inc"/>
<TopLine Value="4334"/>
<CursorPos X="5" Y="4342"/>
<UsageCount Value="10"/>
</Unit53>
<Unit54>
<Filename Value="../../richmemofactory.pas"/>
<UnitName Value="RichMemoFactory"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="13" Y="11"/>
<SyntaxHighlighter Value="FreePascal"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Text"/>
</Unit54>
<Unit55>
<Filename Value="../../../lazarus/lcl/widgetset/wslclclasses.pp"/>
<UnitName Value="WSLCLClasses"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="64"/>
<CursorPos X="87" Y="78"/>
<SyntaxHighlighter Value="FreePascal"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Text"/>
</Unit55>
</Units>
<JumpHistory Count="16" HistoryIndex="15">
<JumpHistory Count="22" HistoryIndex="21">
<Position1>
<Filename Value="unit1.pas"/>
<Caret Line="24" Column="16" TopLine="1"/>
@ -487,6 +520,30 @@
<Filename Value="../../win32/win32richmemo.pas"/>
<Caret Line="207" Column="1" TopLine="192"/>
</Position16>
<Position17>
<Filename Value="../../richmemofactory.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position17>
<Position18>
<Filename Value="../../richmemofactory.pas"/>
<Caret Line="28" Column="21" TopLine="6"/>
</Position18>
<Position19>
<Filename Value="../../richmemofactory.pas"/>
<Caret Line="22" Column="29" TopLine="6"/>
</Position19>
<Position20>
<Filename Value="../../win32/win32richmemo.pas"/>
<Caret Line="231" Column="36" TopLine="216"/>
</Position20>
<Position21>
<Filename Value="../../richmemofactory.pas"/>
<Caret Line="11" Column="12" TopLine="7"/>
</Position21>
<Position22>
<Filename Value="project1.lpr"/>
<Caret Line="6" Column="12" TopLine="1"/>
</Position22>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>

View File

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