Recent

Author Topic: TIpHtmlNode.GetAttributes doesn't works, bug or properties are not implemented?  (Read 5044 times)

SunyD

  • Guest
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

  • Hero Member
  • *****
  • Posts: 11830
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?
« Last Edit: July 22, 2017, 12:03:51 am by wp »

wp

  • Hero Member
  • *****
  • Posts: 11830
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

  • Guest
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

  • Guest
@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

  • Hero Member
  • *****
  • Posts: 11830
I 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
« Last Edit: August 11, 2017, 11:10:39 am by wp »

SunyD

  • Guest
ok thanks.

 

TinyPortal © 2005-2018