PWCT 1.9 Art Documentation ( http://doublesvsoop.sourceforge.net )

2006-2013, Mahmoud Fayed ( msfclipper@users.sourceforge.net )

_____________________________________________________________________________________

Table of contents

1 - Introduction

2 - Implementation steps

3 - Final Steps Tree

4 Application during the runtime

1 - Introduction

In this lesson we are going to learn how to develop large applications using HarbourPWCT (Part 5)

In this part of our lesson we will create a  new application using the (Main Window) template and the (Sub Window) Template

 

 2 Implementation steps

 

 

Create new file

 

s1.JPG

Fig. (1)

 

Select the template (Main Window)

 

s2.JPG

Fig. (2)

 

File name : Main.SSF

 

s3.JPG

Fig. (3)

 

s4.JPG

Fig. (4)

 

Run the application

 

s5.JPG

Fig. (5)

 

s6.JPG

Fig. (6)

 

Create new file using the template ( Sub Window )

 

s7.JPG

Fig. (7)

 

File Name ( About.SSF )

 

s8.JPG

Fig. (8)

 

s9.JPG

Fig. (9)

 

Modify the class name to (AboutClass)

 

s10.JPG

Fig. (10)

 

s11.JPG

Fig. (11)

 

s12.JPG

Fig. (12)

 

Modify the window name to (AboutWindow)

 

s13.JPG

Fig. (13)

 

s14.JPG

Fig. (14)

 

s15.JPG

Fig. (15)

 

s16.JPG

Fig. (16)

 

Generate the source code file (About.PRG)

 

s17.JPG

Fig. (17)

 

Open the file (Main.SSF)

 

s18.JPG

Fig. (18)

 

s19.JPG

Fig. (19)

 

Use the component (Set procedure to) to call the source file (About.PRG)

 

s20.JPG

Fig. (20)

 

s21.JPG

Fig. (21)

 

s22.JPG

Fig. (22)

 

Create object (AboutObject) of class (AboutClass)

 

s23.JPG

Fig. (23)

 

Use the component (New Object)

 

s24.JPG

Fig. (24)

 

s25.JPG

Fig. (25)

 

s26.JPG

Fig. (26)

 

s27.JPG

Fig. (27)

 

Add new menu item to call the about window

 

s28.JPG

Fig. (28)

 

When the user click (About) the method (ShowWindow) related to the object (AboutObject) will be invoked

 

s29.JPG

Fig. (29)

 

Move the generated step up

 

s30.JPG

Fig. (30)

 

s31.JPG

Fig. (31)

 

Run the application (CTRL+R)

 

3 Final Steps Tree

============

Main.SSF

============

 

The First Step

                Load System Modules

                                Set Procedure to "About.PRG"

                Create System Objects

                                Create Object AboutObject of Class AboutClass

                Define New Window  ( win1 ) , Title : "System"

                                Window Events

                                Window Properties

                                Window Controls

                                                START OF MAIN MENU

                                                                MENU POPUPS

                                                                                DEFINE POPUP "File"

                                                                                                POPUP ITEMS

                                                                                                                Define ITEM ( "About" )

                                                                                                                Define ITEM ( "Close System" )

                                                                                                END OF POPUP

                                                                END OF MAIN MENU

                                                Define New Statusbar

                                                                Items

                                                                                Define New StatusItem ( "Ready" )

                                                                                                Events

                                                                                                Properties

                                                                                Keyboard

                                                                                                Events

                                                                                                Properties

                                                                                Clock

                                                                                                Events

                                                                                                Properties

                                                                End Statusbar

                                End Of Window

                                win1.Maximize ( )

                                Activate window

Procedures

                Define Procedure closesystem

                                Start Here

                                                win1.Release ( )

                                End of Procedure

 

============

About.SSF

============

 

Set Class Name & Window Name

                PWCT-Code Generator: Replace String (MyClassName) with (AboutClass)

                PWCT-Code Generator: Replace String (MyWindowName) with (&(self:cWindowName))

Class

                Define Class MyClassName

                                Declare Class Data

                                                Data cWindowName Init Value "AboutWindow"

                                Declare Class Methods

                                                Method showwindow

                                                Method closewindow

                                End of Class

                                Class Methods

                                                Define Method showwindow Class MyClassName

                                                                Start Here

                                                                                Define New Window  ( MyWindowName ) , Title : "Welcome"

                                                                                                Window Events

                                                                                                Window Properties

                                                                                                Window Controls

                                                                                                                Define New Button ( btnClose ) , Caption : "Close"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:closewindow

                                                                                                                                Button Properties

                                                                                                End Of Window

                                                                                                MyWindowName.Center ( )

                                                                                                Activate window

                                                                End of Method (Return 0)

                                                Define Method closewindow Class MyClassName

                                                                Start Here

                                                                                MyWindowName.Release ( )

                                                                End of Method (Return 0)

 

 

4 Application during the runtime

 

s32.JPG

Fig. (32)

 

s33.JPG

Fig. (33)