TWHForm2HTML OVERVIEW :  
*********************

TWHForm2HTML, also known as "F2H", is a WYSIWYG form to HTML convertor. 

Drag and drop a TWHForm2HTML component on any Delphi or C++ Builder form and you are ready to convert it to HTML.

A custom editor gives you full control of the HTML attributes used, plus a few options.

Conversion can be done :

- into standard HTML or into WebHub chunks
- at design time or dynamically at run time
- through an export to a disk file or in memory.

As browsers size objects quite differently, the component may address the four main browsers differently in order to keep a common look and feel despite of their different behaviour. (The four are: Netscape 3, Netscape 4, Microsoft IE 3, and MS IE 4.)

Who is the ideal user ? 

- The Delphi developer who has an HTML form to code and doesn't know HTML very well - or who simply wants to save time.  You can use the component at *design time* only, and export the HTML code to integrate it in a static page. By keeping the BrowserFamily property set to bfDefault, the component chooses an average way to size objects, giving an acceptable rendering with all browsers.

- The Delphi developer who has an existing C/S Delphi application to be ported for remote access through the Web, with tens of data entry screens can do it in a breeze.
By adding the component to all the forms for which remote access is needed and including those forms in a WebHub project, a big part of the job is done immediately. In that way of use, keeping the original look and feel of the form is a big plus of course.

SUPPORTED CONTROLS AND CONTAINERS :
*********************************

Controls :
- TLabel
- TMemo (any TCustomMemo)
- TEdit (any TCustomEdit)
- TCheckBox
- TRadioButton
- TComboBox (any TCustomComboBox)
- TListBox (any TCustomListBox)
- TButton
- TImage
- TRadioGroup

Containers :
- TCustomForm
- TGroupBox
- TPanel
- and any other TWinControl container

INSTALLATION :
************

TWHForm2HTML currently supports Delphi 2, Delphi 3 and C++ Builder.

WebHub VCL Developers :
---------------------
- The trial version of F2h is automatically installed on the WebHub palette 
  when you build your component library or package.
- To install the registered version, backup and then replace the 
  following files in ht\lib32 : f2h.* and regf2h.pas.
- Rebuild your component library or package to take advantage of your 
  new code.  D3 and D4 users, note that there is a .BAT file in 
  ht\pkg which will rebuild all your packages (exit Delphi before using it!).


Delphi 3  :
--------

- Unzip the F2H.ZIP file in any folder (F2H_R.ZIP if registered)
- Execute Component|Install component...
- Fill in the "Unit file name" text box with the full path to REGF2H.PAS
- Fill in the "Package file name" area (existing or new package)
- Click the OK button

The component will be installed on a palette named "WebHub".


C++ Builder 3  :
-------------

- Unzip the F2H_C3.ZIP file in any folder (F2H_C3_R.ZIP if registered)
- Execute Component|Install packages...
- Click the first Add... button, select the F2HPKG.BPL file and click the Open button
- Click the OK button

The component will be installed on a palette named "WebHub".

Delphi 2 :
--------

- Unzip the F2H_D2.ZIP file in any folder (F2H_D2_R.ZIP if registered)
- Execute Component|Install...
- Click the Add... button, fill in the "Module name" text box with the full 
  path to REGF2H.PAS, and click the OK button
- Click the OK button

The component will be installed on a palette named "WebHub".

Enjoy !

USE AT DESIGN-TIME :
******************

PROPERTIES FROM THE OBJECT INSPECTOR :
************************************

AlternateFonts : string	= Optional string appended to the 'Face' attribute of the <FONT> tags.
Attributes...		= Open the editor (see below)
BGColor : string	= Fixes the form's background color. Accepts :
			  * [None] : no background color
			  * [Same] : same background color as the Delphi form color
			  * any HTML color name
			  * any HTML color string in the form #RRGGBB
                          * any color picked from the TColorDialog (opened by double clicking)
Browse it !		= Opens the HTML form using your default browser. BrowserFamily should
			  be set in advance.
BrowserFamily		= (bfDefault, bfIE3, bfIE4, bfNS3, bfNS4). Sets the target browser.
			  bfDefault equals bfIE4 because that browser provides the best overall 
                          way of sizing objects.
Browse WebHub chunk !	= Opens the exported WebHub chunk using your default text editor. 
			  BrowserFamily should be set in advance.
ChunkOnly : Boolean	= When exporting in standard mode if ChunkOnly is False, the component
			  exports a whole HTML page, including a page title.
Export HTML...		= Opens a TSaveDialog to perform the export in standard HTML mode
Export WebHub chunk...	= Opens a TSaveDialog to perform the export in the WebHub mode
MainContainer : 
	TWinControl	= By default, TWHForm2HTML converts the whole form. By setting 
			  MainContainer to any other container (groupbox, panel, ...), you may
			  restrict the export to that container.
QualifiedNames :
	Boolean		= If True, the elements' default names are built using the syntax 
			  "FormName[_ContainerName]_ControlName", to make sure that each element's name 
			  is unique throughout your web application.  Otherwise, the short names
                          "ControlName" are used.
