Developer Magic™: Rapidapp™ User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
Developer Magic™: RapidApp™ User’s Guide Document Number 007-2590-004 CONTRIBUTORS Written by Doug Young, Terri Wanke, and Ken Jones Production by Linda Rae Sande Engineering contributions by Doug Young © 1995, 1996, Silicon Graphics, Inc.— All Rights Reserved The contents of this document may not be copied or duplicated in any form, in whole or in part, without the prior written permission of Silicon Graphics, Inc. RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure of the technical data contained in this document by the Government is subject to restrictions as set forth in subdivision (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS 52.227-7013 and/or in similar or successor clauses in the FAR, or in the DOD or NASA FAR Supplement. Unpublished rights reserved under the Copyright Laws of the United States. Contractor/manufacturer is Silicon Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94043-1389. Silicon Graphics, the Silicon Graphics logo, IRIS, and OpenGL are registered trademarks and CASEVision, Developer Magic, Indigo Magic, Inventor, IRIS IM, IRIS InSight, IRIS Showcase, IRIS ViewKit, Open Inventor, and RapidApp are trademarks of Silicon Graphics, Inc. Builder Xcessory is a trademark of Integrated Computer Systems, Inc. Ada is a registered trademark of Ada Joint Program Office, U.S. Government. Motif and OSF/Motif are registered trademarks of Open Software Foundation. X Window System is a trademark of Massachusetts Institute of Technology. ToolTalk is a trademark of Sun Microsystems, Inc. NetLS is a trademark of Apollo Computer, Inc., a subsidiary of Hewlett-Packard Company. Developer Magic™: RapidApp™ User’s Guide Document Number 007-2590-004 Contents List of Examples xix List of Figures xxi About This Guide xxv What This Guide Contains xxv What You Should Know Before Reading This Guide xxvi Suggested Reading xxvii Font Conventions in This Guide xxx Upgrading to Builder Xcessory xxxi 1. RapidApp Tour 1 Building a Calculator: A RapidApp Example 1 2. RapidApp Basics 11 RapidApp Overview 11 Prerequisites for Installing RapidApp 13 Setting Up Your Working Environment for RapidApp 13 Project Directory 13 Resource Files 14 Editor 14 Color-Map 14 Starting RapidApp 15 The Startup Screen 15 RapidApp Tips 16 iii Contents The RapidApp Interface 17 Menu Bar 18 Palette 18 Instance Header 19 Resource Editor 19 Quick Help 19 Palette Tabs 19 3. Interface Design 21 The Indigo Magic Style 21 Basic Interface Construction 22 See Also 23 Parent/Child Interaction 23 Parent/Child Relationship 23 Selecting a Parent Element 24 Confining Element Creation to the Selected Parent 24 Interface Element Creation 24 Creating Interface Elements 25 Copying Interface Elements 28 Aborting Interface Element Creation 28 See Also 28 iv Contents Interface Element Manipulation 29 Moving and Resizing Interface Elements 29 Moving and Resizing Windows 29 Moving and Resizing Containers 29 Moving and Resizing Elements within Containers 30 Moving Elements to Another Container 35 Deleting Interface Elements 36 Naming Interface Elements 36 Modifying an Interface Element’s Appearance or Behavior 37 Modifying Resources 37 Callback Resources 38 Constraint Resources 39 Dynamic Resources 39 Extended Resources 40 Additional Interaction Techniques 40 Locking on to an Element 40 Viewing the Interface Element Hierarchy 40 Save Your Interface and Files 42 4. Application Development 43 Development Cycle 43 Test Your Application 44 Browsing Source 44 Create an Application Icon 45 Create a Minimized Window Icon 46 Create Installable Images 46 Development Model 47 Object-Oriented Components 47 v Contents 5. Code Creation and Management 49 Generate Code 49 Generating RapidApp’s Code 49 Adding and Editing Code 50 Following a Few Simple Coding Rules 50 Using Colors and Fonts 51 Using the Debugger to Add Code 51 Using a Text Editor to Add Code 54 Using EZ Convenience Functions 54 Code Management 55 Code Generation 55 Class Architecture 57 Code Merging 58 Block Merge 58 Three-Way Merge 59 6. Advanced Topics 63 Work With Windows 63 Simple Windows 65 VkWindows 65 Main Primary and Co-Primary Windows 69 Adding New Top-Level Window Layouts to RapidApp 70 Work With Containers 72 Bulletin Board 73 Rubber Board 74 Spring Box 79 Form 82 Paned Windows 86 RowColumn 88 Radio Box 89 Frame 89 Scrolled Window 90 Drawing Areas 90 Tabbed Deck 91 vi Contents Work With Menus 92 Menu Bars 92 Creating a Menu Bar 93 Adding Panes to a Menu Bar 93 Removing Panes From a Menu Bar 94 Moving Panes In a Menu Bar 94 Menu Panes 94 Displaying and Hiding a Menu’s Contents 94 Adding Items to a Menu 95 Moving Items in a Menu 96 Removing Items From a Menu 96 Option Menus 96 Work With Dialogs 97 Using the IRIS ViewKit Dialog System for Standard Dialogs 97 Creating and Using Custom Dialogs 99 Selecting a Dialog to Customize 99 Adding Elements to the Dialog 100 Adding a Menu Bar to the Dialog 100 Setting the Dialog Message, Dialog Title, and Button Labels 100 Code Generation for Customized Standard Dialogs 100 Code Generation for Dialogs Customized From the Dialog Window 101 Example of a Custom Dialog 102 Work With User-Defined Components 104 Creating Components 105 An Example: Creating a Component 107 Deriving From Your Own Super Class 109 Using Components 110 Editing Components 111 Deleting Components 111 7. VkEZ Library 113 EZ Convenience Functions 113 Examples Using the EZ Functions 115 Support for Widget Resources 115 vii Contents VkEZ Operators 116 General Operators 116 String() 116 int() 117 Assignment Operators 117 Append Operators 119 Decrement Operator 120 Attributes 121 8. Component Libraries 123 Work With Component Libraries 123 Introduction 123 Configuring RapidApp 124 Build a Component Library 125 Generating Code for the Component Library 125 Building the Component Library 126 Example of Creating a Component Library 127 Install a Component Library 127 Package a Component Library for Distribution 127 Load Components Onto Palettes 128 Introduction 128 Loading Components Into RapidApp 129 Loading a Component Onto a RapidApp Palette 129 Example of Loading a Component Onto a RapidApp Palette 133 Files Generated When Loading Components on a Palette 134 Deleting a Component from a Custom RapidApp Palette 135 Creating an Installable Image 136 Adding Resources to Components 136 Arguments and Argument Types 141 Support for Callbacks 142 viii Contents Load Non-RapidApp Components 143 Introduction 143 Requirements for Loading Components Not Created With RapidApp 144 Testing Components 147 Adding Custom Base Classes to RapidApp 149 9. Example Applications 151 A Simple Open Inventor Program 151 Online Examples 158 A. RapidApp Reference 161 Reference 161 Global Objects 162 File Menu 162 Edit Menu 163 View Menu 164 Classes Menu 165 Project Menu 165 RapidApp Preferences Dialog 166 Project Card 167 RapidApp Card 169 Code Style Card 171 Merge Options Card 173 RapidApp Component Importer Dialog 175 Palette Tabs 176 Keys and Shortcuts 176 ix Contents Windows Palette 178 Simple Window 179 VkSimpleWindow Resources 179 VkWindow 180 Dialog Window 180 File Dialog 181 Info Dialog 181 Error Dialog 182 Warning Dialog 182 Question Dialog 182 x Contents Containers Palette 183 Bulletin Board 184 Bulletin Board Resources 184 Rubber Board 185 Rubber Board Resources 185 Spring Box 185 Spring Box Resources 186 Spring Box Constraint Resources 188 Form 188 Form Resources 189 Form Constraint Resources 190 Paned and HPaned Windows 191 Paned and HPaned Window Resources 192 Paned and HPaned Window Constraint Resources 193 Row Column 193 Row Column Resources 194 Scrolled Window 195 Scrolled Window Resources 196 Drawing Area and Visual Drawing 196 Drawing Area and Visual Drawing Resources 197 Visual Drawing Resources 197 Radio Box 198 Radio Box Resources 198 Frame 198 Frame Resources 199 Frame Constraint Resources 199 GLDraw 200 Tabbed Deck 203 Tabbed Deck Resources 203 xi Contents Controls Palette 204 Push Button 204 Push Button Resources 205 Code Examples 206 Toggle Button 207 Toggle Button Resources 208 Code Examples 210 Drawn Button 210 Drawn Button Resources 210 Arrow Button 212 Resources 212 Label 213 Label Resources 213 Code Examples 214 Separator 215 Separator Resources 215 Scroll Bar 216 Scroll Bar Resources 216 Code Examples 217 Scale 217 Scale Resources 218 Code Examples 219 Scrolled List 219 Scrolled Window Resources 221 List Resources 221 Scrolled Text 223 Scrolled Text Resources 223 Text Field 224 Text Field Resources 224 Finder 225 Finder Resources 226 Thumb Wheel 226 Thumb Wheel Resources 226 xii Contents Dial 227 Dial Resources 228 LED Button 229 LED Button Resources 229 Drop Pocket 231 Drop Pocket Resources 231 Menus Palette 232 Pulldown Menu 232 Pulldown Resources 233 Cascade Menu 233 Cascade Resources 233 Radio Pulldown 234 RadioPulldown Resources 234 OptionMenu 234 OptionMenu Resources 234 Menu Entry 235 MenuEntry Resources 235 Menu Label 235 MenuLabel Resources 235 Menu Toggle 236 MenuToggle Resources 236 Menu Separator 236 Confirm First 237 MenuToggle Resources 237 Menu Bar 237 ViewKit Palette 238 VkOutline 238 VkCompletionField 239 VkGraph 239 VkPie 239 VkTabPanel 240 VkVUMeter 240 VkTickMarks 240 xiii Contents Inventor Palette 241 Directional Light 241 Examiner Viewer 242 Examiner Viewer Resources 242 Walk Viewer 243 Walk Viewer Resources 243 Render Area 244 Render Area Resources 244 Plane Viewer 245 Plane Viewer Resources 245 Material Editor 245 SoFly Viewer 246 SoFly Viewer Resources 246 xiv Contents B. RapidApp Makefile Conventions 249 C. Frequently Asked Questions and