[Lazarus] Question about TRichMemo

silvioprog silvioprog at gmail.com
Thu Nov 3 03:25:11 CET 2016


On Wed, Nov 2, 2016 at 9:09 PM, Dmitry Boyarintsev via Lazarus <
lazarus at lists.lazarus-ide.org> wrote:

> On Wed, Nov 2, 2016 at 7:25 PM, silvioprog via Lazarus <
> lazarus at lists.lazarus-ide.org> wrote:
>
>>
>> Done: http://bugs.freepascal.org/view.php?id=30852 .
>>
> Yep, totally fine. Should accept it tonight. Thank you.
>

Perfect! :-)

I had some ideas, and I can send small patches showing them. For example,
what do you think about adding the GetLink() method in the TCustomRichMemo
class and the href:string attribute in the TLinkMouseInfo record? It can
allow the programmer to do something like this:

procedure TForm1.RichMemo1LinkAction(Sender: TObject; ALinkAction:
TLinkAction;
  const info: TLinkMouseInfo; LinkStart, LinkLen: Integer);
var
  Link: string;
begin
  if RichMemo1.GetLink(LinkStart, LinkLen, Link) then
    OpenURL(Link);
end;

or:

var
  Link: string;
begin
  Link := RichMemo1.GetLink(LinkStart, LinkLen);
  if Link <> '' then
    OpenURL(Link);
end;

or just (easiest way):

procedure TForm1.RichMemo1LinkAction(Sender: TObject; ALinkAction:
TLinkAction;
  const info: TLinkMouseInfo; LinkStart, LinkLen: Integer);
begin
    OpenURL(info.href);
...

I can implement it easily on GTK using
g_object_set_data()/g_object_get_data() doing small changes in the
SetTextUIParams()/GetTextUIParams()/Gtk2_RichMemoMouseButton() functions,
however, it depends on your decision, if so, I can send a patch asap (first
version for GTK but future patch for win-VCL). :-)


> ps. this component should be installed as default in Lazarus IDE. ;-)
>>
> It's not my call.
>
> Including a component into an IDE is a big administrative issue.
> The main question is - how - the component is included: as a part of LCL
> (default components set) or as 3d-party component.
>
> If the component to become LCL-default component, then the whole work of
> maintaining it goes to respective widgetset maintainers.
> If the component to go as a 3d party component, then it needs some sort of
> versioning in place (and this is not the case for richmemo). So it would be
> clear which version (revision) of the component goes with the next Lazarus
> release.
>
> thanks,
> Dmitry.
>

Indeed. Anyway, I hope to see this (awesome) component installed by default
in Lazarus IDE some day. :-)

-- 
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161102/62851013/attachment.html>


More information about the Lazarus mailing list