Getting Started
Total Page:16
File Type:pdf, Size:1020Kb
Getting Started Appeon PowerBuilder® 2019 R2 FOR WINDOWS DOCUMENT ID: DC37772-01-1900-01 LAST REVISED: March 24, 2020 Copyright © 2019 Appeon. All rights reserved. This publication pertains to Appeon software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement. Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Appeon Inc. Appeon and other Appeon products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Appeon Inc. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP and SAP affiliate company. Java and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the U.S. and other countries. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. All other company and product names mentioned may be trademarks of the respective companies with which they are associated. Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies. Appeon Inc., 1/F, Shell Industrial Building, 12 Lee Chung Street, Chai Wan District, Hong Kong. Contents I Welcome to PowerBuilder ...................................................................................... 1 1 Introduction to PowerBuilder .......................................................................... 2 1.1 What PowerBuilder is ........................................................................... 2 1.2 The PowerBuilder environment ............................................................ 3 1.3 PowerBuilder objects ............................................................................ 8 2 About the PowerBuilder Tutorial ................................................................... 15 2.1 Learning to build a client/server application ....................................... 15 2.2 How you will proceed ......................................................................... 16 2.2.1 How long it will take ................................................................. 17 2.2.2 What you will learn ................................................................... 17 2.3 Setting up for the tutorial .................................................................... 17 II Building a Client/Server Application ..................................................................... 19 3 LESSON 1 Starting PowerBuilder ................................................................ 20 3.1 Create a new workspace .................................................................... 20 3.2 Create a target ................................................................................... 24 3.3 Specify an icon for the application ..................................................... 29 3.4 Change the size of the main window ................................................. 32 3.5 Run the application ............................................................................. 35 4 LESSON 2 Customizing the PowerBuilder Environment .............................. 40 4.1 Manipulate the System Tree window ................................................. 40 4.2 Open an object ................................................................................... 41 4.3 Manipulate views ................................................................................ 42 4.3.1 Add an extra Script view .......................................................... 43 4.3.2 Display view title bars .............................................................. 44 4.3.3 Float and dock views ............................................................... 44 4.3.4 Manipulate tabbed views .......................................................... 45 4.3.5 Save a view layout scheme ..................................................... 45 4.3.6 Reset the default view layout scheme ...................................... 46 4.4 Set up the toolbars ............................................................................. 46 4.4.1 Show labels on toolbar buttons ................................................ 46 4.4.2 Float the toolbars ..................................................................... 47 4.4.3 Reposition the toolbars ............................................................. 48 5 LESSON 3 Building a Login Window ........................................................... 51 5.1 Create a new window ......................................................................... 51 5.2 Add controls to the window ................................................................ 54 5.2.1 Add a Picture control ................................................................ 56 5.2.2 Add StaticText controls ............................................................ 57 5.2.3 Specify properties of the StaticText controls ............................ 58 5.2.4 Add SingleLineEdit controls ..................................................... 59 5.2.5 Specify properties of the SingleLineEdit controls ..................... 60 5.2.6 Add CommandButton controls .................................................. 61 5.2.7 Specify properties of the CommandButton controls ................. 61 5.3 Change the tab order on the window ................................................. 62 5.4 Code some Help events and preview the window .............................. 63 5.5 Write the script to open the window ................................................... 66 5.5.1 Modify the frame window Open event ...................................... 66 5.5.2 Compile the script .................................................................... 69 6 LESSON 4 Connecting to the Database ...................................................... 71 6.1 Look at the Demo Database .............................................................. 71 6.1.1 Look at the database profile for the Demo Database ............... 72 6.1.2 Look at table definitions in the Demo Database ....................... 75 6.2 Run the Connection Object wizard ..................................................... 79 6.3 Declare a global variable .................................................................... 81 6.4 Modify the connection information ...................................................... 85 6.4.1 Modify the of_GetConnectionInfo function ............................... 85 6.4.2 Call the connection service manager ....................................... 86 6.5 Complete the login and logout scripts ................................................ 88 6.5.1 Set up shortcuts for AutoScript ................................................ 89 6.5.2 Add code to the OK button Clicked event ................................ 90 6.5.3 Add code to the Cancel button Clicked event .......................... 91 6.5.4 Add code to the application Close event .................................. 92 6.6 Run the application ............................................................................. 93 7 LESSON 5 Modifying the Ancestor Window ................................................ 95 7.1 Add a library to the search path ......................................................... 95 7.2 Create a new ancestor sheet window ................................................ 96 7.3 Create a new sheet window inheritance hierarchy ............................. 97 7.4 Add a DataWindow control for the master DataWindow ..................... 99 7.5 Add a DataWindow control for the detail DataWindow ..................... 101 7.6 View the scripts inherited from the user object ................................. 102 7.7 Add user events and event scripts ................................................... 104 7.8 Add scripts to retrieve data for the DataWindow controls ................. 107 7.9 Adjust a runtime setting for sheet window size ................................ 110 8 LESSON 6 Setting Up the Menus .............................................................. 112 8.1 Modify the frame menu .................................................................... 112 8.1.1 Modify the File menu .............................................................. 112 8.1.2 Enable Help menu items ........................................................ 114 8.2 Create a new sheet menu ................................................................ 115 8.2.1 Inherit and save a new menu ................................................. 115 8.2.2 Add items to the new menu ................................................... 116 8.2.3 Add a new toolbar for the new menu items ............................ 118 8.3 Add menu scripts to trigger user events ........................................... 119 8.4 Attach the new menu and run the application .................................. 120 9 LESSON 7 Building DataWindow Objects .................................................. 122 9.1 Create and preview a new DataWindow object ...............................