kooloveme / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 0 forks source link

Question: how to found the absolute position of a text object? #354

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I need to render a VCL component over the THtmlViewer component in order to 
match its position to the position of na specific html object (text). Is there 
a way to do that?

Keep up the good work!

Best regards,

- Gabriel

Original issue reported on code.google.com by gabriel....@projuris.com.br on 28 May 2014 at 12:54

GoogleCodeExporter commented 9 years ago
Hi Gabriel,

because of the internal representation of text in THtmlViewer you cannot find a 
specific text. But you can find block elements by ID in THtmlViewer.NameList.

Currently the resulting TIDObject gives you the YOffset only.

The upcoming version 11.5 will also provide a DrawRect, if the resulting 
TIDObject is a TSectionBase. TSectionBase is one descendant of TIDObject and 
there might be others in THtmlViewer.NameList as well.

Version 11.5 is developed at https://github.com/BerndGabriel/HtmlViewer.git and 
will be released in July 2014.

OrphanCat

Original comment by OrphanCat on 28 May 2014 at 9:14

GoogleCodeExporter commented 9 years ago
Thank you for your quick reply.

Is that a way to render the VCL control TDateTimePicker inside a <form>? 

Original comment by gabriel....@projuris.com.br on 29 May 2014 at 2:23

GoogleCodeExporter commented 9 years ago
If you want to place VCL controls onto a HTML document you can use <panel> or 
<object> and handle events OnPanel* resp. OnObject*. 

Placing form controls is done internally. For <input> VCL controls are wrapped 
by classes derived from TFormControlObj.

If you are interested in registering your own <input> controls, I could 
implement a method 

RegisterFormControl(const InputType: String; ControlClass: 
TFormControlObjClass);

E.g. calling RegisterFormControl('datetime', TDateTimePickerFormControlObj) 
would allow 

<input type="datetime" value="2014-05-29 18:23:45"> 

which would display the control wrapped by TDateTimePickerFormControlObj.

Original comment by OrphanCat on 29 May 2014 at 4:34