SetFonts : Boolean	= If True, TWHForm2HTML uses the <FONT> tag to render the elements' fonts.
                          The controls which are concerned are : labels, radiobuttons and
			  checkboxes.
Version 		= Read-only version information.

THE ATTRIBUTES EDITOR :
*********************

Opened by double clicking on the component, the editor lists the controls in a tree view on the left panel. By selecting a control in the tree, you may check / edit its attributes on the right panel. The first element in the tree (<FORM>..</FORM>) gives you control on the <FORM> tag attributes.

The editor shows four kinds of "attributes" :

- HTML attributes
- Special HTML attributes used when exporting in WebHub mode : they have the same name as the standard 
  attribute, prefixed by 'WH'. Example : Action matches with WHAction for use in WebHub.
- WebHub macros
- TWHForm2HTML options

Only the TWHForm2HTML options are documented here. They vary depending on the control selected :

Options for all elements :
- AfterElement : string		= Lets you insert any HTML code after the element
- BeforeElement : string	= Lets you insert any HTML code before the element

Options for all elements but containers and labels :
- ExtraAttributes		= To define additional HTML attributes (e.g. JavaScript handlers)
				  of the form :
				  'AnAttribute1="Value1" AnAttributeN="ValueN"'

Options for a TForm :
- Border : Boolean		= If True, the form is rendered with a border around it
- ShowCaption : Boolean		= If True, the title bar of the form is kept
- CaptionBGColor : string	= Back color of the title bar if ShowCaption is True
				  Default = 'Navy'
- CaptionColor : string		= Text color of the title bar if ShowCaption is True
				  Default = 'White'

Options for a TButton :
- AsImage : Boolean		= Specifies if the button has to be converted to an <INPUT>
				  tag (standard HTML button, type "submit" or "reset"), or to  
				  an <IMG> tag.

Options for a TImage :
- AsButton : Boolean		= If True, the TImage is translated in an <INPUT Type="image">
				  tag. If False, the TImage can optionally be handled as an anchor.
- AsAnchor : Boolean		= If True, you can edit the HREF link attribute.  

USE AT RUN-TIME :
***************

The component can be used to generate the forms chunks on the fly. A write-only 'CGIUserAgent' property (compatible with TWebServer.CGIUserAgent in WebHub) must be used to inform the component of the target browser.

Example in WebHub mode :

with WHForm2HTML1 do begin
   CGIUserAgent := WebServer1.CGIUserAgent;   // set BrowserFamily automatically
   ExportWHChunkFName := 'aChunk.txt';	      // set the export filename
   if exportWHChunk then		      // function exportWHChunk : Boolean
      // do something with the text file
end;

Instead of writing the chunk to a text file, you can get the WebHub chunk string through the public
property WHChunk : string read getWHChunk.

Example in standard mode :

with WHForm2HTML1 do begin
   CGIUserAgent := WebServer1.CGIUserAgent;   // sets BrowserFamily automatically
   ExportFName := 'aForm.HTML';	      	      // sets the export filename
   if exportHTML then		      	      // function exportHTML : Boolean
      // do something with the HTML page
end;

Instead of writing the page to a text file, you can get the its string through the public
property HTML : string read getHTML.

Notice that if you create controls at run-time, TWHForm2HTML must be informed in order to take those new controls into account. To achieve that, simply call the Synchronize procedure.

As shown below, it's also possible to set attributes on-the-fly.

Example :

var
   attrObject : THAttrObject;
begin
with WHForm2HTML1 do begin
   // Creation of controls on the fly
   // ...
   // ...
   synchronize;   // Now the component knows about them
   // ...
   // Now let's say that you created a TButton named 'Button1' and you
   // need to access the corresponding THButton object in order to set
   // one of its HTML attributes :

   attrObject := WHForm2HTML1.HMainContainer.FindHObjectByName('Button1');
   if attrObject <> nil then begin
      with attrObject do begin
         Attributes['AsImage'].BooleanValue := False;   // set the 'AsImage' option
         Attributes['Type'].Value := 'reset';           // set the 'Type' attribute
      end;
   end;
end;   

Two events pairs (OnBeforeRendering / OnAfterRendering and OnBeforeRenderingControl / OnAfterRenderingControl) may also be used to control the component at run-time.


SYSTEM REQUIREMENTS
You need Delphi 2/3/4 or C++Builder 3. The client/server edition is not required.
WebHub is not required. (What's WebHub? A complete framework for web application 
development, see webhub.com!)


HOME PAGE for the FORM to HTML Converter Component
Includes online interactive demo - no download required.  The FREE trial version 
is linked from this page...   http://www.href.com/dfm2html


TO REGISTER THIS COMPONENT for $99.00
Online via the Web: http://www.href.com/hrefshop:detail::0108
Telephone: (707) 542-0844 Mon-Fri, 9am to 5pm PST.
Fax: (707) 542-0896

THANK YOU!

Author: Philippe Maquet, pm@mail.href.com
Copyright (c) 1998 HREF Tools Corp. All Rights Reserved Worldwide.

###
