Jump to content

UniHTMLMemo autoscroll


stiaan

Recommended Posts

Hi

 

Can anybody please assist:

I'm busy developing a UniGUI system that captures the realtime output of a console application and is then displayed it in a TUniHTMLMemo control. I need to be able to scroll as the text comes in from the console app.

 

The application successfully captures the output, but I need to scroll and show the latest line.

 

Much appreciated!

 

Regards

Stiaan

Link to comment
Share on other sites

Hi

 

Can anybody please assist:

I'm busy developing a UniGUI system that captures the realtime output of a console application and is then displayed it in a TUniHTMLMemo control. I need to be able to scroll as the text comes in from the console app.

 

The application successfully captures the output, but I need to scroll and show the latest line.

 

Much appreciated!

 

Regards

Stiaan

 

Hi,

 

You can use ScrollBars property of TUniHTMLMemo to deal with scroll. There you can supply ssBoth, ssNone, ssHorizontal or ssVirtical.

 

Best Regards,

  • Upvote 1
Link to comment
Share on other sites

scroll programmatically to the last line.

 

Hi,

 

For now try:

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  HTMLMemoJSName: string;
begin
  HTMLMemoJSName := UniHTMLMemo1.JSName;
  UniHTMLMemo1.Lines.Add('scroll programmatically to the last line... ');
  UniSession.AddJS('setTimeout(function(){' + HTMLMemoJSName + '.iframeEl.dom.contentWindow.scrollTo(0, ' +
                    HTMLMemoJSName + '.iframeEl.dom.contentWindow.document.body.scrollHeight)}, 50)');
end;

Best regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...