TIpHtmlNode.GetAttributes doesn't works, bug or properties are not
implemented?
lazarus / 5-Lazarus Extra Components
----------------------------------------------------------------------
SunyD · 2017-04-29 00:53
In TIpHtmlPanel you can change attributes (color, size ..) from html-
tags in program without reload the html-source. It is usefull for
creating user interfaces.
But it doesn't work in lazarus, because TIpHtmlNode.GetAttributes
returns always zero.
Is there an error in my code or is that a bug?
I uploaded 2 examples ones without lfm-file, you can compile it with
delphi too.
The second one is lazarus version from simplified TBrowser example
from Iphtml-package.
----------------------------------------------------------------------
wp · 2017-07-21 21:57
Sorry, I completely missed this post...
Only published properties have RTTI, but IpHtmlNodes only declare
public properties. Please try the attached IpHtml unit in which I
published most of the node properties - in my own experiments it seems
to be working, although a lot of properties are marked as
"unsupported" - maybe the selection of published properties is not yet
correct.
The HTML nodes tree is a nice idea and very useful for debugging. Is
it one of the Delphi examples, or is it your code? In the latter case,
would you allow me to add it to the ported examples for Lazarus?
----------------------------------------------------------------------
wp · 2017-07-23 17:03
In r55563, the HTML node properties are published if the define
HTML_RTTI is activated. I also fixed some bugs. Your demo runs fine
now. Since, as I know now, the HTML tree is a reduced version of one
of the original TurboPower demos I condensed it even more and added it
as a sample project to folder examples/turbopower_ipro
(tpiprohtmltree).
----------------------------------------------------------------------
SunyD · 2017-07-23 20:56
Thank you very much, iphtmlpanel has big potential. We can build
dynamic html guis. One thing in iphtml is still missin, page break by
printing.With this it can also used for dynamic reports. I will try to
implement it, when I have time.
You can use the the examples. I think, I converted the example with
"....Tbrowserlaz..." from original version on SourceForge. I think it
has mozillas license. The other example is from me.
I check your commits tomorrow.
----------------------------------------------------------------------
SunyD · 2017-07-24 17:56
@wp
I downloaded today the lazarus 1.8 fixes svn (Rev 55576) and I can't
find any HTML_RTTI-Option in "Defines".
I played with your iphtml-file, it is good, some properties are
missing but I can add it later.
Most of string properties have as type tkAString.
When you add in procedure GetProperty/SetProperty the lines
tkAString : Result := GetStringProperty;
or
tkAString : SetStringProperty;
then you can get and set string values.
When you doubleclick in example app on the property listbox then you
can change the values dynamic, iphtmlpanel shows it immediately.
Thanks again, now I know where the problem was.
----------------------------------------------------------------------
wp · 2017-07-24 18:04
Quote from: Soner A. on July 24, 2017, 07:56:05 pmI can't find any
HTML_RTTI-Option in "Defines".
Initially I had defined it in ipdefine.inc. But then I realized that
it would not be possible to change it from application level this way.
Finally I decided to do it like in the example in
example/turbopower_ipro where the define is added in the project
settings, page "Additions and overrides" which automatically rebuilds
the package according to the usage of new define. See project
(lazarus)/examples/turbopower_ipro/tpiprohtmltree.lpi
----------------------------------------------------------------------
SunyD · 2017-07-24 18:34
ok thanks.