Writing your first Delphi App

Last Updated: 7/28/2005



Sections above here:
Home  ยป  Development

Sections below here:

Topics in this section:
Rethinking the User Interface
Writing your first Delphi App
Images and Graphics
Extending Intraweb
Working with COM
Working with ClientDataSets
Creating PDA Applications
Error Handling
Control Size
Reading and writing custom cookies
Miscellaneous
Advanced Development
Session Locking

Search Documentation:

All IntraWeb applications should be created using the IntraWeb Application Wizard in the IntraWeb tab in the repository. Click on File -> New -> Other and then choose the IntraWeb tab. Select the IntraWeb Application Wizard. Finally click Ok.

This creates a framework for a new IntraWeb stand alone application. Although the project can be compiled and executed at this stage, it does not do anything. The standard debug form comes up displaying some information about IW and menu items to debug the application. Selecting the Execute (or pressing the F9 key) menu item will launch the browser with a blank page. This is because main form does not contain any components or functionality yet.

program Project1;
uses
  Forms,
  IWMain,
  ServerController in 'ServerController.pas' {IWServerController: TIWServerController},
  Unit1 in 'Unit1.pas' {IWForm1: TIWFormModuleBase};
{$R *.res}
begin
  Application.Initialize;
  Application.CreateForm(TFormIWMain, formIWMain);
  Application.Run;
end.

The code in the figure above displays the contents of the project file. You can see that it is the same as a standard Delphi application. This is true for stand alone applications.

As mentioned previously, the new project is the basic building block for any IntraWeb application. Like any other Delphi project, a main IntraWeb form is created and can be used as the main form of the application. To demonstrate the power and the facility of IW applications, below, a small example is shown.

  1. Open up the default IWForm (IWUnit1.pas) that has been created.
  2. Drop a TIWButton, TIWEdit and TIWLabel on the form in no particular order.
  3. Assign the following code to the Button's OnClick event:
    procedure TIWFormModule.IWButton1Click(Sender: TObject); 
    begin 
      IWLabel1.Caption := IWEdit1.Text; 
    end; 

Once the steps are complete, compile and run the application. To test it, press the F9 key. The default browser should be launched and display the main form. Enter some text in the text box and click on the button. The output is displayed in the label.



(C) 2002-2009 - Atozed Software Ltd.