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 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
Fig. (1)
Select the template (Main Window)
Fig. (2)
File name : Main.SSF
Fig. (3)
Fig. (4)
Run the application
Fig. (5)
Fig. (6)
Create new file using the template ( Sub Window )
Fig. (7)
File Name ( About.SSF )
Fig. (8)
Fig. (9)
Modify the class name to (AboutClass)
Fig. (10)
Fig. (11)
Fig. (12)
Modify the window name to (AboutWindow)
Fig. (13)
Fig. (14)
Fig. (15)
Fig. (16)
Generate the source code file (About.PRG)
Fig. (17)
Open the file (Main.SSF)
Fig. (18)
Fig. (19)
Use the component (Set procedure to) to call the source file (About.PRG)
Fig. (20)
Fig. (21)
Fig. (22)
Create object (AboutObject) of class (AboutClass)
Fig. (23)
Use the component (New Object)
Fig. (24)
Fig. (25)
Fig. (26)
Fig. (27)
Add new menu item to call the about window
Fig. (28)
When the user click (About) the method (ShowWindow) related to the object (AboutObject) will be invoked
Fig. (29)
Move the generated step up
Fig. (30)
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
Fig. (32)
Fig. (33)
|