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

2006-2019, 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 2)

In this part of our lesson we will divide our application into two source files

1 - Main.SSF Contains the main window

2 - Sub.SSF contains the welcome class

we will add a new step to our goal in Main.SSF to call the source file (Sub.PRG)

to do this we will use the component (Set procedure to)

the source file (Sub.PRG) is a source code file generated from (Sub.SSF)

(Sub.SSF) is a (Server Extension)

to set (Sub.SSF) as (Server Extension)

1 - open Sub.SSF

2 - open Server Units Window

3 - Goto compile tab

4 - set checkbox (Server Extension) On

2 - Implementation Steps

s1.JPG

Fig. (1) Goal Desginer - Steps Tree

Select the step (The First Step)

We will start now new interaction process to generate new steps to our steps tree.

The slow way (Using Mouse):

                1 - Click Interact to open the components browser

                2 - Select the domain (Structure Programming)

                3 - Select the component (Set Procedure To)

The fast way (Using Keyboard shortcuts):

                1 - Get the component using its name by typing (Set Procedure To)

                Note : Stop typing when you see the required component is selected

s2.JPG

Fig. (2) Component Browser – Select the component (Set Procedure To)

After selecting the component click Ok or press ENTER

s3.JPG

Fig. (3) Interaction page - Set the properties and enter the required data as in the image above

s4.JPG

Fig. (4) Goal Desginer -  Steps Tree

3 - Final Steps Tree

-----------------

SUB.SSF

-----------------

Classes

                Define Class windowwelcome

                                Declare Class Data

                                Declare Class Methods

                                                Method showwindow

                                                Method closewindow

                                                Method sayhello

                                End of Class

                                Class Methods

                                                Define Method showwindow Class windowwelcome

                                                                Start Here

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

                                                                                                Window Events

                                                                                                Window Properties

                                                                                                Window Controls

                                                                                                                Define Label ( lbl1 ) , Caption : "Name"

                                                                                                                                Label Events

                                                                                                                                Label Properties

                                                                                                                Define TextBox ( text1 )

                                                                                                                                TextBox EVENTS

                                                                                                                                TextBox Properties

                                                                                                                Define New Button ( btn1 ) , Caption : "Say Hello"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:sayhello()

                                                                                                                                Button Properties

                                                                                                                Define New Button ( btn2 ) , Caption : "Close Window"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:closewindow()

                                                                                                                                Button Properties

                                                                                                End Of Window

                                                                                                winwelcome.Center ( )

                                                                                                Activate window

                                                                End of Method (Return 0)

                                                Define Method closewindow Class windowwelcome

                                                                Start Here

                                                                                winwelcome.Release ( )

                                                                End of Method (Return 0)

                                                Define Method sayhello Class windowwelcome

                                                                Start Here

                                                                                myname = winwelcome.text1.Value

                                                                                Show Message "Hello " + myname Title "Welcome" Type: Message Box

                                                                End of Method (Return 0)

-----------------

MAIN.SSF

-----------------

The First Step

                Set Procedure to "Sub.PRG"

                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 ( "Welcome" )

                                                                                                                Define ITEM ( "Close System" )

                                                                                                END OF POPUP

                                                                END OF MAIN MENU

                                End Of Window

                                win1.Maximize ( )

                                Activate window

Procedures

                Define Procedure callwelcome

                                Start Here

                                                Create Object myobj of Class windowwelcome

                                                myout = myobj.showwindow()

                                End of Procedure

                Define Procedure closesystem

                                Start Here

                                                win1.Release ( )

                                End of Procedure

4 - Application during the runtime

runtime1.JPG

Fig. (5) Application during the runtime

runtime2.JPG

Fig. (6) Application during the runtime

runtime3.JPG

Fig. (7) Application during the runtime

runtime4.JPG

Fig. (8) Application during the runtime

runtime5.JPG

Fig. (9) Application during the runtime