TIpHtmlPanel does not allow creating controls on the fly
Original Reporter info from Mantis: pgimeno
-
Reporter name: Pedro Gimeno
Original Reporter info from Mantis: pgimeno
- Reporter name: Pedro Gimeno
Description:
This is probably more of a feature request than a bug, not sure. Currently, dynamically creating a node that is associated to a control (e.g. a TIpHtmlNodeBUTTON node), does not create the associated control.
Steps to reproduce:
Place this in the FormCreate of a form of type TForm1 that contains a TIpHtmlPanel called IpHtmlPanel1:
procedure TForm1.FormCreate(Sender: TObject); var Body: TIpHtmlNode; Node: TIpHtmlNode; begin IpHtmlPanel1.SetHtmlFromStr(#60'body>' + 'this works: '#60'button type="button" value="hi">'#60'/button> but'#60'br>' + #60'/body>'); Body := IpHtmlPanel1.MasterFrame.Html.HtmlNode.ChildNode[0]; TIpHtmlNodeText.Create(Body).ANSIText := 'this doesn''t: '; TIpHtmlNodeBUTTON.Create(Body).value := 'hi'; TIpHtmlNodeText.Create(Body).ANSIText := ' see?'; end;
Additional information:
The reason is that all controls are created in a single place, namely in the InternalCreateFrames function, so the code is not really prepared to handle dynamic addition of controls.