{"id":313,"date":"2022-01-07T18:20:19","date_gmt":"2022-01-07T21:20:19","guid":{"rendered":"https:\/\/gladiston.net.br\/?page_id=313"},"modified":"2022-07-13T16:05:15","modified_gmt":"2022-07-13T19:05:15","slug":"htmlviewer","status":"publish","type":"page","link":"https:\/\/gladiston.net.br\/en\/programacao\/lazarus-ide\/htmlviewer\/","title":{"rendered":"HtmlViewer(FrameViewer)"},"content":{"rendered":"<p>Initially it was called THtmlPort, but in the last versions I find it with the name of HtmlViewer. Whatever the correct name today, it is a suite of components (THtmlViewer, TFrameViewer and TFrameBrowser) that allow us to display HTML formatted text.<\/p>\n\n\n\n<p>It&#039;s not a web browser but a panel capable of displaying pure HTML code with hyperlink and all, that HTML code can come from instructions in code form or from external files like an index.html saved on disk. Its panel is well behaved and its borders and scrollbars can be hidden, it can be small to the point of being confused with a TLabel which opens up a series of possibilities, since a conventional TLabel doesn&#039;t allow HTML tags, but it can also get bigger looking like if with a TMemo\/TRichedit, but without the editing feature, after all this component only displays HTML code, but does not allow editing them.<\/p>\n\n\n\n<p>See this simple example of how to use it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var sHtml_Code:String begin sHtml_Code:=&amp;#039;&lt;h3&gt;Additional information&lt;\/h3&gt;&amp;#039;; sHtml_Code:=sHtml_Code+&amp;#039;&lt;p&gt;Order #9999 was &lt;strong&gt;called off&lt;\/strong&gt;&lt;\/p&gt;&amp;#039;; \/\/ my preferred way \/\/ Note: HtmlViewer1 is the HtmlViewer1.Clear component; HtmlViewer1.LoadFromString(sHtml_Code); \/\/ another form that is also accepted: \/\/HtmlViewer1.Text:=sHtml_Code; end;<\/code><\/pre>\n\n\n\n<p>I consider it essential in my applications. You can also use it in Delphi in the commercial version and Community Edition.<\/p>\n\n\n\n<p>Read the documentation at the links below to learn how to use it.<\/p>\n\n\n\n<p>More information at:<br><a href=\"https:\/\/wiki.lazarus.freepascal.org\/THtmlPort\">https:\/\/wiki.lazarus.freepascal.org\/THtmlPort<\/a><br><a href=\"https:\/\/github.com\/digao-dalpiaz\/DzHTMLText\">https:\/\/github.com\/digao-dalpiaz\/DzHTMLText<\/a><\/p>\n\n\n\n<p>If you are looking for more examples, please read this other article titled \u201c<a href=\"https:\/\/gladiston.net.br\/en\/?page_id=358\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"learning by example\">learning by example<\/a>\u201c, in it you will find many examples.<\/p>","protected":false},"excerpt":{"rendered":"<p>Inicialmente ele chamava-se THtmlPort, mas nas ultimas vers\u00f5es encontro ele com o nome de HtmlViewer. Seja qual for o nome correto hoje, trata-se de uma su\u00edte de componentes(THtmlViewer, TFrameViewer e TFrameBrowser) que nos permite exibir texto formatado em HTML. N\u00e3o \u00e9 um navegador de internet, mas um painel capaz de exibir um c\u00f3digo HTML puro [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":159,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/template-full-width.php","meta":{"footnotes":""},"class_list":["post-313","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/comments?post=313"}],"version-history":[{"count":8,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/313\/revisions"}],"predecessor-version":[{"id":1178,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/313\/revisions\/1178"}],"up":[{"embeddable":true,"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/pages\/159"}],"wp:attachment":[{"href":"https:\/\/gladiston.net.br\/en\/wp-json\/wp\/v2\/media?parent=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}