Developer Magic™: Rapidapp™ User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
Developer Magic™: RapidApp™ User’s Guide Document Number 007-2590-001 CONTRIBUTORS Production by Laura Cooper Engineering contributions by Doug Young Cover design and illustration by Rob Aguilar, Rikk Carey, Dean Hodgkinson, Erik Lindholm, and Kay Maitz © 1994, Silicon Graphics, Inc.— All Rights Reserved This document contains proprietary and confidential information of Silicon Graphics, Inc. The contents of this document may not be disclosed to third parties, 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. Developer Magic™: RapidApp™ User’s Guide Document Number 007-2590-001 Contents List of Examples xiii List of Figures xv About This Guide xix What This Guide Contains xix What You Should Know Before Reading This Guide xx Suggested Reading xxi Font Conventions in This Guide xxiv Upgrading to Builder Xcessory xxiv 1. Getting Started With RapidApp 3 RapidApp Overview 3 Installing and Starting RapidApp 4 The RapidApp Interface 5 The RapidApp Menu Bar 6 The RapidApp Palette Area 7 The RapidApp Instance Header 7 The RapidApp Resource Editor 8 The RapidApp Quick Help Area 8 iii Contents Basic Interaction Techniques 8 Creating Interface Elements 9 Adding a Container to a Top-Level Window 11 Creating Interface Elements in an Existing Container 11 Explicit Focus Mode 13 Moving and Resizing Interface Elements 13 Directly Repositioning and Resizing Child Elements 14 Indirectly Positioning Child Elements 16 Reparenting Child Elements 17 Deleting Interface Elements 17 Naming Interface Elements 18 Editing Interface Element Resources 18 Callbacks 20 Constraints 20 Dynamic Resources 21 Additional Interaction Techniques 21 Locking on to an Element 22 Selecting a Parent Element 22 Viewing the Widget Hierarchy 22 Resetting IRIS IM Widgets 22 Example: A Calculator 24 EZ Convenience Functions 31 Examples Using the EZ Functions 33 Support for Widget Resources 34 iv 2. Creating Applications With RapidApp 37 RapidApp Development Model 37 Object-Oriented Components 38 Integration With the Indigo Magic Desktop Environment 39 Code Management 40 Code Generation 40 Object-Oriented Design 42 Code Merging 43 Integration With ProDev WorkShop for Building and Debugging 45 Editing Files 46 Compiling 46 Browsing Source 46 Debugging and Interactively Adding Functionality 47 Integration With Software Packager for Creating Installable Images 48 RapidApp Development Cycle 49 3. Building Interfaces With RapidApp 53 Choosing and Using Windows 53 Simple Windows 54 VkWindows 55 Main Primary and Co-Primary Windows 58 Dialog Windows 60 Using Containers 63 Bulletin Board 65 Rubber Board 66 Spring Box 70 Form 73 Paned Windows 78 RowColumn 79 v Contents Radio Box 80 Frame 81 Scrolled Window 82 Drawing Areas 82 Tabbed Deck 82 Creating and Editing Menus 84 Menu Bars 84 Creating a Menu Bar 84 Adding Panes to a Menu Bar 85 Removing Panes From a Menu Bar 86 Moving Panes In a Menu Bar 86 Menu Panes 86 Displaying and Hiding a Menu’s Contents 86 Adding Items to a Menu 87 Moving Items in a Menu 88 Removing Items From a Menu 88 Option Menus 88 Creating, Editing, and Manipulating Components 89 Creating Components 89 Using Components 92 Editing Components 92 Deleting Components 93 Creating Components from External Classes 93 4. Example Programs 97 A Simple Open Inventor Program 97 Online Examples 104 A. Frequently Asked Questions about RapidApp 107 Frequently Asked Questions 107 vi B. RapidApp Reference 121 Global Objects 121 File Menu 122 Edit Menu 123 View Menu 124 Classes Menu 124 Project Menu 125 Options Menu 126 C++ File Options Dialog 126 RapidApp Preferences Dialog 127 Application Names Dialog 127 Palette Tabs 129 Keys and Shortcuts 129 Windows Palette 131 VkSimpleWindow 131 VkSimpleWindow Resources 131 VkWindow 132 VkDialogWindow 132 Containers Palette 133 BulletinBoard 133 BulletinBoard Resources 134 SpringBox 134 SpringBox Resources 135 SpringBox Constraint Resources 137 Form 137 Form Resources 138 Form Constraint Resources 138 RowColumn 140 RowColumn Resources 141 RadioBox 142 RadioBox Resources 143 vii Contents PanedWindow, HorzPanedWindow 143 PanedWindow, HorzPanedWindow Resources 144 PanedWindow, HorzPanedWindow Constraint Resources 144 Frame 144 Frame Resources 145 Frame Constraint Resources 145 ScrolledWindow 146 ScrolledWindow Resources 147 RubberBoard 147 RubberBoard Resources 148 DrawingArea, VisualDrawingArea 148 DrawingArea, VisualDrawingArea Resources 149 VisualDrawingArea Resources 149 Controls Palette 150 PushButton 151 PushButton Resources 151 Code Examples 152 ToggleButton 154 ToggleButton Resources 154 Code Examples 156 ArrowButton 156 Resources 157 DrawnButton 157 DrawnButton Resources 157 Label 159 Label Resources 159 Code Examples 161 Separator 161 Separator Resources 162 ScrollBar 162 ScrollBar Resources 163 Code Examples 163 viii Scale 164 Scale Resources 164 Code Examples 166 ScrolledList 166 Scrolled Window Resources 167 List Resources 168 Scrolled Text 169 Scrolled Text Resources 169 TextField 171 TextField Resources 171 Finder 172 Finder Resources 172 Thumbwheel 173 Thumbwheel Resources 173 Dial 174 Dial Resources 175 GLwMDrawingArea 175 Drop Pocket 178 DropPocket Resources 178 Menus Palette 178 Pulldown Menu 179 Pulldown Resources 180 Cascade Menu 180 Cascade Resources 180 Radio Pulldown 181 RadioPulldown Resources 181 OptionMenu 181 OptionMenu Resources 182 ix Contents Menu Entry 182 MenuEntry Resources 182 Menu Label 183 MenuLabel Resources 183 Menu Toggle 183 MenuToggle Resources 183 Menu Separator 184 ConfirmFirst 184 MenuToggle Resources 184 ViewKit Palette 185 VkOutline 185 VkCompletionField 186 VkGraph 186 VkTabPanel 187 VkTabbedDeck 187 VkVUMeter 187 VkPie 187 VkTickMarks 188 Inventor Palette 188 Examiner Viewer 189 Examiner Viewer Resources 189 Walk Viewer 190 Walk Viewer Resources 190 Plane Viewer 191 Plane Viewer Resources 191 Material Editor 191 Directional Light 192 SoFly Viewer 192 SoFly Viewer Resources 193 Render Area 193 Render Area Resources 194 x C. Source Code for the Calculator Application 195 The Calculator main.C File 195 The CalcWindowMainWindow Class 196 The Calculator Class 200 The CalculatorUI Class 205 The Calculator Resource File 205 Makefile 206 D. RapidApp Makefile Conventions 211 E. VkEZ Reference 213 General Operators 213 operator String() 213 operator int() 214 Assignment Operators 214 Append Operators 216 Decrement Operator 217 Attributes 218 Glossary 219 Index 221 xi Contents xii List of Examples Example B-1 Retrieving Text from a Subclass of Label Using the IRIS IM API 153 Example B-2 Retrieving Text from a Subclass of Label Using the VkEZ API 153 Example B-3 Setting Text on a Subclass of Label using the VkEZ API 154 Example B-4 Setting the Indicator State on a Toggle Button Without Invoking Callbacks 156 Example B-5 Setting the Indicator State on a Toggle Button and Triggering Callbacks 156 Example B-6 Retrieving Text from a Subclass of Label Using the IRIS IM API 161 Example B-7 Retrieving Text from a Subclass of Label Using the VkEZ API 161 Example B-8 Setting Text on a Subclass of Label Using the VkEZ API 161 Example B-9 Getting the Value of a Scroll Bar Using the IRIS IM API 163 Example B-10 Getting the Value of a Scroll Bar Using the VkEZ API 164 Example B-11 Setting the Value of a Scroll Bar Using the IRIS IM API 164 Example B-12 Setting the Value of a Scroll Bar Using the VkEZ API 164 Example B-13 Getting the Value of a Scale Using the IRIS IM API 166 Example B-14 Getting the Value of a Scale Using the VkEZ API 166 Example B-15 Setting the Value of a Scale Using the IRIS IM API 166 Example B-16 Setting the Value of a Scale Using the VkEZ API 166 Example C-1 Calculator main.C File 195 Example C-2 The Calculator CalcWindowMainWindow.h File 196 Example C-3 The Calculator CalcWindowMainWindow.C File 197 xiii List of Examples Example C-4 The Calculator Calculator.h File 200 Example C-5 The Calculator Calculator.C File 202 Example C-6 The Calculator Resource File 205 Example C-7 The Calculator Makefile file 206 xiv List of Figures Figure 1-1 RapidApp Startup Screen 5 Figure 1-2 RapidApp Main Window 6 Figure 1-3 Creating a Widget 10 Figure 1-4 Creating a Pushbutton as a Child of a Bulletin Board 12 Figure 1-5 Repositioning a Widget in a Bulletin Board Container 15 Figure 1-6 Resizing a Widget 16 Figure 1-7 Repositioning a Widget in a RowColumn 17 Figure 1-8 Header Area 18 Figure 1-9 Resource Editor Area 19 Figure 1-10 A Resource Whose Value Is a String 19