Application Techniques Appeon PowerBuilder® 2017 R2 FOR WINDOWS DOCUMENT ID: DC37774-01-1700-01 LAST REVISED: January 26, 2018 Copyright © 2018 by Appeon Limited. 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 Limited. Appeon and other Appeon products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Appeon Limited. 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 Limited, 1/F, Shell Industrial Building, 12 Lee Chung Street, Chai Wan District, Hong Kong Contents I Sample Applications ............................................................................................... 1 1 Using Sample Applications ............................................................................. 2 1.1 About the sample applications ............................................................. 2 1.2 Installing the sample applications ......................................................... 2 1.3 Opening the sample applications ......................................................... 2 1.4 Using the Code Examples application .................................................. 2 1.4.1 Browsing the examples .............................................................. 3 1.4.2 Finding examples ....................................................................... 3 1.4.3 Running and examining examples ............................................. 4 II Language Techniques ........................................................................................... 6 2 Selected Object-Oriented Programming Topics ............................................. 7 2.1 Terminology review ............................................................................... 7 2.2 PowerBuilder techniques ...................................................................... 8 2.3 Other techniques ................................................................................ 12 3 Selected PowerScript Topics ........................................................................ 17 3.1 Dot notation ........................................................................................ 17 3.2 Constant declarations ......................................................................... 20 3.3 Controlling access for instance variables ........................................... 20 3.4 Resolving naming conflicts ................................................................. 21 3.5 Return values from ancestor scripts ................................................... 23 3.6 Types of arguments for functions and events .................................... 24 3.7 Ancestor and descendant variables ................................................... 25 3.8 Optimizing expressions for DataWindow and external objects ........... 26 3.9 Exception handling in PowerBuilder ................................................... 27 3.9.1 Basics of exception handling .................................................... 28 3.9.2 Objects for exception handling support .................................... 28 3.9.3 Handling exceptions ................................................................. 29 3.9.4 Creating user-defined exception types ..................................... 31 3.9.5 Adding flexibility and facilitating object reuse ........................... 32 3.9.6 Using the SystemError and Error events .................................. 33 3.10 Garbage collection and memory management ................................. 34 3.10.1 Configuring memory management ......................................... 35 3.11 Efficient compiling and performance ................................................ 36 3.12 Reading and writing text or binary files ............................................ 36 4 Getting Information About PowerBuilder Class Definitions ........................... 39 4.1 Overview of class definition information ............................................. 39 4.1.1 Terminology .............................................................................. 40 4.1.2 Who uses PowerBuilder class definitions ................................. 41 4.2 Examining a class definition ............................................................... 42 4.2.1 Getting a class definition object ............................................... 42 4.2.2 Getting detailed information about the class ............................ 42 4.2.3 Getting information about a class's scripts ............................... 44 4.2.4 Getting information about variables .......................................... 46 III User Interface Techniques .................................................................................. 48 5 Building an MDI Application ......................................................................... 49 5.1 About MDI ........................................................................................... 49 5.2 Building an MDI frame window ........................................................... 51 5.3 Using sheets ....................................................................................... 52 5.4 Providing MicroHelp ............................................................................ 54 5.5 Using toolbars in MDI applications ..................................................... 54 5.5.1 Customizing toolbar behavior ................................................... 55 5.5.2 Saving and restoring toolbar settings ....................................... 56 5.6 Sizing the client area .......................................................................... 59 5.7 About keyboard support in MDI applications ...................................... 61 6 Managing Window Instances ........................................................................ 63 6.1 About window instances ..................................................................... 63 6.2 Declaring instances of windows ......................................................... 64 6.3 Using window arrays .......................................................................... 65 6.4 Referencing entities in descendants ................................................... 67 7 Using Tab Controls in a Window .................................................................. 69 7.1 About Tab controls ............................................................................. 69 7.2 Defining and managing tab pages ..................................................... 70 7.3 Customizing the Tab control ............................................................... 72 7.4 Using Tab controls in scripts .............................................................. 75 7.4.1 Referring to tab pages in scripts .............................................. 75 7.4.2 Referring to controls on tab pages ........................................... 77 7.4.3 Opening, closing, and hiding tab pages ................................... 77 7.4.4 Keeping track of tab pages ...................................................... 78 7.4.5 Creating tab pages only when needed ..................................... 78 7.4.6 Events for the parts of the Tab control ..................................... 80 8 Using TreeView Controls .............................................................................. 82 8.1 About TreeView controls .................................................................... 82 8.2 Populating TreeViews ......................................................................... 85 8.2.1 Functions for inserting items .................................................... 85 8.2.2 Inserting items at the root level ................................................ 87 8.2.3 Inserting items below the root level .......................................... 87 8.3 Managing TreeView items .................................................................. 89 8.3.1 Deleting items ........................................................................... 90 8.3.2 Renaming items ........................................................................ 91 8.3.3 Moving items using drag and drop ........................................... 91 8.3.4 Sorting items ............................................................................ 94 8.4 Managing TreeView pictures .............................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages464 Page
-
File Size-