Recent

Author Topic: What are the latest recommendations for THtmlViewer and TRichEdit?  (Read 3644 times)

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Platform:  Windows Server Essentials 2016, Lazarus 1.8.1, FPC 3.0.5
Goal 1: To view HTML files like THtmlViewer did in Delphi. 
Goal 2: To write text to an on-screen log, with different colored lines of text in the log. (Log lines that describe a Start or Stop in blue, normal lines in black, and error lines in red). 

TRichEdit matched Goal 2 in Delphi, so I went looking for a Lazarus equivalent and found TRichView http://wiki.freepascal.org/RichView, which looked like it might get me to both Goal 1 and Goal 2, but it does not compile. 
I also downloaded an Html viewer from http://wiki.freepascal.org/THtmlPort, but it looks like they are Delphi installs only.. not for Lazarus (no .lpk files) even though the web page says it's ported to Lazarus.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #1 on: February 12, 2018, 11:16:56 pm »
the online package manager has a couple of richtext components richmemo and richedit(not in OPM) are wrappers around the system rtf support kmemo (http://tkweb.eu/en/delphicomp/kmemo.html )of kControls is said to support rtf but I haven't tested it my self, I had good luck with TRichedit which did almost everything I needed including adding images to the rtf but for your purposes I would try to use KMemo it is native pascal code that does not use the underline system's controls so it will be easier to port to any other system (embeded or not) that might or might not have rtf support. As for the THmlViewer the new version from github (https://github.com/BerndGabriel/HtmlViewer) installs with out problems for me and I think that there is a version on the OPM as well for faster installation.
« Last Edit: February 12, 2018, 11:19:51 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #2 on: February 13, 2018, 03:27:19 am »
Hi tazz.  A few questions:

- What is an "OPM"? Where do I get it?  How do I use it?
- I have the current version (11.8) of THTMLViewer, but as I said, there is no .lpk in the files provided in the download except for the one for FrameViewer09.lpk  I need the .lpk for the THtmlViewer.  How did you install your copy?
- I'm trying to install KMemo, but the compile stops with an error "Unknown identifier" at the UTF8Copy(AText, I, 1); line 4030 of KMemoRTF.  Do you know of a work-around for this?

Thanks tazz.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #3 on: February 13, 2018, 03:37:57 am »
OPM (Online Package Manager) is a handy tool for installing new packages for Lazarus. OPM is installed by default if you have Lazarus version 1.8.0 or above. To activate this tool:

Lazarus main menu > Package > Online Package Manager

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #4 on: February 13, 2018, 03:53:34 am »
Found it!  Thanks Handoko.  However, the package installer chokes on the same line as before:

KMemo install, stops with an error "Unknown identifier" at the UTF8Copy(AText, I, 1); line 4030 of KMemoRTF.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #5 on: February 13, 2018, 04:57:51 am »
I have no problem installing KControls using OPM, everything just run smoothly. I am using Lazarus 1.8.0 64-bit FPC 3.0.4 Gtk2 Ubuntu 17.10.

Below is a screenshot of a simple test of using KMemo:

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #6 on: February 13, 2018, 04:14:33 pm »
I was able to get KControls installed into my Laz 1.8.1, FPC 3.0.5, by adding the unit "LazUTF8" to  the "uses" clause, in the interface section of all KControl units that the compiler got stuck at, complaining of a UTF8 function or identifier not found.  I also had to change the namespace reference that prefixed a "...character..." named function.  It appears that Lazarus's UTF8 functions were placed into their own unit upon some refactoring.

I have not tried out any of the controls, I'm just recording this here for the benefit of others who may follow and have this same problem.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #7 on: February 13, 2018, 06:41:41 pm »
Have you tried KControls + Lazarus 1.8.0 FPC 3.0.4? If it works but not on Laz 1.8.1 FPC 3.0.5, I think you should submit a bug report:

https://bugs.freepascal.org

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: What are the latest recommendations for THtmlViewer and TRichEdit?
« Reply #8 on: February 13, 2018, 08:02:45 pm »
All my install problems were solved by:

- In Lazarus, you have to first click Package, Install/Uninstall Packages, in Available Packages, select OnlinePackageManger.  Save and rebuilt IDE.
- Run the Online Package Manager, and install HtmlViewer and KControls.

Everything works as it should.  All installation problems solved.  I now have an HTMLViewer tab and a KControls tab.

 

TinyPortal © 2005-2018