Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Aug 12, 2015 · 3 comments
Open

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 28 May 2014 at 12:54

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Answered
  • Added labels: Type-Question
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Thank you for your quick reply.

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

Original comment by [email protected] on 29 May 2014 at 2:23

@GoogleCodeExporter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant