Recent

Author Topic: THTMLViewer and Copy SelText  (Read 2359 times)

KarenT

  • Full Member
  • ***
  • Posts: 120
THTMLViewer and Copy SelText
« on: April 09, 2018, 07:39:08 pm »
Hi All, I suspect this might be a "feature" of using Ubuntu 16.04 and Unity, but the THTMLViewer.SelText has a padlock on it in the drop-down. The Source shows it as a UnicodeString.

Try as I might I cannot figure out a way to copy selected text.

Is there an "Inner text" and "Outer text" option with this Viewer? I have not yet found it -- yet. :)

How can I copy selected text?

Thank you.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: THTMLViewer and Copy SelText
« Reply #1 on: April 09, 2018, 11:02:04 pm »
I would guess that a simple unicodestrng would be all you need.....

MyString := THTMLWhatEver.SelText;


Now if I understand that all selected text should now be in MyString;
The only true wisdom is knowing you know nothing

KarenT

  • Full Member
  • ***
  • Posts: 120
Re: THTMLViewer and Copy SelText
« Reply #2 on: April 10, 2018, 05:49:08 pm »
MyString := THTMLWhatEver.SelText;
Now if I understand that all selected text should now be in MyString;

Thank you Jamie, sarcasm, often entertaining but never helpful. A blind frog would have safely assumed that I had already tried every common method. To wit, "try as I might," could have been a small clue.

But, having mentioned Ubuntu in the OP -- and -- if you were really interested in helping, that should have  been a clue for you to first do a little research. I have seen this issue lamented before by Ubuntu/Lazarus hopefuls. AND, that's why I asked about the "inner text"and "outer text" that is available in the Delphi WebBrowser Component. As I could probably have found the text I was looking for in that and done the .seltext there.


valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: THTMLViewer and Copy SelText
« Reply #3 on: April 10, 2018, 06:09:51 pm »
MyString := THTMLWhatEver.SelText;
Now if I understand that all selected text should now be in MyString;

Thank you Jamie, sarcasm, often entertaining but never helpful.

It's a pity, but Jamie is always doing that.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: THTMLViewer and Copy SelText
« Reply #4 on: April 10, 2018, 11:21:53 pm »
My reply was with the material supplied, there was no mention of actually trying to read the property into a local
string. a UnicodeString;

  I have working WebObject code for the Windows frontend, its kicking around here somewhere, if you don't get an
answer to your problem I'll dig it up from the archives and see if it will compile in Lazarus. This comes from an old
Delphi project.


The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018