DHTMLEdit - Pre Sale Questions
Absolute positioning and custom tags
Thread Starter: ttm Started: 10/30/2007 2:49 PM UTC
Replies: 4
Absolute positioning and custom tags
Hello,
  Before purchase I would like to know if your component supports absolute positioning, I have tested the demo application and while components in absolute positioning are shown, cannot be moved on the page, are locked to the position they are.

Also, I would like to know if you provide some way to provide dynamic contents for custom tags, for example, if in an HTML page, there is a <customtag>, can I get notified that the controls needs the HTML source code for that tag?

Regards

Re: Absolute positioning and custom tags
Hello ttm:

Before purchase I would like to know if your component supports absolute positioning

Yes, it does.

I have tested the demo application and while components in absolute positioning are shown, cannot be moved on the page, are locked to the position they are.

To move a control around the page, the page itself must have some dimensions. For example, insert a picture in an empty editor, select that picture and toggle its absolute positioning, then insert some text or spaces in the editor or add some blank lines. Now you can move the picture around the HTML document. (If you select 'View' | 'Details' from the main menu, things may become clearer).

Also, I would like to know if you provide some way to provide dynamic contents for custom tags, for example, if in an HTML page, there is a <customtag>, can I get notified that the controls needs the HTML source code for that tag?

Yes, there exists the TagsSubstitution property.


-Nicholas
Re: Absolute positioning and custom tags
Thanks a lot for your fast reply, let me explain a bit better:

My requeriments for absolute positioning are:
-The control must be drag and drop to anywhere in the html document and the left and top coordinates specified in the style attribute must be updated accordingly:

<textarea style="Z-INDEX: 101; LEFT: 462px; POSITION: absolute; TOP: 294px"></textarea>

I don't know if this behaviour is built-in in your component or would I need to program that to react to drop of elements. You can test the behaviour I need if you use Delphi 2006/2007, create a new HTML document and set the PageLayout property to GridLayout.

My requeriments for custom tags are:
-The document may contain custom tags like:

<asp:button>

-I don't wan't to replace the tag in the source of the document, I need to know, when the DHTMLEdit control is going to render that tag, because is unknown to it, I will provide the html code used to render that tag in the editor, but not substitute the tag in the source code.

I'm keen to buy the component, as in any case, provides a lot of the functionality I need, I just need to know if that behaviour is built-in, or even is possible to achieve that.

Regards
Re: Absolute positioning and custom tags
My requeriments for absolute positioning are:
-The control must be drag and drop to anywhere in the html document and the left and top coordinates specified in the style attribute must be updated accordingly:
<textarea style="Z-INDEX: 101; LEFT: 462px; POSITION: absolute; TOP: 294px"></textarea>

Yes, this is possible:

procedure TForm1.ProfDHTMLEdit21Create(Sender: TObject);
const
 CGID_MSHTML: TGUID = '{DE4BA900-59CA-11CF-9592-444553540000}';
 IDM_2D_POSITION = 2394;
var
 D: IDispatch;
 vaOut: OleVariant;
begin
 if (Sender as TProfDHTMLEdit2).GetDOM(D) then
   (D as IOleCommandTarget).Exec(@CGID_MSHTML, IDM_2D_POSITION, OLECMDEXECOPT_DODEFAULT, True, vaOut)
end;

My requeriments for custom tags are:
-The document may contain custom tags like:
<asp:button>
-I don't wan't to replace the tag in the source of the document, I need to know, when the DHTMLEdit control is going to render that tag, because is unknown to it, I will provide the html code used to render that tag in the editor, but not substitute the tag in the source code.

Yes, this is possible, but not the way you describe - you can't simply provide an HTML code to render your custom tags. You need to implement IElementBehaviorFactory, IElementBehavior, and IHTMLPainter (type TMyHighlightBehavior = class(TInterfacedObject, IElementBehaviorFactory, IElementBehavior, IHTMLPainter)) and put some appropriate GDI calls in the Draw method to render your custom tags. Then attach the behavior class with that implementation to your custom tags.


-Nicholas
Re: Absolute positioning and custom tags
Exactly what I need, I have just placed an order, thanks a lot for your help.