richmemo: update link sample to be pure GUI application, properly name button captions

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4078 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2015-04-06 03:11:57 +00:00
parent 0fe137b895
commit bb76adab15
3 changed files with 19 additions and 8 deletions

View File

@ -46,6 +46,7 @@
<Filename Value="unit1.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
</Unit1>
@ -61,6 +62,13 @@
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerMessages>
<MsgFileName Value=""/>

View File

@ -16,7 +16,9 @@ object Form1: TForm1
Anchors = [akTop, akLeft, akRight, akBottom]
HideSelection = False
Lines.Strings = (
'RichMemo1'
'RichMemo1 RichMemo1 '
'RichMemo1 RichMemo1 '
'RichMemo1 RichMemo1 '
)
OnMouseUp = RichMemo1MouseUp
TabOrder = 0
@ -26,17 +28,17 @@ object Form1: TForm1
Left = 8
Height = 25
Top = 8
Width = 75
Caption = 'Button1'
Width = 96
Caption = 'Make Link'
OnClick = Button1Click
TabOrder = 1
end
object Button2: TButton
Left = 88
Left = 120
Height = 25
Top = 8
Width = 75
Caption = 'Button2'
Width = 96
Caption = 'Unlink'
OnClick = Button2Click
TabOrder = 2
end

View File

@ -61,8 +61,9 @@ end;
procedure TForm1.OnLinkAction(Sender: TObject; AAction: TLinkAction;
const AMouseInfo: TLinkMouseInfo; StartChar, LenChars: Integer);
begin
if AMouseInfo.button = mbLeft then
writeln('sel: ', StartChar,' ', LenChars);
if AMouseInfo.button = mbLeft then begin
ShowMessage( 'Link Text: "'+RichMemo1.GetText(StartChar, LenChars)+'"' );
end;
end;
end.