Multi-informatica
 

 

 

Products

 

Resources

 

 

 

THtm

THtm is the basic HTML rendering engine element. Basically is a HTML tag, with a content that can be new sub-HTMLTags.

The Thtm class have 4 mains members (properties).

The HTML Type: Which start the HTML tag. (Ej.with lttd) ... and finish

The params: Which are embebed in the HTML init tag. 'border=1' 'name="myname1"

The contenido which are a string that can be read as HTML code.

And the contents property which is a list of Thtm classes.

Before any Gp response, there is created a 'structure tree' of Thtm elements in which each element can have more Thml elements as children. Then by the render procedure, this elements are writed in a stream as HTML code.

The function is similar to IntraWeb TIWHTMLTag but there is some differences, 

use TlinkTag types instead strings . This is good for fast construction, (is better handle enum types than string types). The render instruction make the rest.

Is more secure for typed bugs. If String construction, you can write some like

mySH := tpHtml.createtag ('TABNLE'); 

// an error in 'n' for fast type, you can execute the program, but it don't work

    mySH := tgpHtml.createtag (ltTABNLE); 

//  I can't compile the program,  then I fix the error and run and work.

Have some extension for handle integer constant like string.

Example. mySH.addtagk (lth5,kstrWellcome);

Say make a <h5> tag with the constant integer KstrWellcome (which represent a 'Wellcome' or 'Bienvenido' string it depending of language)

Table  extension for optimal code.

mySH.addcell ('my cell') 

// instead

mySH.Contents.AddTag('TD').Contents.AddText('my cell');

overview library

 

 

TgpHtml = class    
protected      
  property contents :TList; list of sub-htmltag nodes
  property taL:Tagp;  
   

param,
contenido:string;
autofin:tautofin;
template__:integer;
sttemplate : string;

 
       
public methods    
  function addcell (const tit:string): TgpHtml;
create a TgpHtml node as a table cell with tit content
  procedure

addcellInt(dato:integer);

add the integer dato as cell in table
  function addcells (datos:array of const):TgpHtml; // create a table row with cells content in datos array.
// Each item of datos array in different cell. This items, can be
// string, integer, etc... If is a class, write the class name
// and if is a TgpHtml then is rendered as content.
  function addcellOb(o:TgpHtml):TgpHtml;
create a cell table with the TgpHtml object as content
  function addcontrol
(tip:tinputhtml; const na,value:string; h,size:integer):TgpHtml;
Add a control form with name, value, size... params.
The type is defined in TinputHTML param
  procedure AddintegerParamk (kk:integer; valor:integer); Add a integer param to the Html Tag
  function

AddO (spytag:TgpHtml):TgpHtml;

include a TgpHtml node in the list.
  procedure Addparam (const par:string);  
  procedure adds (const tx:string); Add a string to the render list.
  function addtag(lt:Tagp):TgpHtml; create a tgphtml node. lt = kind of HTML tag
  procedure addStrings(const tx:tstringlist); Add the Tstring items to the render list
  function addtagk (lt:Tagp; ks:integer):TgpHtml; add a tgphtml node.
  function renderme :string; Convert to HTML String format the contenst of the list.
  procedure renderStream(sss:Tstream);
Convert to HTML String format the contenst and output to a stream.
at the final of renderStream function , the list is deleted.
  constructor createtag (lt:Tagp);
createtags (lt:Tagp; const tit:string);
creaTag (lt:Tagp;spytag:TgpHtml);
creatagName (lt:Tagp; const na:string);
{create a tag html node}
   




public

function addTrd (o:TgpHtml):TgpHtml;


function addtagid(lt:Tagp; const ids:string):TgpHtml;

function addtagClass(lt:Tagp; cla:TclassStyle):TgpHtml;

function addtagObject(lt:Tagp;spytag:TgpHtml):TgpHtml;
function addTD:TgpHtml;
{ create a TgpHtml node. lt : kind of HTML tag }
function addtagConst (lt:Tagp; datos:array of const):TgpHtml;
function addth (const tit:string):TgpHtml;
procedure addcellpads0;


//?
Function addJavaScript ( const programa : string ) : TgpHtml;
function addInputBB (kknom:integer):TgpHtml;

//?
procedure Addrefinput (const na:string);

procedure AddStringParamK (kk:integer;const valor:string);
procedure AddTitleiF (const valor:string);
procedure AddTypeInput(buttontyp:tinputhtml);
//?
// procedure AddParamClass (const nn:TclassStyle);

procedure AddparamK(pa:integer);
procedure AddParamName(const valor:string);
//Add a integer param to the Html Tag
procedure AddintegerParamk (kk:integer; valor:integer);
procedure AddParamValue (const valor:string);
function addtags (lt:Tagp; const tit:string):TgpHtml;

procedure addError (const tx:string);
//?
function adddoble(const tit,dato:string):TgpHtml;
procedure AddStringParam (const kk:string;const valor:string);

public

function addcellK (kk:integer):TgpHtml;
function addTHs(kk:array of integer):TgpHtml;
function addValue(const tit:string; dato:integer):TgpHtml;
function addCellClass(const tit:string;kk:TclassStyle):TgpHtml;

function addTR:TgpHtml;
Procedure valignTop;

property template : string read gettemplate write settemplate;


end;

 

 

Method Description
addStrings

procedure (const tx:tstringlist)

Add the Tstring items to the render list.

 

thtmladdr = class ( tgphtml )

TspyHtml extension for link tag <a>

Method Description
CreateLink

constructor CreateLink ( const dir : string )

create a tgphtml node which link to the link in datos,

 

 

 

 

 

 

   

 

 

 

Teléfono: 978-610539 - Fax: 978-610861 -Trav.Agustina Aragón 1,1e 44002 Teruel ( España ).webmaster

Copyright © 1997-2004 , [Multi-Informatica Teruel, S.L].La información contenida en este documento está sujeta a modificaciones sin previo aviso. Otros productos u organizaciones mencionadas aquí son marcas comerciales o marcas registradas propiedad de sus respectivas organizaciones o propietarios.

  Zapatec