CodeWarrior ®
IDE User Guide
Windows ® | Macintosh ® | Solaris™ | Linux
Because of last-minute changes to CodeWarrior, some of the information in this
manual may be inaccurate. Please read the Release Notes on the CodeWarrior
CD for the latest up-to-date information.
Revised: 8/14/00 mds
Metrowerks CodeWarrior copyright ©1993–2000 by Metrowerks, Inc. and its licensors.
All rights reserved.
Documentation stored on the compact disk(s) may be printed by licensee for personal
use. Except for the foregoing, no part of this documentation may be reproduced or
transmitted in any form by any means, electronic or mechanical, including
photocopying, recording, or any information storage and retrieval system, without
permission in writing from Metrowerks, Inc.
Metrowerks, the Metrowerks logo, CodeWarrior, PowerPlant, and Metrowerks
University are registered trademarks of Metrowerks Inc. CodeWarrior Constructor,
Geekware, PowerParts, and Discover Programming are trademarks of Metrowerks Inc.
All other trademarks and registered trademarks are the property of their respective
owners.
ALL SOFTWARE AND DOCUMENTATION ON THE COMPACT DISK(S) ARE
SUBJECT TO THE LICENSE AGREEMENT IN THE CD BOOKLET.
How to Contact Metrowerks:
U.S.A. and International Metrowerks Corporation
9801 Metric Blvd., Suite #100
Austin, TX 78758
U.S.A.
World Wide Web http://www.metrowerks.com
Registration Information http://www.metrowerks.com/register
mailto:
[email protected] Desktop Technical Support http://www.metrowerks.com/support/desktop/
mailto:
[email protected] Embedded Technical Support http://www.metrowerks.com/support/embedded/
mailto:
[email protected] Sales, Marketing, & Licensing mailto:
[email protected] Ordering Voice: (800) 377–5416
Fax: (512) 997–4901
Intl. Sales, Mkt & Licensing mailto:
[email protected] International Ordering Voice: +1 512 997-4724
Fax: +1 512 997-4901
Table of Contents
1 Introduction 17
CodeWarrior IDE Overview . . . . . . . . . . . . . . . . 17
IDE Tools . . . . . . . . . . . . . . . . . . . . . . . 18
IDE Flexibility . . . . . . . . . . . . . . . . . . . . . 18
CodeWarrior Projects . . . . . . . . . . . . . . . . . . 19
IDE User Guide Overview . . . . . . . . . . . . . . . . . 21
Read the Release Notes! . . . . . . . . . . . . . . . . . . 22
Manual Conventions . . . . . . . . . . . . . . . . . . . 23
Typographical Conventions . . . . . . . . . . . . . . . 23
Host Conventions . . . . . . . . . . . . . . . . . . . 24
Figure Conventions. . . . . . . . . . . . . . . . . . . 25
Keyboard Conventions . . . . . . . . . . . . . . . . . 25
New in This Release. . . . . . . . . . . . . . . . . . . . 26
Find and Replace . . . . . . . . . . . . . . . . . . . . 26
Selectable Menu Bar Layouts. . . . . . . . . . . . . . . 26
Shielded Folders . . . . . . . . . . . . . . . . . . . . 27
Remote Debugging . . . . . . . . . . . . . . . . . . . 27
Symbolics Window . . . . . . . . . . . . . . . . . . . 27
Project Engine Improvements . . . . . . . . . . . . . . 27
Import/Export of IDE Preferences and Target Settings . . . 28
Contextual Menu Improvements . . . . . . . . . . . . . 28
Where To Go From Here . . . . . . . . . . . . . . . . . . 28
Getting Started and Tutorials . . . . . . . . . . . . . . 29
Targeting Documentation . . . . . . . . . . . . . . . . 29
Adobe Acrobat Indexes . . . . . . . . . . . . . . . . . 30
2 Getting Started 31
System Requirements . . . . . . . . . . . . . . . . . . . 31
Windows . . . . . . . . . . . . . . . . . . . . . . . 32
Mac OS . . . . . . . . . . . . . . . . . . . . . . . . 32
Solaris . . . . . . . . . . . . . . . . . . . . . . . . 33
Linux . . . . . . . . . . . . . . . . . . . . . . . . . 33
CodeWarrior IDE Installation. . . . . . . . . . . . . . . . 33
Programming Concepts . . . . . . . . . . . . . . . . . . 33
Creating Input Files . . . . . . . . . . . . . . . . . . 34
IDE User Guide IDE–3
Table of Contents
Generating the Software. . . . . . . . . . . . . . . . . 36
Debugging and Refining the Software. . . . . . . . . . . 36
An Introduction to the CodeWarrior IDE. . . . . . . . . . . 37
Projects and Targets . . . . . . . . . . . . . . . . . . 37
Source-Code Editing and Browsing . . . . . . . . . . . . 38
Compiling and Linking . . . . . . . . . . . . . . . . . 39
Project Debugging . . . . . . . . . . . . . . . . . . . 39
Rapid Application Development . . . . . . . . . . . . . 40
Version Control . . . . . . . . . . . . . . . . . . . . 40
Scripting . . . . . . . . . . . . . . . . . . . . . . . 40
Customizing the IDE . . . . . . . . . . . . . . . . . . 40
Working with Third-Party Tools . . . . . . . . . . . . . 41
3 Working with Projects 43
Guided Tour of the Project Window . . . . . . . . . . . . . 44
Navigating the Project Window . . . . . . . . . . . . . 45
Project Window Toolbar . . . . . . . . . . . . . . . . . 45
Files View . . . . . . . . . . . . . . . . . . . . . . . 46
Design View . . . . . . . . . . . . . . . . . . . . . . 53
Link Order View . . . . . . . . . . . . . . . . . . . . 53
Targets View. . . . . . . . . . . . . . . . . . . . . . 54
Creating a New Project . . . . . . . . . . . . . . . . . . 55
Types of Project Files . . . . . . . . . . . . . . . . . . 55
Choosing a Project Stationery File . . . . . . . . . . . . 56
Naming Your New Project . . . . . . . . . . . . . . . . 57
Using the New Project dialog box . . . . . . . . . . . . 58
Modifying Your New Project. . . . . . . . . . . . . . . 60
Building Your New Project . . . . . . . . . . . . . . . 60
Working with Project Stationery . . . . . . . . . . . . . . 60
About Project Stationery . . . . . . . . . . . . . . . . 61
About the Project Stationery Folder . . . . . . . . . . . . 61
Creating Your Own Project Stationery . . . . . . . . . . . 62
Importing Makefiles into Projects . . . . . . . . . . . . . . 64
Using the Makefile Importer Wizard . . . . . . . . . . . 64
Makefile Importer Wizard Options . . . . . . . . . . . . 65
Opening an Existing Project . . . . . . . . . . . . . . . . 67
Using the Open Command . . . . . . . . . . . . . . . 68
IDE–4 IDE User Guide
Table of Contents
Using the Open Recent Command . . . . . . . . . . . . 68
Using the Project Window to Open Subprojects. . . . . . . 69
Opening Project Files Created on Other Host Platforms . . . 69
Saving a Project . . . . . . . . . . . . . . . . . . . . . 70
Items Saved with Your Project . . . . . . . . . . . . . . 70
Saving a Copy of Your Project . . . . . . . . . . . . . . 70
Closing a Project . . . . . . . . . . . . . . . . . . . . . 71
Choosing a Default Project . . . . . . . . . . . . . . . . . 71
Managing Files in a Project. . . . . . . . . . . . . . . . . 72
Expanding and Collapsing Groups . . . . . . . . . . . . 72
Selecting Files and Groups. . . . . . . . . . . . . . . . 73
Adding Files. . . . . . . . . . . . . . . . . . . . . . 75
Moving Files and Groups . . . . . . . . . . . . . . . . 83
Creating Groups . . . . . . . . . . . . . . . . . . . . 84
Removing Files and Groups . . . . . . . . . . . . . . . 85
Renaming Groups . . . . . . . . . . . . . . . . . . . 86
Touching and Untouching Files . . . . . . . . . . . . . 87
Working with Complex Projects . . . . . . . . . . . . . . 89
What is a Build Target? . . . . . . . . . . . . . . . . . 90
What is a Subproject? . . . . . . . . . . . . . . . . . . 90
What is a Design? . . . . . . . . . . . . . . . . . . . 92
Strategy for Creating Complex Projects . . . . . . . . . . 92
Creating a New Build Target . . . . . . . . . . . . . . . 92
Changing a Build Target’s Name . . . . . . . . . . . . . 94
Changing a Build Target’s Settings . . . . . . . . . . . . 95
Setting the Current Build Target . . . . . . . . . . . . . 95
Creating Build-Target Dependencies . . . . . . . . . . . 96
Assigning Files to Build Targets . . . . . . . . . . . . . 98
Creating Subprojects Within Projects . . . . . . . . . . . 99
Examining Project Information . . . . . . . . . . . . . . . 100
Moving a Project . . . . . . . . . . . . . . . . . . . . . 103
Importing and Exporting a Project . . . . . . . . . . . . . 103
Controlling Debugging in a Project . . . . . . . . . . . . . 104
Generating Debugging Information for a Project . . . . . . 104
Generating Debugging Information for a File . . . . . . . 105
Adding Preprocessor Symbols to a Project . . . . . . . . . . 107
IDE User Guide IDE–5
Table of Contents
4 Working with Files 109
Creating a New File . . . . . . . . . . . . . . . . . . . . 109
Opening an Existing File. . . . . . . . . . . . . . . . . . 110
Opening Files from the File Menu . . . . . . . . . . . . 110
Opening Files from the Project Window . . . . . . . . . . 113
Opening Files from an Editor Window . . . . . . . . . . 115
Opening a Related File . . . . . . . . . . . . . . . . . 117
Saving a File . . . . . . . . . . . . . . . . . . . . . . . 117
Closing a File . . . . . . . . . . . . . . . . . . . . . . 124
Closing One File . . . . . . . . . . . . . . . . . . . . 124
Closing All Files . . . . . . . . . . . . . . . . . . . . 125
Printing a File . . . . . . . . . . . . . . . . . . . . . . 125
Setting Print Options . . . . . . . . . . . . . . . . . . 126
Printing a Window . . . . . . . . . . . . . . . . . . . 126
Reverting to a Previously-Saved File . . . . . . . . . . . . 127
Comparing and Merging Files & Folders. . . . . . . . . . . 128
File Comparison and Merge Overview . . . . . . . . . . 128
Choosing Files To Compare . . . . . . . . . . . . . . . 131
Examining and Applying Differences . . . . . . . . . . . 132
Choosing Folders To Compare . . . . . . . . . . . . . . 133
5 Editing Source Code 137
Guided Tour of the Editor Window . . . . . . . . . . . . . 137
Text-Editing Area. . . . . . . . . . . . . . . . . . . . 138
Interface Pop-Up Menu . . . . . . . . . . . . . . . . . 140
Function Pop-Up Menu . . . . . . . . . . . . . . . . . 141
Marker Pop-Up Menu . . . . . . . . . . . . . . . . . 142
Document Settings Pop-Up Menu . . . . . . . . . . . . 142
VCS Pop-Up Menu . . . . . . . . . . . . . . . . . . . 143
File Path Caption . . . . . . . . . . . . . . . . . . . . 143
Dirty File Marker. . . . . . . . . . . . . . . . . . . . 143
Pane Splitter Controls . . . . . . . . . . . . . . . . . . 144
Line and Column Indicator . . . . . . . . . . . . . . . 144
Toolbar Disclosure Button . . . . . . . . . . . . . . . . 144
Path Pop-Up Menu (Mac OS) . . . . . . . . . . . . . . 145
Editor Window Configuration . . . . . . . . . . . . . . . 145
Setting Text Size and Font . . . . . . . . . . . . . . . . 146
IDE–6 IDE User Guide
Table of Contents
Seeing Window Controls . . . . . . . . . . . . . . . . 146
Splitting the Window into Panes . . . . . . . . . . . . . 147
Saving Editor Window Settings . . . . . . . . . . . . . 148
Basic Text Editing . . . . . . . . . . . . . . . . . . . . . 149
Basic Editor Window Navigation . . . . . . . . . . . . . 149
Adding Text . . . . . . . . . . . . . . . . . . . . . . 150
Deleting Text . . . . . . . . . . . . . . . . . . . . . 150
Selecting Text . . . . . . . . . . . . . . . . . . . . . 151
Moving Text (Drag and Drop) . . . . . . . . . . . . . . 152
Using Cut, Copy, and Paste . . . . . . . . . . . . . . . 152
Balancing Punctuation . . . . . . . . . . . . . . . . . 153
Shifting Text Left and Right . . . . . . . . . . . . . . . 154
Undoing Changes . . . . . . . . . . . . . . . . . . . 154
Controlling Color . . . . . . . . . . . . . . . . . . . 155
Navigating the Text . . . . . . . . . . . . . . . . . . . . 155
Finding a Routine . . . . . . . . . . . . . . . . . . . 156
Adding, Removing, and Selecting a Marker . . . . . . . . 156
Using Bookmarks . . . . . . . . . . . . . . . . . . . 159
Opening a Related File . . . . . . . . . . . . . . . . . 160
Going to a Particular Line . . . . . . . . . . . . . . . . 161
Using Go Back and Go Forward . . . . . . . . . . . . . 161
Configuring Editor Commands . . . . . . . . . . . . . 161
Opening the Directory of a File (Mac OS) . . . . . . . . . 161
Online References . . . . . . . . . . . . . . . . . . . . 162
Finding Symbol Definitions . . . . . . . . . . . . . . . 163
WinHelp (Windows) . . . . . . . . . . . . . . . . . . 164
QuickHelp (Mac OS) . . . . . . . . . . . . . . . . . . 164
QuickView (Mac OS) . . . . . . . . . . . . . . . . . . 165
THINK Reference (Mac OS) . . . . . . . . . . . . . . . 165
Inserting Routine (Reference) Templates (Mac OS) . . . . . 166
6 Finding and Replacing Text 167
Guided Tour of the IDE’s Find Features . . . . . . . . . . . 167
Find Dialog Box . . . . . . . . . . . . . . . . . . . . 168
Find and Replace Dialog Box . . . . . . . . . . . . . . 168
Find in Files Window . . . . . . . . . . . . . . . . . . 169
Find Options . . . . . . . . . . . . . . . . . . . . . . . 169
IDE User Guide IDE–7
Table of Contents
General Search Options . . . . . . . . . . . . . . . . . 170
Multi-File Search Options . . . . . . . . . . . . . . . . 172
Search Buttons . . . . . . . . . . . . . . . . . . . . . 176
Finding and Replacing Text in a Single File . . . . . . . . . . 177
Finding Text . . . . . . . . . . . . . . . . . . . . . . 178
Finding and Replacing Text . . . . . . . . . . . . . . . 179
Searching with Special Characters . . . . . . . . . . . . 181
Finding and Replacing Text in Multiple Files . . . . . . . . . 182
In Folders . . . . . . . . . . . . . . . . . . . . . . . 182
In Projects . . . . . . . . . . . . . . . . . . . . . . . 184
In Symbolics . . . . . . . . . . . . . . . . . . . . . . 187
In Files . . . . . . . . . . . . . . . . . . . . . . . . 189
Search Results . . . . . . . . . . . . . . . . . . . . . 191
Searching for Selected Text . . . . . . . . . . . . . . . . . 193
Finding Text in the Active Editor Window . . . . . . . . . 193
Finding Text in Multiple Editor Windows . . . . . . . . . 194
Using Regular Expressions (grep) . . . . . . . . . . . . . 195
Operators . . . . . . . . . . . . . . . . . . . . . . . 196
Find and Replace Using Regular Expressions . . . . . . . 197
7 Browsing Source Code 205
Activating the Browser . . . . . . . . . . . . . . . . . . 205
Understanding the Browser Strategy . . . . . . . . . . . . 206
Contents View . . . . . . . . . . . . . . . . . . . . . 207
Browser View . . . . . . . . . . . . . . . . . . . . . 208
Hierarchy View . . . . . . . . . . . . . . . . . . . . 209
Guided Tour of the Browser . . . . . . . . . . . . . . . . 210
Browser Contextual Menu . . . . . . . . . . . . . . . . 211
Contents Window . . . . . . . . . . . . . . . . . . . 213
Browser Window. . . . . . . . . . . . . . . . . . . . 214
Multi-Class Hierarchy Window . . . . . . . . . . . . . 222
Single-Class Hierarchy Window . . . . . . . . . . . . . 224
Symbol Window . . . . . . . . . . . . . . . . . . . . 225
Browser Menu . . . . . . . . . . . . . . . . . . . . . 228
Browser Wizards . . . . . . . . . . . . . . . . . . . . . 229
New Class Wizard . . . . . . . . . . . . . . . . . . . 230
New Member Function Wizard. . . . . . . . . . . . . . 236
IDE–8 IDE User Guide
Table of Contents
New Data Member Wizard . . . . . . . . . . . . . . . 240
Using the Browser . . . . . . . . . . . . . . . . . . . . 243
Setting Browser Options . . . . . . . . . . . . . . . . 244
Identifying Symbols in the Browser Database . . . . . . . 244
Navigating Code in the Browser . . . . . . . . . . . . . 245
Browsing Across Subprojects. . . . . . . . . . . . . . . 246
Completing Symbols . . . . . . . . . . . . . . . . . . 246
Opening a Source File. . . . . . . . . . . . . . . . . . 248
Seeing a Declaration . . . . . . . . . . . . . . . . . . 248
Seeing a Routine Definition . . . . . . . . . . . . . . . 248
Editing Code in the Browser . . . . . . . . . . . . . . . 249
Analyzing Inheritance . . . . . . . . . . . . . . . . . 249
Finding Functions That Are Overrides . . . . . . . . . . 249
Viewing MFC and PowerPlant Classes . . . . . . . . . . 250
Saving a Default Browser . . . . . . . . . . . . . . . . 251
8 Configuring IDE Options 253
Preferences Guided Tour. . . . . . . . . . . . . . . . . . 253
Preference Panels. . . . . . . . . . . . . . . . . . . . 254
Window Buttons . . . . . . . . . . . . . . . . . . . . 254
Choosing Preferences . . . . . . . . . . . . . . . . . . . 256
General Preferences. . . . . . . . . . . . . . . . . . . 257
Editor Preferences . . . . . . . . . . . . . . . . . . . 277
Debugger Preferences . . . . . . . . . . . . . . . . . . 288
RAD Tools Preferences . . . . . . . . . . . . . . . . . 305
Customizing the IDE . . . . . . . . . . . . . . . . . . . 306
Window Buttons . . . . . . . . . . . . . . . . . . . . 306
Customizing Commands . . . . . . . . . . . . . . . . 307
Customizing Key Bindings . . . . . . . . . . . . . . . 314
Customizing Toolbars. . . . . . . . . . . . . . . . . . 323
9 Configuring Target Options 331
Target Settings Guided Tour . . . . . . . . . . . . . . . . 331
Settings Panels . . . . . . . . . . . . . . . . . . . . . 332
Window Buttons . . . . . . . . . . . . . . . . . . . . 332
Choosing Target Settings . . . . . . . . . . . . . . . . . 335
Target Settings . . . . . . . . . . . . . . . . . . . . . 336
IDE User Guide IDE–9
Table of Contents
Code-Generation Settings . . . . . . . . . . . . . . . . 361
Editor Settings . . . . . . . . . . . . . . . . . . . . . 365
Debugger Settings . . . . . . . . . . . . . . . . . . . 366
10 Compiling and Linking 375
Choosing a Compiler . . . . . . . . . . . . . . . . . . . 376
Understanding Plug-in Compilers . . . . . . . . . . . . 376
Setting a File Extension . . . . . . . . . . . . . . . . . 376
Compiling and Linking a Project . . . . . . . . . . . . . . 377
Compiling Files . . . . . . . . . . . . . . . . . . . . 378
Setting Link Order . . . . . . . . . . . . . . . . . . . 379
Updating a Project . . . . . . . . . . . . . . . . . . . 380
Making a Project . . . . . . . . . . . . . . . . . . . . 380
Enabling Debugging . . . . . . . . . . . . . . . . . . 381
Running a Project . . . . . . . . . . . . . . . . . . . 382
Debugging a Project . . . . . . . . . . . . . . . . . . 382
Generating a Link Map . . . . . . . . . . . . . . . . . 383
Synchronizing Modification Dates . . . . . . . . . . . . 384
Handling Object Code . . . . . . . . . . . . . . . . . 384
Advanced Compile Options . . . . . . . . . . . . . . . 386
Using Precompiled or Preprocessed Headers . . . . . . . . . 387
Creating Precompiled Headers . . . . . . . . . . . . . . 388
Defining Symbols For C/C++ . . . . . . . . . . . . . . 390
Defining Symbols For Pascal . . . . . . . . . . . . . . . 392
Preprocessing Source Code. . . . . . . . . . . . . . . . . 394
Disassembling Source Code . . . . . . . . . . . . . . . . 394
Guided Tour of the Message Window . . . . . . . . . . . . 395
Using the Message Window . . . . . . . . . . . . . . . . 398
Seeing Errors and Warnings . . . . . . . . . . . . . . . 398
Stepping Through Messages . . . . . . . . . . . . . . . 400
Correcting Compiler Errors and Warnings . . . . . . . . . 400
Correcting Linker Errors . . . . . . . . . . . . . . . . 401
Correcting Pascal Circular References . . . . . . . . . . . 404
Saving and Printing the Message Window . . . . . . . . . 405
Locating Errors in Modified Files . . . . . . . . . . . . . 406
Special Library Options (Mac OS) . . . . . . . . . . . . . . 407
Import Weak. . . . . . . . . . . . . . . . . . . . . . 408
IDE–10 IDE User Guide
Table of Contents
Initialize Before . . . . . . . . . . . . . . . . . . . . 408
Merge Into Output . . . . . . . . . . . . . . . . . . . 408
11 Debugging Source Code 409
Symbolics Files . . . . . . . . . . . . . . . . . . . . . . 410
Preparing for Debugging . . . . . . . . . . . . . . . . . 411
Setting Up a Build Target for Debugging . . . . . . . . . 411
Setting Up a File for Debugging . . . . . . . . . . . . . 412
Generating Symbolics Information . . . . . . . . . . . . 413
Using the Debugger. . . . . . . . . . . . . . . . . . . . 414
Guided Tour of the Debugger . . . . . . . . . . . . . . . 415
Thread Window . . . . . . . . . . . . . . . . . . . . 416
Symbolics Window . . . . . . . . . . . . . . . . . . . 425
Symbol Hint . . . . . . . . . . . . . . . . . . . . . . 431
Debugger Contextual Menu . . . . . . . . . . . . . . . 431
Processes Window . . . . . . . . . . . . . . . . . . . 432
Expressions Window . . . . . . . . . . . . . . . . . . 436
Global Variables Window . . . . . . . . . . . . . . . . 437
Breakpoints Window . . . . . . . . . . . . . . . . . . 438
Watchpoints Window . . . . . . . . . . . . . . . . . . 439
Register Windows . . . . . . . . . . . . . . . . . . . 440
Log Window. . . . . . . . . . . . . . . . . . . . . . 445
Variable Window . . . . . . . . . . . . . . . . . . . . 446
Array Window . . . . . . . . . . . . . . . . . . . . . 447
Memory Window . . . . . . . . . . . . . . . . . . . 448
Basic Debugging . . . . . . . . . . . . . . . . . . . . . 450
Starting Up . . . . . . . . . . . . . . . . . . . . . . 451
Running, Stepping, and Stopping Code . . . . . . . . . . 454
Navigating Code . . . . . . . . . . . . . . . . . . . . 462
Breakpoints . . . . . . . . . . . . . . . . . . . . . . 467
Watchpoints . . . . . . . . . . . . . . . . . . . . . . 476
Viewing and Changing Data . . . . . . . . . . . . . . . 480
Editing Source Code . . . . . . . . . . . . . . . . . . 493
Expressions . . . . . . . . . . . . . . . . . . . . . . . 493
How Expressions are Interpreted . . . . . . . . . . . . . 494
Using Expressions . . . . . . . . . . . . . . . . . . . 497
Example Expressions . . . . . . . . . . . . . . . . . . 499
IDE User Guide IDE–11
Table of Contents
Expression Syntax . . . . . . . . . . . . . . . . . . . 501
Using Vector Variables in Expressions (Mac OS) . . . . . . 505
Troubleshooting . . . . . . . . . . . . . . . . . . . . . 506
General Problems . . . . . . . . . . . . . . . . . . . 507
Problems Launching the Debugger . . . . . . . . . . . . 507
Problems Running/Crashing the Debugger . . . . . . . . 509
Problems with Breakpoints . . . . . . . . . . . . . . . 509
Problems with Variables. . . . . . . . . . . . . . . . . 511
Problems with Source Files . . . . . . . . . . . . . . . 515
Debugger Error Messages . . . . . . . . . . . . . . . . 517
12 RAD Designs and Layouts 523
About RAD . . . . . . . . . . . . . . . . . . . . . . . 523
CodeWarrior RAD Tools . . . . . . . . . . . . . . . . . . 524
Class Authoring . . . . . . . . . . . . . . . . . . . . 524
Component Model . . . . . . . . . . . . . . . . . . . 524
Creating RAD Projects. . . . . . . . . . . . . . . . . . . 525
RAD Wizards . . . . . . . . . . . . . . . . . . . . . . 529
Java Applet Wizard . . . . . . . . . . . . . . . . . . . 530
Java Application Wizard . . . . . . . . . . . . . . . . 537
Java Bean Wizard. . . . . . . . . . . . . . . . . . . . 542
Working with Designs . . . . . . . . . . . . . . . . . . . 545
Adding Designs to a Project . . . . . . . . . . . . . . . 546
Design View in the Project Window. . . . . . . . . . . . 548
Designs in the Targets View . . . . . . . . . . . . . . . 549
Working with Layouts. . . . . . . . . . . . . . . . . . . 549
13 RAD Layout Editing 553
Layout Editor . . . . . . . . . . . . . . . . . . . . . . 553
Creating a Layout . . . . . . . . . . . . . . . . . . . 553
Modifying a Layout . . . . . . . . . . . . . . . . . . 554
Layout Wizards . . . . . . . . . . . . . . . . . . . . . 560
Java Frame Wizard . . . . . . . . . . . . . . . . . . . 561
Component Palette . . . . . . . . . . . . . . . . . . . . 563
Component Palette Toolbar . . . . . . . . . . . . . . . 563
Catalog Pop-up Menu . . . . . . . . . . . . . . . . . 564
Component Tools . . . . . . . . . . . . . . . . . . . 564
IDE–12 IDE User Guide
Table of Contents
Component Catalog window . . . . . . . . . . . . . . . . 567
Component Catalog Toolbar . . . . . . . . . . . . . . . 568
Catalog Pane . . . . . . . . . . . . . . . . . . . . . 569
Component Pane . . . . . . . . . . . . . . . . . . . . 569
Component Catalog Contextual Menu . . . . . . . . . . 573
Creating Component Catalogs . . . . . . . . . . . . . . 574
Object Inspector . . . . . . . . . . . . . . . . . . . . . 578
Object Pop-up Menu . . . . . . . . . . . . . . . . . . 578
Properties Tab . . . . . . . . . . . . . . . . . . . . . 579
Events Tab . . . . . . . . . . . . . . . . . . . . . . 581
Object Inspector Contextual Menu . . . . . . . . . . . . 582
14 RAD Components 585
Java AWT Components . . . . . . . . . . . . . . . . . . 585
Java Swing Components . . . . . . . . . . . . . . . . . . 586
Component Editors . . . . . . . . . . . . . . . . . . . . 588
Menu Editor . . . . . . . . . . . . . . . . . . . . . . 589
Pop-up Menu Editor . . . . . . . . . . . . . . . . . . 593
15 RAD Browsing 595
Browser Window RAD Features . . . . . . . . . . . . . . 595
Tab Control . . . . . . . . . . . . . . . . . . . . . . 595
Properties View . . . . . . . . . . . . . . . . . . . . 597
Methods View . . . . . . . . . . . . . . . . . . . . . 598
Events View . . . . . . . . . . . . . . . . . . . . . . 599
RAD Windows . . . . . . . . . . . . . . . . . . . . . . 600
New Property Window . . . . . . . . . . . . . . . . . 600
New Method Window . . . . . . . . . . . . . . . . . 602
New Event Set Window . . . . . . . . . . . . . . . . . 605
New Event Set wizard . . . . . . . . . . . . . . . . . 607
New Event Window . . . . . . . . . . . . . . . . . . 613
16 Using the CodeWarrior® IDE with Version Control Systems 617
Using Version Control Systems . . . . . . . . . . . . . . . 617
Commercially Available VCS Plug-ins. . . . . . . . . . . 617
Activating VCS Operations . . . . . . . . . . . . . . . . 619
Installing VCS Software . . . . . . . . . . . . . . . . . 619
Activating VCS Software . . . . . . . . . . . . . . . . 619
IDE User Guide IDE–13
Table of Contents
Accessing VCS Features . . . . . . . . . . . . . . . . . . 622
VCS Menu . . . . . . . . . . . . . . . . . . . . . . 622
Version Control Login Window . . . . . . . . . . . . . 625
VCS Pop-up . . . . . . . . . . . . . . . . . . . . . . 625
Project Window . . . . . . . . . . . . . . . . . . . . 628
VCS Messages Window . . . . . . . . . . . . . . . . . 629
Common VCS Operations . . . . . . . . . . . . . . . . . 629
Getting a File’s Status . . . . . . . . . . . . . . . . . . 629
Modifying a Checked In File . . . . . . . . . . . . . . . 630
Dealing with ‘ckid’ Resources (Mac OS) . . . . . . . . . 631
Other Operations. . . . . . . . . . . . . . . . . . . . 631
A CodeWarrior® IDE Menu Reference 633
IDE Menu Tables . . . . . . . . . . . . . . . . . . . . . 634
Info Menu . . . . . . . . . . . . . . . . . . . . . . . 635
File Menu . . . . . . . . . . . . . . . . . . . . . . . 635
Edit Menu . . . . . . . . . . . . . . . . . . . . . . . 637
View Menu . . . . . . . . . . . . . . . . . . . . . . 638
Search Menu. . . . . . . . . . . . . . . . . . . . . . 639
Project Menu . . . . . . . . . . . . . . . . . . . . . 642
Debug Menu . . . . . . . . . . . . . . . . . . . . . 644
Data Menu . . . . . . . . . . . . . . . . . . . . . . 647
Browser Menu . . . . . . . . . . . . . . . . . . . . . 649
Layout Menu . . . . . . . . . . . . . . . . . . . . . 650
Window Menu . . . . . . . . . . . . . . . . . . . . . 651
VCS Menu . . . . . . . . . . . . . . . . . . . . . . 653
Tools Menu . . . . . . . . . . . . . . . . . . . . . . 653
Scripts Menu . . . . . . . . . . . . . . . . . . . . . 654
Editor Extensions Menu . . . . . . . . . . . . . . . . . 654
Help Menu . . . . . . . . . . . . . . . . . . . . . . 655
Alphabetical Menu-Command Listing . . . . . . . . . . . . 655
Submenu Listing . . . . . . . . . . . . . . . . . . . . . 696
Java Exceptions Submenu . . . . . . . . . . . . . . . . 696
Align Submenu . . . . . . . . . . . . . . . . . . . . 697
Resize Submenu . . . . . . . . . . . . . . . . . . . . 697
Toolbar Submenu . . . . . . . . . . . . . . . . . . . 698
IDE–14 IDE User Guide
Table of Contents
B Solaris™ and Linux Utilities 703
Copy Files Accessory . . . . . . . . . . . . . . . . . . . 703
Source File/Directory Selection . . . . . . . . . . . . . 704
Currently Selected Files/Directories . . . . . . . . . . . 705
Destination Directory Selection. . . . . . . . . . . . . . 706
File Systems Facility. . . . . . . . . . . . . . . . . . . . 706
The File Systems Dialog Box . . . . . . . . . . . . . . . 707
The File System Options Dialog Box . . . . . . . . . . . 708
Keyboard Preferences Dialog Box . . . . . . . . . . . . . . 711
C Opening Project Files from Earlier IDE Versions 715
Converting a Single 1.7 Project . . . . . . . . . . . . . . . 715
Converting Multiple 1.7 Projects (Mac OS) . . . . . . . . . . 716
Opening Project Files from Versions Prior to 1.7 (Mac OS) . . . 717
Index 719
IDE User Guide IDE–15
Table of Contents
IDE–16 IDE User Guide
1
Introduction
This manual describes the CodeWarrior® Integrated Development
Environment (IDE). You can use the IDE to develop software for
various operating systems using programming languages such as C,
C++, and the Java™ programming language.
NOTE On occasion a CodeWarrior product ships with an earlier version
of the IDE than reflected in this user guide. New features
described in this manual do not apply to previous IDE versions.
See “New in This Release” on page 26 to learn about new
features. Visit the following web site for more information about
available patches and updates for CodeWarrior tools:
http://www.metrowerks.com/
The following sections introduce you to the CodeWarrior IDE User
Guide:
• CodeWarrior IDE Overview
• IDE User Guide Overview
• Read the Release Notes!
• Manual Conventions
• New in This Release
• Where To Go From Here
CodeWarrior IDE Overview
The CodeWarrior IDE is an application that provides a set of tools
for developing software using a graphical user interface (GUI).
You can use the IDE to perform the following actions:
• Edit code
IDE User Guide IDE–17
Introduction
CodeWarrior IDE Overview
• Navigate through code
• Examine code
• Compile code
• Link code
You can also configure options for code generation, project
navigation, and other operations.
IDE Tools
CodeWarrior products include various IDE tools. The following list
shows the tools that ship with most IDE versions:
• A source-code editor
• A source-code browser
• Compilers
• Linkers
• Assemblers
• A debugger
NOTE See the documentation that came with your CodeWarrior product for
information on which tools your product includes.
IDE Flexibility
The following table describes several ways in which the
CodeWarrior IDE provides flexibility.
Multiple hosts You can run the IDE on a variety of host computers while
you develop software. The CodeWarrior product that
you purchased determines the hosts available to you.
Multiple platform targets The CodeWarrior product that you purchased
determines the platform targets for which you can create
code. For example, you can use the IDE to develop
software for Pentium® computers running the Microsoft®
Windows® operating system.
IDE–18 IDE User Guide
Introduction
CodeWarrior IDE Overview
Multiple programming You can use the IDE to develop a program, plug-in,
languages library, or other executable code using different
programming languages such as C, C++, and Java.
Plug-in architecture A plug-in is a small, loadable code module that extends
the functionality of the parent program. The IDE uses
plug-ins to support several tools, including the
compilers, linkers, and the CodeWarrior debugger.
The IDE may also include additional plug-ins, depending
on the version that you purchased. You can also use
third-party plug-in tools, such as plug-in compilers and
debuggers.
CodeWarrior Projects
A project is a collection of related files and configuration settings
that the CodeWarrior IDE uses to organize your software
development.
Using projects allows you to avoid writing complicated build
scripts (makefiles). Instead of editing build scripts, you can use
simple mouse and keyboard operations to manipulate CodeWarrior
projects.
You can use a single project to create and manage several
configurations of your software for use on various computer
platforms.
Project-related terms
CodeWarrior terminology frequently uses the project-related terms
defined in the following table.
Host The system on which you run the CodeWarrior IDE to develop
code. A sample host is a computer that runs the IDE on the
Microsoft® Windows® operating system.
IDE User Guide IDE–19
Introduction
CodeWarrior IDE Overview
Platform target The operating system, processor, or microcontroller for which you
develop code. A sample platform target is a PowerPC™ computer
that runs the Mac® OS operating system software.
Build target The collection of settings and files that determines the contents of
your code and the process by which the IDE compiles and links the
code into a final output file. A sample build target is a debugging
build target that includes specific debugging settings for a project.
Multiple build targets
In the CodeWarrior IDE, you can specify multiple build targets for a
particular platform target.
For example, Figure 1.1 on page 21 shows the organization of a
project for a Windows platform target. The project includes the
following items:
• a debugging build target of a software application
• an optimized release build target of the same software
application
Within a single project, build targets with distinct settings can share
the same collection of files. The build targets manipulate the files to
produce different results. For example, after debugging a program,
you need only switch to a different build target and then choose a
menu command to generate a final version of the same program.
IDE–20 IDE User Guide
Introduction
IDE User Guide Overview
Figure 1.1 A Project and its Build Targets
IDE User Guide Overview
Table 1.1 lists every chapter in this manual, and describes the
information contained in each. However, this manual only contains
information about general software development with the
CodeWarrior IDE. See “Targeting Documentation” on page 29 for a
discussion of how these chapters relate to other CodeWarrior
documentation.
Table 1.1 Contents of Chapters
Chapter Description
Introduction an overview of the IDE, manual conventions, and
CodeWarrior documentation
Getting Started system requirements, installation, and a guided tour
of the user interface
IDE User Guide IDE–21
Introduction
Read the Release Notes!
Chapter Description
Working with Projects creating, configuring, and managing projects
Working with Files opening, saving, backing up, comparing, and printing
files
Editing Source Code editing and navigating text and source code
Finding and Replacing Text finding and replacing text in various files
Browsing Source Code analyzing and navigating a project from various
views
Configuring IDE Options customizing the IDE Preferences window and using
toolbars
Configuring Target Options customizing build targets in a project
Compiling and Linking compiling, linking, running, updating, preprocessing,
and precompiling project files
Debugging Source Code using the CodeWarrior debugger to examine code
RAD Designs and Layouts rapid application development (RAD) and its
implementation in the CodeWarrior IDE
RAD Layout Editing using the CodeWarrior RAD tools to create and
manage project designs and layouts
RAD Components descriptions of the components provided with the
CodeWarrior RAD tools
RAD Browsing using the Class Browser and Object Inspector to
examine RAD project designs
Using the CodeWarrior® IDE working with version-control systems and the
with Version Control Systems CodeWarrior IDE
Read the Release Notes!
Please read the release notes. They contain last-minute addenda
since the documentation was printed. You can find the release notes
on the CodeWarrior CDs in the Release Notes folder.
IDE–22 IDE User Guide
Introduction
Manual Conventions
Manual Conventions
The following sections describe the different conventions used in
the CodeWarrior IDE User Guide:
• Typographical Conventions
• Host Conventions
• Figure Conventions
• Keyboard Conventions
Typographical Conventions
The CodeWarrior IDE User Guide applies some style conventions to
make it easier to read and find specific information.
Notes, warnings, tips, and beginner hints
An advisory statement or NOTE restates an important fact, or calls
your attention to a fact that might not be obvious.
NOTE This is a sample note. Notes state important facts.
A WARNING calls attention to an operation that, if performed, could
be irreversible or otherwise cause an error.
WARNING! This is a sample warning. Failure to heed warnings can cause
undesirable results.
A TIP helps you become more proficient with the CodeWarrior IDE.
This manual provides tips for improving your productivity,
efficiency, and overall IDE prowess.
TIP This is a sample tip. Tips provide useful knowledge for improving the
way you work with the IDE.
A For beginners note helps you better understand terminology and
concepts if you are new to programming.
IDE User Guide IDE–23
Introduction
Manual Conventions
For beginners This is a sample For Beginners note. Read these notes for
information geared towards new programmers.
Typeface conventions
If you see text that appears in a different typeface (as the word
different does in this sentence), the text represents file or folder
names, source code, keyboard input, or programming items.
Text formatted like this means that the text refers to an item on the
screen, such as a menu command or control in a dialog box.
A > character separates each command in a menu hierarchy. For
example, Window > Toolbar > Reset Window Toolbar lists the
hierarchy you follow to select the Reset Window Toolbar
command. In this example, you would highlight Window in the
menu bar, then highlight Toolbar, and finally choose the Reset
Window Toolbar command.
You can use online viewing applications that support hypertext
navigation to read electronic versions of CodeWarrior
documentation. You can click underlined and colored text in the
electronic documentation to view related information. For example,
when using the Adobe® Acrobat® Reader software, clicking the text
“IDE User Guide Overview” takes you to a section that gives you an
overview of the entire CodeWarrior IDE User Guide.
Host Conventions
Throughout this manual, generic platform identifiers describe
CodeWarrior IDE hosts. The following list explains these generic
identifiers:
• Windows—desktop versions of the Windows operating system
that comply with the Win32® application programming interface
(API), such as the Windows® 95, Windows® 98, and Windows
NT® operating systems.
• Mac OS—the Mac OS operating system software, version 7.1 or
later.
• Solaris—the Solaris™ Operating Environment software, version
2.5.1 or later.
IDE–24 IDE User Guide
Introduction
Manual Conventions
• Linux—Red Hat® Linux for x86 version 5.2 or later, or SuSE™
Linux for x86 version 6.1 or later.
Figure Conventions
The visual interfaces of the hosts described in “Host Conventions”
on page 24 are nearly identical in all significant respects. When
discussing a particular interface element, such as a dialog box or a
window, the screenshot of that element can come from a variety of
possible hosts. You should have no difficulty understanding the
picture, even if you use the CodeWarrior IDE on a different host
than the one shown in the screenshot.
However, there are occasions when dialog boxes or windows are
unique to a particular host. For example, a dialog box for a
Windows host might appear dramatically different from the same
dialog box for a Mac OS host. In such cases, this manual clearly
identifies each screenshot so that you can see how the IDE operates
on your host.
Keyboard Conventions
The CodeWarrior IDE uses similar default keyboard shortcuts, or
key bindings, across most hosts. However, keys that have similar
functions across hosts have different names. For example, the Ctrl
key on a Windows host usually performs the same operation as the
Command key on a Mac OS host and the Meta key on a Solaris host.
To handle these kinds of situations, a list shows each key binding
along with its corresponding host. For operations that require
multiple keystrokes, hyphens separate each key in the binding. For
example, the key binding Ctrl-Alt-P instructs you to press and hold
the Ctrl, Alt, and P keys, then release them.
Special note for Solaris users and Linux users
On Solaris and Linux computers, you can map modifier keys to any
key on the keyboard. See “Keyboard Preferences Dialog Box” on
page 711 for more information on changing the default modifier key
mappings. When reading this manual, you must remember your
changes to the default modifier key mappings.
IDE User Guide IDE–25
Introduction
New in This Release
New in This Release
The CodeWarrior IDE includes new features with each major
release. The following list details the most notable new features:
• Find and Replace
• Selectable Menu Bar Layouts
• Shielded Folders
• Remote Debugging
• Symbolics Window
• Project Engine Improvements
• Import/Export of IDE Preferences and Target Settings
• Contextual Menu Improvements
Find and Replace
The IDE includes new functionality to help you find text in a single
file, find and replace text in a single file, as well as find and replace
text across multiple files. In addition to searching multiple files, you
can search specific folders, projects, and symbolics files. The Find
dialog box, Find and Replace dialog box, and Find In Files window
provide the new find-and-replace features.
For more information, see “Finding and Replacing Text” on page
167.
Selectable Menu Bar Layouts
The IDE now uses two different menu bar layouts to organize
menus and menu commands. The Windows menu bar layout
resembles the menu structure of Windows-based applications. This
layout introduces the View menu, which contains menu commands
that open various IDE windows. The Macintosh menu bar layout
preserves the traditional IDE menu structure, which resembles the
structure of Macintosh-based applications. You can change the
default menu bar layout for your IDE host.
For more information, see “Menu bar layout” on page 259 and
“CodeWarrior® IDE Menu Reference” on page 633.
IDE–26 IDE User Guide
Introduction
New in This Release
Shielded Folders
You can now specify folders that you wish to ignore during certain
types of operations. You use Shielded Folders preference panel to
specify the folders to ignore, and types of operations in which to
ignore them. This preference panel expands on previous shielded-
folder operations, such as ignoring folders with names enclosed in
parentheses.
For more information, see “Shielded Folders” on page 266.
Remote Debugging
You can now organize and modify several configurations of remote-
debugging connections. These configurations allow you to make
minor adjustments while maintaining functionality. The Remote
Connections preference panel and the Remote Debugging settings
panel control connections between two computers, as well as
connections between a computer and embedded hardware. The
Other Executables settings panel sends executable files to the
remote computer during the debugging session.
For more information, see “Remote Connections” on page 296,
“Other Executables” on page 366, and “Remote Debugging” on
page 372.
Symbolics Window
The IDE now includes a Symbolics window that presents detailed
information about projects, files, and symbolics files. This single
window lists each active project or build target that contains
symbolics information. Selecting a project allows you to view the
files, functions, and source code belonging to that project or build
target.
For more information, see “Symbolics Window” on page 425.
Project Engine Improvements
The IDE now collects information about unresolved source trees
and reports this information in a Message window. The Remove
IDE User Guide IDE–27
Introduction
Where To Go From Here
Object Code dialog box now incorporates the functionality of
Compact Targets and allows you to recurse subprojects.
For more information, see “Handling Object Code” on page 384.
Import/Export of IDE Preferences and Target
Settings
The IDE Preferences window and Target Settings window now let
you import and export IDE preferences and project build-target
settings in Extensible Markup Language (XML) file format.
See “Export Panel and Import Panel buttons” on page 256 for more
information.
Contextual Menu Improvements
Contextual menus in the IDE now include additional commands
organized into groups. The Editor Settings preference panel allows
you to individually enable or disable these groups. Hierarchical
submenus organize long lists of declarations and definitions.
For more information, see “Contextual Menus” on page 278.
Where To Go From Here
If you are new to the CodeWarrior IDE, or if you want to quickly get
started using the IDE with a new platform, see “Getting Started and
Tutorials” on page 29.
If you are an experienced CodeWarrior IDE user, see “New in This
Release” on page 26 for an overview of new features.
To learn how to use the IDE with a new target operating system, see
“Targeting Documentation” on page 29.
When you are ready to debug your code, see “Debugging Source
Code” on page 409.
The following sections give you a better idea of how to proceed:
• Getting Started and Tutorials
IDE–28 IDE User Guide
Introduction
Where To Go From Here
• Targeting Documentation
• Adobe Acrobat Indexes
Getting Started and Tutorials
The documentation mentioned in this section resides in the
CodeWarrior Documentation folder. This folder, included on at
least one of the CDs in your CodeWarrior product, contains
manuals in PDF, HTML, or other combinations of formats.
The folder also includes a complete index of the CodeWarrior
documentation for use with Adobe Acrobat. See “Adobe Acrobat
Indexes” on page 30 for more information.
If you are new to the CodeWarrior IDE, consult the following
resources:
• Refer to the Getting Started guide for an overview of your
CodeWarrior product and available references.
• See “An Introduction to the CodeWarrior IDE” on page 37 for an
overview of the CodeWarrior IDE user interface.
• Refer to the CodeWarrior Documentation folder for
instructions on using online documentation viewers.
• To learn more about the CodeWarrior IDE, its features and
capabilities, visit the Metrowerks Training web site:
http://www.metrowerks.com/training/
Locate the self-paced tutorial link on the site to get started.
• Free, online supplemental courses in a variety of programming
disciplines like C, C++, and the Java programming language are
available at the following web site:
http://www.codewarrioru.com/
Targeting Documentation
The CodeWarrior IDE User Guide describes how to use the cross-
platform features of the IDE. However, you must also read the
appropriate CodeWarrior targeting documentation to learn how to
develop software for a specific platform target.
IDE User Guide IDE–29
Introduction
Where To Go From Here
For example, if you wish to learn how to use the IDE to develop
software for the Windows desktop, you must consult at least two
references:
• The CodeWarrior IDE User Guide—to learn about general IDE
features
• Targeting Windows—to learn about specific software
development issues for the Windows-desktop platform target
The CodeWarrior Documentation folder, included on at least
one of the CDs in your CodeWarrior product, contains the targeting
documentation in PDF, HTML, or other combinations of formats.
The folder also includes a complete index of the CodeWarrior
documentation for use with Adobe Acrobat. See the next section,
“Adobe Acrobat Indexes,” for more information.
Adobe Acrobat Indexes
An Acrobat PDX index is included on the CodeWarrior Reference CD
that provides a global index across all the Portable Document
Format (PDF) documentation included with CodeWarrior. Add the
CodeWarrior index to Acrobat’s Available Indexes list using the
Edit > Search > Select Indexes menu option. Once added, you can
easily search for all occurrences of an item, like stationery, or
Carbon, or anything.
IDE–30 IDE User Guide
2
Getting Started
This chapter helps you get started using the CodeWarrior® IDE. You
can find information about system requirements, IDE software
installation, and an introduction to the IDE user interface and its
capabilities.
This chapter includes the following sections:
• System Requirements
• CodeWarrior IDE Installation
• Programming Concepts
• An Introduction to the CodeWarrior IDE
NOTE This manual describes how to use the cross-platform features of the
IDE. To learn how to develop software for a particular platform
target, you should read additional CodeWarrior documentation. See
“Targeting Documentation” on page 29 for more information.
TIP See “An Introduction to the CodeWarrior IDE” on page 37 for a
preliminary tour of the CodeWarrior IDE.
System Requirements
This section specifies the requirements to operate the CodeWarrior
IDE on the following hosts:
• Windows
• Mac OS
• Solaris
• Linux
IDE User Guide IDE–31
Getting Started
System Requirements
Windows
The Windows-hosted version of the CodeWarrior IDE requires the
following items:
• an Intel® Pentium®-class processor, AMD-K6™-class processor,
or greater
• at least 32 megabytes of RAM
• approximately 90 megabytes of free hard disk space for a
minimal installation
• Microsoft® Windows® operating system (Windows® 95,
Windows® 98, Windows NT® 4.0 with Service Pack 3 or later, or
Windows® 2000)
• a CD-ROM drive to install the software.
Mac OS
The Mac OS-hosted version of the CodeWarrior IDE requires the
following items:
For hosted development on Classic Mac OS:
• a PowerPC™ 601 or greater processor
• at least 64 megabytes of RAM
• approximately 150 megabytes of free hard disk space for a
minimal installation
• Mac® OS operating system software, version 8.6 or 9.x.
• CarbonLib 1.0.4
• a CD-ROM drive to install the software
For hosted development on Mac OS X:
• a PowerPC™ G3 or greater processor
• at least 128 megabytes of RAM
• approximately 150 megabytes of free hard disk space for a
minimal installation
• Mac® OS X DP4. The IDE is a Carbon™ application under
Mac OS X.
• a CD-ROM drive to install the software
IDE–32 IDE User Guide
Getting Started
CodeWarrior IDE Installation
Solaris
The Solaris-hosted version of the CodeWarrior IDE requires the
following items:
• a Sun™ SPARCstation™ or SPARC®-based computer
• at least 64 megabytes of RAM
• approximately 80 megabytes of free hard disk space
• Solaris™ Operating Environment software version 2.5.1 or later,
an X11-R5 display server, and Motif® version 1.2 or later (CDE
recommended)
• a CD-ROM drive to install the software.
Linux
The Linux-hosted version of the CodeWarrior IDE requires the
following items:
• an Intel Pentium-class processor or AMD K6-class processor
• at least 64 megabytes of RAM
• approximately 80 megabytes of free hard disk space
• Red Hat® Linux for x86 version 5.2 or later, SuSE™ Linux for x86
version 6.1 or later, and an X11-R5 display server
• a CD-ROM drive to install the software
CodeWarrior IDE Installation
To learn how to install the IDE, refer to the Getting Started guide.
The installation software places the CodeWarrior IDE, compilers,
linkers, and other tools on your hard disk.
Programming Concepts
If you are new to computer programming, read this section to learn
about the terms used in this manual.
There are three important tasks involved in software development:
• Creating Input Files
IDE User Guide IDE–33
Getting Started
Programming Concepts
• Generating the Software
• Debugging and Refining the Software
First, you create files that contain statements written in a computer
language such as C, C++, the Java™ programming language, or
assembly language. You can also create files that contain resources,
which are descriptions of user-interface objects such as windows,
dialog boxes, and menus.
Next, you apply tools that transform your source materials into
software that executes on your target computer. Such tools include
compilers, linkers, assemblers, and debuggers. You use these tools
to create different types of software, depending on the tools used
and the target computer. For example, you could create applications
(executable files), dynamic libraries (shared libraries), and static
libraries.
After you create a piece of software, you can use a debugger to
examine that software. The debugger helps you determine whether
the software executes as you intended. If the software does not
execute properly, you make changes to your source material to
correct each problematic software bug. You continue to revise and
debug the source material until the software works correctly.
Creating Input Files
You create and use several types of files when developing software:
source-code files, resource files, interface or header files, library
files, and project files.
Source-code file
A source-code file is a text file containing program statements
written in a language such as C, C++, the Java programming
language, or assembly language.
Resource file
A resource file contains descriptions of user-interface items, such as
window definitions, dialog-box layouts, and text strings. A resource
file can be a binary file or a text file translated by a special resource
compiler. The IDE links these resource files into your software.
Placing resources in separate files makes it convenient to tweak and
IDE–34 IDE User Guide
Getting Started
Programming Concepts
customize those resources without having to recompile other parts
of a program.
Interface or header file
An interface file, also called a header or include file, is a text file
referred to by source-code files. Typically, interface files give access
to objects, variables, data structures, routines, and other items in
libraries or source-code files.
Library file
A library file contains objects, variables, routines, and other items
that are already compiled. There are two library types: static
libraries and dynamic libraries.
The IDE builds a static library into a program. A static library
cannot change (hence the term static) unless you rebuild the
software. Furthermore, you cannot share static libraries with other
programs.
Although a program might refer to a dynamic library, the IDE does
not build a dynamic library into a program. Instead, the program
accesses the library dynamically, that is, while the program is
actually running. Often, more than one program shares the same
dynamic library. You can replace a dynamic library with a newer
version. Programs that utilize the dynamic library remain
unaffected, as long as the newer library version provides the same
operations as the original library version.
NOTE Most platform targets support static libraries, but not all platform
targets support dynamic libraries. See “Targeting Documentation”
on page 29 for information on resources for platform targets.
Project file
A project file contains one or more build targets. Each build target
contains source-code files, resources, interfaces, library files, and
even other project files. Each build target also contains its own
settings that tell the IDE how to create your software. See “Projects
and Targets” on page 37 for more information on build targets.
IDE User Guide IDE–35
Getting Started
Programming Concepts
Generating the Software
The CodeWarrior IDE uses compilers, assemblers, and linkers to
build your software. The IDE automatically chooses the appropriate
tools to create your software, based on information provided by the
build targets in your project.
Compilers
A compiler translates a source-code file, such as a C, C++, or Java
file, into binary machine code (also called object code). The compiler
is one of the first tools the IDE invokes to build your program. At a
later stage, linkers use the object code generated by compilers to
complete the build process.
Assemblers
An assembler translates an assembly-language file into object code.
An assembler is really just a compiler, only it translates assembly-
language code rather than high-level language code such as C, C++,
or the Java programming language.
Linkers
A linker combines the object code in a build target with the object
code produced by the compilers and assemblers. The final result is
an output file.
Output file
The linker generates the output file. There are different types of
output files, such as applications and libraries. Refer to the
CodeWarrior targeting documentation for more information about
the software that you can develop for a platform target. See
“Targeting Documentation” on page 29 for additional details.
Debugging and Refining the Software
A debugger facilitates controlled program execution and helps you
find errors in your code. You can use the debugger to stop program
execution and view variable contents. You can also execute one line
of code at a time.
IDE–36 IDE User Guide
Getting Started
An Introduction to the CodeWarrior IDE
To use the CodeWarrior debugger with your software, you must
configure your project to produce special information. This
debugging information (also known as symbolics files) contains data
that the debugger needs to display and control statements,
variables, objects, and data types in your source code. Thus, the
debugger uses symbolics files to control your program.
In addition to its own debugger, the IDE supports third-party
debuggers on some platforms. Refer to the CodeWarrior targeting
documentation for more information.
See “Debugging Source Code” on page 409 for information on the
CodeWarrior debugger.
An Introduction to the CodeWarrior IDE
This section describes the concepts, tasks, and general operation of
the CodeWarrior IDE. This section discusses the following topics:
• Projects and Targets
• Source-Code Editing and Browsing
• Compiling and Linking
• Project Debugging
• Rapid Application Development
• Version Control
• Scripting
• Customizing the IDE
• Working with Third-Party Tools
See “CodeWarrior IDE Overview” on page 17 and “Programming
Concepts” on page 33 for information on the terms used in this
section.
Projects and Targets
The IDE uses projects and build targets to organize the files and
settings used to create a program. A project contains one or more
build targets. A build target is a collection of source-code files,
resource files, libraries, settings, even other projects, that describes
IDE User Guide IDE–37
Getting Started
An Introduction to the CodeWarrior IDE
how to create a piece of software for a particular processor or
operating system. Build targets within a project can share the same
files, but each build target has its own settings.
The CodeWarrior IDE has pre-configured stationery projects that
simplify the project-creation process. When you use stationery,
creating a new project involves deciding on a platform target,
choosing a programming language, and then selecting a
corresponding stationery project.
You set project options by manipulating its build targets. You can
customize several settings, including the following examples:
• Platform-target selection
• Compiler optimizations
• Object-code details
• Source-code translation
You can also specify the kinds of files to add to a build target.
Depending on the platform target, you can set additional options.
See “Targeting Documentation” on page 29, “Working with
Projects” on page 43, and “Configuring Target Options” on page
331 for more information on working with projects and build
targets.
Source-Code Editing and Browsing
The IDE has a powerful and flexible text editor for use with source-
code and text files. In addition to regular text-editing features, the
IDE provides drag-and-drop editing, text-file manipulation in
various file formats, and marker navigation in a text file.
The editor also has many practical features for programmers.
Programming aids include automatic indention, syntax coloring,
routine and interface pop-up menus, and automatic balancing of
braces, brackets, and parentheses. The editor works closely with the
Class Browser to help you edit, view, and navigate among routines,
data structures, variables, and objects.
The IDE lets you search for normal text or regular expressions and
replace matching items. Your search can span a single file or a
IDE–38 IDE User Guide
Getting Started
An Introduction to the CodeWarrior IDE
group of files. You can also specify the types of files you wish to
search.
You can use a file-comparison and merging command to display
two text files side-by-side. This arrangement lets you compare
differences between the files. In addition, you can compare the
contents of two folders and look for differences between files.
See “Working with Files” on page 109, “Editing Source Code” on
page 137, “Finding and Replacing Text” on page 167, and
“Browsing Source Code” on page 205 for more information on
working with text and source-code files.
Compiling and Linking
The IDE has commands to preprocess, precompile, compile, update,
link, run, disassemble, and check syntax. The IDE automatically
chooses the compilers and linkers to operate on the appropriate files
when you issue a compile or link command. The IDE uses the
settings in the build targets within a project to determine how to
process files and data. The Project Menu provides the commands
you need to carry out this process.
See “Configuring Target Options” on page 331 and “Compiling and
Linking” on page 375 for information on options for compilation,
linking, and software generation.
Project Debugging
The CodeWarrior debugger provides detailed information on
program execution as you debug your source code. The debugger
fully supports x86, PowerPC, 68K, and Java debugging.
After you configure your project and enable the debugger, you Run
the project to use debugging features. You can pause the program at
any time to set breakpoints and watchpoints, view variables or
memory, step into or out of routines, and perform many other
debugging tasks.
NOTE Some versions of the CodeWarrior IDE do not ship with the
CodeWarrior debugger. In such cases, you must use an external
debugging application or third-party debugger to provide debugging
IDE User Guide IDE–39
Getting Started
An Introduction to the CodeWarrior IDE
support. For additional information, see the CodeWarrior targeting
documentation.
Rapid Application Development
The CodeWarrior IDE includes rapid application development
(RAD) tools that help you create user interfaces for your
applications. The IDE manages the software framework and
generates basic source code automatically. In addition, you can
revise the generated source code or write your own source code to
handle tasks more efficiently.
See “RAD Designs and Layouts” on page 523 for more information
on the CodeWarrior RAD tools.
Version Control
You can configure the IDE to work with a particular version control
system (VCS). You can log onto a file server, retrieve files, store files,
and perform other revision-control tasks. You can choose from
several VCS software packages that support the CodeWarrior IDE.
See “VCS Pop-Up Menu” on page 143 and “Using the
CodeWarrior® IDE with Version Control Systems” on page 617 for
information on using the IDE with VCS software.
Scripting
The IDE supports scripting via Perl scripts, Visual Basic® scripts,
batch files (Windows), and AppleScript® scripts (Mac OS). When
you script the IDE, you can automate repetitive, time-consuming, or
complex tasks.
Refer to the CodeWarrior Scripting Reference for more information on
scripting the IDE.
Customizing the IDE
The IDE has many user-configurable options. You use the IDE
Preferences window to customize features, such as the colors and
fonts used for viewing and editing source code, as well as the key
IDE–40 IDE User Guide
Getting Started
An Introduction to the CodeWarrior IDE
bindings used for activating specific commands. The IDE also
provides customizable toolbars that provide buttons for invoking
commands and viewing information.
See “Configuring IDE Options” on page 253 for more information
on customizing the IDE.
Working with Third-Party Tools
The IDE works with third-party text editors, debuggers, and
development tools. For example, the IDE can work with other tools
in the following situations:
• Using an external text editor to create source-code files
• Connecting to hardware for a debugging session
• Managing source-code revisions using a version-control system.
See “IDE Extras” on page 259, “Debugging a Project” on page 382,
and “Using the CodeWarrior® IDE with Version Control Systems”
on page 617 for information on using the CodeWarrior IDE with
third-party tools.
IDE User Guide IDE–41
Getting Started
An Introduction to the CodeWarrior IDE
IDE–42 IDE User Guide
3
Working with Projects
This chapter introduces the CodeWarrior® IDE Project window and
shows how to create, configure, and work with projects.
A project contains one or more build targets, as shown in Figure 1.1
on page 21. Each build target in a project contains a collection of
files that the IDE uses to build an output file. Build targets within a
project can share some or all of their files. Sample output files
include applications, static libraries, and dynamic libraries.
Each build target within a project has its own options that
customize how the IDE builds the output file. There are a wide
variety of options that control code optimization, browsing,
debugging, compiler warnings, and much more.
You can also configure build targets within a project to depend on
other build targets in the project. This feature makes it possible to
build software that, for example, combines the output files for
different platform targets into a single output file.
This chapter discusses many of the basic tasks involving projects,
such as creating projects, opening projects, adding files, and saving
projects. In addition, you can learn advanced operations such as
moving files in the Project window, marking files for debugging,
creating nested projects and build targets, and dividing the Project
window into file groups.
This chapter discusses the following topics:
• Guided Tour of the Project Window
• Creating a New Project
• Working with Project Stationery
• Importing Makefiles into Projects
• Opening an Existing Project
IDE User Guide IDE–43
Working with Projects
Guided Tour of the Project Window
• Saving a Project
• Closing a Project
• Choosing a Default Project
• Managing Files in a Project
• Working with Complex Projects
• Examining Project Information
• Moving a Project
• Importing and Exporting a Project
• Controlling Debugging in a Project
• Adding Preprocessor Symbols to a Project
Guided Tour of the Project Window
The Project window shows information about the various files and
build targets in a project. The Project window uses four different
views: the Files view, Design view, Link Order view (sometimes
called Segments view or Overlays view), and Targets view. To
choose a view, click its tab at the top of the Project window, as
shown in Figure 3.1.
Figure 3.1 Project Window Tabs
The Files view shows a list of all the files in a project. You can
organize the items in this view into hierarchical groups.
The Design view shows the rapid application development (RAD)
designs in the project. This view appears only when you develop
software using the CodeWarrior RAD tools.
IDE–44 IDE User Guide
Working with Projects
Guided Tour of the Project Window
The Link Order view shows information about the compilation and
link settings the IDE uses to build the final output file for the current
build target.
The Targets view shows information about the active build target,
build targets associated with RAD designs, build-target
dependencies, and link-compatible build targets.
The following topics explain the Project window in detail:
• Navigating the Project Window
• Project Window Toolbar
• Files View
• Design View
• Link Order View
• Targets View
To learn more about debugging information, see “Controlling
Debugging in a Project” on page 104.
Navigating the Project Window
To navigate the Project window, use the vertical scroll bar on the
right side of the window, or use the Up-Arrow and Down-Arrow
keys on your keyboard. If the Project window contains several files,
use the Home key to jump to the first file in the first segment or
group, and use the End key to jump to the last file in the last
segment or group.
Use the Page Up and Page Down keys to scroll one page up or one
page down the Project window.
To learn about a technique for selecting files as you type, refer to
“Selection by keyboard” on page 75.
Project Window Toolbar
The toolbar in the Project window has buttons and other items that
provide shortcuts to commands and information about the project.
You can choose the items to display on the toolbar and the order in
which those items appear. You can also choose to hide or display
IDE User Guide IDE–45
Working with Projects
Guided Tour of the Project Window
the toolbar itself. To learn more about toolbars in the CodeWarrior
IDE and how to configure them, refer to “Customizing the IDE” on
page 306.
Files View
The Files view shows the files for all build targets in the project. You
can arrange the files into hierarchical groups without affecting the
way the IDE handles a build target. The Files view also shows
information about modification status, file access paths, code size,
data size, current build target, debugging status, and other
information.
The following topics describe the Files view:
• File column
• Code column
• Data column
• Target column
• Debug column
• Touch column
• Sorting items
• Interface pop-up menu
• Project window contextual menu
• Checkout Status column
• Project Checkout Status icon
• Checkout Status column
• Project File Proxy icon (Mac OS)
File column
The File column lists files and groups in a configurable hierarchical
view. A group can contain files and other groups.
Double-clicking a file name in the File column opens that file. For
more information on opening files from the File column, refer to
“Opening Files from the Project Window” on page 113.
IDE–46 IDE User Guide
Working with Projects
Guided Tour of the Project Window
Use the hierarchical control, shown in Figure 3.2, to display and
hide group contents in the File column.
To see the path along which the IDE accesses a file, follow these
steps:
Windows Right-click the file name in the Project window, then
choose Open in Windows Explorer from the contextual menu that
appears.
Mac OS Control-click the file name in the Project window, then
choose File Path from the contextual menu that appears. The File
Path submenu lists the path to the file.
Solaris and Linux Click and hold on the file name in the Project
window, then choose File Path from the contextual menu that
appears. The File Path submenu lists the path to the file.
Figure 3.2 Project Window
Code column
The Code column shows the size, in bytes or kilobytes, of the
compiled executable object code for files and groups. A 0 in the
Code column indicates that the file is not currently compiled. A n/a
in the column indicates that the file is not in the current build target,
or that the IDE cannot compile executable code for the file.
IDE User Guide IDE–47
Working with Projects
Guided Tour of the Project Window
The values in the Code column do not reflect the amount of object
code that the IDE adds to the final output file. The linker might not
use all the object code in a file when creating the final output.
Instead, the linker can ignore data and code that other files in the
project do not reference (known as deadstripping code).
For more information on how the linker works, see “Compiling and
Linking a Project” on page 377.
Data column
The Data column shows the size, in bytes or kilobytes, of non-
executable data in the object code for files in the project. A 0 in the
Data column indicates that the file is not currently compiled, or that
the file does not contain a data section in its object code. A n/a in the
column indicates that the file has no object code.
Like the Code column, the values in the Data column do not reflect
the amount of data that the IDE adds to the final output file.
For more information on how the linker works, see “Compiling and
Linking a Project” on page 377.
Target column
The Target column shows whether an item is in the current build
target. This column appears only when the project has more than
one build target. A black marker in the Target column indicates that
the corresponding item is in the current build target. A gray marker
for a group indicates that only some of the files in the group are in
the current build target.
To toggle the assignment of a particular file in the project to the
current build target, click the Target column for that file. To
simultaneously toggle the assignment of every file in the project to
the current build target, use one of the following techniques:
Windows, Solaris, and Linux Alt-click in the Target column
Mac OS Option-click in the Target column
For information on using the Target column to add and remove files
in build targets, see “Assigning Files to Build Targets” on page 98.
IDE–48 IDE User Guide
Working with Projects
Guided Tour of the Project Window
Debug column
The Debug column shows whether the IDE generates debugging
information for specific files. A black marker in this column
indicates that the IDE generates debugging information for the
corresponding item. A gray marker for a group indicates that the
IDE generates debugging information for only some of the files in
the group.
To toggle the generation of debugging information for a particular
file in the project, click the Debug column for that item. To
simultaneously toggle debugging information generation for every
file in the project, use one of the following techniques:
Windows, Solaris, and Linux Alt-click in the Debug column
Mac OS Option-click in the Debug column
To learn more about file debugging, see “Generating Debugging
Information for a File” on page 105.
Touch column
The Touch column shows whether a file needs to be compiled the
next time the IDE builds a target. A black marker in this column
indicates that the IDE re-compiles the corresponding item the next
time you choose the Bring Up To Date, Make, Run, or Debug
commands. A gray marker for a group indicates that the IDE re-
compiles only some of the files in the group.
To toggle re-compilation for a particular file in the project, click the
Touch column for that item. To simultaneously toggle re-
compilation for every file in the project, use one of the following
techniques:
Windows, Solaris, and Linux Alt-click in the Touch column
Mac OS Option-click in the Touch column
To learn more about this feature, see “Synchronizing modification
dates” on page 88.
Sorting items
You can sort the items listed in the Files view of the Project window.
Click a particular column title to sort the listed items accordingly.
IDE User Guide IDE–49
Working with Projects
Guided Tour of the Project Window
The active column title appears darker than the other column titles.
Click the active column title a second time to stop sorting the items.
For example, clicking the File column title, as shown in Figure 3.3,
sorts the listed items alphabetically by file name. Clicking the title
again stops sorting according to file-name criteria. You can click
only one column title at a time.
After clicking a column title to sort items, you can toggle the sort
order by clicking the Sort Order button. This button changes its
appearance to indicate the current sorting order:
Items are currently sorted in ascending order.
Items are currently sorted in descending order.
Figure 3.3 Sorting Listed Items in the Files View
IDE–50 IDE User Guide
Working with Projects
Guided Tour of the Project Window
Interface pop-up menu
The Interface pop-up menu lists and opens interface and header
files for your source-code files. This pop-up menu also lets you
touch or untouch the selected item and set other options.
For groups, the Interface pop-up menu lists the files within the
group. To open a file, choose its name from the list in the pop-up
menu.
For more information about opening interface and header files, see
“Interface pop-up menu” on page 114.
Project window contextual menu
Figure 3.4 shows a sample contextual menu that appears in the
Project window. Use one of the following techniques to display the
contextual menu:
Windows Right-click a file name in the Project window.
Mac OS Control-click a file name in the Project window.
Solaris and Linux Click and hold on a file name in the Project
window.
Figure 3.4 Contextual Menu in the Project Window
IDE User Guide IDE–51
Working with Projects
Guided Tour of the Project Window
You can choose a command from the contextual menu to operate on
the selected item. The commands that appear in the menu depend
on the selected item. The following examples show you how to use
some common commands in the contextual menu:
• To check the programming language syntax of the selected file,
choose Check Syntax from the pop-up menu.
• To compile the selected file, choose Compile from the pop-up
menu.
• To remove the selected item from the project, choose Delete or
Clear from the pop-up menu.
For more information about contextual menus in other parts of the
IDE, see contextual menus in the index.
Checkout Status column
The Checkout Status column, shown in Figure 3.2 on page 47,
shows whether files are checked in or checked out of a version
control system (VCS). Use this column to track changes to your
code, particularly when more than one person works on your
software project. The Checkout Status column appears only when
you configure your CodeWarrior project to use a version control
system. For more information about using a particular VCS product,
refer to its documentation.
Project Checkout Status icon
The Project Checkout Status icon shows whether a project is
writable, as well as the file access permissions for that project. A
version control system assigns these permissions when you check in
or check out a project file.
To learn more about the Project Checkout Status icon and how the
icon relates to the access permissions assigned to your source-code
files, see “Getting a File’s Status” on page 629. To learn more about
using a particular version control system, refer to its
documentation.
Project File Proxy icon (Mac OS)
The Project File Proxy icon, shown in Figure 3.2 on page 47, allows
you to manipulate the project file whose contents currently appear
IDE–52 IDE User Guide
Working with Projects
Guided Tour of the Project Window
in the Project window. This proxy icon behaves the same way as the
proxy icons in the Finder of Mac OS 8.5 or later. For example, to
move the project file to the trash, click and hold the proxy icon until
it changes color, then drag it from the Project window to the trash.
Design View
The Design view shows the rapid application development (RAD)
designs in your project. This view shows the objects that belong to
particular designs as well as the names of those objects. You can use
the Design view a convenient starting point for inspecting object
names, object properties, and design hierarchies.
When your project includes RAD designs, you can use the Targets
view of the Project window to see the hierarchy of designs and
build targets for the entire project. A single project file lets you
manage multiple designs. Within each design, you can manage
multiple build targets.
For more information about RAD designs, see “RAD Designs and
Layouts” on page 523.
Link Order View
The CodeWarrior IDE compiles project files in the order shown in
the Link Order view. This view is useful for explicitly specifying a
custom build order. For example, if file B depends on information
from file A, and the default build order processes file B before file A,
the IDE might fail to compile the project. You can avoid this
problem by changing the ordering of the files in the Link Order
view to process file A before file B.
Changing the order of files in the Link Order view affects the final
binary code produced by your project file. You cannot nest items in
the Link Order view more than one level deep.
For more information about link order, see “Setting Link Order” on
page 379. For more information about file groups, see “Managing
Files in a Project” on page 72.
Mac OS The Link Order view might be named Segments for
some build targets. Refer to “Targeting Documentation” on page 29
for more information.
IDE User Guide IDE–53
Working with Projects
Guided Tour of the Project Window
Embedded The Link Order view might be named Overlays for
some build targets. Refer to “Targeting Documentation” on page 29
for more information.
Targets View
The Targets view shows a list of the build targets in the project. This
view also shows the items required by the build targets to create a
final output file. Figure 3.5 shows a sample Targets view.
The Targets view also contains the Link column. Use this column to
establish dependencies among build targets. For example, one build
target might depend on the output of another build target. To
establish this dependency in the Targets view, click in the Link
column next to the build target that creates the output.
If your project includes RAD designs, the Targets view also shows
the hierarchy of build targets within each design. For more
information on working with build targets, see “Working with
Complex Projects” on page 89. To learn more about designs, see
“RAD Designs and Layouts” on page 523.
Figure 3.5 Targets View in the Project Window
IDE–54 IDE User Guide
Working with Projects
Creating a New Project
Creating a New Project
Creating a new CodeWarrior project file involves the following
concepts:
• Types of Project Files
• Choosing a Project Stationery File
• Naming Your New Project
• Using the New Project dialog box
• Modifying Your New Project
• Building Your New Project
Types of Project Files
CodeWarrior uses these types of files to create new projects:
• Project Stationery—Project stationery contains pre-configured
libraries, source-code placeholders, and resource file
placeholders. You can use project stationery to create new
projects. Novice programmers and programmers that want the
convenience of pre-configured settings should use project
stationery. For more information, see “Working with Project
Stationery” on page 60.
• RAD Wizards—Rapid application development (RAD) wizards
present a series of customizations that guide you through the
process of creating a RAD project. To learn how to use these
wizards, see “Creating RAD Projects” on page 525.
• Empty Project—Empty project files do not contain any files
whatsoever. You can use empty projects for detailed
configuration of compiler and linker settings. Advanced
programmers can take advantage of empty projects to create
fully customized applications.
• Makefile Importer Wizard (Windows)—The Makefile Importer
wizard parses a Visual C nmake file or a GNU make file and
creates a CodeWarrior project. For more information about
using the Makefile Importer, see “Importing Makefiles into
Projects” on page 64.
The rest of this section discusses creating new projects using project
stationery. For additional information, see “Working with Project
Stationery” on page 60.
IDE User Guide IDE–55
Working with Projects
Creating a New Project
NOTE Advanced programmers interested in using empty projects should
read “Configuring Target Options” on page 331. That chapter
provides information about configuring compiler and linker settings
for use with projects.
Choosing a Project Stationery File
To use a project stationery file to create a new project, choose File >
New. The CodeWarrior IDE displays the New window, shown in
Figure 3.6.
Figure 3.6 New Window
IDE–56 IDE User Guide
Working with Projects
Creating a New Project
Click the Project tab near the top of the New window to display the
Project panel. The items listed in the Project panel represent various
types of project files. The items with names ending in Stationery
represent project stationery files.
To create new projects from stationery, you progress through a
hierarchy of choices. First, you select stationery for a particular
platform target, such as a computer that runs the Windows® or
Mac® OS operating systems. Next, you specify a specific operating
system, language, or programming framework. After you designate
these more general options, you can choose from several pre-
configured project stationery files.
After you select an item in the Project panel list, various options
appear along the right side of the panel.
To create a new project from stationery, select the appropriate
Stationery item in the Project panel list. For example, to create a
project that uses the C or C++ programming language to develop an
application for the Mac OS, select the Mac OS C/C++ Stationery
item in the list.
To create an empty project that has no libraries or other support
files, select the Empty Project item in the Project panel list.
For beginners Selecting Empty Project is not recommended because of the
complexities of including the correct libraries and files and choosing
the correct target settings. Instead of creating an empty project, use
the project stationery files provided by the CodeWarrior IDE. These
pre-configured stationery files already contain basic settings for
getting started with a new project.
For more information about project stationery, see “Working with
Project Stationery” on page 60.
Naming Your New Project
After choosing File > New and selecting an item in the Project tab
of the New window, enter a name for the new project in the Project
name field (Figure 3.6 on page 56).
IDE User Guide IDE–57
Working with Projects
Creating a New Project
TIP You should complete the name of the project file with a .mcp file-
name extension, like this: MyProject.mcp. This naming
convention helps you quickly identify the file as a Metrowerks
CodeWarrior Project. Furthermore, the Windows-hosted version of
the CodeWarrior IDE uses this extension to properly recognize the
project file.
The Location field (Figure 3.6 on page 56) shows the full path to the
folder in which the project is saved. To change the current path,
enter a new path directly into the field.
Alternatively, click the Set button to display a dialog box. Use the
dialog box to navigate to the location in which you want to save the
project. Enable the Create Folder checkbox if you wish to create a
new folder to contain the project file and all of its associated files.
Then click Save to confirm the location and return to the New
window.
After entering a name for the new project and specifying a location
in which to save that project, click OK in the New window. The
New Project dialog box appears.
WARNING! If you try to save the new project, and you already have an existing
project with the same name in the same location, an error message
appears. Be sure to use a unique name for your new project.
Using the New Project dialog box
The New Project dialog box, shown in Figure 3.7 on page 59,
presents a list of project stationery based on your choice from the
New window. For example, if you selected the Win32 C/C++
Application Stationery item in the New window, the New Project
dialog box shows a list of C or C++ project stationery for the
Windows platform. Browse through this list, select the stationery
file representing the type of project you wish to create, and click
OK.
IDE–58 IDE User Guide
Working with Projects
Creating a New Project
Figure 3.7 New Project Dialog Box
In some cases, the New Project dialog box presents a hierarchy of
project stationery. The topmost level of the hierarchy shows the
languages or programming frameworks for which project stationery
is available. Click the hierarchical control next to the particular
language or framework you want to use for your project. Then,
browse through the expanded list and select the stationery file
representing the type of project that you wish to create.
For example, suppose you want to create a new project geared
towards a Java™ 2 application. First, you would click the
hierarchical control next to the Java2 option in the New Project
dialog box. The list expands and shows the project stationery for the
Java programming language. Expanding the Java2 option reveals a
project stationery file named Java Application. This file provides a
Java 2 application structure. When you select Java Application and
click OK, the CodeWarrior IDE creates a new project with all the
libraries and support files you need.
After you select a project stationery file and click OK, the
CodeWarrior IDE automatically sets up a new project in the
following ways:
IDE User Guide IDE–59
Working with Projects
Working with Project Stationery
• Creates a project folder with the same name as your project file
(if you enabled the Create Folder checkbox as discussed in
“Naming Your New Project” on page 57). For example, the IDE
creates a folder named MyProject to store the project file
named MyProject.mcp and the information associated with
that project file.
• Copies the stationery Preferences and Target Settings to the
newly created project file.
• Opens the Project window. The new project contains libraries,
source-code placeholders, and resource-file placeholders that
appear in this window. If you chose to create an empty project,
no files or libraries appear in the window.
Modifying Your New Project
Most new projects created from stationery contain source-file
placeholders. You probably want to delete these placeholders and
replace them with source files of your own. See “Managing Files in a
Project” on page 72 to learn more about manipulating files in a
project
You can also add additional libraries to the project file. To learn
about the types of libraries you can include, refer to the Targeting
manual of interest to you. See “Targeting Documentation” on page
29 for more information.
Building Your New Project
After you create your project and add your own files to it, you can
build it to produce your software. To learn how to build a project,
refer to “Compiling and Linking” on page 375.
Working with Project Stationery
This section describes the creation and use of project stationery. For
more information about the role of project stationery in the project-
creation process, see “Creating a New Project” on page 55.
You can configure a CodeWarrior project to contain multiple build
targets. Each project can also contain a collection of subprojects. For
IDE–60 IDE User Guide
Working with Projects
Working with Project Stationery
more information, see “CodeWarrior IDE Overview” on page 17
and “Working with Complex Projects” on page 89.
This section includes the following topics:
• About Project Stationery
• About the Project Stationery Folder
• Creating Your Own Project Stationery
About Project Stationery
A project stationery file is typically a minimal, pre-configured
project file. Think of it as a template, or blank slate, that you can use
to create a new project. When you create a new project using a
project stationery file, the CodeWarrior IDE copies to the newly
created project all the files contained in the project stationery file.
A project stationery file includes the following items:
• Options and settings for the project
• Libraries, source-code files, and resource files for the project
• (Mac OS) All segmentation and grouping information, including
segment loader settings (68K projects only) and names
After creating a new project from the project stationery file, you can
use the new project to begin developing code in the IDE.
About the Project Stationery Folder
The IDE provides project stationery files for different kinds of
projects. The Project Stationery folder organizes the project
stationery files into a hierarchy of nested folders.
The IDE recognizes the following types of files within the Project
Stationery folder:
• Normally saved projects
• Project stationery files
• (Mac OS) Aliases to projects
The Project Stationery folder resides at the following location:
IDE User Guide IDE–61
Working with Projects
Working with Project Stationery
Windows The Stationery folder, inside the CodeWarrior
folder
Mac OS The (Project Stationery) folder, inside the
Metrowerks CodeWarrior folder
Solaris and Linux The (Project Stationery) folder, inside
the CodeWarrior folder
Creating Your Own Project Stationery
You can create a unique stationery (template) project file that
contains your customized collection of files and options.
Configuring your own project stationery file allows you to re-use
your customized settings each time you create a new project.
For beginners Before creating your own project stationery, study the existing
project stationery files supplied with the IDE. Understanding the
purpose of each file in the project stationery files helps you develop
more useful project stationery files.
To create your own project stationery file, follow these steps:
1. Create a new project from an existing project stationery file.
See “Creating a New Project” on page 55 for more information.
2. Choose File > Save A Copy As.
A dialog box appears.
3. Use the dialog box to save the new project to the Project
Stationery folder.
You must create a folder in which to store the new project. The IDE
recognizes a project stationery file by its enclosing folder. Make sure
to complete the project-file name with the .mcp extension. The
Windows-hosted CodeWarrior IDE requires this extension in order
to properly recognize the file.
4. Modify the project settings to best suit your needs.
Add and remove files as needed, rearrange files, and configure the
project exactly as you would like to have for a base project. The
CodeWarrior IDE duplicates these settings when using your
customized project stationery file to create new projects.
IDE–62 IDE User Guide
Working with Projects
Working with Project Stationery
5. Ensure that copies of all project source files are present in the
project folder.
If the source files are not in the same folder as the project file, the
IDE cannot duplicate those source files to any new projects created
with your project stationery file.
6. Save your changes after you finish modifying the project.
The project now contains all the settings that the IDE needs to create
new projects. Because you saved the project to the Project Stationery
folder, the IDE recognizes the project as a project stationery file.
7. Close the project.
After closing the project, the IDE generates a project data folder for
the project file. By default, this folder appears within the same
folder as the project file. The name of the project data folder
contains the name of the project file. For example, the IDE generates
a MyProject_Data folder for a project file named
MyProject.mcp.
8. Delete the project data folder.
The IDE does not use the project data folder to create new projects
from stationery. After you delete the project data folder, your
project is ready for use as a project stationery file.
After you save your stationery file in the Project Stationery folder,
you can use that stationery the next time you choose File > New.
After you use your custom project stationery file to create a new
project, the IDE duplicates all of the files associated with your
project stationery file to the new project.
To learn how to configure the Preferences in your project stationery
file, see “Choosing Preferences” on page 256. See “Choosing Target
Settings” on page 335 to learn about configuring the Target Settings
in a similar way.
For information about adding files or changing files in the project,
see “Managing Files in a Project” on page 72. See “Backing up files”
on page 120 for more information about saving a copy of the project
under a different name.
Since you saved the project stationery file before continuing work
with it, your favorite default settings become available again the
IDE User Guide IDE–63
Working with Projects
Importing Makefiles into Projects
next time you use your project stationery file to create a new project.
New projects created with your project stationery file include all the
settings you initially configured for that stationery file.
If at any time you decide that you want to use different project
settings for new projects, you can create a new project stationery
file. Follow the same procedure described in this section to create
the new project stationery file. If you wish to replace the older
version of the project stationery file with the newer version, save the
new version to the same location as the old version, under the same
name, and replace (overwrite) the old version.
Importing Makefiles into Projects
The Windows-, Solaris-, and Linux-hosted CodeWarrior IDE can
import Visual C nmake or GNU make files into CodeWarrior project
files. The IDE uses the Makefile Importer wizard to process the
files. This wizard performs the following tasks:
• Parses the makefile
• Creates a CodeWarrior project
• Creates build targets
• Adds source files as specified in the makefile
• Matches the information specified in the makefile to the output
name, output directory, and access paths of the newly created
build targets
• Selects a linker to use with the project
This section discusses the following topics:
• Using the Makefile Importer Wizard
• Makefile Importer Wizard Options
Using the Makefile Importer Wizard
To create a new project from a makefile, follow these steps:
1. Choose File > New.
The New window, shown in Figure 3.6 on page 56, appears.
IDE–64 IDE User Guide
Working with Projects
Importing Makefiles into Projects
2. Click the Project tab in the New window
The Project view appears.
3. Select Makefile Importer Wizard from the list.
4. Follow the conventions for naming the new project and saving it
to a particular location.
“Naming Your New Project” on page 57 describes these
conventions.
5. Click OK in the New window.
The Makefile Importer wizard appears.
See “Makefile Importer Wizard Options” for more information
about using the wizard.
Makefile Importer Wizard Options
The Makefile Importer Wizard, shown in Figure 3.8 on page 66,
presents several options that help you customize the makefile-
conversion process. The wizard covers the following options:
• Makefile Location
• Settings
• Diagnostic Settings
After configuring these options as desired, click Finish. The
Makefile Importer Wizard presents a summary window of current
conversion settings. Click Generate to import the makefile
according to these settings, or click Cancel to return to the wizard
and make additional changes.
Makefile Location
Enter in this field the path to makefile that you wish to import into a
CodeWarrior project file. Alternatively, click the Browse button to
open a dialog box. Use the dialog box to locate the makefile. After
you locate and select the makefile, click Open. The path to the
makefile appears in the Makefile Location field.
IDE User Guide IDE–65
Working with Projects
Importing Makefiles into Projects
Figure 3.8 Makefile Importer Wizard
Settings
These options determine the tool set used for the makefile
conversion as well as the linker selection for the new project file.
The options include the following items:
• Tool Set Used In Makefile—Choose from this pop-up menu the
tool set whose build rules form the basis of the makefile.
• Metrowerks Tool Set—Choose from this pop-up menu the
linker tool set that you wish to use for the generated
CodeWarrior project.
IDE–66 IDE User Guide
Working with Projects
Opening an Existing Project
Diagnostic Settings
The following checkboxes handle message reporting for various
types of information generated during the conversion process:
• Log Targets Bypassed—Enable this checkbox to log information
about the build targets parsed in the makefile that were not
converted to CodeWarrior build targets.
• Log Build Rules Discarded—Enable this checkbox to log
information about the build rules in the makefile that were
discarded in the conversion to a CodeWarrior project.
• Log All Statements Bypassed—Enable this checkbox to log the
same information as the Log Targets Bypassed and Log Build
Rules Discarded checkboxes, as well as information about other
items in the makefile that were not understood during the
parsing process.
After the conversion process completes, details about the generated
information appear in a Message window, shown in Figure 3.9. For
more information about using this window, see “Guided Tour of
the Message Window” on page 395.
Figure 3.9 Message Window
Opening an Existing Project
This section tells you how to open your projects so that you can
work on them.
The CodeWarrior IDE allows you to keep several projects open at
the same time. To work with one of several opened projects, choose
the project name from the Window Menu.
IDE User Guide IDE–67
Working with Projects
Opening an Existing Project
You can specify a default project on which IDE commands operate.
See “Choosing a Default Project” on page 71 for more information.
This section includes the following topics:
• Using the Open Command
• Using the Open Recent Command
• Using the Project Window to Open Subprojects
• Opening Project Files Created on Other Host Platforms
Using the Open Command
To open a project file, you can use the Open menu command. To
use the menu command, follow these steps:
1. Choose the File > Open.
A dialog box appears.
2. Select the project file that you wish to open.
On the Windows-hosted IDE, use the Files of Type pop-up menu in
the dialog box to select Project Files. The file list changes to show
the project files that you can open.
3. Click Open.
The IDE displays a Project window for the opened project.
NOTE See “Opening Project Files from Earlier IDE Versions” on page 715
for more information about using project files created on early
versions of the CodeWarrior IDE.
To learn more about working with CodeWarrior project files, see
“Working with Projects” on page 43.
Using the Open Recent Command
The CodeWarrior IDE maintains in the File Menu a list of recently
opened projects. As a convenience, you can use the Open Recent
menu command to re-open one of these projects.
To learn about setting the number of files that the IDE remembers in
this menu, see “IDE Extras” on page 259.
IDE–68 IDE User Guide
Working with Projects
Opening an Existing Project
Using the Project Window to Open Subprojects
If your project contains subprojects, and you want to open one of
those subprojects, double-click the subproject file’s icon in the
Project window. The IDE displays the subproject in a new Project
window.
To learn more about subprojects, and how to add them to a Project
window, refer to “Working with Complex Projects” on page 89.
Opening Project Files Created on Other Host
Platforms
CodeWarrior IDE project files are cross-platform. For example, on a
Windows computer you can open a project created on a Macintosh
computer.
To use a project created on another host platform, copy only its
project file, not its associated Data folder, from the other host
platform to your computer. After copying the project, open it in the
IDE and recompile its files. Although a project’s format is cross-
platform, its compiled object code is not.
NOTE Before copying a project, ensure that the project has a “.mcp” file-
name extension (without the quotes). For example, if the project’s
name is MyProject, rename it to MyProject.mcp. The Windows-
hosted version of the CodeWarrior IDE requires this file-name
extension in order to recognize the project file.
TIP When creating any project, always add the “.mcp” extension to the
project file’s name.
See also “Document Settings Pop-Up Menu” on page 142 for
information on editing source code files created on other platforms
and “Host Flags” on page 342 for information on configuring access
paths for a host platform.
IDE User Guide IDE–69
Working with Projects
Saving a Project
Saving a Project
The CodeWarrior IDE automatically updates and saves your project
after you perform certain actions. This section describes the actions
that cause the IDE to save a project file.
The IDE saves your project after you perform one of the following
actions:
• Close the project
• Change Preferences or Target Settings for the project
• Add or delete files in the project
• Compile any file in the project
• Edit groups in the project
• Remove object code from the project
• Quit the CodeWarrior IDE
You do not need to manually save your project unless you want to
create a copy of it. See “Saving a Copy of Your Project” on page 70
for more information.
Items Saved with Your Project
The CodeWarrior IDE automatically saves the following
information for your project:
• The names and locations of files added to the project
• All configuration options
• Dependency information (such as touch state and interface-file
lists)
• Browser information
• The object code of any compiled source-code files
Saving a Copy of Your Project
To save a copy of the project file (for example, as a backup), choose
File > Save A Copy As. The IDE creates a copy of the project file
under a new name that you specify. The IDE also leaves the original
project file intact.
IDE–70 IDE User Guide
Working with Projects
Closing a Project
WARNING! Do not use the desktop to copy project files currently open in the
IDE. Always use the IDE to close the project file before using the
desktop to copy that file. This technique helps you avoid corrupting
your project’s data.
Closing a Project
After you work with a project for a while, you might want to close it
and work on another project. You might want to close all projects,
quit the CodeWarrior IDE, and work on something else. This section
describes how to close project files.
To close a project, you close its Project window in the IDE. To close
the frontmost Project window, choose File > Close. If necessary, use
the Window Menu to bring the desired Project window forward.
You do not have to close your project before quitting the
CodeWarrior IDE. The IDE automatically saves your project after
you perform various actions. To learn more, see “Saving a Project”
on page 70.
The IDE allows you to have more than one project open at a time, so
you do not have to close a project before switching to another
project. Just open another project and begin working with it.
NOTE Having multiple projects open at the same time consumes more
memory on your computer, and also causes project-opening times
to lengthen slightly. Keep these performance issues in mind as you
work with multiple projects in the IDE.
Choosing a Default Project
Since the CodeWarrior IDE permits multiple open projects, it is
sometimes ambiguous as to which project a Make, Run, or other
operation applies. The IDE carries out the operation on the project
file whose Project window is currently active.
IDE User Guide IDE–71
Working with Projects
Managing Files in a Project
However, source-code files can belong to more than one open
project. In this case, you can use the Set Default Project menu
command to specify a default project for IDE operations. In any
ambiguous situation, the IDE applies the operation to the default
project that you choose.
The first project you open becomes the default project. If you close
the default project, the default project becomes the project with the
frontmost Project window. You use the menu command to specify a
different project.
Managing Files in a Project
This section discusses adding, moving, naming, organizing,
viewing, marking for compilation, and removing files from your
project. This section covers the following topics:
• Expanding and Collapsing Groups
• Selecting Files and Groups
• Adding Files
• Moving Files and Groups
• Creating Groups
• Removing Files and Groups
• Renaming Groups
• Touching and Untouching Files
Expanding and Collapsing Groups
In the Project window, groups organize files into collapsible lists.
Click a group’s name to expand it and view its contents. Click the
group’s name again to collapse it and view only its name.
You can expand or collapse all subgroups that belong to a particular
group, as shown in Figure 3.10. Use one of the following techniques:
Windows, Solaris, and Linux Alt-click the group’s name.
Mac OS Option-click the group’s name.
IDE–72 IDE User Guide
Working with Projects
Managing Files in a Project
Figure 3.10 Expanding Groups and Subgroups
You can also expand or collapse sibling groups (all groups at the
same level), as shown in Figure 3.11 on page 74. Use one of the
following techniques:
Windows, Solaris, and Linux Ctrl-click a group’s name.
Mac OS Command-click a group’s name.
Selecting Files and Groups
From the Project window, you can select one or more files and
groups to open, compile, check syntax, remove from the project, or
move to a different group.
Selecting a group includes all of its files, even if those files do not
appear to be selected in the Project window.
IDE User Guide IDE–73
Working with Projects
Managing Files in a Project
Figure 3.11 Expanding Sibling Groups
Selection by mouse-clicking
To select a single file or group in the Project window, click its name.
To select a consecutive list of files or groups, click the name of the
first file or group in the list, then Shift-click the name of the last file
or group. The IDE selects all groups and files between the ones that
you selected.
Another way to select a consecutive list of items is to drag-select
them, in the same way that you select items on the desktop.
To select or de-select any non-consecutive file or group, as shown in
Figure 3.12 on page 75, use one of the following techniques:
Windows, Solaris, and Linux Ctrl-click the file’s name
Mac OS Command-click the file’s name
IDE–74 IDE User Guide
Working with Projects
Managing Files in a Project
Figure 3.12 Non-consecutive File Selection
Selection by keyboard
To select a file or group by using the keyboard, type the first few
characters of the file’s or group’s name. The IDE selects the file or
group whose name most closely matches the characters you typed.
Windows, Solaris, and Linux If you make a mistake while
typing the characters, press Backspace. After the IDE selects the file
that you wish to open, press Enter.
Mac OS If you make a mistake while typing the characters, press
Delete. After the IDE selects the file that you wish to open, press
Return.
NOTE You can only use these techniques to select files in currently
expanded groups in the Project window. The IDE does not match
your keystrokes with the names of files in collapsed groups.
Adding Files
This section describes how to add files to your IDE project. You can
learn more about the following topics:
• Placement of added files and groups
• Using the Add Files command
• Using drag and drop
• Using the Add Window menu command
IDE User Guide IDE–75
Working with Projects
Managing Files in a Project
After adding a file to a project, the IDE adds the path used to locate
that file to the project’s Access Paths. The Message window appears
after the IDE adds a new access path to the project.
NOTE If you create a project using the Empty Project option, see “Linker”
on page 337 and “File Mappings” on page 350. These sections
describe how to configure the IDE so that you can add files to your
project.
Normally, the IDE forces each file in a project to have a unique
name. To remove this restriction, enable the Save project entries
using relative paths checkbox in the Target Settings panel.
See “Access Paths” on page 339 for more information about
defining additional paths in your project.
For more information about the Message window, see “Guided
Tour of the Message Window” on page 395.
Placement of added files and groups
The IDE always places added files and groups after the currently
selected item in the Project window. If the Project window does not
contain a selection, the added items appear at the bottom of the
window. To place a new file or group in a particular location,
always select the file or group above the desired location before
using the Add Files or Add Window command.
Regardless of the expanded or collapsed state of a selected group,
the IDE places the added files at the end of that group. To learn
about how to select a file or group of files, see “Selecting Files and
Groups” on page 73.
You can move a file or group to a new location within the project.
For more information, see “Moving Files and Groups” on page 83.
Using the Add Files command
Choose Project > Add Files to open the Add Files dialog box, which
helps you add files to your project. Use the menu command to add
source-code files, libraries, resource files, and other files.
IDE–76 IDE User Guide
Working with Projects
Managing Files in a Project
In order for files to appear in the dialog box, their extensions must
match a mapping defined in the File Mappings preference panel.
To examine and configure file mappings, see “File Mappings” on
page 350.
Add Files dialog box (Windows)
Figure 3.13 shows the Add Files dialog box. The Files of Type pop-
up menu is initially set to view All Files.
Use the dialog box to navigate through folders and drives to find
files that you wish to add.
To add a single file to your project, select the file and click Add.
Alternatively, double-click the file.
To select multiple files, as shown in Figure 3.13, press the Control
key while clicking the file names in the dialog box.
Figure 3.13 Adding Files to a Project (Windows)
IDE User Guide IDE–77
Working with Projects
Managing Files in a Project
To select a contiguous group of files, click on the first file name in
the group, then press the Shift key and click on the last file in the
group.
After you select the files that you wish to add, click Add. If your
project contains multiple build targets, the IDE prompts you (Figure
3.16 on page 82) to select the build targets to which you want the
files added. There might be a delay while the IDE locates the
selected files and adds them to your project.
Click Cancel to close the dialog box without adding any files to the
project.
Add Files dialog box (Mac OS)
Figure 3.14 shows the Add Files dialog box.
Figure 3.14 Adding Files to a Project (Mac OS)
IDE–78 IDE User Guide
Working with Projects
Managing Files in a Project
Use the pop-up menu at the top of the file list to navigate through
folders and drives to find files that you wish to add. You can also
use the Shortcuts, Favorites, or Recent buttons to assist your search.
To add a single file to your project, select the file and click Add.
Alternatively, double-click the file.
To select multiple files, click the disclosure triangles in the list to
reveal the files that you wish to add. Shift-click each file name to
include it in your selection. If you change your mind about adding a
particular file, Shift-click that file’s name to de-select it.
After you select the files that you wish to add, click Add. If your
project contains multiple build targets, the IDE prompts you (Figure
3.16 on page 82) to select the build targets to which you want the
files added. There might be a delay while the IDE locates the
selected files and adds them to your project.
Click Cancel to close the dialog box without adding any files to the
project.
Add Files dialog box (Solaris and Linux)
Figure 3.15 on page 80 shows the Add Files dialog box. The file path
field at the top of the dialog box displays the path to the current
directory listing.
Use the dialog box to navigate through folders and drives to find
files to that you wish to add. The Select files to add list shows the
files to be added to your project.
To add a file to your project, select the file in the directory listing
and click Add to move that file to the Select files to add list.
Alternatively, double-click the file to move it to the list. Repeat this
procedure for each file that you wish to add to your project.
Click Add All to add all the files displayed in the file list to the
Select files to add list (all available files in the directory).
To remove a file from the Select files to add list, select the file that
you wish to remove and click Remove.
Click Remove All to clear the Select files to add list.
IDE User Guide IDE–79
Working with Projects
Managing Files in a Project
Figure 3.15 Adding Files to a Project (Solaris and Linux)
After you select all the files that you wish to add, click Done. The
IDE adds to your project the files in the Select files to add list. If
your project contains multiple build targets, the IDE prompts you
(Figure 3.16 on page 82) to select the build targets to which you
want the files added. There might be a delay while the IDE locates
the selected files and adds them to your project.
Click Cancel to close the dialog box without adding any files to the
project.
Using drag and drop
You can drag and drop files or folders into an open Project window
to add them to the project.
IDE–80 IDE User Guide
Working with Projects
Managing Files in a Project
To add files to your project using this technique, first select the files
or folders that you wish to add. You can select files in various
places, including the desktop or the multi-file search list in the IDE’s
Find window.
To complete the add operation, drag your selection into the Project
window. If your project contains multiple build targets, the IDE
prompts you (Figure 3.16 on page 82) to select the build targets to
which you want the files added.
After you drag the selected files into the Project window, the IDE
verifies that it can add the files to the project. After you drag a folder
into the Project window, the IDE verifies that the folder, or one of its
subfolders, contains at least one source-code file, library, or resource
file, and that file is not already in the project.
The IDE rejects the drag-and-drop operation if the selection does
not contain at least one recognized file.
NOTE See “Linker” on page 337 and “File Mappings” on page 350 for more
information on configuring the IDE to recognize files.
Use the focus bar (an underline) that appears in the Project window
to place the files in a specific position within the existing group
hierarchy.
Releasing the mouse button (dropping the files) adds the dragged
items to the project, inserting them below the position indicated by
the focus bar. If your project contains multiple build targets, the IDE
prompts you (Figure 3.16 on page 82) to select the build targets to
which you want the files added.
The IDE does not allow you to drag an entire volume (such as your
hard disk) into the Project window.
The IDE allows you to drag and drop items outside of the Project
window. You can also drag files to another application to open
them in that application.
Although the IDE supports dragging and dropping files into the
Project window on all platforms, some platforms do not allow you
to remove files by dragging them out of the Project window. To
IDE User Guide IDE–81
Working with Projects
Managing Files in a Project
learn how to remove files from the Project window, see “Removing
Files and Groups” on page 85.
Figure 3.16 Adding Files to Specific Build Targets
Using the Add Window menu command
The Add Window menu command adds to the active project the file
associated with the active editor window. You typically use this
command when you create a new file and decide to add that file to
the active project.
The IDE enables the Add Window menu command only after you
meet the following criteria:
• The file that you wish to add is a text file.
• You open an editor window for the text file.
• The text file is not part of the active project.
• The file name contains an extension that the IDE recognizes. To
learn more about these extensions, see “File Mappings” on page
350.
IDE–82 IDE User Guide
Working with Projects
Managing Files in a Project
After meeting the criteria, you can use the Add Window menu
command by following these steps:
1. Ensure that a project is currently open.
The IDE adds the file to the active project.
2. Open the file that you wish to add to the project.
An editor window appears and shows the contents of the file.
3. Choose Project > Add Window.
The name of the menu command changes, based on the file name
shown in the title bar of the active editor window. For example, if
the name of the active window is MyFile, the name of the menu
command changes from Add Window to Add MyFile to Project.
If the file that you wish to add is currently untitled, the Save As
dialog box appears. Use the dialog box to name and save the file.
The IDE adds the saved file to the active project.
If your project contains multiple build targets, the IDE prompts you
(Figure 3.16 on page 82) to select the build targets to which you
want the file added.
Moving Files and Groups
You can move one or more files or groups within the Project
window’s views. For example, you can arrange build targets in the
Targets view.
Follow these steps to move files or groups:
1. Select the files or groups that you wish to move.
Selecting a group includes all of its files, even if those files do not
appear to be selected in the Project window. For more information
about selection, see “Selecting Files and Groups” on page 73.
2. Drag the selected files or groups to a new position in the Project
window.
A focus bar (underline) indicates the new position of the files that
you wish to move. The focus bar appears only in those positions
that accept the types of files in your selection. For example, if your
selection contains a group, the focus bar appears only under other
groups.
IDE User Guide IDE–83
Working with Projects
Managing Files in a Project
3. Drop the selected files or groups to the new position.
The IDE moves the items to the position indicated by the focus bar.
NOTE The focus bar has a small arrow at its left end that indicates the level
of insertion into the existing hierarchy. If the arrow is to the left of a
group icon, the insertion occurs at the same level as the target
group. If the arrow is to the right of the group icon, the insertion
occurs inside the target group.
Creating Groups
You can create groups in the Files view of the Project window.
Groups organize related files under a single name. You can show or
hide a group’s contents in the Project window.
To create a group in a project, follow these steps:
1. Bring forward the Project window in which you wish to create a
group.
The IDE adds new groups only to the active Project window.
2. Switch to the Files view of the active Project window.
The Files view shows the groups that organize your project’s files.
3. Choose Project > Create Group.
The Create Group dialog box appears.
Mac OS The new group might use the word “Segment” in place
of the word “Group” if the current build target is the 68K
microprocessor.
Embedded The new group might use the word “Overlay” in
place of the word “Group.”
4. Enter in the dialog box a name for the new group.
You can change the name at a later time. See “Renaming Groups”
on page 86 for more information.
5. Click OK.
The new group appears in the Files view of the Project window.
IDE–84 IDE User Guide
Working with Projects
Managing Files in a Project
Removing Files and Groups
You can use menu commands or drag and drop for supported
platforms to remove files from a Project window.
Using menu commands
You can remove files from either the Files view or the Link Order
view of the Project window. When removing files from the Project
window, you need to be aware of a subtle issue:
WARNING! If you remove files from the Files view of the Project window, the
IDE removes the files from the entire project, including all build
targets.
When removing files from the Link Order view (also called the
Segments view or Overlays view for some build targets), the IDE
removes the files from the current build target.
To learn more about build targets, see “What is a Build Target?” on
page 90.
To remove one or more files or groups in the Files view, follow
these steps:
1. Select the files or groups that you wish to remove.
Selecting a group includes all of its files, even if those files do not
appear to be selected in the Project window. To learn how to select
files, see “Selecting Files and Groups” on page 73.
2. Choose Edit > Delete (Windows menu bar layout) or Edit > Clear
(Macintosh menu bar layout).
The IDE removes the selected files and groups from the project.
WARNING! You cannot undo file or group removals. If you mistakenly remove a
group, you must re-add its files using either the Add Files or Add
Window menu commands.
IDE User Guide IDE–85
Working with Projects
Managing Files in a Project
Using drag and drop
The CodeWarrior IDE supports dragging and dropping files into
the Project window. On some host platforms, you cannot drag files
out of the Project window.
Renaming Groups
You can rename groups in the Project window. Your renamed
groups can reflect changes that you make to your project over time.
To rename a group, follow these steps:
1. Select the group that you wish to rename.
For more information about selecting items, see “Selecting Files and
Groups” on page 73. You can also use the arrow keys on your
keyboard to navigate to the desired group.
2. Display the Rename Group dialog box.
Use this dialog box, shown in Figure 3.17, to rename the selected
group.
Windows, Solaris, and Linux Press Enter to display the dialog
box.
Mac OS Press Return to display the dialog box
3. Enter a new name for the group in the Enter Group Name field.
4. Click OK.
The new group name appears in the Project window.
Figure 3.17 Rename Group Dialog Box
IDE–86 IDE User Guide
Working with Projects
Managing Files in a Project
If you select more than one group at a time, the Rename Group
dialog box appears multiple times, once for each group. Each Enter
Group Name field shows the current name of a specific group.
Mac OS On Mac OS 68K build targets, the Segment Info dialog
box shown in Figure 3.18 appears. This dialog box contains a series
of checkboxes that affect segment loader information. The Mac OS
68K linker uses the text that you enter in the Name field to name the
code segment when building the project. See the Targeting Mac OS
manual for more information on using segments.
Figure 3.18 Segment Info Dialog Box
Touching and Untouching Files
Use the Touch column shown in Figure 3.2 on page 47 to mark files
that need compilation. The CodeWarrior IDE does not always
recognize file changes and might not automatically re-compile all
files in certain situations. In such cases, you can use the Touch
column.
You can use one of the following techniques to ensure that the IDE
compiles a file:
• Click in the Touch column beside the file name in the Project
window’s Files view. A check mark appears in the Touch
IDE User Guide IDE–87
Working with Projects
Managing Files in a Project
column next to the file name. This check mark indicates that the
IDE re-compiles the file during the next build.
• Select the file that you wish to re-compile, then choose the Touch
command from the Interface pop-up menu.
• Click the check-mark icon at the top of the Touch column. The
IDE touches all files in entire project. The IDE re-synchronizes
the state of the files, depending on their modification dates. Use
this technique if you modify the files outside of the IDE.
NOTE If the file did not change since the IDE last compiled it, the first
command in the Interface pop-up menu is Touch. After you choose
the Touch command, the IDE compiles the file the next time it builds
your project. If the file changed since the IDE last compiled it, the
Untouch command appears instead of the Touch command.
To unmark files so that the IDE does not compile them during the
next build, use one of the following techniques:
• Click the check mark that appears in the Touch column to the
left of the file name
• Select the file that you wish to unmark, then choose the Untouch
command from the Interface pop-up menu.
Synchronizing modification dates
To update the modification dates stored in your project file, click the
check-mark icon at the top of the Touch column. Alternatively,
choose Project > Synchronize Modification Dates.
After you click the icon or choose the menu command, the IDE
checks the modification date of each file in the project. If the file was
modified since it was last compiled, the IDE marks it for re-
compilation. This strategy re-synchronizes the state of the files in
the project, depending on their modification dates.
Synchronizing modification dates is useful if you modify files
outside of the CodeWarrior IDE, perhaps by a third-party editor
that does not notify the CodeWarrior IDE after modifying a file.
NOTE (Mac OS) Some third-party editors use AppleEvents to inform the
IDE of a file modification. These editors include BBEdit™, Object
IDE–88 IDE User Guide
Working with Projects
Working with Complex Projects
Master™, and Alpha™. You do not need to use the Synchronize
Modification Dates command if you use one of these external
editors.
Working with Complex Projects
The CodeWarrior IDE provides flexible facilities for creating project
files that use sophisticated build rules. This section discusses how to
construct complex project files that contain other projects or
different kinds of build-target code. These types of projects allow
you to create powerful build hierarchies for your software.
For example, you can set up a complex project that contains build
targets for both shipping and debugging versions of your software.
By switching between these build targets, the IDE generates
different versions of the software during the development process.
Each of these build targets can have its own settings. For example,
the debugging build target could have optimizations disabled and
debugging information enabled, while the shipping build target
could have code optimizations enabled.
This section discusses the following topics:
• What is a Build Target?
• What is a Subproject?
• What is a Design?
• Strategy for Creating Complex Projects
• Creating a New Build Target
• Changing a Build Target’s Name
• Changing a Build Target’s Settings
• Setting the Current Build Target
• Creating Build-Target Dependencies
• Assigning Files to Build Targets
• Creating Subprojects Within Projects
IDE User Guide IDE–89
Working with Projects
Working with Complex Projects
What is a Build Target?
A build target is a set of rules and settings that you configure to
produce an output file, such as an application or library.
The CodeWarrior IDE has the capability to build different kinds of
output files, or build targets, from one project file, as shown in
Figure 3.5 on page 54. For example, you can manage two separate
build targets in a single project, one for debugging purposes, and
the other for your finalized code.
You can also define a specific build order for the various build
targets in a project, so that the IDE builds a particular build target
before building another. This process is useful for sharing resource
files among other build targets. You can configure the IDE to handle
build-target dependencies, such as processing a build target
required by another build target.
Each build target in the project can have its own distinct set of build
settings. The project file and project folder organize these settings.
To learn more about developing build targets for a particular
platform, see “Targeting Documentation” on page 29 and “Strategy
for Creating Complex Projects” on page 92.
What is a Subproject?
A subproject is a normal, stand-alone project file that can nest within
another project file, like the memory.mcp project file shown in
Figure 3.19 on page 91. Subprojects are useful if you have a project
file that you want to keep separate from the main project file. This
arrangement allows you to organize the build process into separate
project files.
For example, subprojects are useful for developing applications that
use a plug-in architecture. Suppose your program uses several plug-
in modules, each sharing common source code with other plug-ins.
You might create one project file to build all the plug-ins by creating
a separate build target for each plug-in. In this scenario, the project
file for the plug-ins is the subproject. Including the subproject in the
project file of the main application causes the IDE to build the
subproject before building the main project.
IDE–90 IDE User Guide
Working with Projects
Working with Complex Projects
Figure 3.19 Subproject Within a Project
You can assign a project file to any build target in a project. To learn
more, see “Assigning Files to Build Targets” on page 98. To learn
how to add files to a project, see “Adding Files” on page 75.
You can instruct the IDE to process one or more build targets in a
subproject when processing the enclosing build target in the main
project. When the IDE builds a build target in the main project, it
first builds any selected build targets in any of the subprojects.
You can link the output of the main project with the output of the
subproject’s build target. To create this link, switch to the main
project’s Targets view, then click in the Link column next to the
subproject’s build target. For more information about the Targets
view and the Link column, see “Targets View” on page 54.
The IDE does not automatically process a subproject’s build targets
after you add the subproject to the main project. The IDE only
processes the chosen build targets within the subproject.
You can make a subproject specific to a build target. In other words,
you can choose the build targets to which a subproject belongs.
Other build targets in the main project do not handle the subproject.
IDE User Guide IDE–91
Working with Projects
Working with Complex Projects
What is a Design?
A design is a collection of components, layouts, and objects for rapid
application development (RAD).
Each design in your project can have distinct sets of build targets.
As you add source files to a design, the IDE automatically adds
those files to the build targets in the design.
To learn more about CodeWarrior RAD features, refer to “RAD
Designs and Layouts” on page 523.
Strategy for Creating Complex Projects
The choice to use multiple build targets or subprojects within a
project file depends on your needs. If you want access to all source
code in one project, then using multiple build targets is a good
choice. Subprojects are better when you prefer to keep separate
stand-alone project files.
For example, if you need to build a number of plug-in libraries that
accompany your application, create a project that builds the
subprojects with a single Make command. Then, include this project
file as a subproject in your main application’s project file. With this
arrangement, the IDE builds the subproject’s plug-ins first, then
builds your main application.
Each project has a maximum limit of 255 build targets. Before you
reach that limit, consider available memory and load times. Projects
with many build targets occupy more disk space, take longer to
load, and use more memory.
If your project contains more than ten or twenty build targets, you
can improve IDE performance by moving some of the build targets
to subprojects. Any build target that the IDE rarely builds, or any
build target that uses a distinct set of source files, is a good
candidate for moving to a subproject.
Creating a New Build Target
This section describes how to create new build targets in your
project. These build targets help you manage complex projects. For
IDE–92 IDE User Guide
Working with Projects
Working with Complex Projects
example, you can use multiple build targets to control a debug
version and a release version of an application, all within a single
project file.
To create a new build target in your project, follow these steps:
1. Go to the Targets view of the Project window.
Click the Targets tab at the top of the Project window to display the
Targets view, shown in Figure 3.5 on page 54. You create new build
targets within this view.
2. Choose Project > Create Target.
The New Target dialog box shown in Figure 3.20 appears.
Figure 3.20 New Target Dialog Box
3. Enter in the Name For New Target field the desired name for the
new build target.
4. Decide whether to create an empty build target or clone an
existing build target.
Enable the radio button that performs the desired task:
• Empty target—creates an empty build target to which you
manually assign files and configure settings.
• Clone existing target—copies the files and settings of an existing
build target as the basis for creating a new build target. Choose
from the pop-up menu the build target that you wish to clone.
IDE User Guide IDE–93
Working with Projects
Working with Complex Projects
5. Click OK.
The new build target appears in the Targets view of the Project
window.
You can associate the new build target with other build targets. You
can use these associations to create complex build dependencies. To
learn more, see “Creating Build-Target Dependencies” on page 96.
To learn how to configure settings for a build target, see “Choosing
Target Settings” on page 335.
You can establish dependencies among build targets. For more
information, see “Targets View” on page 54 and “Creating Build-
Target Dependencies” on page 96.
Changing a Build Target’s Name
Changing the name of a build target involves opening the Target
Settings window, selecting the settings panel that contains the build
target’s name, changing the name as desired, and saving your
modifications.
To change a build target’s name, follow these steps:
1. Go to the Targets view of the Project window.
Click the Targets tab at the top of the Project window to display the
Targets view, shown in Figure 3.5 on page 54. You modify build
targets within this view.
2. Double-click the build target whose name you wish to change.
The IDE opens the Target Settings window with the settings for the
build target. “Configuring Target Options” on page 331 describes
the Target Settings window in detail.
3. Select the Target Settings panel from the hierarchical list of
available panels that appears in the window.
Figure 9.4 on page 337 shows the Target Settings panel.
4. Enter in the Target Name field the new name that you wish to use.
5. Click Save.
The IDE saves the new build-target name.
6. Close the Target Settings window.
IDE–94 IDE User Guide
Working with Projects
Working with Complex Projects
You can also open the Target Settings window by choosing Edit >
Target Settings. The name of the menu command changes, based on
the name of the current build target. For example, if the name of the
current build target is ReleaseTarget, the name of the menu
command changes to ReleaseTarget Settings.
To learn more about the Target Settings panel, see “Target Settings”
on page 336.
Changing a Build Target’s Settings
Each build target in a project has its own settings. You use the
Target Settings window to modify the build target’s settings.
To open the Target Settings window for a particular build target in
your project, double-click the name of the build target in the Targets
view of the Project window.
Alternatively, choose Edit > Target Settings. The name of the menu
command changes, based on the name of the current build target.
For example, if the name of the current build target is
ReleaseTarget, the name of the menu command changes to
ReleaseTarget Settings.
The Target Settings window contains a hierarchical list of all
available settings panels for the current build target. Select a panel
from this list to view its options in the Target Settings window.
See “Configuring Target Options” on page 331 for more information
about settings panels that apply to virtually all build targets. See
“Targeting Documentation” on page 29 to learn about the
documentation available for platform-specific settings panels.
Setting the Current Build Target
You can use several techniques to change the current build target.
This section describes the most common techniques:
• Using the Current Target pop-up menu
• Using the Targets view of the Project window
• Using the Set Default Target menu command
IDE User Guide IDE–95
Working with Projects
Working with Complex Projects
Using the Current Target pop-up menu
Figure 3.2 on page 47 shows the Current Target pop-up menu. The
name of the current build target appears in this menu. To change
the current build target, select a new build target from the pop-up
menu.
Using the Targets view of the Project window
Figure 3.5 on page 54 shows the Targets view. This view shows the
build targets that belong to the active project.
The icon at left (an archery “target”) appears beside each
build target in the Targets view of the Project window. A
build target with this icon is not the current build target.
The icon at left (a target with an arrow going into it) appears
beside the current build target. Only one build target at a time
has this icon.
To change the current build target, click the icon beside the desired
build target. The build target whose icon you clicked becomes the
current build target. The arrow appears in its icon.
Using the Set Default Target menu command
You can set the current build target by using the Set Default Target
menu command. Choose Project > Set Default Target to reveal a
submenu of build targets in the active project. A check mark or
bullet appears beside the current build target. To change the current
build target, choose the desired build target from the submenu.
For example, you can use the menu command to switch among
multiple build targets in a project. You might wish to switch the
current build target in order to perform a different build.
Creating Build-Target Dependencies
You can configure a build target to depend on other build targets.
These dependencies are useful for enforcing a specific build order,
so that the IDE builds certain build targets before others. For
example, you could have a build target that depends on information
IDE–96 IDE User Guide
Working with Projects
Working with Complex Projects
in a second build target. In order to compile correctly, the IDE must
build the second build target before the first build target.
To specify that a build target depends on a second build target,
follow these steps:
1. Go to the Targets view of the Project window.
Click the Targets tab at the top of the Project window to display the
Targets view.
2. Drag the second build target below and indented to the right of
the first build target.
The IDE adds an italicized entry for the second build target within
the first build-target group. This entry makes the first build target
dependent on the presence of the second build target. Now, the IDE
builds the second build target before attempting to build the first
build target.
To link the first build target with object code from the second build
target, follow these steps:
1. Click the Link column of the italicized entry for the second build
target.
The italicized entry for the second build target resides within the
first build-target group.
2. Note that the object code from the second build target appears in
the Link Order view of the first build target.
With the first build target active, click the Link Order tab at the top
of the Project window to display the Link Order view. Notice that
the object code from the second build-target group now appears in
the link order for the first build-target group.
NOTE For Windows and Mac OS hosts, the object code from the second
build-target group appears at the beginning of the link order. For
Solaris and Linux hosts, the object code from the second build-
target group appears at the end of the link order.
See “Creating a New Build Target” on page 92 for information
about creating new build targets in your projects.
IDE User Guide IDE–97
Working with Projects
Working with Complex Projects
See “Setting the Current Build Target” on page 95 to learn how to
set the current build target.
see “Strategy for Creating Complex Projects” on page 92 to learn
more about complex projects that use subprojects or multiple build
targets.
Assigning Files to Build Targets
You can use several techniques to assign files to build targets. This
section describes the most common techniques:
• Using the Target column
• Using the Project Inspector
Using the Target column
The Target column in the Project window’s Files view indicates
whether a file belongs to the current build target. The IDE displays
this column only if the project has more than one build target. A file
that belongs to the current build target has a marker in the Target
column.
To assign a file to the active build target, click in the Target column
beside that file to place a marker. Click an existing marker to
exclude a file from the active build target.
You can also toggle assignment of all files at the same time to the
current build target. Use one of the following techniques:
Windows, Solaris, and Linux Alt-click in the Target column.
Mac OS Option-click in the Target column.
Using the Project Inspector
You can use the Project Inspector to assign a file to various build
targets.
To use the Project Inspector, follow these steps:
1. Select the file in the Project window that you wish to assign to
build targets.
See “Selecting Files and Groups” on page 73 for more information.
IDE–98 IDE User Guide
Working with Projects
Working with Complex Projects
2. Open the Project Inspector.
Use the appropriate menu command:
• (Windows menu bar layout) Choose View > Project Inspector
• (Macintosh menu bar layout) Choose Window > Project
Inspector
For more information about menu bar layouts, see “Menu bar
layout” on page 259.
3. Click the Targets tab in the Project Inspector to display the
Targets view.
Figure 3.23 on page 102 shows the Targets view of the Project
Inspector.
4. Configure checkboxes as desired to assign the file to the build
targets.
The Targets view shows the build targets to which you can assign
the file. Enable the checkbox next to a build target to assign the file
to that build target. Disable the checkbox next to a build target to
exclude the file from that build target.
5. Click Save.
The IDE saves the file assignments. Click Revert to undo your
changes and restore the original assignments.
Creating Subprojects Within Projects
To create a subproject, drag and drop a project file into an open
Project window. You can also add the project file using the
techniques discussed in “Adding Files” on page 75.
If your project contains multiple build targets, the IDE prompts you
(Figure 3.16 on page 82) to select the build targets to which you
want the project file added. The project file then appears in the list
of files in your project, as shown in Figure 3.21 on page 100.
The subproject becomes a part of the main project file. After you
perform a Make on the main project, the IDE builds the subproject
first.
IDE User Guide IDE–99
Working with Projects
Examining Project Information
After you add a subproject to a project file, you can assign build
targets to that subproject. To learn how to do this, see “Assigning
Files to Build Targets” on page 98.
Figure 3.21 Subproject Within a Project
Examining Project Information
You can use the Project Inspector, shown in Figure 3.22 on page 101
and Figure 3.23 on page 102, to view and configure information
about your project and its source-code files. The Project Inspector
includes an Attributes view and a Targets view.
Use the appropriate menu command to open the Project Inspector:
• (Windows menu bar layout) Choose View > Project Inspector
• (Macintosh menu bar layout) Choose Window > Project
Inspector
For more information about menu bar layouts, see “Menu bar
layout” on page 259.
To learn how to use the Project Inspector to assign files to specific
build targets, see “Using the Project Inspector” on page 98.
IDE–100 IDE User Guide
Working with Projects
Examining Project Information
Figure 3.22 Project Inspector - Attributes View
The Attributes view provides information about individual files in
your project. The view shows the following file attributes:
• Name—the name of the file
• Kind—the file type
• Project—the project to which the file belongs
• Code Size—the size of the file’s code
• Data Size—the file’s data size after being compiled by the IDE
• Full Path—the path to the file’s location on your hard disk
• Access Path—the access path that the IDE uses to locate the file
IDE User Guide IDE–101
Working with Projects
Examining Project Information
• Debug Info—Enable this checkbox to generate debugging
information (symbolics information) for the file during the next
build. Disable the checkbox to prevent debug-info generation.
For more information, see “Controlling Debugging in a Project”
on page 104.
To apply your changes to a file’s attributes, click Save. To undo
your changes and restore the original attributes, click Revert.
Mac OS To learn more about the Initialize Before, Merge Into
Output, and Import Weak checkboxes, see “Special Library Options
(Mac OS)” on page 407.
Figure 3.23 Project Inspector - Targets View
IDE–102 IDE User Guide
Working with Projects
Moving a Project
Moving a Project
The CodeWarrior IDE stores all required information about your
project in the project file itself. The IDE also generates other files,
usually stored in a folder having a name similar to your project file,
that contain information about window positions, object code,
debugging information, browser data, and other settings. The IDE
does not need these additional files to re-create your project.
WARNING! (Windows) Previous versions of the Windows-hosted CodeWarrior
IDE used a folder called Resource.frk to store state information
for the project file. Resource.frk is now obsolete and is no longer
generated or utilized by the IDE.
To move the project on your hard disk, copy the project file to a new
location. The project file’s name typically ends in the .mcp
extension. Optionally, you can also copy the folders and files
generated by the IDE for use with the project.
After moving the project file to a new location, the IDE re-
construct’s the project’s state the next time you perform a Bring Up
To Date or Make operation. The IDE does not require the generated
folders or files in order to re-construct the project. In a revision
control system, you need only check in the main project file and not
the generated files.
If your project file references other files by using absolute Access
Paths, you might need to modify those paths after moving the
project. See “Access Paths” on page 339 for more information.
If you move the project file to a different platform, see “Opening
Project Files Created on Other Host Platforms” on page 69 for more
information.
Importing and Exporting a Project
The IDE allows you to import and export a project file in extensible
markup language (XML) format.
IDE User Guide IDE–103
Working with Projects
Controlling Debugging in a Project
To export an open project file, choose File > Export Project. A
dialog box prompts you to name the exported file.
Mac OS You can export the project file in Importable XML
format or Text File List format. The latter format creates a plain-text
listing of the project’s text files.
To import an XML-formatted file, choose File > Import Project. A
dialog box prompts you to select a file to import. The IDE imports
the selected file into a CodeWarrior project file and prompts you to
save the project file.
TIP Create a folder in which to save the project file. This way, the IDE
stores all files associated with the project in the same folder as the
project file itself.
Controlling Debugging in a Project
Your program might not run correctly the first time you build it.
You can use the CodeWarrior debugger to troubleshoot your
program and examine its execution. In order to use the debugger,
you must configure your project to generate debugging information
(symbolics information), and you must activate the debugger.
This section describes how to generate the debugging information.
To learn how to activate the debugger, see “Preparing for
Debugging” on page 411.
This section covers the following topics:
• Generating Debugging Information for a Project
• Generating Debugging Information for a File
Generating Debugging Information for a
Project
To generate debugging information for a project file, choose Project
> Enable Debugger. If your project’s settings are not properly
configured, a dialog box appears. Click Yes in the dialog box to
allow the IDE to automatically configure the project’s settings for
generating debugging information.
IDE–104 IDE User Guide
Working with Projects
Controlling Debugging in a Project
To learn how to manually configure debugging information for a
project, see “Choosing Target Settings” on page 335.
Generating Debugging Information for a File
To generate debugging information for a source-code file, click in
the Debug column of the Project window. A Debug Info marker
appears in the column, as shown in Figure 3.24. The IDE
automatically sets this marker as you add files to your project,
unless you disable the option in the project’s Linker panel.
Figure 3.24 Debugging Information Markers
You can also use the Project Inspector to enable or disable
debugging information. See “Using the Project Inspector” on page
98 for more information. The debug state of each file that you add to
IDE User Guide IDE–105
Working with Projects
Controlling Debugging in a Project
the project matches the state of the Enable Debugger menu
command. When you see the Enable Debugger command, the
debugger is disabled and debugging information is also disabled.
When you see the Disable Debugger command, the debugger is
enabled and automatically configures each added file to generate
debugging information.
The Debug Info marker (Figure 3.24 on page 105) indicates whether
the IDE generates debugging information for a file while building
the project. Clicking a file’s Debug Info marker removes it and
disables debugging-information generation for that file.
After you change a Debug Info marker’s status, the IDE marks the
affected file for re-compilation the next time it builds your project.
You can simultaneously toggle Debug Info for all files associated
with the current build target. Use one of the following techniques:
Windows, Solaris, and Linux Shift-click in the Debug column.
Mac OS Option-click in the Debug column.
NOTE Marking a source code file for debugging inclusion does not mean
that the IDE creates a debugging file during the link process. The
Linker settings panel for the build target contains the options that
affect whether CodeWarrior creates a debugging file.
Debug Info marker for groups
You can toggle debugging information for groups by clicking the
Debug Info marker in the Debug column (Figure 3.24 on page 105).
The Debug column shows one of the following markers for a group:
• Black marker—all files in the group generate debugging in-
formation
• Gray marker—only some of the files in the group generate
debugging information
• No marker—no debugging information is generated
IDE–106 IDE User Guide
Working with Projects
Adding Preprocessor Symbols to a Project
Adding Preprocessor Symbols to a Project
Sometimes you want to add your own symbol definitions to a
project so that the IDE automatically includes them at the beginning
of each source-code file when building the project.
The following example shows a custom symbol definition in the C
or C++ programming language:
#define GLOBAL_DEBUG
Perhaps you wish to define the GLOBAL_DEBUG symbol only when
building development versions of your code, but exclude the
definition before shipping your final product.
To achieve this goal, create a precompiled header and insert the
symbol definition into the header. See “Using Precompiled or
Preprocessed Headers” on page 387 for more information.
To learn more about this topic, refer to Inside CodeWarrior: C/C++
Tools, Inside CodeWarrior: MSL C Reference, Inside CodeWarrior: C
Compilers Reference, and the CodeWarrior targeting documentation.
IDE User Guide IDE–107
Working with Projects
Adding Preprocessor Symbols to a Project
IDE–108 IDE User Guide
4
Working with Files
This chapter introduces the concepts behind working with files in
the CodeWarrior® IDE.
This chapter discusses opening, creating, saving, closing,
comparing, and printing files in the CodeWarrior environment.
This chapter includes the following sections:
• Creating a New File
• Opening an Existing File
• Saving a File
• Closing a File
• Printing a File
• Reverting to a Previously-Saved File
• Comparing and Merging Files & Folders
To learn about editing files, see “Editing Source Code” on page 137.
To learn about using revision-control systems to work with files, see
“Using the CodeWarrior® IDE with Version Control Systems” on
page 617.
Creating a New File
You create a new file when you wish to create and edit source code.
To create a new untitled window where source code or text may be
entered, choose the New Text File command from the File Menu.
After the new window appears, a text insertion point appears on the
first line of the window. The CodeWarrior IDE places text that you
type at this insertion point.
IDE User Guide IDE–109
Working with Files
Opening an Existing File
To learn more about text editing in the window you have just
created, see “Editing Source Code” on page 137.
Opening an Existing File
There are several ways to open a file with the CodeWarrior IDE. The
methods discussed here are:
• Opening Files from the File Menu
• Opening Files from the Project Window
• Opening Files from an Editor Window
• Opening a Related File
NOTE You cannot open libraries with the CodeWarrior editor because of
their binary format.
Opening Files from the File Menu
You can open two types of files:
• Project file—a file containing information on building a
CodeWarrior project
• Text file—a source code, interface, or other text file
Project file
To open a project file, choose the Open command from the File
Menu. For information on opening CodeWarrior project files, see
“Opening an Existing Project” on page 67.
Text file
To open a text file or a source code file, choose the Open command
from the File Menu. The IDE displays an Open dialog box, as shown
in Figure 4.1 (Windows), Figure 4.2 (Mac OS), and Figure 4.3
(Solaris).
Windows From the Files of Type pop-up menu, select All Files.
The list of files changes to show all the files in the current folder,
including text files.
IDE–110 IDE User Guide
Working with Files
Opening an Existing File
Mac OS The dialog box displays a list of the available project and
text files in the current folder. If the file is a stationery text file, the
IDE will open a new, untitled editor window and copy the contents
of the stationery file into the window.
Solaris The dialog box displays a list of the available project and
text files in the current directory.
Figure 4.1 Open Dialog Box (Windows)
Select the file you would like to open, and click Open. The
CodeWarrior IDE opens the file in an editor window.
For more information about editing source code, see “Editing
Source Code” on page 137.
IDE User Guide IDE–111
Working with Files
Opening an Existing File
Figure 4.2 Open Dialog Box (Mac OS)
Figure 4.3 Open Dialog Box (Solaris and Linux)
IDE–112 IDE User Guide
Working with Files
Opening an Existing File
Opening Files from the Project Window
There are different ways to open files from within the project
window, depending on the type of file you wish to see. These
different ways are:
• File column—opening a file that is in the project
• Group pop-up menu—opening a text source file from within a
collapsed group
• Interface pop-up menu—opening an interface file included in a
project’s source file
TIP (Mac OS) Files that contains binary data cannot be opened and
displayed in a CodeWarrior editor window. If the file was created
using another application, double-clicking the file name in the File
column will open the file in the application that created it. Refer to
“Disassembling Source Code” on page 394 to learn how to view the
contents of a library file.
File column
If the file you wish to see appears in the File column of the project
window’s File or Link Order views, double-click the file name to
open it. If the file is a text file, CodeWarrior opens it in an editor
window.
Mac OS On the Mac OS, if the file is any other type, the
CodeWarrior IDE opens the application that created the file. If the
file is a binary file, such as a library file, it will not be opened,
because binary files are not viewable using printable characters.
Another way to open a file is to select it, and then press the Enter/
Return key. You can select multiple files in the Project window, and
open them all by pressing the Enter/Return key. If you do not know
how to select multiple files in a project, refer to “Selecting Files and
Groups” on page 73.
For more information about the File Column, refer to “File column”
on page 46.
IDE User Guide IDE–113
Working with Files
Opening an Existing File
TIP To open several files from the File Column at one time, hold down
the Ctrl/Command key and click each file that you want to see.
Then, double-click on one of the selected files.
Group pop-up menu
Another way to open a source file is to use the Interface pop-up
menu for a group. A similar menu is shown in Figure 4.4. From this
pop-up menu you may select the file in the group that you want to
open.
You can open a source file by choosing it from the Interface pop-up
menu menu for the group that contains the file. This works even if
the group is collapsed and the file is not visible in the project
window.
Interface pop-up menu
To open a header or interface file, click on the Interface pop-up
menu to see a list of files. Select the file you want to open from this
list, as shown in Figure 4.4.
Figure 4.4 Interfaces Files Pop-up Menu in the Project Window
Note that header files inside “<...>” are system header files located
within the Metrowerks CodeWarrior folder. Files without these
symbols are header files that you have created. Your header files are
stored in the same folder as your project or other Access Paths you
have designated. To learn more about Access Paths and how to
configure them, refer to “Access Paths” on page 339.
TIP To switch between a source file and its interface file, use the same
name for both files, except for the extension. For example, name
IDE–114 IDE User Guide
Working with Files
Opening an Existing File
your files foo.cpp and foo.h. Then press Ctrl/Command-` to
instantly switch between the two files.
When the Interfaces File Pop-up is clicked for a library file that is
part of your project, you will only have the option to Touch or
Untouch the library file. Since libraries do not contain header or
interface files, these files can not be opened from a pop-up
corresponding to a library file.
To learn more about touching files, see “Touching and Untouching
Files” on page 87.
Opening Files from an Editor Window
To open an interface file from within a source file you are editing,
click the Interface Pop-Up Menu at the top left of the editor window
as shown in Figure 5.2 on page 140. This pop-up menu lists all
interface or header files used by the source file. Select a file from the
Interface Pop-Up Menu to open it in a new editor window.
NOTE If there are no files available in the menu, it means your text file
does not contain source code, or that the source file has not yet
been compiled.
Here is a different method. If you are editing any source code file,
you can open an interface file mentioned anywhere in the text file
with the Find and Open ‘Filename’ command.
First, select text in the editor window containing the name of the
interface file you would like to open. An example of a file name you
might see in a C source code file is stdio.h. You could select
stdio.h by double-clicking on the stdio portion of the text. Then,
choose the Find and Open ‘Filename’ command from the File
Menu.
The CodeWarrior IDE then searches for the file and opens the file in
an editor window. If the IDE cannot find the selected file, a system
beep sounds.
There is another method for opening a file. The following example
demonstrates the usefulness of this method. Suppose you are
IDE User Guide IDE–115
Working with Files
Opening an Existing File
editing a C++ .cpp file. Press Ctrl/Command ` to open a new
editor window and display the .h file that corresponds to the .cpp
file. Type the same keyboard shortcut again to display the .cpp file.
In order for this keyboard shortcut to work, your source and
interface files must have the same name, excluding the file name
extensions. For example, if you are editing myFile.cpp and you
want to see the associated interface file, press Ctrl/Command ` to
display myFile.h in a new editor window. To find these related
files, the IDE searches a project according to the items in the Access
Paths settings panel. To learn more, refer to “Access Paths” on page
339.
If you are editing a source code file and want to open a file without
selecting any text, choose the Find and Open File command from
the File Menu. This command will use the settings in the Access
Paths for the project to search for the file to open.
After you choose Find and Open File, the CodeWarrior IDE then
displays a dialog box, as shown in Figure 4.5. Type the name of the
file you wish to search for in the Open editable text field.
Figure 4.5 Find and Open File Dialog Box
If you want to search both System Paths pane and User Paths pane
directory paths (all paths specified in the Access Paths), turn the
Search Only in System Paths option off.
To search only the CodeWarrior directory structure (the paths
specified in the System Paths pane of the Access Paths), click on the
Search Only in System Paths option to enable it.
IDE–116 IDE User Guide
Working with Files
Saving a File
To learn more about Access Paths and how to configure them, refer
to “Access Paths” on page 339 for more information.
Opening a Related File
If you are working in a source code file and wish to open the
corresponding interface file, or working with an interface file and
wish to open the corresponding source file, use the Ctrl/Command
` keyboard shortcut. You can use this shortcut to easily switch back
and forth between the two files.
Saving a File
This section describes the many ways that the CodeWarrior IDE can
save files. The topics discussed are:
• Saving one file
• Saving files automatically
• Renaming and saving a file
• Backing up files
• Saving as a MS-DOS, Mac OS, or UNIX text file
NOTE (Mac OS and Solaris) When saving a file, you will often have the
option of saving it as a stationery file. A stationery file is like a
template or “starter” file. For example, creating a stationery file
would be useful if you had standard documentation header text that
you wanted to appear at the top of every file you create. If you
create a stationery file with the header text, you could start every
new file by opening this stationery file. See “Opening Files from the
File Menu” on page 110 for more information.
Saving one file
To save your changes to the current editor file, choose the Save
command from the File Menu. The CodeWarrior IDE saves your file
to your hard disk.
IDE User Guide IDE–117
Working with Files
Saving a File
The Save command is dimmed if the window is new and has no
data, if the contents of the active window have already been saved,
or when the active window is the project window.
NOTE If the file is new and untitled, the CodeWarrior IDE displays the Save
As dialog box, described in “Renaming and saving a file” on page
118. Choose a name and location for your new file with this dialog
box.
Projects are saved when they are closed, when you quit or exit the
CodeWarrior IDE, or when the Save A Copy As command is
selected. You don’t need to explicitly save projects.
Saving all files
To save your changes to all the files currently open, press the
keyboard shortcut Shift-Ctrl-S (Windows) or Option-Command-S
(Mac OS). The CodeWarrior editor saves all the modified files to
your hard disk.
Saving files automatically
The CodeWarrior IDE can automatically save changes to all your
modified files whenever you choose the Preprocess, Precompile,
Compile, Disassemble, Bring Up To Date, Make, or Run
commands from the Project Menu.
Using the Save open files before build feature can save your work if
your program should crash while running. However, if you’re
experimenting with a change and don’t want to save changes, you
may want to turn this option off.
To learn about how to enable or disable this feature, refer to the
Save open files before build option in the section of this manual
titled “Editor Settings” on page 277.
Renaming and saving a file
If you want to save a new untitled file or save a file under a new
name, use the Save As command on the File Menu. If the file is in
the current project, the CodeWarrior IDE updates the project to use
the new name.
IDE–118 IDE User Guide
Working with Files
Saving a File
When you choose Save As from the File Menu, the CodeWarrior
IDE displays the dialog box shown in Figure 4.6 (Windows), Figure
4.7 (Mac OS), or Figure 4.8 (Solaris).
Mac OS and Solaris Choose the Text or Stationery button to
save the file as either a text file or a stationery file.
NOTE (Mac OS) Beginning with Mac OS 8.5, the dialog box that you see
when you select the Save As command will no longer appear as
shown in Figure 4.7. Instead of clicking the Stationery radio button
directly, you must first tell the IDE that you want to use the stationery
option. To do this, select Stationery Option from the Format pop-
up list. When the Stationery Option dialog box appears, click the
Stationery radio button and click OK.
Figure 4.6 Save As Dialog Box (Windows)
Choose the file location and name the file, then click the Save
button.
IDE User Guide IDE–119
Working with Files
Saving a File
The CodeWarrior IDE saves the file and changes the name of the
editor window to the name you entered.
If the file is in the current project, the CodeWarrior IDE changes the
file’s entry in the project to match the saved name. If you don’t want
to change the project, but still want to save the file, you can refer to
the following section, “Backing up files.”
Backing up files
If you want to save a backup copy of a text file before you make
some changes to the original, use the Save A Copy As command in
the File Menu. The CodeWarrior IDE creates a copy of the file under
a new name that you specify, but leaves the original file unchanged
and does not change the currently-open project to use the new file
name.
Figure 4.7 Save As Dialog Box (Mac OS)
After choosing Save A Copy As from the File Menu, the
CodeWarrior editor displays the dialog shown in Figure 4.6
IDE–120 IDE User Guide
Working with Files
Saving a File
(Windows), Figure 4.7 (Mac OS), or Figure 4.8 (Solaris). Specify the
file’s new location and choose a unique name for the file.
Mac OS and Solaris You can also choose whether to save the
file as text stationery or a text file.
Now click Save and CodeWarrior saves a version of the file with
your new name. It does not change the file in the editor window or
in the current project.
If the project window is the active window, Save A Copy As allows
you to save the project using a new name, or as a text file. You
decide which type of project to create using the Save Project As
Type pop-up menu shown in Figure 4.9. If you save the project as a
text file, that text file will contain the names of all the files in the
project.
Figure 4.8 Save As Dialog Box (Solaris)
IDE User Guide IDE–121
Working with Files
Saving a File
Saving as a MS-DOS, Mac OS, or UNIX text file
When you open a text file originally created in a Windows, Mac OS,
or UNIX text editor, CodeWarrior internally converts the text file to
be compatible with the host platform and corrects inconsistent line
endings. When you finish editing the file, CodeWarrior saves the
file in its original format.
To learn about saving a text file under a different text format, see
“Document Settings Pop-Up Menu” on page 142.
Figure 4.9 Saving a Copy of a Project (Windows)
IDE–122 IDE User Guide
Working with Files
Saving a File
Figure 4.10 Saving a Copy of a Project (Mac OS)
Figure 4.11 Saving a Copy of a Project (Solaris)
IDE User Guide IDE–123
Working with Files
Closing a File
Closing a File
Every editor or project window in the CodeWarrior IDE that you
have opened is associated with a file on the hard disk. When you
close the window, you close the file. You can close all windows or
just a single CodeWarrior IDE window.
The topics in this section are:
• Closing One File
• Closing All Files
Closing One File
To close a window, choose Close from the File Menu.
If you close a text file using the File Menu and have not yet saved
your changes, the CodeWarrior IDE asks if you want to save the
changes before closing the window, as shown in Figure 4.12. If you
choose to close the file without saving your changes, all changes are
lost.
Figure 4.12 Unsaved Changes Dialog Box
Another way to close a window is by clicking the close box of the
active window. This is exactly the same as choosing the Close
command in the File Menu.
IDE–124 IDE User Guide
Working with Files
Printing a File
Closing an active project window automatically saves the project,
and you will not see the dialog shown in Figure 4.12. For more on
saving project files, consult “Saving a Project” on page 70.
The Close command also saves other properties of the window,
such as the size, location, and the selected text in the active window.
Refer to “Editor Settings” on page 277 for information on how to
configure these options. If the appropriate options are enabled, the
next time the source code file is opened, it will occupy the same
position on your screen and the same text will be selected.
Mac OS The Close command saves the window position
information in a format that is compatible with the Macintosh
Programmer’s Workshop (MPW). If you open a saved CodeWarrior
editor file with MPW, the same window parameters are respected.
For more information about MPW, refer to the documentation on
the CodeWarrior Reference CD.
Closing All Files
To close all open windows, use the Close All command. If you
modified any file during the edit session, the editor prompts you to
save information before closing each window that contains changes.
Close All only closes editor and debugger windows. The Find
dialog box, as well as project windows, remain open.
Windows This command is available by pressing Ctrl-Shift-W.
Mac OS This command is available when you press the Option
key before clicking on the File menu.
TIP To close all editor windows at once, press Alt/Option and click on
the close box of an editor window.
Printing a File
Use the print options in the CodeWarrior IDE to print open files, a
project file, or the contents of a window.
The topics in this section are:
IDE User Guide IDE–125
Working with Files
Printing a File
• Setting Print Options
• Printing a Window
Setting Print Options
To configure printing options, choose the printer setup appropriate
for your platform. CodeWarrior displays the appropriate printer
dialog box. Choose File > Page Setup to display the printer dialog
box.
Use this dialog box to select the paper size, orientation, and other
settings. The specific settings and options depend on the printer you
have connected to your computer. For more information on using
your printer, consult the documentation packaged with your
computer and printer.
If you Click OK, CodeWarrior saves the options for the next time
you print any files.
Printing a Window
To print a window, make the window active and choose the Print
command from the File Menu. This menu command allows you to
print some or all of the active window.
When you choose this command, the CodeWarrior IDE displays the
print dialog box for your printer. There are two additional
CodeWarrior-specific options available for configuration in this
dialog box. Depending on your printer and printer software, these
options may be displayed in various places in different print dialog
boxes.
The CodeWarrior-specific options are:
• Print Selection Only
• Print using Syntax Highlighting
Print Selection Only
If there is selected text in the editor window you are printing, the
Print Selection Only option appears. When this option is on, the
CodeWarrior IDE prints only the selected text in the window, not
IDE–126 IDE User Guide
Working with Files
Reverting to a Previously-Saved File
the entire file. When this option is off, the CodeWarrior IDE prints
the entire file.
Print using Syntax Highlighting
When the Print using Syntax Highlighting option is on, the
CodeWarrior IDE prints the file with syntax coloring. On a black
and white printer, the colors come out as shades of gray. When the
Print using Syntax Highlighting option is off, the CodeWarrior IDE
prints the file in black and white without syntax coloring.
TIP (Mac OS) To print color syntax-highlighted text in bold and
comments in italics, choose Black & White printing from the Print
dialog box and turn on Print using Syntax Highlighting.
When you are finished configuring printing parameters, click the
Print button in the printer dialog box. The CodeWarrior IDE then
spools the file to your printing software for printing.
For information on other options in the print dialog box, see the
documentation that came with your printer or printer software.
Reverting to a Previously-Saved File
If you’ve opened a text file and started editing it, then realize that
you don’t want to use the changes you’ve made, use the Revert
command on the File Menu. When you select this command the
dialog box shown in Figure 4.13 appears.
IDE User Guide IDE–127
Working with Files
Comparing and Merging Files & Folders
Figure 4.13 Revert to a Previous File
If you click the OK button, the last copy of the file you’re working
with will be opened, and all changes you have made since the last
time you saved the file are lost. If you click Cancel, the file you’re
working with is not changed or saved to disk, and you can continue
editing it.
Comparing and Merging Files & Folders
The CodeWarrior IDE has a facility to compare two text files, mark
the differences between the files, and apply changes between the
files. In addition, you can compare the contents of two folders.
The topics in this section show you how to use the IDE’s file
comparison features:
• File Comparison and Merge Overview
• Choosing Files To Compare
• Examining and Applying Differences
• Choosing Folders To Compare
File Comparison and Merge Overview
The IDE’s file comparison window displays two text files and the
differences—insertions and deletions— between them. Figure 4.14
shows an example file comparison window. The window has
controls to examine, add, and remove the differences between the
files. The currently selected difference is shown with a darker color
IDE–128 IDE User Guide
Working with Files
Comparing and Merging Files & Folders
and outlined in black to contrast it from the other differences visible
in the window.
The file comparison window has these parts:
Source file
Displays the source text file that IDE uses as a basis for its
comparison with the destination file. This pane appears on the left
side of the file comparison window.
Destination file
Displays the source destination file that’s compared with the source
file. This pane appears on the right side of the file comparison
window. Differences between the source file and the destination
may be added to or removed from the destination file.
IDE User Guide IDE–129
Working with Files
Comparing and Merging Files & Folders
Figure 4.14 File Comparison Window
Source file Comparison Destination file
column
Difference list Toolbar
Comparison column
Shows a graphical representation of where text was added or
removed between the source and destination files. This column
appears between the source and destination panes in the
comparison window.
Difference list
Lists the insertions, deletions, and lines of mismatching text
between the two files. Selecting an item in the list displays the
IDE–130 IDE User Guide
Working with Files
Comparing and Merging Files & Folders
difference in the source and destination panes. The comparison
column also shows how and where the difference occurs between
the two files. Text in the difference list will appear in italics when a
difference is applied.
Toolbar
Has buttons to apply or remove changes between the two files to the
destination file. Table 4.1 describes the toolbar’s buttons. The
toolbar also has buttons to undo and redo changes to the source and
destination files. For information on configuring toolbars, see
“Customizing the IDE” on page 306.
Table 4.1 Common Toolbar Buttons
Button Description
Apply difference
Unapply difference
Undo
Redo
Choosing Files To Compare
To open a file comparison window, choose Compare Files from the
Search Menu to show a dialog box that prompts you for two files,
source and destination files, to compare. To use a file dialog box to
browse for the source and destination files, click their respective
Choose buttons. You may also drag and drop text files into their
respective boxes.
Windows Make sure that the Compare Files radio button, shown
in Figure 4.15, is enabled. This allows you to select files by using the
Choose buttons.
IDE User Guide IDE–131
Working with Files
Comparing and Merging Files & Folders
Text Compare Options
Select the Case Sensitive checkbox to consider the case of letters as
part of the comparison operation. To ignore the case of letter,
deselect this checkbox.
To ignore extra space and tab characters while comparing text,
enable the Ignore Extra Space checkbox. To take space and tab
characters into account, disable the checkbox.
See “Folder Compare Options” on page 134 for information on the
folder comparison options.
To show the comparison window after choosing files and setting
options, click the Compare button.
Figure 4.15 Compare Files Setup Dialog Box
Editor Files pop-up
Examining and Applying Differences
Use the comparison window’s toolbar and difference list to choose
among the differences between the source and destination files and
apply changes to the destination file.
IDE–132 IDE User Guide
Working with Files
Comparing and Merging Files & Folders
To view a difference between the two files, click its entry in the
difference list. To apply the difference, click the Apply button in the
toolbar or choose Apply Difference from the Search Menu. To
reverse a difference you’ve already applied, click the Unapply
button or choose Unapply Difference from the Search Menu.
WARNING! Currently, using the Apply Difference and Unapply Difference
buttons erase all actions from the Undo stack. In other words, when
you exit the Difference window after apply or unapplying, all undo
and redo actions will have been cleared from the Undo stack.
To Compare Editor Files
To compare two files that are already open in editor windows, click
on the Editor Files pop-up menu next to the source and destination
paths, as shown in Figure 4.15. A list of open editor windows
appears. Choose a file name from the menu to make it the source or
destination file. Click Compare after choosing the source and
destination files to display the comparison window.
NOTE If you have trouble comparing files, ensure that their enclosing
folders’ names do not match the criteria specified in the Shielded
Folders preference panel. The IDE ignores folders whose names
match the shielding criteria. Ignored folders and their contents do
not appear in the file comparison window.
Choosing Folders To Compare
To open a folder comparison window, choose Compare Files from
the Search Menu to show a dialog box that prompts you for two
folders, the source and destination folders, to compare. To set these
folders, drag and drop the folders into their respective boxes (Figure
4.16).
Windows To enable Folder Comparison Options as described in
the following section, click the Compare Folders radio button.
Clicking this radio button also allows you to select folders by using
the Choose buttons in the Compare Files Setup dialog box.
IDE User Guide IDE–133
Working with Files
Comparing and Merging Files & Folders
Folder Compare Options
Select Only Show Different Files to only display files that are
different in both folders in the Files In Both Folders list of the
Compare Folders window (Figure 4.17). By default, this option is
disabled, so all files in the source and destination folders are
displayed.
Comparisons between files in the source and destination folders are
normally based upon the file modification dates and file sizes. This
is usually good enough to determine if there are differences
between the two files. If there are invisible items in the folders, the
comparison will skip over those items.
Figure 4.16 Compare Folders Setup Dialog Box
Select Compare Text File Contents to perform a more accurate
compare of the files in the two folders. In essence, this performs a
Compare Files command on every file in the source and destination
folders and checks neither the modification dates nor the file sizes.
This option is a lot slower since every file has to be opened, but the
comparison information is more accurate.
See “Text Compare Options” on page 132 for information on the file
comparison options.
IDE–134 IDE User Guide
Working with Files
Comparing and Merging Files & Folders
When you click the Compare button, the IDE displays the Folder
Compare Results Window, as shown in Figure 4.17. Source code
files, header files, text files, and folders appear in plain face. All
other files appear italicized.
The Files In Both Folders list displays all files in both the source and
destination folders unless the Only Show Different Files option is
enabled. Files that are different in the two folders have a small
bullet positioned to the right of their name.
When you click on a file in the Files In Both Folders list, Files Only
In Source list, or Files Only In Destination list, specific information
about the selected file appears in the Selected Item box at the bottom
of the folder comparison window.
NOTE If you have trouble comparing folders, ensure that their names do
not match the criteria specified in the Shielded Folders preference
panel. The IDE ignores folders whose names match the shielding
criteria. Ignored folders and their contents do not appear in the file
comparison window.
IDE User Guide IDE–135
Working with Files
Comparing and Merging Files & Folders
Figure 4.17 Folder Compare Results Window
Files in Both Files Only in Files Only in
Folders list Source list Destination list
Zoom box
Double-click on a file in the Files In Both Folders list to open a
Compare Files window for resolving the differences between the
two differing files.
The Files Only In Source list displays all the files that appear only in
the source folder while the Files Only In Destination list displays
only files that appear within the destination folder.
You can click on a zoom box for any of the three lists to expand
them to fill the window. Click again to collapse back to their original
size.
IDE–136 IDE User Guide
5
Editing Source Code
This chapter explains how to use the CodeWarrior® IDE text editor
to edit your source code.
The CodeWarrior editor is a full-featured text editor specially
designed for programmers. The editor includes the following
features:
• Pop-up menus on every editor window, useful for opening
interface files and navigating routines
• Syntax coloring that formats source code for easy identification
of comments and keywords
• Point-and-click access to online reference material for routines
This chapter covers the following topics:
• Guided Tour of the Editor Window
• Editor Window Configuration
• Basic Text Editing
• Navigating the Text
• Online References
You can also customize options that affect the way the CodeWarrior
editor works. To learn more, see “Editor Settings” on page 277.
Guided Tour of the Editor Window
The CodeWarrior editor window, shown in Figure 5.1 on page 139,
contains several elements for viewing and editing text files.
To open a new editor window, create a new text file by choosing
File > New Text File.
IDE User Guide IDE–137
Editing Source Code
Guided Tour of the Editor Window
NOTE (Windows) The IDE disables the New Text File menu command by
default. See “Customizing Commands” on page 307 to learn how to
enable the menu command.
The sections that follow describe the elements of the editor window:
• Text-Editing Area
• Interface Pop-Up Menu
• Function Pop-Up Menu
• Marker Pop-Up Menu
• Document Settings Pop-Up Menu
• VCS Pop-Up Menu
• File Path Caption
• Dirty File Marker
• Pane Splitter Controls
• Line and Column Indicator
• Toolbar Disclosure Button
• Path Pop-Up Menu (Mac OS)
Text-Editing Area
You use the text-editing area of the editor window to enter and edit
text.
You can select and drag text out of an editor window to any
destination that accepts a drop, such as another open editor
window. You can also drag selected text into an editor window
from other applications that support drag-and-drop.
For more information about drag-and-drop operations with text, see
“Moving Text (Drag and Drop)” on page 152.
IDE–138 IDE User Guide
Editing Source Code
Guided Tour of the Editor Window
Figure 5.1 Editor Window
IDE User Guide IDE–139
Editing Source Code
Guided Tour of the Editor Window
Interface Pop-Up Menu
Use the Interface pop-up menu, shown in Figure 5.2, to open
interface or header files referenced by the current file. You
can also choose the Touch and Untouch commands from this
pop-up menu.
Figure 5.2 The Interface Pop-up Menu
To open a file in the list, choose its name. In order to see a list of files
in the menu, the project file must be open. The IDE cannot open
certain files, such as precompiled header files and libraries.
For more information on opening files, see “Opening an Existing
File” on page 110.
To re-compile your file the next time the IDE builds the project,
choose the Touch command. If you click the Interface pop-up menu
again, you can choose the Untouch command to prevent the IDE
from re-compiling the file.
To learn more about touching files, see “Touching and Untouching
Files” on page 87.
IDE–140 IDE User Guide
Editing Source Code
Guided Tour of the Editor Window
Function Pop-Up Menu
Use the Function pop-up menu, shown in Figure 5.3, to
navigate to specific functions or routines in the current
source-code file.
If the pop-up menu is empty, the file shown in the text-editing area
is not a source-code file. If the text-insertion point is currently
located within a particular function, a bullet appears next to that
function in the pop-up menu.
Figure 5.3 Function Pop-up Menu
NOTE By default, the pop-up menu lists functions in order of appearance
in the source-code file. To alphabetically list functions, use one of
the following techniques:
• (Windows) Ctrl-click the pop-up menu
• (Mac OS) Option-click the pop-up menu
• (Solaris and Linux) Alt-click the pop-up menu
Alternatively, see “Sort function popup” on page 280.
TIP If you edit a Pascal file, the Function pop-up menu shows function
names in italics, procedure names in plain face, and the main
program in bold face.
IDE User Guide IDE–141
Editing Source Code
Guided Tour of the Editor Window
Marker Pop-Up Menu
Use the Marker pop-up menu, shown in Figure 5.4, to
manipulate markers in your text files. Markers help you
access a particular line of text, remember your position in the
text file, or note important parts of the text.
For more information on using markers, see “Adding, Removing,
and Selecting a Marker” on page 156.
Figure 5.4 The Marker Pop-up Menu
Document Settings Pop-Up Menu
Use the Document Settings pop-up menu, shown in Figure
5.5, to toggle syntax coloring for the current file and set the
format for saving a text file.
Figure 5.5 Document Settings Pop-up Menu
IDE–142 IDE User Guide
Editing Source Code
Guided Tour of the Editor Window
Choose Syntax Coloring from the pop-up menu to toggle the
appearance of syntax elements in various colors onscreen.
The pop-up menu also lets you choose file formats for saving text
files: Macintosh, DOS, and UNIX. A bullet appears next to the
current save format for the file shown in the editor window. To save
the file in a different format, choose a format from the pop-up
menu. The IDE uses the format each time you save the text file.
For more information on the Syntax Coloring option shown in this
menu, see “Text Colors” on page 282.
VCS Pop-Up Menu
If the current file is part of a version control system (VCS), the VCS
pop-up menu, shown in Figure 5.1 on page 139, indicates the read/
write database status of the file. The VCS pop-up menu icon
indicates whether you can modify the file. See “Common VCS
Operations” on page 629 for additional details about the icons and
their meanings.
Using this pop-up menu, you can get a new copy of your file,
checkout the file for modification, make the file writable so that you
can modify it without checking it out, and perform other operations.
For more information about version-control software, refer to
“Using Version Control Systems” on page 617.
File Path Caption
The File Path caption, shown in Figure 5.1 on page 139, displays the
directory path to the file whose contents appear in the editor
window.
Mac OS To learn about another way to determine file paths, refer
to “Path Pop-Up Menu (Mac OS)” on page 145.
Dirty File Marker
The Dirty File marker, shown in Figure 5.1 on page 139, shows
whether you modified the current file since the IDE last saved or
IDE User Guide IDE–143
Editing Source Code
Guided Tour of the Editor Window
opened it. Table 5.1 details the states and icons of the Dirty File
marker.
Table 5.1 Dirty File Marker States
State Description
Unchanged file
Modified and unsaved file (a dirty file)
Pane Splitter Controls
Pane Splitter controls divide an editor window into panes so that
you can view different portions of a file in the same window.
You can also use the controls to adjust pane positions. Figure 5.8 on
page 147 shows an editor window with multiple panes.
For more information on this topic, see “Splitting the Window into
Panes” on page 147.
Line and Column Indicator
The Line and Column indicator, shown in Figure 5.1 on page 139,
indicates the line number and column number that contains the
text-insertion point. You can click the indicator to go to another line
in the file.
For information about moving the text-insertion point to another
line, see “Going to a Particular Line” on page 161.
Toolbar Disclosure Button
The Toolbar Disclosure button, shown in Figure 5.1 on page 139,
toggles the appearance of the editor-window toolbar. If the toolbar
is hidden, a row of smaller controls appears at the bottom of the
editor window (see Figure 5.7 on page 146).
IDE–144 IDE User Guide
Editing Source Code
Editor Window Configuration
For more information on using the Toolbar Disclosure button, see
“Seeing Window Controls” on page 146.
Path Pop-Up Menu (Mac OS)
To see the directory path of the file in the active editor window,
press the Command key and click the file name in the editor
window’s title bar, as shown in Figure 5.6. You can open a folder by
choosing its name from the pop-up menu.
Figure 5.6 File Path Pop-up Menu in the Window Title Bar
Editor Window Configuration
The IDE allows you to customize the way the editor displays your
source code. This section covers the following topics:
• Setting Text Size and Font
• Seeing Window Controls
• Splitting the Window into Panes
• Saving Editor Window Settings
To learn about configuring the editor window toolbar, see
“Customizing the IDE” on page 306.
IDE User Guide IDE–145
Editing Source Code
Editor Window Configuration
Setting Text Size and Font
The Font & Tabs preference panel controls the font used to display
text in an editor window. For more information on this topic, see
“Font & Tabs” on page 281.
Seeing Window Controls
The toolbar at the top of the editor window contains a row of pop-
up menus and controls. Click the Toolbar Disclosure Button, shown
in Figure 5.1 on page 139, to show or hide this toolbar.
If you hide the toolbar, the default pop-up menu controls appear
along the bottom of the editor window, as shown in Figure 5.7. Note
that the File Path Caption is not visible in this arrangement.
NOTE If you hide a customized editor window toolbar, custom items do not
appear at the bottom of the window. The default toolbar items
always appear when the toolbar is hidden. After you show the
toolbar again, the custom configuration re-appears. For information
on configuring toolbars, see “Customizing Toolbars” on page 323.
Figure 5.7 Pop-up Menus Along the Bottom of the Editor Window
To show the toolbar along the top of the editor window again, click
the Toolbar Disclosure Button once more.
You can choose a default setting to display or hide the toolbar in
editor windows. To do so, see “Toolbar Disclosure Button” on page
IDE–146 IDE User Guide
Editing Source Code
Editor Window Configuration
144 for more information. See also “Showing and hiding a toolbar”
on page 325.
Splitting the Window into Panes
You can split the editor window into panes to view different parts
of a file in the same window, as shown in Figure 5.8. This section
describes creating, adjusting, and removing multiple panes.
Figure 5.8 Multiple Panes in an Editor Window
IDE User Guide IDE–147
Editing Source Code
Editor Window Configuration
Creating a new pane
To create a new pane in an editor window, click and drag a
Pane Splitter control. Pane Splitter controls appear in each
scroll bar of a pane in the editor window, on the top right
and bottom left sides.
As you drag a Pane Splitter control, a gray focus line tracks your
progress and indicates the new pane position. After you release the
control, the editor creates a new pane.
You can also double-click the Pane Splitter control to split a pane
into two equal parts.
Resizing a pane
To change the sizes of the panes in an editor window, click
and drag the Pane Resize boxes.
As you drag a resize box, a gray focus line indicates your progress.
After you release the resize box, the editor changes the size of the
affected panes.
Removing a pane
To remove a pane from an editor window, click and drag
a Pane Resize box all the way to the edge of a window.
As you drag the Pane Resize box, a gray focus line indicates your
progress. If you drag the resize box near the edge of the window,
the focus line disappears. If you release the resize box at that time,
the editor removes the smaller of the two panes from the window.
You can also double-click a Pane Resize box to remove a pane.
Saving Editor Window Settings
The IDE saves the current settings of an editor window after you
close a window or toggle the appearance of the toolbar.
The saved settings include the size and location of the window as
well as the toolbar display setting. After you re-open the same
editor window at a later time, the IDE applies these saved settings.
IDE–148 IDE User Guide
Editing Source Code
Basic Text Editing
WARNING! (Mac OS) If you work with a revision-control system that uses native
file locking, you must check a file out in order to save settings. If you
use ckid resources to lock the files, the IDE saves the information
without requiring you to check out the file.
To learn more about configuring editor window settings, see “Font
& Tabs” on page 281.
To learn about saving default settings for browser windows, see
“Saving a Default Browser” on page 251.
Basic Text Editing
The CodeWarrior IDE provides several aids for editing source-code
files. You can use these aids to manipulate text and control color.
This section discusses the following topics:
• Basic Editor Window Navigation
• Adding Text
• Deleting Text
• Selecting Text
• Moving Text (Drag and Drop)
• Using Cut, Copy, and Paste
• Balancing Punctuation
• Shifting Text Left and Right
• Undoing Changes
• Controlling Color
Basic Editor Window Navigation
The IDE provides several ways to move the text-insertion point in a
file. You typically navigate files by using scroll bars or by using the
keyboard.
IDE User Guide IDE–149
Editing Source Code
Basic Text Editing
Scroll-bar navigation
Like any other text editor, the CodeWarrior editor lets you adjust
the scroll bars in the window to view different parts of your text.
Keyboard navigation
You can use the arrow keys on the keyboard to move the text-
insertion point in the file. You can also scroll to different locations in
the file without moving the text-insertion point.
The Customize IDE Commands window lists the keyboard
shortcuts, or key bindings, available for use with the editor. For more
information about the window, see “Customizing Key Bindings” on
page 314.
Adding Text
To add text to an open file, click once in the Text-Editing Area of the
window. After an insertion point appears at location that you
clicked, you can begin typing on the keyboard to enter text.
To read about different ways to move the insertion point in an
editor window, see “Basic Editor Window Navigation” on page 149.
Deleting Text
The IDE provides several ways to delete text. Use one of the
following techniques:
Windows, Solaris, and Linux To delete text that you just
typed, press Backspace. To delete the text to the right of the text-
insertion point, press Delete. To delete more than one contiguous
character at a time, select the text that you wish to delete and press
Backspace.
Mac OS To delete text that you just typed, press Delete. To delete
the text to the right of the text-insertion point, press Del ( ). To
delete more than one contiguous character at a time, select the text
that you wish to delete and press Delete.
To learn about selecting text, read the next section, “Selecting Text.”
IDE–150 IDE User Guide
Editing Source Code
Basic Text Editing
Selecting Text
The IDE provides several ways to select text in an editor window.
You can select a word, a line, a range of text, or a rectangular
portion of text. You can also select text by holding down the Shift
key while pressing various key bindings.
To select a word, use this technique:
• Double-click the word
To select a line, use one of the following techniques:
• Triple-click anywhere in the line
• Move the cursor to the left edge of the editor window so that its
icon changes to a right-pointing arrow, then click. (You must
enable the Left margin click selects line checkbox in the Editor
Settings preference panel in order to use this technique.)
To select a range of text, use one of the following techniques:
• Drag the cursor over the contiguous range of text that you wish
to select, then release the cursor
• Move the text-insertion point to the beginning of your desired
selection, then press the Shift key while clicking the end of your
desired selection. The IDE selects everything between the
starting and ending points, inclusive.
• Move the cursor to the left edge of the editor window so that its
icon changes to a right-pointing arrow, then click and drag the
cursor to select lines of text. (You must enable the Left margin
click selects line checkbox in the Editor Settings preference
panel in order to use this technique.)
Mac OS You can select parts of text identifiers by holding down
the Control key while using the left or right arrow keys, or when
double-clicking. For example, double-clicking between the two “m”
characters in FindCommandStatus() would result in the word
Command being selected.
To select a rectangular portion of text, use one of the following
techniques:
Windows, Solaris, and Linux Hold down the Ctrl key while
dragging the cursor.
IDE User Guide IDE–151
Editing Source Code
Basic Text Editing
Mac OS Hold down the Command key while dragging the
cursor.
To select an entire routine in the editor window, press the Shift key
while selecting the name of the routine from the Function Pop-Up
Menu. This technique is particularly useful for copy-and-paste
operations, or for using drag-and-drop operations to move code.
The Customize IDE Commands window lists the keyboard
shortcuts, or key bindings, available for selecting text. For more
information about the window, see “Customizing Key Bindings” on
page 314.
For more information about using drag-and-drop with text, see the
next section, “Moving Text (Drag and Drop).”
You can also select blocks of code by using the Balance command.
To learn more, see “Balancing Punctuation” on page 153.
Moving Text (Drag and Drop)
To move selected text to a new location, you can use the drag-and-
drop capabilities of the editor. To learn more about enabling and
disabling this feature, see “Editor Settings” on page 277.
The CodeWarrior editor also accepts text items from other
applications that support drag-and-drop operations. Refer to the
documentation that came with the applications for information
about drag-and-drop support.
TIP (Mac OS) You can also copy selected text to a new location. To
perform this operation, hold down the Option key while dragging the
text. After you release the text, the editor places a copy of the
selected text at the new location.
Using Cut, Copy, and Paste
Most computer applications support a standard set of menu
commands, such as Cut, Copy, and Paste. In the CodeWarrior IDE,
these commands appear in the Edit menu.
IDE–152 IDE User Guide
Editing Source Code
Basic Text Editing
Use these commands to manipulate text within a window, among
several windows, or between applications.
For more information about these commands, see “Edit Menu” on
page 637.
Balancing Punctuation
When you edit source code, you often have to make sure that every
opening parenthesis (, bracket [, and brace { has a closing
parenthesis ), bracket ], and brace }, or the compiler could
misinterpret your code or give you an error.
The CodeWarrior IDE provides several checks that help you balance
these elements correctly.
To check for balanced parentheses, brackets, or braces, place the
insertion point in the text you want to check. Then, choose Balance
from the Edit Menu. Alternatively, double-click on the parenthesis,
bracket, or brace character that you want to check for a matching
character.
The CodeWarrior editor searches through the text file, starting from
the text-insertion point, for a parenthesis, bracket, or brace. After the
editor finds one of these characters, it searches through the text file
in the opposite direction for a matching character. When the editor
finds a match, it selects the text between the two characters. The
computer beeps when the punctuation is not balanced. For example,
if the insertion point is not enclosed by matching parentheses,
brackets, or braces, the computer beeps.
TIP Use the Balance command to quickly select blocks of code.
Using automatic balancing
You can have the editor check for balanced punctuation
automatically. To learn more about this feature, refer to “Balance
while typing” on page 279.
IDE User Guide IDE–153
Editing Source Code
Basic Text Editing
Shifting Text Left and Right
Use the Shift Left and Shift Right commands on the Edit Menu to
shift a block of text to the left or right.
To shift a selected block of text, choose Shift Right or Shift Left
from the Edit Menu. If you do not know how to do select text, refer
to “Selecting Text” on page 151.
The CodeWarrior editor shifts the selected text one tab stop to the
right or left by inserting or deleting a tab at the beginning of every
line in the selection.
To learn more about controlling the number of spaces used for
indenting text, refer to “Font & Tabs” on page 281.
Undoing Changes
The CodeWarrior editor offers several ways to undo mistakes as
you edit a file.
Undoing the last edit
The Undo command reverses the effect of your last action. The
name of the Undo command on the Edit Menu varies, depending on
your last action. For example, if you just typed some text, the name
of the command changes to Undo Typing. Choose this command to
remove the text you just typed.
Undoing and redoing multiple edits
When you enable the Use multiple undo option, you can undo or
redo several previous actions.
For instance, if you Cut a word, then Paste it, then type some text,
you can backtrack through all of those actions by choosing the
Undo command three times. The first Undo removes the text you
typed, the second Undo unpastes the text you pasted, and the third
Undo uncuts the text you cut, therefore returning the text to its
original condition. You can perform the three original activities
again in the same order by choosing the Redo command three
times.
IDE–154 IDE User Guide
Editing Source Code
Navigating the Text
To enable the Use multiple undo option, refer to “Use multiple
undo” on page 279.
Note that the keyboard shortcut for the Redo command changes
when the Use multiple undo option is disabled.
WARNING! The IDE saves undo actions in a stack, which could cause you to
lose certain actions when you use multiple undo and redo. Each
undo action adds an item to the stack, while each redo action
repositions a pointer to the next undo action. For example, if there
were five undo actions on the stack (ABCDE), and you redo two of
them, the stack appears to the pointer like this: ABC. When you
perform a new action (ABCF), the undo events (DE) are no longer
available.
Reverting to the last saved version of a file
The Revert command in the File menu returns a file to its last saved
version. To learn more about reverting to the previous version of a
file, see “Reverting to a Previously-Saved File” on page 127.
Controlling Color
You can use color to highlight many elements in your source code,
such as comments, keywords, and quoted character strings.
Highlighting these elements helps you identify them in the text, so
you can check your spelling and syntax as you type by recognizing
color patterns. You can also highlight custom keywords, which are
in a list of words you designate. For information on configuring
color syntax options, see “Text Colors” on page 282.
Navigating the Text
The CodeWarrior editor offers flexible means for navigating
through text in your source-code files.
This section covers the following topics:
• Finding a Routine
• Adding, Removing, and Selecting a Marker
IDE User Guide IDE–155
Editing Source Code
Navigating the Text
• Using Bookmarks
• Opening a Related File
• Going to a Particular Line
• Using Go Back and Go Forward
• Configuring Editor Commands
• Opening the Directory of a File (Mac OS)
In addition, the integrated source-code browser has many powerful
techniques for navigating through your code. To learn more about
the CodeWarrior browser, refer to “Browsing Source Code” on page
205.
You can change the key bindings that cause the text-insertion point
to move around in a file. Refer to “Customizing Key Bindings” on
page 314 for more information.
Finding a Routine
Click the icon shown at left to display the Routine pop-up
menu, discussed in “Function Pop-Up Menu” on page 141.
This pop-up menu lets you access routines in your code.
NOTE If the Routine pop-up menu is empty, the current file is not a source-
code file.
Adding, Removing, and Selecting a Marker
You can add or remove a marker in any of your text files using the
facilities built into the CodeWarrior editor. Markers allow you to
jump to specific points in a file, or leave notes to yourself about
work in progress.
Adding a marker
To add a marker, move the text-insertion point to the location in the
text that you wish to mark, then choose Add marker from the
Marker Pop-Up Menu. The Add Marker dialog box, shown in
Figure 5.9 on page 157, appears.
IDE–156 IDE User Guide
Editing Source Code
Navigating the Text
Figure 5.9 Add Marker Dialog Box
In the Name for new marker field, enter text that helps identify the
location that you are marking. For example, you could enter a brief
note, a comment, a routine name, or similar information.
Click Add to confirm the text in the field and add a marker at the
text-insertion point. The text that you entered now appears in the
Marker Pop-Up Menu, as shown in Figure 5.10.
TIP If you select some text in a source file, then choose Add Marker,
the selected text appears in the text field of the Add Marker dialog
box. This shortcut is handy for quickly adding specific routines or
lines as marker text.
Figure 5.10 Example Text File with an Added Marker
Adding Markers with #pragma
There is another method for marking files on a more permanent
basis. In C/C++ programs, you can use the following directive to
create a marker:
IDE User Guide IDE–157
Editing Source Code
Navigating the Text
#pragma mark myMarker
In Pascal, you can use the following directive to create a marker:
{$PRAGMAC MARK myMarker}
When embedded in your file, these examples automatically add
myMarker to the Function Pop-Up Menu after you open the file in
the editor.
Unlike the markers defined using the Marker Pop-Up Menu,
markers defined with #pragma statements appear in the Routine
pop-up menu.
Removing a marker
To remove a marker, choose the Remove markers command from
the Marker Pop-Up Menu. The Remove markers dialog box shown
in Figure 5.11 appears. After you select the marker that you wish to
delete, click Remove to permanently remove the marker from the
list. To close the Remove Markers dialog box, click Done to confirm
your changes or click Cancel to discard your changes.
Figure 5.11 Remove Markers Dialog Box
IDE–158 IDE User Guide
Editing Source Code
Navigating the Text
Jumping to a marker
To jump to a specific marker in your file, choose the marker’s name
from the Marker Pop-Up Menu. The IDE moves the text-insertion
point to the marker’s location and scrolls to that location if
necessary.
Using Bookmarks
Bookmarks behave like temporary markers. The IDE does not save
bookmarks from one editing session to the next, nor does it display
their names in pop-up menus. However, bookmarks behave
similarly to markers, and you can use them on a temporary basis.
To manipulate bookmarks, you must use the default key bindings
assigned to their respective commands, or assign your own. The
Customize IDE Commands window includes the following
commands related to bookmarks:
• Add bookmark
• Go to next bookmark
• Go to previous bookmark
To learn more about assigning key bindings to these commands, see
“Customizing Key Bindings” on page 314.
Adding a bookmark
To add a bookmark, move the text-insertion point to the line of
source code that you wish to mark, then press the key binding
assigned to the Add bookmark command.
A blue diamond appears on the source-code line that you
bookmarked.
See “Navigating bookmarks” on page 160 for more information
about moving among the bookmarks in the active editor window.
Removing a bookmark
You can remove one bookmark at a time, or you can simultaneously
remove all bookmarks from the active editor window.
IDE User Guide IDE–159
Editing Source Code
Navigating the Text
To remove an existing bookmark, move the text-insertion point to
the line of source code that contains the bookmark. Press the key
binding assigned to the Add bookmark command to remove the
bookmark.
To simultaneously remove all bookmarks, close the active editor
window. Bookmarks do not persist from one editing session to the
next, so all bookmarks disappear after the IDE closes the window.
Navigating bookmarks
To scroll to each subsequent bookmark in the active editor window,
use the key binding assigned to the Go to next bookmark
command. To scroll to each previous bookmark, use the key
binding assigned to the Go to previous bookmark command.
Scrolling for bookmarks causes the IDE to wrap around both ends
of the file. For example, if the text-insertion point is at the last
bookmark in the file, using the Go to next bookmark key binding
causes the IDE to wrap around to the beginning of the file and scroll
to the first bookmark that it encounters. Similarly, using the Go to
previous bookmark key binding at the first bookmark in the file
causes the IDE to wrap around to the end of the file.
Opening a Related File
The CodeWarrior editor lets you open files that are related to the file
in the active editor window. For example, you can view a header file
used by a source-code file.
One way to open interface or header files referenced by the current
file is to use the Interface Pop-Up Menu, shown in Figure 5.2 on
page 140. To open a related file, choose its name from the pop-up
menu. You can also use the pop-up menu to Touch and Untouch the
current file.
There is another method for opening an interface or header file used
by your source code. To open the related file, press Ctrl-D
(Windows) or Command-D (Mac OS) after selecting the file name in
the active window. To learn more about this technique, refer to
“Opening an Existing File” on page 110.
IDE–160 IDE User Guide
Editing Source Code
Navigating the Text
Going to a Particular Line
You can go to a specific line in an editor window if you know its line
number. The IDE numbers lines consecutively, with the first line
designated as line 1.
Click the Line and Column Indicator in the
editor window to open the Line Number
dialog box shown in Figure 5.12 on page 161.
Enter the desired line number and click OK.
Figure 5.12 Line Number Dialog Box
Using Go Back and Go Forward
The Go Back and Go Forward commands are only available when
you use the CodeWarrior browser. If you already enabled the
browser, refer to “Go Back and Go Forward” on page 245 for
information about using these commands.
For more information about the CodeWarrior browser, see
“Browsing Source Code” on page 205.
Configuring Editor Commands
The CodeWarrior IDE lets you customize editor key bindings to suit
your working style. Refer to “Customizing Key Bindings” on page
314 to learn about the commands you can customize to your liking.
Opening the Directory of a File (Mac OS)
If you want to know the full directory path of the file in the active
editor window, use the Path pop-up menu. To display this pop-up
IDE User Guide IDE–161
Editing Source Code
Online References
menu, press the Command key and click on the file name in the title
bar of the editor window.
You can open the directory that contains the file shown in the active
editor window by choosing the directory name from the Path pop-
up menu, as shown in Figure 5.6 on page 145.
Online References
As you work on a program, you often need to look up the
documentation or definition of a particular routine, variable, or
type. You might also need to look up documentation about using
the IDE. The online help included with the IDE contains both kinds
of documentation.
Before you can use the online help available from the IDE, you need
to install the help files and viewer applications from the
CodeWarrior Reference CD. Follow the instructions for your
particular host:
Windows Insert the CodeWarrior Reference CD into your CD-
ROM drive. Wait for a dialog box to appear. Click “Launch
CodeWarrior Setup” and follow the onscreen instructions.
Mac OS Insert the CodeWarrior Reference CD into your CD-
ROM drive. Double-click the CodeWarrior Reference Installer icon
inside the CD. Follow the onscreen instructions to install the help
files and viewer applications.
Solaris and Linux Insert the CodeWarrior Tools CD into your
CD-ROM drive. Change your current directory to that of the CD-
ROM drive. Locate and run the install.sh file on the CD, then
follow the onscreen instructions.
This section describes how to look up documentation online and
how to set up the online reference databases.
The topics in this section are:
• Finding Symbol Definitions
• WinHelp (Windows)
• QuickHelp (Mac OS)
• QuickView (Mac OS)
IDE–162 IDE User Guide
Editing Source Code
Online References
• THINK Reference (Mac OS)
• Inserting Routine (Reference) Templates (Mac OS)
Finding Symbol Definitions
You can find the definition of a symbol in the source-code files of
your project. You can also find symbol definitions by using the
online documentation viewer selected in IDE Extras preferences
panel. Supported online reference viewers include WinHelp
(Windows) and QuickHelp (Mac OS), as well as older online help
systems such as QuickView (Mac OS) and THINK Reference (Mac
OS).
TIP The CodeWarrior browser also looks up symbol definitions. See
“Using the Browser” on page 243 for more information.
To look up the definition of a selected symbol, choose Find
Definition from the Search Menu. CodeWarrior searches all of the
files in your project for the symbol definition.
If CodeWarrior finds a definition, it opens an editor window and
highlights the definition for you to examine. If CodeWarrior does
not find a definition, a system beep sounds.
TIP To return to your original location after viewing a symbol definition,
press Shift-Ctrl/Command-B. This key binding is equivalent to the
Go Back menu command. For more information, see “Go Back and
Go Forward” on page 245.
Mac OS, Solaris, and Linux You can also use the Find
Reference and Find Definition & Reference commands to look up
symbol definitions. After you select a symbol and choose the Find
Reference command, CodeWarrior searches the online
documentation for the symbol definition (see “IDE Extras” on page
259 for more information). After you select a symbol and choose the
Find Definition & Reference command, The IDE searches both the
project files and the online documentation for the symbol definition.
IDE User Guide IDE–163
Editing Source Code
Online References
WinHelp (Windows)
The CodeWarrior IDE provides help files for use with the WinHelp
viewer application. WinHelp is part of the Windows operating
system.
You can use WinHelp to look up documentation on Win32, MFC,
the ANSI libraries, and the CodeWarrior IDE. In addition, you can
right-click on many components in the IDE to view pop-up help
information.
To use WinHelp, choose CodeWarrior Help from the Help menu.
The help file for the IDE appears.
Click the hypertext links in the WinHelp documentation to learn
more about the IDE. To learn how to perform specific tasks, click the
How to hypertext link in the WinHelp window. Clicking the
Glossary hypertext link provides descriptions of the terms used in
the online documentation.
Refer to “Finding Symbol Definitions” on page 163 to begin looking
up documentation online.
QuickHelp (Mac OS)
The CodeWarrior IDE provides help files for use with the
QuickHelp viewer application. The CodeWarrior Help folder
contains the QuickHelp files.
You can use QuickHelp to look up documentation on PowerPlant,
the ANSI libraries, and the CodeWarrior IDE. In addition, you can
use Balloon Help on many components in the IDE to view help
information.
To use QuickHelp, choose CodeWarrior Help from the Help menu.
The help file for the IDE appears.
Click the hypertext links in the WinHelp documentation to learn
more about the IDE. To learn how to perform specific tasks, click the
How to hypertext link in the WinHelp window. Clicking the
Glossary hypertext link provides descriptions of the terms used in
the online documentation.
IDE–164 IDE User Guide
Editing Source Code
Online References
Refer to “Finding Symbol Definitions” on page 163 to begin looking
up documentation online.
QuickView (Mac OS)
QuickView is part of the Macintosh Programmer’s Toolbox Assistant
(MPTA) published by Addison-Wesley for Apple Computer, Inc.
You can use QuickView to look up documentation on PowerPlant,
the ANSI libraries, and the CodeWarrior IDE.
If you have the Macintosh Programmer’s Toolbox Assistant, you can
also look up documentation on Mac OS Toolbox routines.
To use QuickView with the CodeWarrior IDE, you must properly
configure the IDE to use the QuickView files:
1. Position your files.
Place all the QuickView files in the folder that contains the
QuickView application. If you already have the Macintosh
Programmer’s Toolbox Assistant (MPTA), copy all its QuickView
files to the same folder.
2. Remove multiple copies of the QuickView application.
In order to function properly with CodeWarrior, you cannot have
more than one copy of the QuickView application on your
computer system. If your computer system includes duplicate
copies of QuickView, remove all copies except the one in which you
placed the CodeWarrior QuickView files.
3. Select QuickView as the online reference.
Refer to “IDE Extras” on page 259 to learn how to select the
QuickView application as the online reference viewer for your
project.
Refer to “Inserting Routine (Reference) Templates (Mac OS)” on
page 166 or “Finding Symbol Definitions” on page 163 to begin
looking up documentation online.
THINK Reference (Mac OS)
Refer to “IDE Extras” on page 259 to learn how to select the THINK
Reference application as the online reference viewer for your
IDE User Guide IDE–165
Editing Source Code
Online References
project. THINK Reference includes several databases on Mac OS
Toolbox routines.
THINK Reference is not part of the CodeWarrior product. This
reference viewer is available from third-party sources, such as
Developer Depot on the MacTech CD-ROM.
Refer to “Inserting Routine (Reference) Templates (Mac OS)” on
page 166 or “Finding Symbol Definitions” on page 163 to begin
looking up documentation online.
Inserting Routine (Reference) Templates
(Mac OS)
If you look up a routine (such as an operating system call) in the
QuickView or THINK Reference online viewers, you can paste the
template for the call into the active editor window at the text-
insertion point. This technique is useful when you know the name
of the call you want to add to your source code, but you are not
familiar with the call parameters.
A routine template looks like this:
SetRect(r, left, top, right, bottom);
To insert a reference template into your code, type the routine name
that you want to insert, then select the name you just typed. Next,
choose Insert Reference Template from the Edit Menu.
The CodeWarrior IDE searches for the routine in either QuickView
(Mac OS) or THINK Reference (Mac OS), starting the required
application if it is not already running. If CodeWarrior finds the
routine, the IDE copies the template to the active editor window
and replaces the text you selected with the template. If CodeWarrior
does not find the routine template, a system beep sounds.
IDE–166 IDE User Guide
6
Finding and Replacing Text
This chapter explains how to find and replace text in files. The
CodeWarrior® IDE allows you to find and replace text in a single
file, in every file in a project, or in any combination of files. You can
also use regular expressions, like as those used in grep commands.
This chapter covers the following topics:
• Guided Tour of the IDE’s Find Features
• Find Options
• Finding and Replacing Text in a Single File
• Finding and Replacing Text in Multiple Files
• Searching for Selected Text
• Using Regular Expressions (grep)
Guided Tour of the IDE’s Find Features
The IDE offers two dialog boxes and a window to help you find and
replace text. The following list briefly describes these items:
• Find Dialog Box—allows you to find text in a single file
• Find and Replace Dialog Box—allows you to find text and
replace that text in a single file
• Find in Files Window—combines the features of the two dialog
boxes and adds multi-file find-and-replace capabilities.
NOTE The Shielded Folders preference panel specifies folders that the
IDE can ignore during find or find-and-replace operations. If your
search returns unexpected results, check the options in the
preference panel. One of the options might inadvertently shield a
IDE User Guide IDE–167
Finding and Replacing Text
Guided Tour of the IDE’s Find Features
folder to search. For more information, see “Shielded Folders” on
page 266.
Find Dialog Box
The Find dialog box, shown in Figure 6.1, allows you to find text in
the active editor window. To display this dialog box, choose Search
> Find.
NOTE (Mac OS, Solaris, and Linux) The IDE disables the Find menu
command by default. See “Customizing Commands” on page 307 to
learn how to enable the menu command.
See “Find Options” on page 169 for more information about the
options in this dialog box.
Figure 6.1 Find Dialog Box
Find and Replace Dialog Box
The Find and Replace dialog box, shown in Figure 6.2 on page 169,
allows you to find and replace text in the active editor window. To
display this dialog box, choose Search > Find and Replace.
See “Find Options” on page 169 for more information about the
options in this dialog box.
IDE–168 IDE User Guide
Finding and Replacing Text
Find Options
Figure 6.2 Find and Replace Dialog Box
Find in Files Window
The Find in Files window, shown in Figure 6.3 on page 170, allows
you to find and replace text in multiple open editor windows. You
can search specific folders, projects, and other files. To display the
window, choose Search > Find in Files.
See “Find Options” for more information about the options in this
window.
Find Options
The Find dialog box, Find and Replace dialog box, and Find in
Files window share many options.
This section organizes the options into the following categories:
• General Search Options
• Multi-File Search Options
• Search Buttons
For more information about displaying a particular dialog box or
window, see “Guided Tour of the IDE’s Find Features” on page 167.
IDE User Guide IDE–169
Finding and Replacing Text
Find Options
Figure 6.3 Find in Files Window
General Search Options
Table 6.1 on page 170 describes several search options that you can
use to refine single-file and multi-file searches. For example, you
can customize case sensitivity, regular expressions, and search
direction. Your settings determine the number of matches the IDE
locates within your files.
Table 6.1 Search Options to Refine Single-file and Multi-file Searches
Option Description
Find field Enter in this field the text to locate. You can also use the pop-
up menu to enter search text from recent searches.
Replace field Enter in this field the text to substitute for the text in the Find
field. You can also use the pop-up menu to enter
substitution text from recent replacement operations.
IDE–170 IDE User Guide
Finding and Replacing Text
Find Options
Option Description
Match whole word Enable this checkbox to match only whole words with the
search text you enter in the Find field. Disable the checkbox
to match the search text with text that might be embedded
within larger words.
To match as a whole word, the found text must be delimited
by white space or other non-alphanumeric text.
Stop at end of file Enable this checkbox to stop each search at the end of the
active file. The IDE begins each search at the text-insertion
point. With the checkbox enabled, the IDE beeps after
reaching the end of the file without finding the desired text.
With the checkbox disabled, the IDE wraps to the opposite
end of the file and continues the search.
This checkbox does not affect the Find All operation, which
locates all occurrences of matching text in the active file,
regardless of search direction.
Case sensitive Enable this checkbox to consider upper- and lower-case
letters when matching the search text in the Find field with
the text in the active files. Disable the checkbox to disregard
case.
Regular expression Enable this checkbox to treat the search text in the Find field
as a regular expression. Regular expressions use the same
type of syntax as UNIX™ grep commands. For more
information, see “Using Regular Expressions (grep)” on
page 195.
Search selection only Enable this checkbox to search only selected text in the active
editor window. Disable the checkbox to search all text.
Direction Use this section to choose the direction that you wish to
perform the search. Click the Up radio button to search
upward from the text-insertion point in the active editor
window toward the beginning of the file. Click the Down
radio button to search downward from the text-insertion
point toward the end of the file.
The Stop at end of file checkbox determines what happens
after the IDE reaches the beginning or end of the file.
IDE User Guide IDE–171
Finding and Replacing Text
Find Options
Multi-File Search Options
You can use the Find in Files window to find and replace text
across multiple files using several multi-file search options. For
example, you can instruct the IDE to search only in particular
folders or projects. For more information, see “Finding and
Replacing Text in Multiple Files” on page 182.
Table 6.2 describes the tabs on the Find in Files window that
contain multi-file search options.
Table 6.2 Find in Files Window Tabs
This tab… Contains options for searching these items…
In Folders files residing in particular folders (directories)
In Projects files residing in particular projects
In Symbolics files for which the IDE generates and catalogs
debugging information in a symbolics file
In Files sets of multiple files
This section contains the following topics:
• In Folders Options
• In Projects Options
• Symbolics
• File Set
In Folders Options
Table 6.3 on page 173 describes the multi-file search options on the
In Folders tab.
IDE–172 IDE User Guide
Finding and Replacing Text
Find Options
Table 6.3 In Folders Multi-file Search Options
Option Description
Search in Use this field to specify the path to the folder containing the files
to search.
Clicking the Browse button or Choose button opens a dialog
box where you can choose the folder to search. Alternatively,
you can use the pop-up menu to enter path information from
recent successful folder searches.
Search sub-folders Enable this checkbox to search folders nested within the folder
whose path appears in the Search in field. Disable the checkbox
to ignore the nested folders.
By type Use this pop-up menu to choose a group of files to search.
Each group includes a list of file-name extensions. The IDE
searches the contents of files with matching file-name
extensions only.
The By type field on the Windows-hosted IDE also performs the
function of the Ends with field.
Ends with Use this field to enter a list of file-name extensions, separated by
a commas, to consider during the search. The IDE searches only
the contents of files whose extensions appear in this field.
The IDE remembers recent lists and displays them at the bottom
of the By type pop-up menu.
The Ends with field also shows the list of file-name extensions
associated with each group in the By type pop-up menu.
In Projects Options
Table 6.4 on page 174 describes the multi-file search options on the
In Projects tab.
IDE User Guide IDE–173
Finding and Replacing Text
Find Options
Table 6.4 In Projects Multi-file Search Options
Option Description
Project Use this pop-up menu to specify the projects to search. Choose
All Projects to search all open projects, or choose a project name
to search only the files in that project.
Target Use this pop-up menu to specify the build targets to search for the
projects that you specified in the Project pop-up menu, as
follows:
• To search a specific build target, choose its name.
• To search all build targets, choose All Targets.
• To search only the default build target of each open project,
choose Default Targets. You can choose this option only if
you previously chose All Projects from the Project pop-up
menu.
Project sources Enable this checkbox to search source-code files belonging to the
projects that you specified in the Project pop-up menu. Disable
the checkbox to disregard all source-code files during the search.
The file list at the bottom of the In Projects tab shows the files to
be searched. You can select and delete individual files from this
list.
Project headers Enable this checkbox to search header and interface files
belonging to the projects shown in the Project pop-up menu.
Disable the checkbox to disregard all project header and interface
files during the search.
Project headers refer to header and interface files included by the
project’s source-code files via the #include filename
directive.
The file list at the bottom of the In Projects tab shows the files to
be searched. You can select and delete individual files from this
list.
IDE–174 IDE User Guide
Finding and Replacing Text
Find Options
Option Description
System headers Enable this checkbox to search system header and interface files
belonging to the projects shown in the Project pop-up menu.
Disable the checkbox to disregard all system header and interface
files during the search.
System headers refer to header and interface files included by the
project’s source-code files via the #include <filename>
directive.
The file list at the bottom of the In Projects tab shows the files to
be searched. You can select and delete individual files from this
list.
Search cached Enable this checkbox to search cached sub-targets of the projects
sub-targets shown in the Project pop-up menu. The search criteria that you
define for the projects also applies to the cached sub-targets.
Disable the checkbox to disregard the cached sub-targets during
the search.
In this case, a cached sub-target has the following characteristics:
• The current target builds against it.
• It resides in the current project.
• It resides in a subproject (if you enabled subproject caching for
the current build target. See “Cache Subprojects” on page 347
for more information.)
Symbolics
The In Symbolics tab contains the Symbolics pop-up menu.
Use this pop-up menu to search files for which the IDE generates
and catalogs debugging information in a symbolics file. Choose All
Symbolics to search all open files, or choose a build-target name to
search only in the files of that build target.
The file list at the bottom of the In Symbolics tab shows the files to
search. You can select and delete individual files from this list.
IDE User Guide IDE–175
Finding and Replacing Text
Find Options
File Set
The In Files tab contains the File Set pop-up menu.
Use this pop-up menu to specify sets of files to search, as follows:
• Choose Open Editor Files to search all open editor files.
• Alternatively, choose New File Set to create custom file sets to
search.
You can perform the following tasks with custom file sets:
• Add files to the file set
• Clear the current file listing from the file set
• Save the file set for later use
• Remove the file set
The field at the bottom of the In Files tab lists the files to be
searched. When using custom file sets, you can drag and drop
appropriate files and folders into the field.
Search Buttons
The dialog boxes and window include buttons described in this
section. Use these buttons to perform your search-and-replace
operations. The IDE uses your search criteria to conduct each
search.
Table 6.5 on page 177 describes the search buttons.
IDE–176 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in a Single File
Table 6.5 Search Buttons
Button Description
Find Click this button to search files for text that matches the search
criteria. The IDE selects matching text, scrolls to the selection, and
closes the dialog box or window. The IDE beeps after failing to
locate matching text.
Find All Click this button to search files and locate all occurrences of text
that match the search criteria.
The IDE opens a Search Results window that shows information
about the search results, including the file name and line number
of each match. The Search Results window reports zero
occurrences for an unsuccessful search.
Replace Click this button to replace the next occurrence of text that matches
the search criteria with the text in the Replace field.
Replace All Click this button to replace every occurrence of text that matches
the search criteria with the text in the Replace field. The IDE beeps
after failing to locate text that matches the search criteria.
Cancel Click this button to discard the current search criteria and close the
dialog box or window.
Finding and Replacing Text in a Single File
The Find dialog box allows you to locate text in the active editor
window. The Find and Replace dialog box allows you to search the
active editor window for text that matches the search text, as well as
replace the matching text. This section describes how to use the
dialog boxes for find operations and find-and-replace operations.
For more information about opening files, see “Opening an Existing
File” on page 110.
This section discusses the following topics:
• Finding Text
• Finding and Replacing Text
• Searching with Special Characters
IDE User Guide IDE–177
Finding and Replacing Text
Finding and Replacing Text in a Single File
Finding Text
To find text in a single file, you open the Find dialog box, enter
search text, configure search criteria, and then perform the search.
To find text using the Find dialog box, follow these steps:
1. Choose Search > Find.
2. Enter in the Find field the text to find.
For example, to find occurrences of the text main, enter main in the
Find field.
3. Configure the search criteria.
See “General Search Options” on page 170 and “Searching with
Special Characters” on page 181 for more information.
4. Find individual matching occurrences of text, or find all matching
occurrences, in the active editor window.
For more information about finding individual occurrences, see
“Selective Find.” For more information about finding all
occurrences, see “Find All” on page 179.
To learn how to replace matching text that the IDE finds, see
“Finding and Replacing Text.”
Selective Find
To find individual occurrences of matching text, you must first
complete the steps described in “Finding Text” on page 178. After
completing those steps, click the Find button in the Find dialog box,
or choose Search > Find.
Using the search text in the Find field and the search criteria defined
in the Find dialog box, the IDE searches the active editor window
for matching text. If successful, the IDE closes the Find dialog box,
then displays and selects the matching text in the editor window. If
unsuccessful, the IDE beeps.
You can find the next or previous occurrence of the search text in
the active editor file. Use one of the following techniques:
• Choose Search > Find Next to locate the next occurrence of
matching text
IDE–178 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in a Single File
• Choose Search > Find Previous to locate the previous
occurrence of matching text
NOTE (Windows) The IDE disables the Find Previous menu command by
default. See “Customizing Commands” on page 307 to learn how to
enable the menu command.
You can repeatedly choose the Find Next or Find Previous menu
commands to continue searching for other matches. The IDE beeps
after failing to locate additional occurrences.
Find All
To find all occurrences of matching text, you must first complete the
steps described in “Finding Text” on page 178. After completing
those steps, click the Find All button in the Find dialog box.
A Search Results window appears and shows the search status. You
can view individual matches and stop a search in progress. For
more information, see “Search Results” on page 191.
The Search Results window is similar to the Message window. For
more information about the Message window, see “Guided Tour of
the Message Window” on page 395.
Finding and Replacing Text
To find and replace text in a single file, you open the Find and
Replace dialog box, enter search text, configure search criteria, and
then perform the search. After a successful search, you can replace
matching text located by the IDE.
To find and replace text using the Find and Replace dialog box,
follow these steps:
1. Choose Search > Find and Replace.
2. Enter in the Find field the text to find.
For example, to find occurrences of the text main, enter main in the
Find field.
3. Enter in the Replace field the text to substitute for each occurrence
of the text in the Find field.
IDE User Guide IDE–179
Finding and Replacing Text
Finding and Replacing Text in a Single File
4. Configure the search criteria.
See “General Search Options” on page 170, “Multi-File Search
Options” on page 172, and “Searching with Special Characters” on
page 181 for more information.
5. Find and replace individual matching occurrences of text, or find
and replace all matching occurrences, in the active editor window.
For more information about finding and replacing individual
occurrences, see “Selective Find and Replace.” For more
information about finding and replacing all occurrences, see
“Replace All” on page 181.
To learn how to find text in the active editor window without
replacing matching text, see “Finding Text” on page 178.
Selective Find and Replace
To find and replace individual occurrences of text, you must first
complete the steps described in “Finding and Replacing Text.” After
completing those steps, continue with the additional steps
described in this section.
To selectively find and replace text, follow these steps:
1. Click the Find button in the Find and Replace dialog box, or
choose Search > Find.
Using the search text in the Find field and the search criteria defined
in the Find and Replace dialog box, the IDE searches the active
editor window for matching text. If successful, the IDE closes the
Find and Replace dialog box, then displays and selects the
matching text in the editor window. If unsuccessful, the IDE beeps.
2. Choose the desired menu command from the Search menu.
Choose the menu command that performs the desired task:
• Replace Selection substitutes the matching text with the text
that you entered in the Replace field of the Find and Replace
dialog box.
• Replace and Find Next performs a Replace Selection operation
immediately followed by a Find Next operation. The effect is to
replace the current matching text, then locate the next
occurrence of matching text.
IDE–180 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in a Single File
• Replace and Find Previous performs a Replace Selection
operation immediately followed by a Find Previous operation.
The effect is to replace the current matching text, then locate the
previous occurrence of matching text.
NOTE (Windows) The IDE disables the Replace and Find Previous menu
command by default. See “Customizing Commands” on page 307 to
learn how to enable the menu command.
You can repeatedly choose the Replace and Find Next or Replace
and Find Previous menu commands to continue replacing and
finding other matches. The IDE beeps after failing to locate
additional occurrences.
Replace All
To replace all occurrences of matching text, you must first complete
the steps described in “Finding and Replacing Text” on page 179.
After completing those steps, click the Replace All button in the
Find and Replace dialog box. You can also choose Search > Replace
All if you wish to use the existing criteria in the Find and Replace
dialog box.
WARNING! You cannot undo Replace All. However, if you save the file prior to
using Replace All, you can use Revert to restore the file to its
original state. This technique works as long as you do not save any
changes after using Replace All, and you do not work across
multiple files.
Searching with Special Characters
You can enter special characters, such as a Tab or Return, in the Find
field and Replace field. The IDE considers these special characters
while searching for matching text.
Use one of the following techniques to enter special characters into
the Find field or Replace field:
• Copy text that includes the special characters, then Paste the text
into the desired field
IDE User Guide IDE–181
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
• On IDE hosts that support drag-and-drop operations, drag the
text that includes the special characters from the editor window
directly into the desired field
• Enable the Regular expression checkbox, then enter \t for Tab
or \r for Return in the desired field. Enabling the Regular
expression checkbox alters the meaning of the field. See “Find
and Replace Using Regular Expressions” on page 197 for more
information.
• (Mac OS) Press Option-Tab to enter a Tab character, or press
Option-Return to enter a Return character in the desired field
Finding and Replacing Text in Multiple Files
The Find in Files window allows you to find and replace text across
multiple files. This section describes how to use the window to
search several files.
For more information about opening files, see “Opening an Existing
File” on page 110. To learn about using the CodeWarrior class
browser to search multiple files, see “Go Back and Go Forward” on
page 245.
This section discusses the following topics:
• In Folders
• In Projects
• In Symbolics
• In Files
• Search Results
In Folders
The In Folders tab, shown in Figure 6.4 on page 183, allows you to
search specific folders (directories) in your computer’s file system.
This section describes how to use the options in the tab. For brief
descriptions of each option in the tab, as well as other options, see
“Find Options” on page 169.
IDE–182 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
Figure 6.4 In Folders Tab of Find In Files Window
To choose specific folders to search, follow these steps:
1. Enter in the Search in field the path to the folder to search.
You can enter the path information in the following ways:
• Type the path directly into the field. A sample path appears in
Figure 6.4.
• Choose a recently used path from the pop-up menu for the field.
• Click Browse or Choose to open a dialog box. Use the dialog box
to select the folder to search. The path to that folder then appears
in the Search in field.
2. Configure the Search sub-folders checkbox as desired.
If you enable the checkbox, the search includes all sub-folders
within the folder whose path appears in the Search in field. If you
disable the checkbox, the search only includes the folder itself,
without its sub-folders.
IDE User Guide IDE–183
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
3. Choose the file types to search within the selected folders.
Use the By type pop-up menu to choose the file types to search
within the selected folders. For more information, see “By type” on
page 173.
4. Edit the file-name extension list as desired.
Use one of the following techniques:
• (Windows) Edit the list in the By type pop-up menu.
• (Mac OS, Solaris, and Linux) Edit the list in the Ends with field.
You can edit the list to include additional extensions or exclude
existing extensions. Ensure that commas separate each entry in the
final list.
5. Click the Find, Find All, Replace, or Replace All button to
perform the desired find or find-and-replace operation.
The IDE searches the folders and files that you selected for the first
occurrence of text that matches the search criteria.
To continue the search in the next file, choose Search > Find In Next
File. To continue the search in the previous file, choose Search >
Find In Previous File.
NOTE (Windows) The IDE disables the Find In Previous File menu
command by default. See “Customizing Commands” on page 307 to
learn how to enable the menu command.
For multi-file search operations, a Search Results window appears
and shows the search status. You can view individual matches and
stop a search in progress. For more information, see “Search
Results” on page 191.
To cancel the find or find-and-replace operation, close the Find in
Files window.
In Projects
The In Projects tab, shown in Figure 6.5 on page 185, allows you to
search active projects. This section describes how to use the options
in the tab. For brief descriptions of each option in the tab, as well as
other options, see “Find Options” on page 169.
IDE–184 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
Figure 6.5 In Projects Tab of Find In Files Window
To choose specific projects to search, follow these steps:
1. Choose from the Project pop-up menu the projects to search.
By default, you can search All Projects currently active in the IDE.
To search a specific project only, choose its name from the pop-up
menu.
2. Choose from the Target pop-up menu the build targets to search.
You can choose one of the following options:
• Choose All Targets to search all build targets of the projects you
chose from the Project pop-up menu.
• If you chose All Projects from the Project pop-up menu, you can
choose Default Targets to search the default build target of each
project.
• To search a specific build target, choose its name. The build
targets that appear in the pop-up menu belong to the projects
you chose from the Project pop-up menu.
IDE User Guide IDE–185
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
NOTE In the subsequent steps, if enabling a checkbox does not add any
files to the list at the bottom of the In Projects tab, choose Project >
Make to update the active project’s internal file list. For more
information, see “Making a Project” on page 380.
3. Configure the Project sources checkbox as desired.
If you enable the checkbox, the search includes all source-code files
that belong to the selected build targets and projects. If you disable
the checkbox, the search ignores the source-code files.
4. Configure the Project headers checkbox as desired.
If you enable the checkbox, the search includes all header files that
belong to the selected build targets and projects. If you disable the
checkbox, the search ignores the header files.
NOTE The IDE uses project build data, as opposed to text parsing, to
select the project headers to include. You must compile the project
in order to view project headers in the file list at the bottom of the In
Projects tab.
5. Configure the System headers checkbox as desired.
If you enable the checkbox, the search includes all system header
files that belong to the selected build targets and projects. If you
disable the checkbox, the search ignores the system header files.
NOTE The IDE uses project build data, as opposed to text parsing, to
select the system headers to include. You must compile the project
in order to view system headers in the file list at the bottom of the In
Projects tab.
6. Configure the Search cached sub-targets checkbox as desired.
If you enable the checkbox, the search includes all cached sub-
targets that belong to the selected build targets and projects. If you
disable the checkbox, the search ignores the cached sub-targets.
7. Edit the file list as desired.
The file list at the bottom of the In Projects tab shows the files that
the IDE will search. This list updates to reflect the changes that you
make to other options in the tab. You can select and Delete or Clear
IDE–186 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
files from the list as desired. You can also open a file by double-
clicking its name in the list.
8. Click the Find, Find All, Replace, or Replace All button to
perform the desired find or find-and-replace operation.
The IDE searches the files listed in the tab for the first occurrence of
text that matches the search criteria.
To continue the search in the next file, choose Search > Find In Next
File. To continue the search in the previous file, choose Search >
Find In Previous File.
NOTE (Windows) The IDE disables the Find In Previous File menu
command by default. See “Customizing Commands” on page 307 to
learn how to enable the menu command.
For multi-file search operations, a Search Results window appears
and shows the search status. You can view individual matches and
stop a search in progress. For more information, see “Search
Results” on page 191.
To cancel the find or find-and-replace operation, close the Find in
Files window.
In Symbolics
The In Symbolics tab, shown in Figure 6.6 on page 188, allows you
to search active files for which the IDE generates and catalogs
debugging information in a symbolics file. This section describes
how to use the options in the tab. For brief descriptions of each
option in the tab, as well as other options, see “Find Options” on
page 169.
The steps presented in this section assume that the IDE generates
symbolics information for the files that you wish to search. To learn
more about generating this information, see “Generating Symbolics
Information” on page 413.
IDE User Guide IDE–187
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
Figure 6.6 In Symbolics Tab of Find In Files Window
To ensure that the IDE loads the symbolics information, open in the
Symbolics window the symbolics files generated for the files that
you wish to search. Symbolics files have names that end in .SYM,
.xSYM, .iSYM, or .EXE (CodeView). For more information about
the Symbolics window, see “Symbolics Window” on page 425.
To choose specific symbolics information to search, follow these
steps:
1. Choose from the Symbolics pop-up menu the files with symbolics
information that you wish to search.
You can search All Symbolics files currently active in the IDE. To
search a specific file only, choose its name from the pop-up menu.
2. Edit the file list as desired.
The list at the bottom of the In Symbolics tab shows the files to be
searched. This list updates to reflect the files that you chose from the
Symbolics pop-up menu. You can select and remove files from the
list as desired. You can also open a file by double-clicking its name
in the list.
IDE–188 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
3. Click the Find, Find All, Replace, or Replace All button to
perform the desired find or find-and-replace operation.
The IDE searches the files listed in the tab for the first occurrence of
text that matches the search criteria.
To continue the search in the next file, choose Search > Find In Next
File. To continue the search in the previous file, choose Search >
Find In Previous File.
NOTE (Windows) The IDE disables the Find In Previous File menu
command by default. See “Customizing Commands” on page 307 to
learn how to enable the menu command.
For multi-file search operations, a Search Results window appears
and shows the search status. You can view individual matches and
stop a search in progress. For more information, see “Search
Results” on page 191.
To cancel the find or find-and-replace operation, close the Find in
Files window.
In Files
The In Files tab, shown in Figure 6.7 on page 190, allows you to
specify custom file sets to search. This section describes how to use
the options in the tab. For brief descriptions of each option in the
tab, as well as other options, see “Find Options” on page 169.
To specify custom file sets to search, follow these steps:
1. Choose from the File Set pop-up menu the file set to search.
By default, you can search Open Editor Files in the IDE. To specify
your own list of files, known as a file set, choose New File Set from
the pop-up menu. The list at the bottom of the In Files tab shows
the active file set.
IDE User Guide IDE–189
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
Figure 6.7 In Files Tab of Find In Files Window
2. Click Add Files to add files to the active file set.
A standard dialog box opens. Use the dialog box to choose the file to
add to the active file set. Repeat this step for each file that you wish
to add.
TIP Another way to add files to the active file set is to drag and drop
them into the list at the bottom of the In Files tab. You can also drag
and drop folders that contain the files. The IDE adds files with
recognized file-name extensions to the active file set.
3. Edit the active file set as desired.
You can select and Delete or Clear files from the active file set. You
can also click Clear List to remove all files from the active file set.
4. If desired, click Save This Set to save the active file set.
A dialog box appears and prompts you for a name. After saving the
file set, you can choose its name from the File Set pop-up menu.
IDE–190 IDE User Guide
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
5. If desired, click Remove A Set to remove file sets that you no
longer use.
A dialog box appears and prompts you to select file sets to remove.
To delete a file set, select its name and click Remove. Click Done
after you finish removing file sets. Click Cancel to close the dialog
box and leave the file sets intact.
6. Click the Find, Find All, Replace, or Replace All button to
perform the desired find or find-and-replace operation.
The IDE searches the files listed in the tab for the first occurrence of
text that matches the search criteria.
To continue the search in the next file, choose Search > Find In Next
File. To continue the search in the previous file, choose Search >
Find In Previous File.
NOTE (Windows) The IDE disables the Find In Previous File menu
command by default. See “Customizing Commands” on page 307 to
learn how to enable the menu command.
For multi-file search operations, a Search Results window appears
and shows the search status. You can view individual matches and
stop a search in progress. For more information, see “Search
Results.”
To cancel the find or find-and-replace operation, close the Find in
Files window.
Search Results
As the IDE performs a multi-file search, it opens the Search Results
window, shown in Figure 6.8 on page 192. This window shows
information about the search in progress.
IDE User Guide IDE–191
Finding and Replacing Text
Finding and Replacing Text in Multiple Files
Figure 6.8 Search Results Window
The top portion of the Search Results window lists all matching
occurrences of the search text found so far. To stop a search in
progress, click Stop. The window retains the list accumulated prior
to stopping the search.
After you select an item in top portion of the Search Results
window, the bottom portion of the window displays the matching
occurrence of text within the selected file.
The Search Results window is similar to the Message window. For
more information about the Message window, see “Guided Tour of
the Message Window” on page 395.
IDE–192 IDE User Guide
Finding and Replacing Text
Searching for Selected Text
Searching for Selected Text
You can search for text without having to use the Find dialog box,
Find and Replace dialog box, or Find in Files window. To perform
this type of search, you must first select in the active editor window
the text to locate. To learn more about selecting text, see “Selecting
Text” on page 151.
The IDE assumes that the find dialog-box or window criteria
defined during the previous search also applies to the current
search. This criteria includes options such as matching whole words
and considering case. If you do not wish to use the previous criteria,
you must open the find dialog boxes or window and make the
appropriate changes.
This section discusses the following topics:
• Finding Text in the Active Editor Window
• Finding Text in Multiple Editor Windows
Finding Text in the Active Editor Window
You can search for specific text within the active editor window.
You select the text to locate and then perform a search. You can also
perform the same search repeatedly to find subsequent matches in
the window. The IDE applies the current criteria during each search
to locate matching text.
For more information about opening files, see “Opening an Existing
File” on page 110.
To find text in the active editor window, follow these steps:
1. Select an instance of the text to find.
For example, to locate all occurrences of the text main in the active
editor window, select an existing occurrence of the text main.
2. Choose Search > Find Selection.
Starting at the current text-insertion point location, the IDE searches
the active editor window to locate the next occurrence of the search
text. If successful, the IDE selects the matching text and displays
that text in the editor window. If unsuccessful, the IDE beeps.
IDE User Guide IDE–193
Finding and Replacing Text
Searching for Selected Text
You can find the next or previous occurrence of the search text in
the active editor window. Use one of the following techniques:
• Choose Search > Find Next to locate the next occurrence of
matching text
• Choose Search > Find Previous to locate the previous
occurrence of matching text
NOTE (Windows) The IDE disables the Find Previous menu command by
default. See “Customizing Commands” on page 307 to learn how to
enable the menu command.
You can repeatedly choose the Find Next or Find Previous menu
commands to continue searching for other matches. The IDE beeps
after failing to locate additional occurrences.
Finding Text in Multiple Editor Windows
You can search for text in multiple editor windows. You select the
text to locate, switch to the editor window in which you wish to
locate the selected text, and then perform the search. This method is
useful when your search is in one file and you want to search for the
same text in another file.
For more information about opening files, see “Opening an Existing
File” on page 110.
To find text in multiple editor windows, follow these steps:
1. In the currently active editor window, select an instance of the text
to find.
2. Choose Search > Enter Find String.
The IDE enters the selected text into the Find field of the Find dialog
box, Find and Replace dialog box, and Find in Files window, even
if the dialog boxes and window are not currently visible.
3. Bring forward the editor window to search.
To bring the window forward, choose its name from the Window
menu. This previously inactive window now becomes the active
window.
IDE–194 IDE User Guide
Finding and Replacing Text
Using Regular Expressions (grep)
4. Choose Search > Find Selection.
Starting at the current text-insertion point location, the IDE searches
the active window to locate the next occurrence of the search text. If
successful, the IDE selects the matching text and displays that text
in the editor window. If unsuccessful, the IDE beeps.
You can find the next or previous occurrence of the search text in
the active file. Use one of the following techniques:
• Choose Search > Find Next to locate the next occurrence of
matching text
• Choose Search > Find Previous to locate the previous
occurrence of matching text
NOTE (Windows) The IDE disables the Find Previous menu command by
default. See “Customizing Commands” on page 307 to learn how to
enable the menu command.
You can repeatedly choose the Find Next or Find Previous menu
commands to continue searching for other matches. The IDE beeps
after failing to locate additional occurrences.
Using Regular Expressions (grep)
A regular expression is a text string used as a mask for matching text
in a file. You can create regular expressions from single characters
or from more complicated strings. The IDE compares the regular
expression with the text in your files in order to locate the largest
possible matching string.
This section describes the special operators in regular expressions
recognized by the CodeWarrior IDE, as well as how to use regular
expressions to find and replace text. To use regular expressions
during a search, enable the Regular expression checkbox.
You can also combine the effect of the Regular expression checkbox
with the effect of the Case sensitive checkbox. For example,
enabling both checkboxes causes the IDE to use case-sensitive
regular expressions during a search.
IDE User Guide IDE–195
Finding and Replacing Text
Using Regular Expressions (grep)
NOTE The IDE recognizes regular expressions similar to those used in
UNIX grep commands.
This section discusses the following topics:
• Operators
• Find and Replace Using Regular Expressions
Operators
Table 6.6 shows characters that can become operators with special
meanings based on their placement in the regular expression. For
more information, see “Find and Replace Using Regular
Expressions” on page 197.
Table 6.6 Operator Descriptions
Operator Description
"." The match-any-character operator matches any single printing or non-
printing character except newline and null.
"*" The match-zero-or-more operator replaces the smallest/preceding
regular expression with a subexpression.
"+" The match-one-or-more operator repeats the preceding regular
expression at least once and then as many times as necessary to match
the pattern.
"?" The match-zero-or-one operator repeats the preceding regular
expression once or not at all.
"\n" The back-reference operator in the replace string refers to a specified
group (unit expression) in the find string. You must enclose each group
within parentheses. The digit n must range between 1 and 9. The
number identifies a specific group, starting from the left side of the
regular expression.
"|" The alternation operator matches one of a choice of regular expressions.
If you place the alternation operator between any two regular
expressions, the result matches the largest union of strings that it can
match.
IDE–196 IDE User Guide
Finding and Replacing Text
Using Regular Expressions (grep)
Operator Description
"^" The match-beginning-of-line operator matches the string from the
beginning of the string or after a newline character. When it appears
within brackets the “^” represents a List operator. Because List operators
do not enforce order, [ab] is the same as [ba].
"$" The match-end-of-line operator matches the string either at the end of
the string or before a newline character in the string.
[…] List operators enable you to define a set of items to use as a match. You
must enclose the list items within square brackets. Note that you cannot
define an empty list.
(…) Group operators define sub-expressions that you can use as a single unit
elsewhere in the regular expression.
"-" The range operator defines the characters that fall between the starting
and ending characters within the list.
Find and Replace Using Regular Expressions
You can create regular expressions to find and replace text in your
files. The IDE uses the regular expression to match text in the active
files. This section discusses the following topics:
• Matching simple expressions
• Matching any character
• Repeating expressions
• Grouping expressions
• Choosing one character from many
• Matching the beginning or end of a line
• Using the Find string in the Replace string
• Remembering sub-expressions
• References
Listing 6.1 on page 198 shows sample code. Each topic in this
section refers to this sample code.
IDE User Guide IDE–197
Finding and Replacing Text
Using Regular Expressions (grep)
Listing 6.1 Example Code
#include <iostream>
#define var1 10;
#define var2 20;
using namespace std;
int result = 0;
int main(void)
{
cout << "This example provides information about" << endl;
cout << "the use of regular expressions in the" << endl;
cout << "CodeWarrior IDE." << endl << endl;
cout << "Refer to this code when reading the" << endl;
cout << "sections in the manual dealing with" << endl;
cout << "the use of regular expressions." << endl << endl;
cout << "The value of var1 is " << var1;
cout << " out of 50, and" << endl;
cout << "the value of var2 is " << var2;
cout << " out of 50." << endl;
cout << "$" << var1;
cout << " + $" << var2;
cout << " = $" <<;
result += var1;
result += var2;
cout << result;
cout << endl << endl;
return 0;
}
Matching simple expressions
Most characters match themselves. For example, x matches all
occurrences of the letter x in the code. The only exceptions are
called operators: the asterisk (*), plus sign (+), backslash (\), period
(.), caret (^), square brackets ([ and ]), dollar sign ($), and
ampersand (&). To match an operator, precede it with a backslash,
like this: \* You can also turn any operator (except the caret) into a
literal by enclosing it in square brackets.
IDE–198 IDE User Guide
Finding and Replacing Text
Using Regular Expressions (grep)
For example, refer to the example code shown in Listing 6.1 on page
198. If you want to find every occurrence of the letter m in the code,
you would type m into the Find field. The IDE matches this regular
expression with the m in iostream. Subsequent searches match the
m in namespace, main(void), example, information, and
manual.
If you want to find every occurrence of a dollar sign in the code, you
would type \$ in the Find field. The backslash tells the IDE to
interpret the dollar sign as a normal character instead of an
operator. The IDE matches the regular expression with the first
dollar sign in the following line from Listing 6.1:
cout << "$" << var1;
Subsequent searches match the second and third dollar signs in the
next two lines.
Matching any character
A period (.) matches any character except a newline character. Use
the period when you want to be more flexible in your search.
For example, refer to the example code shown in Listing 6.1 on page
198. If you want to find four-character expressions in the code that
begin with var, enter the expression var. in the Find field. The
period following the var tells the IDE to look through the code for
var immediately followed by a single character. The IDE matches
this regular expression with var1 and var2 in the code.
Repeating expressions
The asterisk (*) and plus sign (+) are two special operators that
allow you to “repeat” expressions in your search string.
For example, refer to the example code shown in Listing 6.1 on page
198. Suppose you type s*ion in the Find field. The s* tells the IDE
to match zero or more occurrences of the letter s just before the
occurrence of ion. In Listing 6.1, this regular expression matches
the ion in both information and sections from the following
lines:
IDE User Guide IDE–199
Finding and Replacing Text
Using Regular Expressions (grep)
cout << "This example provides information about" << endl;
cout << "sections in the manual dealing with" << endl;
The same regular expression also matches the ssion in
expressions from the following lines:
cout << "the use of regular expressions in the" << endl;
cout << "the use of regular expressions." << endl << endl;
If you want to find matches that have at least one letter s preceding
ion, you would type s+ion in the Find field. The plus sign tells the
IDE to match at least one occurrence of the letter s just before the
occurrence of ion. This regular expression matches the ssion in
expressions from Listing 6.1. Notice that s+ion does not match
the ion in information or sections, since there is not at least
one letter s preceding ion in either case.
If you want to find expressions in the code that contain the number
zero, followed by one period or no periods at all, you would type
0\.? in the Find field. The backslash tells the IDE to treat the period
as a normal character, and the ? special operator acts on the normal
period character. This regular expression matches each occurrence
of the number zero in Listing 6.1. This regular expression also
matches the 0. from the following line:
cout << " out of 50." << endl;
As shown in these examples, the asterisk and plus sign usually refer
to a single character. However, it is possible to refer to more than
one character at a time by grouping expressions. See “Grouping
expressions” for more information.
Grouping expressions
If you enclose an expression in parentheses (( and )), the editor
treats the expression as a single unit and applies any asterisk (*) or
plus (+) operator to the whole expression.
For example, refer to the example code shown in Listing 6.1 on page
198. If you want to find expressions in the code that match is, you
could simply type is in the Find field. However, you could also use
IDE–200 IDE User Guide
Finding and Replacing Text
Using Regular Expressions (grep)
( i)s as the regular expression. Notice that ( i)s tells the IDE to
look for the letter s preceded by both a space and the letter i.
Whereas is matches the is within This, this, and is, ( i)s
matches only is in the following two lines from Listing 6.1:
cout << "The value of var1 is " << var1;
cout << "The value of var2 is " << var2;
Choosing one character from many
A string of characters enclosed in square brackets ([]) matches any
one character in that string. To match any character that is not in the
string enclosed within the square brackets, precede the enclosed
expression with a caret (^) like this: [^abc]
For example, refer to the example code shown in Listing 6.1 on page
198. If you want to find expressions in the code that contain the
letters x, y, or z, you would type [xyz] in the Find field. The IDE
matches this regular expression with the letter x in example and
expressions. If instead you want to find expressions in the code
that do not contain the letters x, y, or z, type [^xyz] in the Find
field. The IDE matches this regular expression with every character
in the example code except the letter x in example and
expressions.
Placing a minus sign (-) within square brackets indicates a range of
consecutive ASCII characters. For example, [0-9] is the same as
[0123456789]. Placing the minus sign as the first or last character
within the enclosed string causes the minus sign to loses its special
meaning and become an ordinary character. For example, [-bc]
represents the minus sign and the letters b and c.
If a right square bracket immediately follows a left square bracket, it
does not terminate the string but instead becomes one of the
characters to match. For example, []0-9] tells the IDE to search for
the right square bracket as well as any digit. If any special character,
such as backslash (\), asterisk (*), or plus sign (+), immediately
follows the left square bracket, that special character becomes an
ordinary character. For example, [.] tells the IDE to search for
periods.
You can use square brackets in a similar manner as parentheses. The
IDE treats the information in the square brackets as a single unit.
IDE User Guide IDE–201
Finding and Replacing Text
Using Regular Expressions (grep)
For example, [bsl]ag tells the IDE to search for occurrences of
bag, sag, or lag. Typing [aeiou][0-9] in the Find field tells the
IDE to search for a vowel followed by a number, such as a1.
Matching the beginning or end of a line
You can specify that a regular expression match only the beginning
or end of a line.
For example, refer to the example code shown in Listing 6.1 on page
198. If you want to find expressions in the code that match cout
and occur only at the beginning of a line, you would type
^([ \t]*cout) in the Find field. The [ \t]* in the regular
expression allows zero or more spaces and tabs to precede cout, as
is the case with the code shown in Listing 6.1.
Using the Find string in the Replace string
You can include the contents of the Find string in the Replace string
by using an ampersand (&) in the Replace string. For example, refer
to the example code shown in Listing 6.1 on page 198. Suppose the
Find string is var[0-9] and the Replace string is my_&. The IDE
matches the Find string with var1 and var2. Clicking the Replace
button substitutes var1 with my_var1 or var2 with my_var2.
To use an ampersand in the Replace string without any special
meaning, use \&. An ampersand has no special meaning in the Find
string.
Remembering sub-expressions
You can remember sub-expressions of a regular expression in a Find
string and recall those sub-expressions in the Replace string. You
can create up to nine remembered sub-expressions for each Find
string. You must enclose each sub-expression within parentheses.
To recall these sub-expressions when typing the Replace string, use
\n, where n is a digit that specifies which sub-expression to recall.
Determine n by counting sub-expressions from the left side of the
Find string.
For example, refer to the example code shown in Listing 6.1 on page
198. If you want to change #define declarations into const
declarations, you could perform a search for #define and
IDE–202 IDE User Guide
Finding and Replacing Text
Using Regular Expressions (grep)
manually change each occurrence to a const declaration. However,
you can take advantage of remembered sub-expressions to perform
the same process automatically. Begin by typing the following
regular expression in the Find field:
\#define[ \t]+(.+)[ \t]+([0-9]+);
This regular expression tells the IDE to search for the following
string, in the exact order given: #define, one or more spaces or
tabs, one or more characters, one or more spaces or tabs, one or
more digits, and a semicolon. Starting from the left side of the
regular expression, the first sub-expression is (.+) and the second
sub-expression is ([0-9]+). The Replace string recalls these two
sub-expressions:
const int \1 = \2;
The \1 refers to the first sub-expression from the Find string and the
\2 refers to the second sub-expression from the Find string. These
two sub-expressions recall the variable name and its value from the
original #define declaration. Notice that the Replace string
changes the #define declaration into a const declaration by using
references to the two sub-expressions. Thus, the editor finds
#define var1 10; and changes it into const var1 = 10; in
the code shown in Listing 6.1. It changes the next #define
statement in the same manner.
References
For a comprehensive book on using regular expressions, refer to
Mastering Regular Expressions, by Jeffrey E.F. Friedl, published by
O’Reilly & Associates, Inc.
IDE User Guide IDE–203
Finding and Replacing Text
Using Regular Expressions (grep)
IDE–204 IDE User Guide
7
Browsing Source Code
This chapter describes the CodeWarrior® class browser, a tool you
use to examine your project source code from various perspectives.
The CodeWarrior browser creates a database of all the symbols in
your code, and provides you with a user interface to access the data
quickly and easily, regardless of language.
Historically, programmers have used browsers primarily with
object-oriented code, but the CodeWarrior IDE browser works with
both procedural and object-oriented code. It works with most
compilers, including C, C++, Pascal, and Java.
To help you understand the browser, we are going to look at it from
three perspectives: high-level architecture, user interface, and
functionality.
The topics in this chapter include:
• Activating the Browser
• Understanding the Browser Strategy
• Guided Tour of the Browser
• Browser Wizards
• Using the Browser
Activating the Browser
To learn more about how to activate the browser, refer to:
• “Configuring IDE Options” on page 253 to learn how to
configure IDE preferences related to the browser
• “Activate Browser” on page 347 for details about the target-
specific preference settings that activate the browser.
IDE User Guide IDE–205
Browsing Source Code
Understanding the Browser Strategy
When the browser is activated, the compiler generates the browser
database information.
For more information on browser settings and options, see “Setting
Browser Options” on page 244.
To learn how to use contextual menus in the browser, see “Browser
Contextual Menu” on page 211.
Understanding the Browser Strategy
When you activate the browser, the CodeWarrior IDE compilers
generate a database of information about your code. This database
includes data not only about your code, but also about the
relationships between various parts of your code, such as
inheritance hierarchies.
The browser is a user interface that allows you to sort and sift
through this information in ways that suit your needs.
Like any good database access program, the browser does not
dictate how you should look at your information. It gives you a
variety of tools to suit your working style.
There are three principal ways of looking at the information
available to you in the browser:
• Contents View—a comprehensive view of all data
• Browser View—a class-based view
• Hierarchy View—an inheritance-based view
These sections take a brief look at each option. “Guided Tour of the
Browser” on page 210 discusses the user interface in detail.
The browser also implements instant access to information. By
right-clicking (Windows) or clicking and holding the mouse
(Mac OS, Solaris, and Linux) on any symbol for which there is
information in the database, you get instant access to related source
code. “Browser Contextual Menu” on page 211 discusses this
feature.
IDE–206 IDE User Guide
Browsing Source Code
Understanding the Browser Strategy
In addition, the browser lets you decide the scope of the view. You
can look at data in all your classes, or you may wish to focus on one
class.
Within the browser and hierarchy views, you can look at multiple
classes or single classes. Table 7.1 summarizes the various major
choices you have when using the browser.
Table 7.1 Browser viewing options
Viewing Style Wide Focus Narrow Focus
comprehensive contents not applicable
inheritance-based multi-class single-class
hierarchy hierarchy
The browser-related menu commands in the Window Menu—
Browser Contents, Class Hierarchy, and Class Browser—display
wide-focus views. Once you have the wide view, you can focus on a
particular class.
No matter what viewing style or focus you happen to be in at any
given moment, the browser has simple and intuitive mechanisms
for switching to another kind of view.
Contents View
The Contents view lets you see all of your data sorted by category
into alphabetical lists. Figure 7.1 shows a Contents view.
You select the particular category you want to examine. You can
focus on classes, constants, enumerations, routines, global variables,
macros, routine templates, and type definitions.
See “Contents Window” on page 213 for details on the Contents
window interface.
IDE User Guide IDE–207
Browsing Source Code
Understanding the Browser Strategy
Figure 7.1 A Contents view
Browser View
The Browser view is like a traditional class browser. You use this
view to look at your data from a class-oriented perspective. Figure
7.2 shows what a Browser view looks like.
In the Browser view, you have a list of classes. For the selected class
in that list, you see all of its member routines and its data members.
When you select an item, the source code related to that item is
displayed in the Source pane.
See “Browser Window” on page 214 for details on the user interface
elements in the Browser view.
IDE–208 IDE User Guide
Browsing Source Code
Understanding the Browser Strategy
Figure 7.2 A Browser view
NOTE The Browser view has a toolbar. To learn how to use and customize
the toolbar, see “Customizing the IDE” on page 306. The Browser
view also has a tab control when browsing rapid application
development (RAD) projects. For more information about the tab
control, refer to “RAD Browsing” on page 595.
Hierarchy View
The Hierarchy view is a graphical view of your class hierarchy. You
use this view to understand or follow class relationships. Figure 7.3
illustrates a multi-class hierarchy view for some classes.
IDE User Guide IDE–209
Browsing Source Code
Guided Tour of the Browser
Figure 7.3 A Hierarchy view
The Hierarchy view gives you a real feel for the way your classes
are connected with each other. You can expand and collapse a
hierarchy at will.
See “Multi-Class Hierarchy Window” on page 222 and “Single-
Class Hierarchy Window” on page 224 for details on the Hierarchy
view interface.
Guided Tour of the Browser
At first glance, the browser interface is quite complicated. There are
multiple windows filled with controls and information. However,
there are really only three kinds of views: Contents, Browser, and
Hierarchy.
IDE–210 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
In addition, the browser contextual menu is a fundamental and vital
feature of the browser interface. The contextual menu is available
for any symbol for which the browser database has data. The menu
commands describe various actions that you can perform on the
selected item.
For object-oriented code (member functions only), you have the
opportunity to see the declaration or definition of any routine with
that name. You can also open up a symbol browser that lists every
implementation of the routine. Depending on the nature of the
symbol (class name, routine name, enumeration, and so forth), the
contextual menu lists different destinations appropriate for the
item. This gives you instant access to the source code related to any
symbol.
This section examines each window used by the browser and the
browser controls. The sections are:
• Browser Contextual Menu
• Contents Window
• Browser Window
• Multi-Class Hierarchy Window
• Single-Class Hierarchy Window
• Symbol Window
• Browser Menu
Browser Contextual Menu
When the browser is active, right-click (Windows) or click and hold
(Mac OS, Solaris, and Linux) on any symbol for which there is data
in the browser database. When you do, the IDE displays a
contextual menu with a variety of items.
The commands displayed in the menu depend on the nature of the
symbol you are investigating. Some commands let you open
browser windows, while other commands direct you to a location in
code.
You can also use the contextual menu to perform common
debugging tasks. For example, you can choose commands to set and
clear breakpoints in the active editor window.
IDE User Guide IDE–211
Browsing Source Code
Guided Tour of the Browser
In effect, every symbol in your code—routine name, class name,
data member name, constant, enumeration, template, macro, type
definition, and so forth—becomes a hypertext link to other locations
in your source code.
For example, if you select class name and use the browser
contextual menu, you can open the class declaration, a Browser
Window, or a Single-Class Hierarchy Window. If you use the
contextual menu for a routine name, you get different choices, as
shown in Figure 7.4.
Figure 7.4 A browser contextual menu for a routine
You can even insert a routine template at the location if you wish.
See “Text Colors” on page 282 for more information.
Other menus for other kinds of symbols have similar commands.
TIP To find and enter a browser item for a piece of text you have
selected or just entered, invoke the browser contextual menu for
that text. The menu offers a list of matching items. Choose one of
these items to enter it for you. See “Completing Symbols” on page
246 for other ways to type browser items.
TIP The contextual menu features work not only in browser windows,
but also in the CodeWarrior source code editor! This is a great
IDE–212 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
reason for always having the browser enabled, even if you do not
use the browser windows.
Of particular note in the contextual menu for routine names is the
Find all implementations of command. When you choose this
command for a routine that has multiple definitions, a Symbol
Window opens in the browser.
Contents Window
The Contents window displays browser data sorted by category
into alphabetical lists. Choose View > Browser Contents (Windows
menu bar layout) or Window > Browser Contents (Macintosh
menu bar layout) to display the Contents window, shown in Figure
7.5.
Figure 7.5 A Contents window
The items in this window are:
• Category pop-up menu
• Symbols pane
IDE User Guide IDE–213
Browsing Source Code
Guided Tour of the Browser
Category pop-up menu
The Category pop-up menu select the type of information displayed
in the Symbols pane. The currently selected item is highlighted
(Windows) or checked (Mac OS, Solaris, and Linux).
Symbols pane
The Symbols pane displays every item in the browser database that
is a member of the currently selected category. The items are listed
alphabetically.
NOTE Routines are listed alphabetically by routine name, but the class
name is displayed first. As a result, it may seem that the routines are
not listed alphabetically.
Browser Window
The Browser window (Figure 7.2 on page 209) gives you a class-
based view of the information in the browser database. The window
has several panes displaying lists of information.
You can open Browser window using several techniques:
• Choose Class Browser from the Window Menu.
• Use the Browser Contextual Menu in the Contents View when
classes or functions are displayed.
• Double-click a class name in a Multi-Class Hierarchy Window
• Double-click a class name in a Single-Class Hierarchy Window
TIP The Browser window has a toolbar. To learn how to use and
customize the toolbar, see “Customizing the IDE” on page 306.
When browsing rapid application development (RAD) projects, the
Browser window has a tab control. To learn how to use the tab
control, refer to “RAD Browsing” on page 595.
The Classes pane, Member Functions pane, and Data Members pane
are lists of their respective data. Clicking within a particular pane
IDE–214 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
makes it the active pane. You can also use the Tab key to rotate
through all the panes (except for the Source pane).
TIP Using the Tab key can be mildly hazardous to your source code. If
the Source pane is active and you press the Tab key, you enter a
tab into your source code. Once you are in the Source pane, you
cannot press the Tab key to get out of it.
Windows Use the mouse to select a different pane.
Mac OS, Solaris, and Linux Use the mouse or press Option-
Tab to move to a different pane. A focus outline surrounds the
active pane.
You can click an item in any list to select it, or navigate through the
items in the active list by typing or using the arrow keys. You can
also select items by typing their names. The selection changes to
most closely match the characters you type.
Mac OS, Solaris, and Linux Use the Control-Tab key
combination to cycle through list items alphabetically.
The items in this window include:
• Browser toolbar
• Browser Access Filters pop-up menu
• Pane zoom box
• Resize bar
• Classes pane
• List button
• Classes Pane button
• Class Declaration button
• Member Functions pane
• Data Members pane
• Identifier icon
• Source pane
• Open File icon
• VCS pop-up menu
IDE User Guide IDE–215
Browsing Source Code
Guided Tour of the Browser
• Status area
Browser toolbar
The toolbar provides easy single-click access to many CodeWarrior
commands. The buttons that are displayed in the Browser window’s
toolbar are listed in Table 7.2.
Table 7.2 Browser toolbar buttons
Button Description
Go Back
Go Forward
Show Browser Contents window
Show Multi-Class Hierarchy window
Show Single-Class Hierarchy window
Browser Access Filters pop-up menu
The Browser Access Filters pop-up menu controls the display of
member functions and data members in the Browser view. The pop-
up menu’s commands “filter” the display according to public,
private, and protected access types. A mark is displayed next to
each enabled filter. The available choices in the pop-up menu are
described in Table 7.3.
The first three choices represent shortcuts to multiple filters. For
example, instead of using the Browser Access Filters pop-up menu
three times in succession to enable public, private, and protected
filters, choose View as implementor to enable all three filters
simultaneously.
After you enable a particular filter, the access icons change in the
bottom-right corner of the Browser window. Darkened icons, as
IDE–216 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
shown in Table 7.3, indicate enabled filters. Grayed-out icons
represent disabled filters.
Table 7.3 Browser Access Filters pop-up menu commands
Command Access Show items with…
Icon
View as implementor public, private, and
protected access
View as subclass public and protected access
View as user public access
Show public public access
Show protected protected access
Show private private access
Pane zoom box
The pane zoom box enlarges and shrinks panes in the browser.
Click this box to enlarge a pane to fill the Browser window.
Click this box to shrink a pane to its original size.
Resize bar
A resize bar is located between each pair of panes, as illustrated in
Figure 7.2 on page 209. To resize two panes, drag the resize bar
located between them.
TIP When a source file is displayed in the Source pane, pressing
Control/Command-` opens the associated interface file. If the file in
the Source pane is an interface file, you open the related source
code file, and vice versa.
IDE User Guide IDE–217
Browsing Source Code
Guided Tour of the Browser
Classes pane
The Classes pane lists all the classes in the browser database.
You can view the list alphabetically or by class hierarchy. Toggle the
view by clicking the List button at the top right of the pane, as
shown in Figure 7.2 on page 209.
In the Hierarchy view, hierarchy expansion triangles are displayed
next to class names that have subclasses, as shown in Figure 7.3 on
page 210. Click the expansion triangle to show or hide subclasses.
TIP In the Classes pane, Alt/Option click a hierarchical control to open
all subclasses at all levels. This is a “deep” disclosure. Ctrl/
Command click to open a single level of subclass in a class and all
of its siblings at the same level. This is a “wide” disclosure. Ctrl/
Command-Alt/Option-click to open both wide and deep.
When you select a class in the Classes pane, the Multi-Class
Hierarchy Window selection changes too. The Hierarchy view
scrolls to the newly selected class if necessary.
NOTE The Classes pane does not display information about classes or
structures that do not have any member functions, base classes, or
subclasses. Thus, structures and classes that just have fields and
data members are not displayed.
List button
The List button at the top right of the Classes pane controls the
listing of classes. You can toggle between an alphabetical list or a
hierarchical list.
Click this button to switch to an alphabetical list.
Click this button to switch to a hierarchical list.
IDE–218 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
Figure 7.6 The Browser window with the Classes pane hidden
Classes Pane button
The Classes Pane button at the bottom left of the Browser window
controls the display of the Classes pane.
Click this button to hide the Classes pane (Figure 7.6).
Click this button to display the Classes pane (Figure 7.2).
Class Declaration button
The Class Declaration button at the bottom left of the Browser
window lets you access the declaration of the current class.
Click this button to show the declaration of the current class
in the Source pane. The Status area of the Browser window
shows the name of the current class.
IDE User Guide IDE–219
Browsing Source Code
Guided Tour of the Browser
Member Functions pane
The Member Functions pane lists all member functions defined in
the selected class. Constructors and destructors are at the top of the
list. After that, all other entries are listed in alphabetical order.
You can also display inherited member functions by enabling the
Show Inherited checkbox in the toolbar. The Inherited access icon
in the Browser window ( ) darkens to indicate that inherited
member functions are currently displayed.
TIP If you select a member function in the Member Functions pane in
the Browser Window, you can use the Enter/Return key to open an
editor window and view the definition of the selected function.
Data Members pane
The Data Members pane lists all data members defined in the
selected class. You can also display inherited data members by
enabling the Show Inherited checkbox in the toolbar. The Inherited
access icon in the Browser window ( ) darkens to indicate that
inherited data members are currently displayed.
The entries in the Data Members pane are listed in alphabetical
order. If inherited members are displayed, data members are listed
by superclass, but alphabetically within each class.
TIP If you select a data member in the Data Members pane in the
Browser Window, you can use the Enter/Return key to open an
editor window and view the declaration of the selected data
member.
Identifier icon
A routine or data member can have an identifier icon beside its
name. The following table describes the icons.
IDE–220 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
Table 7.4 Browser identifier icons
Icon Meaning The member is…
static a static member
virtual a virtual function that you can override,
or an override of an inherited function
pure virtual a member function that you must
or abstract override in a subclass if you want to
create instances of that subclass
Source pane
The Source pane displays the source code for the selected item. If
the item is a class, the pane shows the class declaration. If the item is
a routine, the pane shows the routine definition. If the selected item
is a data member, the pane shows the data member declaration
from the interface file.
NOTE If you Alt/Option click an item in the Member Functions pane or the
Data Members pane, that item is entered into the Source pane text
at the current insertion point. This is an efficient way to enter routine
calls or variable names into the Source pane.
The text in the Source pane is fully editable. The path to the file that
contains the code on display is shown at the top of the Source pane.
Open File icon
The Open File icon is located at the top of the Source pane.
Click this icon to open the file that contains the code
displayed in the Source pane. The source code is displayed in
a new editor window.
VCS pop-up menu
This pop-up menu lets you use revision control with the
source file you are viewing. To learn more about how to use
this feature, refer to the discussion in “Common VCS
Operations” on page 629.
IDE User Guide IDE–221
Browsing Source Code
Guided Tour of the Browser
Status area
The status area displays various status messages and other
information. For example, when you select a class from the Classes
pane, the status area displays the base class(es) for the selected class.
Multi-Class Hierarchy Window
The Multi-Class Hierarchy window displays a complete graphical
map of the classes in the browser database. Each class name is
displayed in a box, and related classes are connected to each other
by lines. Choose Class Hierarchy from the Window Menu to
display the Multi-Class Hierarchy window. Figure 7.7 shows the
Multi-Class Hierarchy window.
Use the arrow keys to change the selected class “geographically.”
The up and down keys work on siblings. The left and right keys
work on ancestors and descendants.
You can use the keyboard to change the selection. The current
selection most closely matches the characters you type. Use the Tab
key to change the selected class alphabetically.
TIP If you select a class in the Classes pane in the Browser Window, the
selection in the Multi-Class Hierarchy Window changes too.
If you double-click a class entry, or select the entry and press the
Enter/Return key, you open a Browser Window for that class.
In addition to the entry for each class, the Multi-Class Hierarchy
window has three items:
• Line button
• Hierarchy expansion triangle
• Ancestor Class pop-up menu
Line button
The Line button controls the display of the lines that connect related
classes. You can toggle between diagonal lines and straight lines.
The choice is entirely aesthetic.
IDE–222 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
Figure 7.7 The Multi-Class Hierarchy window
Hierarchy expansion triangle
The hierarchy expansion triangle controls the display of subclasses.
If you click this triangle, the next level of subclasses is displayed or
hidden from view. To be more precise, the expanded state restores
to what it was the last time this class was open.
NOTE Alt/Option click a disclosure triangle to open all subclasses at all
levels. This is a “deep” disclosure. Ctrl/Command click to display
subclasses for a class and all of its siblings. This is a “wide”
disclosure. Ctrl-Alt-click (Windows) or Command-Option-click
IDE User Guide IDE–223
Browsing Source Code
Guided Tour of the Browser
(Mac OS, Solaris, and Linux) to open both wide and deep. You can
use Ctrl/Command-Alt/Option-click to expand or collapse an entire
map if you click the expansion triangle for a base class that has no
ancestors.
Ancestor Class pop-up menu
Click on the Ancestor Class triangle, shown in Figure 7.7, to display
a pop-up menu. This menu lists immediate ancestors. When you
choose an item from the pop-up menu, you jump to that class in the
map. If the item is not currently visible, the computer beeps.
This control is displayed only for classes that have multiple base
classes.
Single-Class Hierarchy Window
The Single-Class Hierarchy window displays a complete graphical
map for a single class in the browser database. The map displays all
immediate ancestors of the class, and all of its descendants. (The
Multi-Class Hierarchy Window only shows one base class.)
Figure 7.8 shows the Single-Class Hierarchy window, displaying
multiple base classes and subclasses. The underlined class name is
the focus of the window.
You can open a single class hierarchy view using several techniques:
• Use the Browser Contextual Menu in the Contents Window
• Use the Browser Contextual Menu in the Multi-Class Hierarchy
Window
• Use the Browser Contextual Menu in the Browser Window
• Use the Show Multi-Class Hierarchy window button in the
Browser toolbar
IDE–224 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
Figure 7.8 The Single-Class Hierarchy window
The Single-Class Hierarchy Window is identical to the Multi-Class
Hierarchy Window, except that it displays a limited map. For
information about how this window behaves, see “Multi-Class
Hierarchy Window” on page 222.
Symbol Window
The Symbol window lists all implementations of any symbol that
has multiple definitions. Most commonly, these symbols are
multiple versions of overridden functions in object-oriented code.
However, the Symbol window works for any symbol that has
multiple definitions in the browser database.
IDE User Guide IDE–225
Browsing Source Code
Guided Tour of the Browser
Figure 7.9 The Symbol window
After selecting an implementation in the Symbol window list, you
see its definition in the Source pane. Figure 7.9 shows the Symbol
window.
You open a Symbol window by right-clicking (Windows) or clicking
and holding (Mac OS, Solaris, and Linux) on a symbol name in any
browser or editor window for which there is information in the
browser database. When you do, a Browser Contextual Menu is
displayed. If the item has multiple implementations, choose Find all
implementations of. When you choose that item, the Symbol
window displays.
TIP In a Source pane or editor window, Alt/Option-double-click or Ctrl/
Command-double-click a function or other symbol name to find all
IDE–226 IDE User Guide
Browsing Source Code
Guided Tour of the Browser
implementations and open the Symbol window without using the
contextual menu.
Most of the items in this window are identical to the Browser
Window. For a discussion of the window in general, see “Browser
Window” on page 214. That topic includes discussion of these
items, also found in the Symbol window:
• Browser toolbar
• Resize bar
• Source pane
• Open File icon
• VCS pop-up menu
The Symbol window also has two unique items: the Symbols pane
and the Orientation button.
The Symbols pane has the focus outline in Figure 7.9 on page 226.
This pane lists all versions of a symbol in the database. When you
select an item in the Symbols pane, that item’s definition appears in
the Source pane.
The Orientation button toggles the position of the Symbols pane
and the Source pane. The position toggles between Figure 7.9 and
Figure 7.10.
IDE User Guide IDE–227
Browsing Source Code
Guided Tour of the Browser
Figure 7.10 The Symbol window in vertical orientation
Browser Menu
When a Contents View, Browser View, or Hierarchy View is visible,
the Browser menu appears in the IDE’s menu bar. You use the
commands in this menu to create new items. The IDE opens a
wizard based on the command you select. The wizard presents
various options to help you create a new class, member function, or
data member.
The following list describes the commands in the Browser menu:
• New Class—opens the New Class Wizard to help you create a
new class. The wizard lets you specify the name, location, file
type, and modifiers for the new class.
IDE–228 IDE User Guide
Browsing Source Code
Browser Wizards
• New Member Function—opens the New Member Function
Wizard to help you create a new member function for a selected
class. The wizard lets you specify the name, return type,
parameters, modifiers, and other optional information for the
new member function.
• New Data Member—opens a the New Data Member Wizard to
help you create a new data member for a selected class. The
wizard lets you specify the name, type, initializer, modifiers, and
other optional information for the new data member.
Browser Wizards
When creating a new class, member function, or data member, you
select a Browser wizard. The wizard helps you complete the item-
creation process. This section describes the following wizards:
• New Class Wizard
• New Member Function Wizard
• New Data Member Wizard
For beginners Each wizard assumes you have a basic understanding of the
associated programming language. If the items in the wizard are
unfamiliar to you, consult additional programming language
references for more information.
The Browser wizards include the following navigation buttons:
• Back—return to the previous step
• Next—proceed to the subsequent step
• Finish—display a summary of current information
• Cancel—discard all changes
Each wizard is divided into a series of steps. You progress through
these steps in sequence, and each step builds on the information
provided in previous steps. When you supply enough information
in a particular step, click Next to continue.
You can modify the default settings in each step. To accept all
current settings in the wizard, click Finish. The wizard displays a
summary of all the current settings for the new project. Click
IDE User Guide IDE–229
Browsing Source Code
Browser Wizards
Generate to accept the current settings and create the new RAD
item, or click Cancel to return to the wizard and continue
modifying settings.
New Class Wizard
The New Class wizard is divided into the following steps:
1. Describe the name and location for the new class.
2. Specify base classes and methods for the new class.
3. List #include files for the new class.
4. Assign the new class to the project’s build targets.
To use the New Class wizard, follow these steps:
1. Describe the name and location for the new class.
This section of the wizard, shown in Figure 7.11, lets you specify the
name, declaration, and location for the new class. Other options are
available to further describe the class.
This section includes the following parts:
• Class Name
• Declaration File
• Namespace
• Use separate file for member definitions
Class Name
Enter a name for the class in this field.
Declaration File
This pop-up menu lets you specify the type of declaration file:
• New File—a declaration file
• Relative to class—a declaration file that depends on an existing
file in the project
IDE–230 IDE User Guide
Browsing Source Code
Browser Wizards
Figure 7.11 New Class wizard - Name and Location
Depending on the option you choose, different fields become
enabled below the Declaration File pop-up menu. The enabled
fields for the New File option are shown in Figure 7.11, and the
enabled fields for the Relative to class option are shown in Figure
7.12.
If you choose the New File option, type in the enabled field the path
to which you want to save the file. Alternatively, click Set next to
the field to save the file using a standard Save window.
If you choose the Relative to class option, the pop-up menu and the
class field beside it become enabled, as shown in Figure 7.12. In the
class field, type the name of the class you want to relate to the new
class. Alternatively, click Set next to the class field, select a class in
the window that opens, and then click Select. Next, use the pop-up
IDE User Guide IDE–231
Browsing Source Code
Browser Wizards
menu to place the new class Before or After the class in the class
field.
Namespace
In this field, type a namespace for the new class. Each name in the
namespace should be unique.
Use separate file for member definitions
Enable this checkbox if you want to use a separate file to define the
members of the new class. Type the path to the separate file in the
field below the checkbox. Alternatively, click Existing to select the
file using a standard dialog box. To create a new separate file, click
New and save the new file to a location on your hard disk.
Figure 7.12 Choosing the Relative to class option
IDE–232 IDE User Guide
Browsing Source Code
Browser Wizards
2. Specify base classes and methods for the new class.
This section of the wizard, shown in Figure 7.13, lets you define
base class, methods, and additional information for the new class.
This section includes the following parts:
• Base Classes
• Generate Constructor and Destructor
• Namespaces required for base classes and constructor
parameters (optional)
Base Classes
Enter in this field a list of base classes for the new class. Some
example base classes are provided.
Figure 7.13 New Class wizard - Base Class and Methods
IDE User Guide IDE–233
Browsing Source Code
Browser Wizards
Generate Constructor and Destructor
Enable this checkbox to generate a constructor and destructor for
the new class. After enabling this checkbox, the following options
become available:
• Access—Choose an access type for the new class from this pop-
up menu. Three access types are available: Public, Protected,
and Private.
• Constructor parameters—If desired, type a list of parameters for
the constructor in this field. Example parameters are listed above
the field.
• Virtual destructor—If you wish, enable this checkbox to create a
virtual destructor for the new class.
Namespaces required for base classes and constructor
parameters (optional)
If you wish, you can enter in this field required namespaces for the
base classes from the Base Classes field and the constructor
parameters in the Generate Constructor and Destructor part of the
wizard.
3. List #include files for the new class.
This section of the wizard, shown in Figure 7.14, lets you specify
additional header #include files for the new class.
This section includes the following parts:
• Include files that will automatically be added for base classes
• Additional header include files
Include files that will automatically be added for base classes
This field shows you a list of #include files that will be
automatically added to the base classes.
Additional header include files
Enter in this field a list of other #include files for the new class, in
addition to those listed in the previous field. Separate each file in the
list with a comma. Sample files are listed below the field.
IDE–234 IDE User Guide
Browsing Source Code
Browser Wizards
Figure 7.14 New Class wizard - Include Files
4. Assign the new class to the project’s build targets.
This section of the wizard, shown in Figure 7.15, lets you assign the
new class to particular build targets within the active project.
This section includes the following parts:
• Project
• Add files to targets
Project
This field shows you the path to the project whose build targets are
listed in the next field.
IDE User Guide IDE–235
Browsing Source Code
Browser Wizards
Figure 7.15 New Class wizard - Targets
Add files to targets
To assign the class to a specific build target, enable the checkbox
next to the build target’s name in this list. For example, in Figure
7.15, the new class is assigned to the generic build target.
New Member Function Wizard
The New Member Function wizard is divided into the following
steps:
1. Describe the declaration of the new member function.
2. Specify file locations for the new member function.
IDE–236 IDE User Guide
Browsing Source Code
Browser Wizards
Figure 7.16 New Member Function wizard - Member Function Declaration
To use the New Member Function wizard, follow these steps:
1. Describe the declaration of the new member function.
This section of the wizard, shown in Figure 7.16, lets you specify the
name, return type, and parameters for the new member function.
Other options are available to further describe the function.
This section includes the following parts:
• Name
• Return Type
• Namespaces required for parameters (optional)
• Namespaces required for parameters (optional)
IDE User Guide IDE–237
Browsing Source Code
Browser Wizards
• Modifiers
Name
Type a name for the member function in this field.
Return Type
Enter an appropriate function return type in this field.
Namespaces required for parameters (optional)
If you wish, type a list of function parameters in this field. Example
parameters are listed above the field.
Namespaces required for parameters (optional)
If desired, enter a list of namespaces required for the parameters in
the Namespaces required for parameters (optional) field. Sample
parameters are listed above the field.
Modifiers
Use the Access and Specifier pop-up menus to choose the access
level and method specifier for the new method. Possible access
levels include Public, Protected, and Private. Possible specifiers
include None, Virtual, Pure Virtual, and Static. You can enable the
Inline or Const checkboxes as desired to further describe the
function’s modifiers.
2. Specify file locations for the new member function.
This section of the wizard, shown in Figure 7.17, lets you specify file
locations associated with the new member function.
This section includes the following parts:
• Declaration
• Definition
• Include files automatically added for return type and
parameters
• Additional header include files
Declaration
This field shows you the location of the file to which the member
function’s declaration will be added.
IDE–238 IDE User Guide
Browsing Source Code
Browser Wizards
Figure 7.17 New Member Function wizard - File Locations
Definition
Enter in this field the path to file used for the member function’s
definition. Alternatively, click Existing to select the file using a
standard dialog box. To create a new file to use for the member
function’s definition, click New and save the new file to a location
on your hard disk.
Include files automatically added for return type and
parameters
This field shows you a list of #include files that will be
automatically added to the member function. These files are
automatically added based on the return type and parameters you
specified from the previous section.
IDE User Guide IDE–239
Browsing Source Code
Browser Wizards
Additional header include files
Enter in this field a list of other #include files for the new member
function, in addition to those listed in the previous field. Some
examples are provided above the field.
New Data Member Wizard
The New Data Member wizard is divided into the following steps:
1. Describe the declaration of the new data member.
2. Specify file locations for the new data member.
To use the New Data Member wizard, follow these steps:
1. Describe the declaration of the new data member.
This section of the wizard, shown in Figure 7.18, lets you specify the
name, type, and initializer for the new data member. Other options
are available to further describe the data member.
This section includes the following parts:
• Name
• Type
• Namespaces required for type (optional)
• Initializer
• Modifiers
Name
Type a name for the data member in this field.
Type
Enter an appropriate data-member type in this field.
Namespaces required for type (optional)
If desired, enter a list of namespaces required for the type in the
Type field. Sample parameters are listed above the field.
IDE–240 IDE User Guide
Browsing Source Code
Browser Wizards
Figure 7.18 New Data Member wizard - Data Member Declaration
Initializer
If you wish, type an initial value for the data member in this field.
Sample initializers are listed above this field.
Modifiers
Use the Access and Specifier pop-up menus to choose the access
level and member specifier for the new data member. Possible
access levels include Public, Protected, and Private. Possible
specifiers include None, Static, and Mutable. You can enable the
Const or Volatile checkboxes as desired to further describe the data
member’s modifiers.
IDE User Guide IDE–241
Browsing Source Code
Browser Wizards
Figure 7.19 New Data Member wizard - File Locations
2. Specify file locations for the new data member.
This section of the wizard, shown in Figure 7.19, lets you specify file
locations associated with the new member function.
This section includes the following parts:
• Declaration
• Definition
• Include file automatically added for member type
• Additional header include files
IDE–242 IDE User Guide
Browsing Source Code
Using the Browser
Declaration
This field shows you the location of the file to which the data
member’s declaration will be added.
Definition
This field is not available in this wizard.
Include file automatically added for member type
This field shows you the #include file that is automatically added
for the data-member type.
Additional header include files
Enter in this field a list of other #include files for the new data
member, in addition to the file listed in the previous field. Some
examples are provided above the field.
Using the Browser
The browser provides multiple paths through the data related to
your code. This section can give you a feel for how to work with the
browser, and outline some techniques you can use to accomplish
common tasks.
Topics in this section include:
• Setting Browser Options
• Identifying Symbols in the Browser Database
• Navigating Code in the Browser
• Browsing Across Subprojects
• Completing Symbols
• Opening a Source File
• Seeing a Declaration
• Seeing a Routine Definition
• Editing Code in the Browser
• Analyzing Inheritance
• Finding Functions That Are Overrides
IDE User Guide IDE–243
Browsing Source Code
Using the Browser
• Viewing MFC and PowerPlant Classes
• Saving a Default Browser
Setting Browser Options
Browser-related menu items and browser-specific options become
available when you activate the browser. See “Activating the
Browser” on page 205 for information on how to enable the
browser.
When the browser is enabled for your project, browser-related
menu commands are enabled. These items include the Browser
Contents, Class Hierarchy, and Class Browser commands in the
Window Menu.
TIP A quick way to tell whether the browser is enabled is to look in the
Window Menu at these browser-related menu commands. If they
are enabled, the browser is active.
In addition, there are global IDE options that relate to the browser.
You control how various items are colored in browser windows,
and the time delay before the Browser Contextual Menu is
displayed (Mac OS, Solaris, and Linux).
To tell the IDE to include items from a project’s subprojects in its
browser windows, see “Cache Subprojects” on page 347.
To learn how to modify these settings, see “Text Colors” on page
282 or “Context popup delay (Mac OS, Solaris, and Linux)” on page
260.
Identifying Symbols in the Browser Database
There is an easy way to know whether or not a symbol is in the
browser database without checking to see if a Browser Contextual
Menu displays: use browser coloring. If the browser is activated,
symbols that are in the browser database are displayed in editor and
browser windows according to the colors you select. See “Text
Colors” on page 282 for more information.
IDE–244 IDE User Guide
Browsing Source Code
Using the Browser
TIP The factory default color setting is identical for all of the eight types
of browser-database symbols. You can choose a different color for
each symbol type if you like. However, if syntax coloring is also
enabled for your code, you may find it easier to identify symbols in
the browser database using only one or two colors.
Navigating Code in the Browser
There are many ways to move around in code with the browser.
Using the Contextual Menu
Perhaps most powerful and flexible way to navigate code is to use
the Browser Contextual Menu. You see this menu when you right-
click (Windows) or click and hold (Mac OS, Solaris, and Linux) on
any symbol for which there is data in the browser database. This
includes class names, routine names, global variables, class data
members, and much more. To learn more, refer to “Browser
Contextual Menu” on page 211.
In the Browser Window, simply selecting a class, routine, or data
member displays the associated code in the window’s Source pane.
Go Back and Go Forward
The browser fully supports the Go Back and Go Forward
commands in the Search Menu. Regardless of the views, windows,
or code you have looked at, you can always go back to what you
were viewing earlier.
These commands allow you to go backward or forward through a
series of changes you made. For example, suppose you use the
browser to look at your project and make changes to a file. Then,
you switch files and make more changes. You may do this many
times. You can use the Go Back command to go back one or more
actions you have performed. Even if you did not make any changes
to the file, but looked at it (or a specific class or method), you can go
back to that action. Similarly, once you have gone back, you can use
the Go Forward command to return to where you started.
When you add the Go Back and Go Forward commands to a
CodeWarrior toolbar, you can use their associated pop-up menus,
IDE User Guide IDE–245
Browsing Source Code
Using the Browser
as shown in Figure 7.20. Click and hold on the Go Back or Go
Forward toolbar icons to display the pop-up menu.
Figure 7.20 Go Back and Go Forward toolbar buttons
Windows Choose an action from the menu to go to that action. If
you choose an action out of sequence, CodeWarrior will go to that
action without going through any previous action.
Mac OS The underlined item is your current position in the
queue. Choose an action from the menu to go to that action. If you
choose an action out of sequence, CodeWarrior will go to that action
without going through any previous action. The CodeWarrior IDE
can track up to 100 actions.
NOTE Go Back and Go Forward do not undo any actions you performed.
They allow for a more flexible method of moving around to specific
places you have been in the Browser window.
Browsing Across Subprojects
The IDE normally only displays browser items for the current build
target. To include browser information from the subprojects of the
current build target, enable subproject caching. For more
information, see “Cache Subprojects” on page 347.
Completing Symbols
The IDE has commands to complete your typing for you when you
enter the name of an item for which the browser has information.
Use the Find symbols with prefix, Find symbols with substring,
IDE–246 IDE User Guide
Browsing Source Code
Using the Browser
Get next symbol, and Get previous symbol keyboard commands to
find and choose browser items that match the text you have selected
or just entered in a source code file. These commands are only
available from the keyboard. They are not available in the IDE’s
menus. See “Customizing Key Bindings” on page 314 for
information about viewing the key bindings for these commands.
To enter the name of a browser item that has the same characters as
the text you have selected or just typed, use the Find symbols with
substring keyboard command. To enter the name of a browser item
that only has the same first characters, use the Find symbols with
prefix keyboard command.
After using the Find symbols with substring and Find symbols
with prefix commands, use the Get next symbol and Get previous
symbol commands to search among the browser symbols that
match the text you have selected or just entered.
After you find the browser item you want to enter, press the right
arrow key to place the insertion point next to the item and continue
typing.
Another way to find and enter a browser item is to select the first
few characters of some text and then right-click (Windows) or click
and hold (Mac OS, Solaris, and Linux) on the selection. The Browser
contextual menu displays a list of matching items, as shown in
Figure 7.21. Choose one of these items to automatically replace the
selected text. See “Browser Contextual Menu” on page 211 for more
information.
Figure 7.21 Automatically replacing selected text
IDE User Guide IDE–247
Browsing Source Code
Using the Browser
Opening a Source File
There are some quick methods you can use to open a source file.
In the Browser Window, click the Open File icon when portions of
the file you wish to see are displayed in the window’s Source pane.
See “Open File icon” on page 221 for more information.
To select a file, click on a symbol used in that file. Then use the
Browser Contextual Menu to open the desired file or see a particular
routine.
If you are looking at a source file, and want to see the interface file,
or vice versa, simply type Ctrl/Command ` to see the related file.
Seeing a Declaration
There are several methods used to view a declaration. The methods
vary depending on the kind of symbol you investigate.
If you select a class name or data member name in a Browser
Window, and the declaration is shown in the Source pane, double-
click the name to open the file that contains the declaration. (If you
select or double-click a routine name, you see the definition).
If you click the Class Declaration button in the Browser window,
you see a class declaration in the Source pane.
When you right-click (Windows) or click and hold (Mac OS, Solaris,
and Linux) on a name in any window, use the Browser Contextual
Menu to open the declaration. This technique lets you see a routine
declaration.
Seeing a Routine Definition
There are several methods you can use to see a routine definition:
• In the Browser Window, select the routine in the Member
Functions pane. The definition is displayed in the Source pane.
To open the file that contains the definition, double-click the
routine name in the Member Functions pane.
• Right-click (Windows) or click and hold (Mac OS, Solaris, and
Linux) on the routine name in any editor or browser window.
IDE–248 IDE User Guide
Browsing Source Code
Using the Browser
Then use the Browser Contextual Menu to jump to the particular
routine definition.
• Choose the Go Back command from the Search Menu.
• Press Alt/Option or Ctrl/Option, then double-click a function
name in any source view. The Symbol Window displays for
functions with multiple definitions to show all implementations
of that function.
• In the Multi-Class Hierarchy Window or the Single-Class
Hierarchy Window, right-click (Windows) or click and hold
(Mac OS, Solaris, and Linux) on a class name. Then use the
Browser Contextual Menu to jump to the particular routine
definition.
Editing Code in the Browser
Any code visible in a Source pane is fully editable. Locate the
definition with which you wish to work. When the code is
displayed in the Source pane, use the same techniques you learned
in the editor window to edit your code.
For more information about the CodeWarrior editor, see “Editing
Source Code” on page 137.
Analyzing Inheritance
Use the Multi-Class Hierarchy Window or the Single-Class
Hierarchy Window to analyze inheritance in your source code.
Look for the small triangle to the left of a class name, as shown in
Figure 7.7. This triangle indicates that the class has multiple
ancestors. Use the associated Ancestor Class pop-up menu to jump
to any ancestor class to study its descendants (or ancestors). Use the
Hierarchy expansion triangle to expose or conceal subclasses.
For more information, see “Multi-Class Hierarchy Window” on
page 222.
Finding Functions That Are Overrides
Use the Browser Window to find functions that are overrides. To
find these overrides, disable the Show Inherited checkbox in the
Browser Window toolbar. Disabling the checkbox disables the
IDE User Guide IDE–249
Browsing Source Code
Using the Browser
display of unchanged inherited functions. However, it does not
disable functions you have overridden.
Next, look for functions that are marked as virtual with an Identifier
icon. Most of these functions are likely to be overrides of inherited
functions, although some could be functions you declared in the
class that were not inherited from an ancestor.
To open a Symbol Window for any routine with multiple
definitions, right-click (Windows) or click and hold (Mac OS,
Solaris, and Linux) on a routine name, and then choose Find all
implementations of. Combined with a Hierarchy view, you see
precisely who overrides the routine, and where the routines are
found in the class hierarchy.
Viewing MFC and PowerPlant Classes
The browser lets you view framework classes, such as the Microsoft
Foundation Classes (MFC) for Windows and the PowerPlant classes
for the Mac OS. If you want the browser to display these framework
classes, you must include framework headers in such a way that the
compiler sees them.
You should use precompiled headers to speed compilation time.
However, if you simply use the precompiled headers directly, the
compiler does not see the framework classes and does not generate
information for the symbol database.
To resolve this problem, include a renamed copy of the source file
that creates the precompiled headers in your project. These source
files are named with extensions that identify precompiled headers,
like .pch or .pch++. Alternatively, include as a subproject the
project that creates the precompiled headers.
Including these files creates a project-specific precompiled header.
CodeWarrior builds this precompiled header from within your
project, exposing framework symbols to the compiler, which
generates information for the browser database.
The reason you want to include a renamed copy is to avoid
problems associated with multiple projects that use the same
precompiled headers. When one project updates the headers, it will
be marked as changed for all other projects, which then rebuild the
IDE–250 IDE User Guide
Browsing Source Code
Using the Browser
precompiled headers. This rebuilding step defeats the purpose of
the precompiled headers.
Saving a Default Browser
Browser windows have various settings that you can modify. You
can preserve these modifications as your default settings.
First, set up a browser window to your liking. For example, set the
size of each pane in the Browser window, and the size and location
of the window itself. Then choose Window > Save Default
Window. The IDE applies the saved window attributes to
subsequently opened browser windows.
You can do the same thing for any of the browser windows.
However, you must save each window’s setup individually, while
that window is active.
To learn about saving editor windows, see “Saving Editor Window
Settings” on page 148..
IDE User Guide IDE–251
Browsing Source Code
Using the Browser
IDE–252 IDE User Guide
8
Configuring IDE Options
This chapter discusses the options available in the CodeWarrior®
IDE Preferences window. In addition, this chapter discusses key
bindings, window toolbars, and their configuration in the
Commands & Key Bindings window.
You can customize the CodeWarrior IDE to your working style by
configuring the preferences in the IDE Preferences window. These
global preference settings affect the way the IDE behaves for all
projects.
The IDE’s toolbars constitute another customizable feature. You can
configure the toolbars to fit your working style and improve your
productivity.
This chapter includes the following topics:
• Preferences Guided Tour
• Choosing Preferences
• Customizing the IDE
Preferences Guided Tour
To open the IDE Preferences window, choose Edit > Preferences.
The window organizes preferences into a group of panels, where
each panel contains settings for related features. For example, one
panel controls the font and tab settings in the CodeWarrior editor.
This section covers the following topics:
• Preference Panels
• Window Buttons
IDE User Guide IDE–253
Configuring IDE Options
Preferences Guided Tour
Preference Panels
The IDE Preferences window contains two parts. The left side of the
window shows a hierarchical list of available panels. The right side
of the window displays preferences for a selected panel. The
available panels vary, depending on the CodeWarrior product that
you use.
The preference panels affect the IDE as a whole and apply to all
projects. To display a particular panel, select its name in the list. You
can use the arrow keys or click the name of the panel. Figure 8.1
shows a selected panel in the IDE Preferences window.
Each panel contains related options that you can modify. After
changing these options, you can save them, discard them, restore
them, or reset them. See “Window Buttons” for more information.
Figure 8.1 Selecting a Preference Panel
Window Buttons
Several buttons in the IDE Preferences window control how the IDE
applies your settings.
This section discusses the following topics:
• Discarding changes
• Factory Settings button
• Revert Panel button
• Save button
• Export Panel and Import Panel buttons
IDE–254 IDE User Guide
Configuring IDE Options
Preferences Guided Tour
• OK, Cancel, and Apply buttons (Windows)
Discarding changes
If you change the settings in the IDE Preferences window and then
try to close the window, the dialog box shown in Figure 8.2 appears.
To discard your changes, click Don’t Save. To keep your changes,
click Save. To discard your changes and return to the IDE
Preferences window, click Cancel.
Figure 8.2 Preferences Confirmation Dialog Box
Factory Settings button
Click Factory Settings to revert the current preference panel to its
default settings. Clicking this button does not affect the settings in
other preference panels.
WARNING! The IDE resets all settings within the preference panel to their
default values after you click the Factory Settings button. If you do
not export the preference panel before restoring its default settings,
you will lose your preferences in that panel. See “Export Panel and
Import Panel buttons” on page 256 for more information.
Revert Panel button
Click Revert Panel to undo the changes you made to the current
preference panel. Clicking this button resets the preference panel to
its last saved state.
IDE User Guide IDE–255
Configuring IDE Options
Choosing Preferences
Save button
Click Save to commit the current settings in all of the preference
panels. After closing the IDE Preferences window, the CodeWarrior
IDE behaves according to the preferences that you saved.
Export Panel and Import Panel buttons
Click Export Panel to save the settings in the current preference
panel to an Extensible Markup Language (XML) file. Click Import
Panel to open an existing XML file and apply its settings to the
current preference panel.
OK, Cancel, and Apply buttons (Windows)
Click OK to commit the current settings in all of the preference
panels and close the IDE Preferences window. Click Cancel to
discard your changes and close the window. Click Apply to commit
the current settings in all of the preference panels without closing
the window. After you click the Apply button, the Cancel button
becomes the Close button. Click Close to dismiss the IDE
Preferences window.
Choosing Preferences
This section discusses how to set preferences for the IDE. These
preferences affect the debugger, editor, rapid application
development (RAD) tools, and general IDE behavior.
See “Preferences Guided Tour” on page 253 for instructions on
viewing a particular preference panel.
This section describes the preference panels in the IDE Preferences
window. The following groups organize the panels:
• General Preferences
• Editor Preferences
• Debugger Preferences
• RAD Tools Preferences
IDE–256 IDE User Guide
Configuring IDE Options
Choosing Preferences
General Preferences
This section describes the preference panels that control general IDE
features:
• Build Settings
• IDE Extras
• Plugin Settings
• Shielded Folders
• Source Trees
Build Settings
The Build Settings preference panel, shown in Figure 8.3 on page
258, allows you to customize project builds.
Build before running
Use this pop-up menu to determine how the CodeWarrior IDE
handles project builds. You can choose to Always build projects
before running them, Never build projects before running them, or
let the CodeWarrior IDE Ask you how to proceed.
Save open files before build
Enable this checkbox to automatically save all open files before
executing the following commands: Preprocess, Precompile,
Compile, Disassemble, Bring Up To Date, Make, and Run.
Show message after building up-to-date project
Enable this checkbox to display a message after building an up-to-
date project. The Message window displays the message. For more
information about this window, see “Guided Tour of the Message
Window” on page 395. For more information about up-to-date
projects, see “Updating a Project” on page 380.
Use Local Project Data Storage
After loading a project file, the IDE creates or updates an associated
project data folder. The IDE stores intermediate project data in this
folder. After you build or close the project, the IDE uses the
information in the project data folder to update the project file.
IDE User Guide IDE–257
Configuring IDE Options
Choosing Preferences
By default, the IDE places the project data folder within the same
folder as the project file. However, the IDE cannot create or update a
project data folder in a location that grants read-only privileges.
To specify a different location for the project data folder, enable the
Use Local Project Data Storage checkbox, then click Choose to
select the path to the location you wish to use. For more information
about the types of paths available to you, see “Add” on page 271.
Figure 8.3 Build Settings Preference Panel
Play sound after ‘Bring Up To Date’ & ‘Make’ (Mac OS, Solaris,
and Linux)
Enable this checkbox to play a sound after finishing a build of your
project. You can choose different sounds for successful and
unsuccessful builds by using the Success and Failure pop-up
menus, respectively.
Compiler thread stack (Windows and Mac OS)
Use the Compiler thread stack field to specify the upper limit of
stack size allocated by the IDE for compiling and linking thread
support.
IDE–258 IDE User Guide
Configuring IDE Options
Choosing Preferences
All builds in CodeWarrior are threaded, with compiling and linking
occurring on a thread separate from the main application thread.
This setting lets you control the size of the stack allocated for the
compiler thread.
Normally, you should not change this setting. However, if you have
a large or very complex project, you can increase this setting to
avoid compiler crashes.
Include file cache (Mac OS)
This field, shown in Figure 8.3 on page 258, specifies the upper limit
on how much memory the IDE should use for caching #include
files and precompiled headers. If your computer has substantial
memory and you want to use that memory to accelerate builds,
increase the number in this field.
IDE Extras
The IDE Extras preference panel, shown in Figure 8.4 on page 260
(Windows) and Figure 8.5 on page 261 (Mac OS), includes options
for remembering previously opened projects and text files, as well
as configuring the IDE for use with third-party editors.
Mac OS, Solaris, and Linux The IDE Extras preference panel
also lets you configure miscellaneous options, such as window
zooming and the Scripts menu.
Menu bar layout
Use this pop-up menu to choose the default menu bar layout for the
CodeWarrior IDE. The name of the menu bar layout suggests the
host. For example, use the Windows menu bar layout to organize
IDE menus according to Microsoft® Windows® user-interface
standards. “CodeWarrior® IDE Menu Reference” on page 633
shows the organization of the menu commands under each menu
bar layout.
Recent projects
Enter in this field the maximum number of recent projects that you
want displayed in the Open Recent submenu of the File Menu.
IDE User Guide IDE–259
Configuring IDE Options
Choosing Preferences
Figure 8.4 IDE Extras Preference Panel (Windows)
Recent documents
Type in this field the maximum number of recent documents that
you want displayed in the Open Recent submenu of the File Menu.
Context popup delay (Mac OS, Solaris, and Linux)
Enter in this field the minimum length of time to hold down the
mouse button before the IDE’s contextual menus appear. You can
enter a value from 0 to 240 ticks. Each tick represents 1/60th of a
second (16.67 milliseconds). For general information about
contextual menus, see “Using the Contextual Menu” on page 245.
To learn how to configure the types of commands that appear in the
contextual menus, see “Contextual Menus” on page 278.
WARNING! If you enter 0 in the Context popup delay field, the IDE completely
disables the contextual menus. To restore the contextual menus,
enter a number greater than 0.
IDE–260 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.5 IDE Extras Preference Panel (Mac OS)
Zoom windows to full screen (Mac OS, Solaris, and Linux)
This checkbox configures the behavior of the zoom box in the upper
right-hand corner of all editor windows. If you enable this
checkbox, clicking the zoom box of an editor window resizes that
window to fill the entire screen. If you disable the checkbox, clicking
the zoom box of an editor window resizes that window to a
standard size.
Use Script menu (Mac OS, Solaris, and Linux)
Enable this checkbox to display the Scripts menu in the IDE’s menu
bar. For more information about scripting the IDE, refer to the
CodeWarrior Scripting Reference. For more information about
scripting the IDE with AppleScript, refer to Targeting Mac OS.
Use External Editor (Mac OS, Solaris, and Linux)
Enable this checkbox to use a third-party text editor to modify text
files. Disable the checkbox if you wish to use the CodeWarrior
editor.
IDE User Guide IDE–261
Configuring IDE Options
Choosing Preferences
NOTE The CodeWarrior IDE does not use the third-party editor for text
editing unless you add the text file you are working with to the active
Project window.
Mac OS Enabling the Use External Editor checkbox causes the
CodeWarrior IDE to send Open Document ('odoc') AppleEvents to
AppleScript-compatible third-party text editors. To use this feature,
create a (Helper Apps) folder (if it does not already exist) in the
CodeWarrior IDE application folder. Next, place an alias inside the
(Helper Apps) folder that points to your third-party editor
application. Then, change the name of the alias to External
Editor.
To learn how to add files to the Project window, see “Adding Files”
on page 75.
Use Third Party Editor (Windows)
Enable this checkbox to use a third-party text editor to modify text
files. Disable the checkbox if you wish to use the CodeWarrior
editor.
If you use a third-party text editor, you can enter command lines in
the following fields:
• Launch Editor—specifies the text editor that the IDE should use
to display text files
• Launch Editor w/ Line #—specifies a text editor and an initial
line of text to jump to upon launch
For example, after you double-click an error message, the IDE
invokes the Launch Editor w/ Line # command line to open a text
file and display the code that caused the error message.
You can use two variables in the command-line strings:
• The IDE expands the %file variable into the full file path.
• The IDE expands the %line variable into the initial line number
in the file.
For example, if you want to use the Emacs text editor to edit text
files, then you would enter the following command line in the
Launch Editor field:
IDE–262 IDE User Guide
Configuring IDE Options
Choosing Preferences
runemacs %file
If you also want the text editor to jump to a particular line in the text
file, you would type the following command line in the Launch
Editor w/ Line # field:
runemacs +%line %file
Consult the documentation provided with your third-party text
editor for more information about using command lines.
Use Multiple Document Interface (Windows)
This checkbox configures the interface style used by the IDE:
• MDI (Multiple Document Interface)—Under this interface style,
the IDE uses a main application window. Multiple IDE
document windows appear within the IDE’s main application
window. Enable the checkbox to use this interface style.
• FDI (Floating Document Interface)—Under this interface style,
the IDE does not use a main application window. Multiple IDE
document windows “float” above the desktop. Disable the
checkbox to use this interface style.
Use ToolServer menu (Mac OS)
This checkbox toggles the appearance of the ToolServer menu
(Figure 8.6) in the IDE’s menu bar. For more information about
ToolServer, refer to Targeting Mac OS.
Figure 8.6 ToolServer Menu
IDE User Guide IDE–263
Configuring IDE Options
Choosing Preferences
Enable automatic Toolbar help (Mac OS)
This checkbox toggles the appearance of Balloon Help for the
toolbar icons. With automatic toolbar help enabled, as you rest the
cursor over a toolbar icon, a help balloon appears and names the
command represented by that icon.
Use BBEdit™ Extensions (Mac OS)
This checkbox toggles the appearance of the BBEdit Extensions
menu (Figure 8.7) in the IDE’s menu bar. This menu allows you to
use the IDE to access BBEdit extensions. For more information
about BBEdit, refer to its documentation.
Figure 8.7 BBEdit Extensions Menu
Find Reference using (Mac OS)
Use this pop-up menu to select an online database application to
look up references and definitions. Although they are not included
in your CodeWarrior product, the IDE supports the following
formats:
• QuickHelp™-based documents
• Symantec THINK Reference database
• PalmQuest reference for the Palm™ connected organizer
• QuickView™-based documents, such as the Macintosh
Programmer’s Toolbox Assistant (MPTA)
To learn more about online reference databases and how to use
them, see “Online References” on page 162.
Plugin Settings
The Plugin Settings preference panel, shown in Figure 8.8 on page
265, contains options for troubleshooting third party IDE plug-ins.
IDE–264 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.8 Plugin Settings Preference Panel
Plugin Diagnostics
Use this pop-up menu to determine the amount of information
reported for the IDE plug-ins that you develop. This information is
useful for diagnosing plug-in behavior, or for viewing detailed
information about the properties of installed plug-ins.
Use the Level pop-up menu to report one of the following levels of
plug-in diagnostic information:
• None—This level is selected by default. The IDE does not
activate the plug-in diagnostics at this level. Consequently, the
IDE does not produce output at this level.
• Errors Only—Choose this level to report problems that the IDE
encounters when loading plug-ins. These problems appear in a
new text file after the IDE starts up
• All Info—Choose this level to report detailed information for
each installed plug-in. The IDE reports problems with plug-in
loading, optional plug-in information, and plug-in properties.
This information appears in a new text file after the IDE starts
up. The text file also includes a complete list of installed plug-ins
and their associated preference panels, compilers, and linkers.
NOTE You must restart the IDE for any changes to the diagnostic level to
take effect. After you change a plug-in diagnostic level and save that
change, a dialog box appears and reminds you to restart.
IDE User Guide IDE–265
Configuring IDE Options
Choosing Preferences
You can save the text file, print it, and use it as an error reference for
troubleshooting your plug-ins. The text file provides suggestions for
correcting general plug-in errors.
Disable third party COM plugins
Enable this checkbox to disable all third-party Common Object
Model (COM) plug-ins for the IDE. This option is useful for
troubleshooting problems with the IDE.
TIP If you experience problems when using the IDE, try enabling this
checkbox to disable third-party COM plug-ins. If the problem does
not occur after you disable the plug-ins, then the source of the
problem likely involves conflicts between third-party plug-ins and the
plug-ins supplied with the IDE.
Shielded Folders
The Shielded Folders preference panel, shown in Figure 8.9 on
page 267, allows you to configure the IDE to ignore folders during
certain operations. You specify regular expressions that match the
names of the folders that you wish to ignore. The IDE treats
matching folders as shielded folders and ignores their contents. For
more information about regular expressions, see “Using Regular
Expressions (grep)” on page 195.
The Shielded Folders list at the top of the panel shows the current
list of regular expressions. The IDE uses this list to determine
whether to shield folders from the current project. The following
regular expressions appear in the Shielded Folders list by default:
• The \(.*\) regular expression matches folders with names that
begin and end with parentheses, such as (Project
Stationery).
• The CVS regular expression matches folders named CVS. With
this regular expression, the IDE skips data files used by the CVS
version control system.
• The .*[_]Data regular expression matches the names of
folders used by the IDE to store target data information, such as
MyProject_Data.
IDE–266 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.9 Shielded Folders Preference Panel
The Shielded Folders list includes two columns. These columns
represent different types of operations for which you can shield
folders:
A bullet in the Project operations column, whose label
appears at left, indicates that the IDE ignores matching
folders for project operations. Such operations include
dragging a folder into the Project window, building a project,
or searching access paths after choosing the Open command.
A bullet in the Find-and-compare operations column, whose
label appears at left, indicates that the IDE ignores matching
folders for find-and-compare operations. Such operations
include dragging a folder into fields in the Find window, or
comparing folder contents.
IDE User Guide IDE–267
Configuring IDE Options
Choosing Preferences
TIP You can configure the project to include items within a shielded
folder. Use the Access Paths target settings panel to specify the
path to the shielded folder that you wish to include.
Add
To add a regular expression to the Shielded Folders list, follow these
steps:
1. Enter in the Regular Expression field the expression that specifies
the folders you wish to ignore.
You can enter the name of a specific folder, or you can enter a
regular expression that matches several folder names.
2. Choose whether to shield matching folders from project
operations, from find-and-compare operations, or from both.
Enable the Project operations checkbox, the Find and compare
operations checkbox, or both. During the operations that you
specify, the IDE ignores folders with names that match the regular
expression.
3. Click Add.
After you click the Add button, the regular expression appears in
the Shielded Folders list. Bullets in the list indicate the operations
for which the IDE ignores matching folders.
4. Click Save.
Change
To modify an existing regular expression, follow these steps:
1. Select the regular expression that you wish to modify.
2. Modify the regular expression.
If desired, enter a new regular expression in the Regular Expression
field.
3. Modify the operations for which to shield matching folders.
Enable the Project operations checkbox and the Find and compare
operations checkbox as desired.
IDE–268 IDE User Guide
Configuring IDE Options
Choosing Preferences
4. Click Change.
After you click the Change button, the modified regular expression
appears in the Shielded Folders list. Bullets in the list reflect the
changes that you made to the corresponding operations.
5. Click Save.
Remove
To delete an existing regular expression, follow these steps:
1. Select the regular expression that you wish to delete.
2. Click Remove.
After you click the Remove button, the IDE deletes the regular
expression from the Shielded Folders list.
3. Click Save.
Source Trees
The Source Trees preference panel, shown in Figure 8.10 on page
270, lets you define global source trees (root paths) for use in your
projects. You can define access paths and build-target output in
terms of source trees. Using this approach, you can share projects
across various hosts. You need only make minor changes to the
source-tree paths to maintain project functionality.
You can use the source trees that you define in the IDE Preferences
window for all projects. However, you can use the source trees
defined in the Target Settings window only for the current build
target in the active project. If you define the same source trees in
both windows, the target-specific source trees take precedence over
the global source trees. For more information about the target-
specific version of the Source Trees panel, see “Source Trees” on
page 355.
IDE User Guide IDE–269
Configuring IDE Options
Choosing Preferences
Figure 8.10 Source Trees Preference Panel
Source Trees list
This list shows all source trees defined for use with the IDE. The list
contains two columns:
• Name—This column shows the name that you assign to each
source tree. After you define a source tree, you can use the
source-tree name in subsequent access-path definitions. For
more information, see “Add” on page 343.
• Path—This column shows the path that you defined for each
source tree. After transferring your project to a new host, you
might need to modify the source-tree paths. Your modifications
automatically propagate to all access paths defined in terms of
the source trees. See “Change” on page 275 for more information
about modifying the current path.
IDE–270 IDE User Guide
Configuring IDE Options
Choosing Preferences
Name
Use this field to enter a name for a new source tree, or to change the
name of an existing source tree.
Type
Use this pop-up menu to choose one of the following types of
source trees:
• Absolute Path—This type of source tree is based on a file path.
• Environment Variable—This type of source tree is based on an
existing environment variable definition. You cannot create or
modify this type of source tree on the Mac OS-hosted IDE.
• Registry Key—(Windows) This type of source tree is based on
an existing registry key entry.
Add
To add a new source tree, follow these steps:
1. Select the appropriate source-tree type from the Type pop-up
menu.
See “Source-Tree path types” on page 272 for more information
about the path types listed in the pop-up menu.
2. Enter a name for the new source tree in the Name field.
3. Click Choose to select the path that you want the source tree to
represent.
Use the dialog box, shown in Figure 8.11 on page 272 (Windows),
Figure 8.12 on page 273 (Mac OS), and Figure 8.13 on page 274
(Solaris and Linux), to select the path.
4. Click Add to add the new source tree to the Source Trees list.
Repeat these steps until you finish adding source trees, then click
Save. You can then define access paths in terms of the source trees.
IDE User Guide IDE–271
Configuring IDE Options
Choosing Preferences
Figure 8.11 Source-Tree Path Selection Dialog Box (Windows)
Source-Tree path types
You can choose at least one of the following path types when
defining a source tree:
• Absolute Path—This path type defines a path from the root
level of the startup hard drive to the folder whose path you wish
to add, including all folders in between. You must update an
absolute path when the name of any item along the path
changes, such as after moving the project to a new location.
• Compiler Relative—This path type defines a path from the
folder that contains the CodeWarrior IDE to the folder whose
path you wish to add. You do not need to update compiler-
relative paths after you move a project, as long as the hierarchy
of the relative path stays the same. You cannot create a relative
path to a folder on a different hard drive than where the
CodeWarrior IDE resides.
IDE–272 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.12 Source-Tree Path Selection Dialog Box (Mac OS)
• System Relative—This path type defines a path from the base
folder of the operating system to the folder whose path you wish
to add. You do not need to update system-relative paths after
you move a project, as long as the hierarchy of the relative path
stays the same. You cannot create a relative path to a folder on a
different hard drive than where the base folder of the operating
system resides.
NOTE Relative paths allow projects to contain two or more files with
identical names. However, for large projects, you might notice
slower performance after adding relative paths to a project.
IDE User Guide IDE–273
Configuring IDE Options
Choosing Preferences
Figure 8.13 Source-Tree Path Selection Dialog Box (Solaris and Linux)
Choosing the Environment Variable or Registry Key source-tree
types enables the field shown in Figure 8.14 on page 275. Enter in
this field the path to the environment variable or registry key.
Saved source trees appear in path pop-up menus for your project.
For example, Figure 8.15 on page 276 shows how you can define an
access path in terms of a source tree named Sample. You can also
define the target output for your project in terms of the source trees
by using the Output Directory field in the Target Settings panel. For
more information about this settings panel, see “Target Settings” on
page 336.
IDE–274 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.14 Creating a Registry Key
Change
To modify an existing source tree, follow these steps:
1. Select the source-tree name in the Source Trees list.
2. Modify the name and type of the source tree as desired.
Enter a new name for the source tree in the Name field, and choose
a new source-tree type from the Type field.
3. Click Change.
Your modifications appear in the Source Trees list.
Repeat these steps until you finish modifying source trees, then
click Save. You can then define access paths in terms of the
modified source trees.
IDE User Guide IDE–275
Configuring IDE Options
Choosing Preferences
Figure 8.15 Choosing Source Trees in Access Path Pop-up Menus
NOTE After changing a source tree, modify the remainder of your project
so that you do not refer to the source tree in its original form. The
IDE cannot find files referenced by the original form of the source
tree and will not be able to use those files when compiling, linking, or
running your project. Therefore, the IDE displays a message
reminding you to update your project.
Remove
To remove an existing source tree, follow these steps:
1. Select the source-tree name in the Source Trees list.
2. Click Remove.
The IDE deletes the selected source tree from the Source Trees list.
IDE–276 IDE User Guide
Configuring IDE Options
Choosing Preferences
Repeat these steps until you finish deleting source trees, then click
Save to commit your changes.
NOTE After removing a source tree, modify the remainder of your project
so that you do not refer to the deleted source tree. The IDE cannot
find files referenced by a deleted source tree and will not be able to
use those files when compiling, linking, or running your project.
Therefore, the IDE displays a message reminding you to update
your project.
Editor Preferences
This section discusses the preference panels that control
CodeWarrior editor features:
• Editor Settings
• Font & Tabs
• Text Colors
Editor Settings
The Editor Settings preference panel, shown in Figure 8.16 on page
278, provides options for configuring the CodeWarrior editor’s
behavior.
Remember
The Remember options control the settings that the editor
remembers between editing sessions.
Font preferences Enable this checkbox to configure the font
information for an individual file. Disable the checkbox to allow all
files to inherit the default font settings from the CodeWarrior IDE.
Selection position Enable this checkbox to allow the IDE to
remember the visible part of a file’s text, the location of the insertion
point, and any selections that were made. Disable the checkbox to
force the editor to go to the first line of each opened source-code
window. This feature requires writable files. To learn more about
writable files, see “Common VCS Operations” on page 629.
IDE User Guide IDE–277
Configuring IDE Options
Choosing Preferences
Figure 8.16 Editor Settings Preference Panel
Window position and size Enable this checkbox to save each
window’s position and size so that it always reappears at the same
location on the screen. This feature requires writable files. To learn
more about writable files, see “Common VCS Operations” on page
629.
Contextual Menus
The Contextual Menus options toggle the display of specific types
of menu commands in the IDE’s contextual menus.
Edit commands Enable this checkbox to display commonly used
menu commands from the Edit menu. See “Edit Menu” on page 637
for more information.
Browser commands Enable this checkbox to display commonly
used menu commands from the Browser menu. See “Browser
Menu” on page 649 for more information. After you enable this
checkbox, you can also enable the Insert Template Commands
checkbox to display templates from your source code. The
contextual menus then display the Insert Template command,
IDE–278 IDE User Guide
Configuring IDE Options
Choosing Preferences
shown in Figure 7.4 on page 212. If necessary, this command
displays a submenu that lists the templates.
Project commands Enable this checkbox to display commonly
used menu commands from the Project menu. See “Project Menu”
on page 642 for more information.
VCS commands Enable this checkbox to display commonly
used menu commands from the VCS menu. See “VCS Menu” on
page 622 for more information.
Debugger commands Enable this checkbox to display
commonly used menu commands from the Debug menu. See
“Debug Menu” on page 644 for more information.
Other Settings
The Other Settings control miscellaneous behaviors that the editor
remembers between programming sessions.
Balance while typing Enable this checkbox if you want the IDE
to check for balanced parentheses, brackets, and braces as you type.
Each time you type a closing parenthesis, bracket, or brace, the
editor attempts to locate the matching opening counterpart. When
successful, the editor brings the matching counterpart into view,
highlights it for a specified length of time (the Balance Flash Delay),
and then returns to where you were typing. If the editor fails to find
a matching counterpart, a beep sounds. By default, the Balance
while typing checkbox is enabled. See “Balance Flash Delay” on
page 280 for more information.
TIP If you do not want to highlight balanced punctuation, set the Balance
Flash Delay to 0.
Use multiple undo Enable this checkbox to undo and redo
multiple actions. Disable the checkbox to undo or redo only the
most recent action. See “Redo” on page 681 and “Undo” on page
691 for more information.
Relaxed C popup parsing Enable this checkbox to allow the
CodeWarrior IDE to recognize the Kernighan and Ritchie style
coding conventions in your source code and properly display
function names in the Routine pop-up menu (see “Function Pop-Up
Menu” on page 141). Disable the checkbox if you use non-standard
macros that can interfere with Kernighan and Ritchie conventions.
IDE User Guide IDE–279
Configuring IDE Options
Choosing Preferences
For more information, refer to “Reference Manual,” of The C
Programming Language, Second Edition (Prentice Hall) by Kernighan
and Ritchie.
NOTE With the Relaxed C popup parsing checkbox enabled, the IDE
cannot recognize some macro functions. If you encounter problems
while viewing routine names, disable this checkbox and try again.
Enable virtual space Enable this checkbox to use virtual spaces
in the editor. With virtual spacing enabled, you can use the arrow
keys to move the text-insertion point past the end of a line of source
code. The editor automatically inserts spaces between the former
end of the line and newly entered text.
Left margin click selects line This checkbox configures cursor
behavior in the left margin of all editor windows:
If the checkbox is enabled, moving the cursor to the left edge of
an editor window changes the cursor’s icon to a right-pointing
arrow. Clicking the left margin with this cursor selects the line
next to the cursor. Dragging the right-pointing arrow along the
left margin selects more than one line.
If the checkbox is disabled, the cursor’s icon is an I-beam. You
cannot use this cursor to select an entire line with a click.
Sort function popup Enable this checkbox to alphabetically sort
the items listed in the Function pop-up menu. See “Function Pop-
Up Menu” on page 141 for more information.
Balance Flash Delay Enter in this field the number of ticks that
the CodeWarrior editor should display and highlight an item. Each
tick represents 1/60th of a second (16.67 milliseconds). This option
applies to balancing punctuation. For more information, see
“Balancing Punctuation” on page 153 and “Balance while typing”
on page 279.
WARNING! If you enter 0 in the Balance Flash Delay field, the IDE completely
disables flashing the balanced punctuation. To restore the flashing,
enter a number greater than 0.
Default file format Use this pop-up menu to configure the
default end-of-line conventions that the CodeWarrior IDE uses to
IDE–280 IDE User Guide
Configuring IDE Options
Choosing Preferences
save files. You can choose one of three formats: Macintosh, DOS, or
Unix. For more information, see “Document Settings Pop-Up
Menu” on page 142.
Font & Tabs
The Font & Tabs preference panel, shown in Figure 8.17, provides
options for configuring font and tab preferences in editor
windows.The preferences in this panel apply to the active editor
window. If no editor windows are currently open, the saved
preferences become default settings in the CodeWarrior editor.
Figure 8.17 Font & Tabs Preference Panel
The editor restores your font and tab preferences each time you
open the text file. This feature requires writable files. To learn more
about writable files, see “Common VCS Operations” on page 629.
Font
Use this pop-up menu to choose your desired text font.
IDE User Guide IDE–281
Configuring IDE Options
Choosing Preferences
Size
Use this pop-up menu to choose your desired font size.
Sample
This field shows sample text that reflects the current settings in the
Font and Size fields.
Document Tab Settings
These options control the use of tabs within the CodeWarrior editor.
Auto Indent Enable this checkbox to automatically create a new
line with the same indentation as the previous line.
Tab Size Enter in this field the number of spaces that you wish to
represent the width of a tab.
Global Tab Settings
These options control the use of tabs throughout the IDE.
Tab indents selection This checkbox controls the way the IDE
inserts tabs into text. If the checkbox is enabled, you can select lines
of text and press the Tab key to insert a tab in front of each selected
line, indenting the existing text. If the checkbox is disabled, the IDE
completely replaces the selected lines with tabs. The checkbox is
enabled by default.
Tab Inserts Spaces Enable this checkbox to insert spaces in the
text after you press the Tab key. Use the Tab Size field to specify the
number of inserted spaces.
Script (Windows)
Use this pop-up menu to choose your desired script system
(language).
Text Colors
The Text Colors preference panel, shown in Figure 8.18 on page 283,
configures text coloring in IDE windows.
Text Colors
The following options control color settings for IDE windows.
IDE–282 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.18 Text Colors Preference Panel
Foreground This option configures the color of any text not
affected by the options in the Activate Syntax Coloring or Activate
Browser Coloring sections. Click the color swatch to change the
current color.
Background This option configures the color of the areas on
which text appears. Click the color swatch to change the current
color.
Activate Syntax Coloring
Enable this checkbox to configure the color of comments, keywords,
strings, and custom sets of keywords in editor windows. Table 8.1
on page 284 describes each of these elements. Click the color swatch
beside the desired element to change the current color.
IDE User Guide IDE–283
Configuring IDE Options
Choosing Preferences
Table 8.1 Syntax Coloring Elements
Element Description
Comments Code comments. In C, C++, and the Java
programming language, you can place
comments between /* and */ or from //
to the end of a line.
Keywords The programming language’s keywords.
This element does not include macros,
types, variables defined by system interface
files, or variables that you define.
Strings Anything that is not a comment, keyword,
or custom keyword. Sample strings include
literal values, variable names, routine
names, and type names.
Custom Keywords Keywords listed in a custom keyword set.
You can define four distinct sets and assign
a unique color to each set. For example, you
can define a custom keyword set of
functions, types, and other names that you
want to highlight with a unique color.
For more information about custom keywords, see “Defining
custom keyword sets” on page 284 and “Importing and exporting
custom keywords” on page 286. For more information about
toggling syntax coloring for individual files, see “Document
Settings Pop-Up Menu” on page 142.
Defining custom keyword sets
You can define a collection of keywords to which you can assign a
unique color. This custom keyword set can include functions, types,
and other names that you want to highlight with a particular color.
You can define up to four global custom keyword sets that apply to
every editor window. You use the Custom Keywords dialog box to
define, modify, export, and import the sets for use within the IDE.
To add a keyword to a custom keyword set, follow these steps:
IDE–284 IDE User Guide
Configuring IDE Options
Choosing Preferences
1. Click the Edit button next to the custom keyword set that you
wish to modify.
The four custom keyword sets appear in the Text Colors preference
panel (Figure 8.18 on page 283). After clicking Edit, the Custom
Keywords dialog box appears (Figure 8.19).
2. Enter in the topmost field of the Custom Keywords dialog box the
keyword that you wish to add.
For example, enter restartApplet in the topmost field, as shown
in Figure 8.19.
Figure 8.19 Custom Keywords Dialog Box
3. Click Add.
The IDE adds the new custom keyword to the custom keyword list.
The custom keyword list in Figure 8.19 already contains
startApplet.
IDE User Guide IDE–285
Configuring IDE Options
Choosing Preferences
NOTE Due to the way the IDE handles custom keyword lists, you might not
be able to add additional keywords to an already large list. After the
IDE fails to add a keyword to the existing list, an error message
appears.
Repeat these steps until you finish adding keywords to the custom
keywords list. If you want the IDE to match the case of each
keyword in the list when applying your color settings, enable the
Case Sensitive checkbox. Click Done to save your changes and
close the Custom Keywords dialog box. Click Cancel to discard
your changes and close the dialog box.
TIP You can also set target-specific colors for custom keywords. See
“Custom Keywords” on page 365 for more information.
To delete a keyword from a custom keyword set, follow these steps:
1. Ensure that the Custom Keywords dialog box is open.
See “Defining custom keyword sets” on page 284 for more
information about opening this dialog box.
2. Select the keyword that you wish to delete.
3. Delete the keyword.
Press the Backspace key (Windows, Solaris, and Linux) or Delete
key (Mac OS). The CodeWarrior IDE removes the custom keyword
from the custom keyword list.
Repeat these steps until you finish deleting custom keywords. Click
Done to save your changes and close the Custom Keywords dialog
box. Click Cancel to discard your changes and close the dialog box.
Importing and exporting custom keywords
You can import existing custom keyword sets for use in the IDE,
and you can export your sets for use on another IDE host.
To import a custom keyword set, follow these steps:
IDE–286 IDE User Guide
Configuring IDE Options
Choosing Preferences
1. Click the Edit button next to the custom keyword set into which
you wish to import new keywords.
The four custom keyword sets appear in the Text Colors preference
panel (Figure 8.18 on page 283). After clicking Edit, the Custom
Keywords dialog box appears (Figure 8.19 on page 285).
2. Click Import from file.
A standard Open dialog box appears.
3. Use the dialog box to select the custom keyword set that you wish
to import.
4. Click Open.
The IDE imports the selected custom keyword set and adds its
keywords to the custom keywords list.
5. Click Done.
The imported custom keywords become part of the custom
keyword set.
To export a custom keyword set, follow these steps:
1. Click the Edit button next to the custom keyword set that you
wish to export.
The four custom keyword sets appear in the Text Colors preference
panel (Figure 8.18 on page 283). After clicking Edit, the Custom
Keywords dialog box appears (Figure 8.19 on page 285).
2. Click Export to file.
A standard Save dialog box appears.
3. Use the dialog box to save the exported custom keyword set.
If you plan to use the exported custom keyword set on a different
host, add a “.txt” extension (without the quotes) to the set’s name.
The Windows-hosted IDE requires this extension in order to
identify the custom keyword set.
4. Click Save.
The IDE exports the custom keyword set and saves it.
5. Click Done.
IDE User Guide IDE–287
Configuring IDE Options
Choosing Preferences
Activate Browser Coloring
Enable this checkbox to configure the color of different types of
browser symbols. Click the color swatch beside the desired symbol
to change the current color.
Debugger Preferences
This section discusses preference panels that control CodeWarrior
debugger features:
• Display Settings
• Windowing
• Global Settings
• Remote Connections
• Java Debugging (Windows and Mac OS)
• Java Settings (Windows)
• MetroNub Settings (Windows and Mac OS)
• x86 Settings (Windows and Mac OS)
Display Settings
The Display Settings preference panel, shown in Figure 8.20 on
page 289, provides options for configuring the CodeWarrior
debugger’s behavior.
Variable Change Hilite
This option lets you configure the color of changed variables that
appear in debugger windows. Click the color swatch to change the
current color.
Watchpoint Hilite
This option lets you configure the color of watchpoints that appear
in debugger windows. Click the color swatch to change the current
color.
Show variable types
Enable this checkbox to show variable types by default after
opening a new Variable window.
IDE–288 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.20 Display Settings Preference Panel
Show all locals
Enable this checkbox to show all local variables by default after
opening a new Variable window. If this option is enabled, the
Variables pane listing is always Variables:All. If this option is
disabled, the Variables pane listing is either Variables:All,
Variables:Auto, or Variables:None, depending on the previous
state. See “Variables pane” on page 419 for more information about
these states.
Show values as decimal instead of hex
Enable this checkbox to show variable values as decimal values by
default instead of as hexadecimal values.
Sort functions by method name in browser
This checkbox toggles the sorting method used for C++, Object
Pascal, and Java functions in the Browser window. Disabling the
IDE User Guide IDE–289
Configuring IDE Options
Choosing Preferences
checkbox causes the browser to alphabetically sort function names
of the form className::methodName by class name first, then by
method name. Enabling the checkbox causes the browser to
alphabetically sort functions directly by method name. Since most
C++, Object Pascal, and Java source-code files tend to contain
methods that belong to the same class, enabling the checkbox helps
you select methods by typing out method names.
Attempt to use dynamic type of C++, Object Pascal and SOM
objects
Enable this checkbox to display the runtime type of C++, Object
Pascal, and SOM objects. Disable the checkbox to display an object’s
static type only.
Show tasks in separate windows
This checkbox toggles the method used to display tasks. Enable the
checkbox so that double-clicking a task in the Processes Window
brings up a separate Thread Window to display the code. Disable
the checkbox so that the Task pop-up menu appears at the top of
the Thread window. Use this menu to choose a task to display in the
Thread window.
NOTE Changes to this setting do not immediately take effect. The setting
at the start of a debugging session stays active for the duration of
that session. If you change the setting in the middle of a debugging
session, you must stop and then restart debugging in order for the
change to take effect.
Show variable values in source code
Enable this checkbox to automatically display variable values in
your source code. If this checkbox is disabled, the variable values do
not appear.
Default size for unbounded arrays
Enter in this field the array size to use in Variable windows when
viewing unbounded arrays.
IDE–290 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.21 Windowing Preference Panel (Windows)
Windowing
The Windowing preference panel, shown in Figure 8.21 (Windows)
and Figure 8.22 on page 292 (Mac OS), allows you to configure non-
debugging window behavior for the start of each debugging
session. Non-debugging windows refer to windows that do not
control the CodeWarrior debugger during a debugging session.
Sample non-debugging windows include editor windows and the
IDE Preferences window.
Do nothing to non-debugging windows
Enable this option to prevent the IDE from hiding, minimizing,
collapsing, or closing non-debugging windows.
Minimize non-debugging windows (Windows)
Enable this option to minimize non-debugging windows. To
expand the minimized windows, use the Window Menu, double-
click the names of the minimized windows in the Project window,
or perform lookups for symbols within the minimized windows. At
the end of the debugging session, the IDE automatically expands
the minimized windows.
NOTE The Minimize non-debugging windows option is only available in
MDI mode. For more information, see “IDE Extras” on page 259 and
“Use Multiple Document Interface (Windows)” on page 263.
IDE User Guide IDE–291
Configuring IDE Options
Choosing Preferences
Figure 8.22 Windowing Preference Panel for Multiple Monitors (Mac OS)
Collapse non-debugging windows (Mac OS, Solaris, and Linux)
Enable this option to collapse non-debugging windows. To expand
the collapsed windows, use the Window Menu, double-click the
names of the collapsed windows in the Project window, or perform
lookups for symbols within the collapsed windows. At the end of
the debugging session, the IDE automatically expands the collapsed
windows.
Hide non-debugging windows
Enable this option to hide, but not close, non-debugging windows.
To reveal the hidden windows, use the Window Menu, double-click
the names of the hidden files in the Project window, or perform
lookups for symbols within the hidden windows. At the end of the
debugging session, the IDE automatically reveals the hidden
windows.
Close non-debugging windows
Enable this option to close non-debugging windows. At the end of
the debugging session, the IDE automatically re-opens the closed
windows.
IDE–292 IDE User Guide
Configuring IDE Options
Choosing Preferences
Do nothing to project windows
Enable this checkbox to prevent the IDE from manipulating Project
windows. Since the IDE uses Project windows to initiate debugging
sessions, enabling the checkbox is useful for debugging multiple
build targets or projects.
Use Debugging Monitor (Mac OS)
The following options, shown in Figure 8.22 on page 292, appear
only when you have more than one monitor connected to your
computer. These options help you manage debugging windows
across your multiple-monitor setup. Enable the Use Debugging
Monitor checkbox to use the IDE’s multiple-monitor debugging
features.
Monitor for debugging Choose from this pop-up menu the
monitor that you wish to use during debugging sessions. The
coordinates in parentheses identify the selected monitor in
QuickDraw space.
Move open windows to debugging monitor when
debugging starts Enable this checkbox to allow the IDE to move
all open windows to the selected debugging monitor after you
begin a debugging session. At the end of the debugging session, the
IDE restores the moved windows to their original positions.
Open windows on debugging monitor during debugging
Enable this checkbox to display within the selected debugging
monitor any window that opens during the debugging session. The
IDE does not save a window’s position on the debugging monitor if
you close that window during the debugging session. This behavior
prevents window positions from gravitating to the debugging
monitor.
Global Settings
The Global Settings preference panel, shown in Figure 8.23 on page
294, provides options for customizing the debugger’s behavior to
better suit your needs.
IDE User Guide IDE–293
Configuring IDE Options
Choosing Preferences
Figure 8.23 Global Settings Preference Panel
Cache Edited Files Between Debug Sessions
Enable this checkbox to maintain a cache of edited files between
debugging sessions. After enabling the checkbox, enter in the
Maintain files in cache for field the number of days to keep the files
in the cache. Click the Purge Cache button to delete the contents of
the current cache.
Confirm invalid file modification dates when debugging
The debugger keeps track of the modification dates of source files
used to create a symbolics file. When the modification dates do not
match, the debugger can warn you of possible discrepancies
between the object code and the source code. Enable the checkbox to
display the warning.
Automatically launch applications when SYM file opened
This checkbox toggles the way the debugger handles target
applications after opening a symbolics file. Enable the checkbox to
automatically launch a target program and set an implicit
breakpoint at the program’s main entry point. Disable the checkbox
IDE–294 IDE User Guide
Configuring IDE Options
Choosing Preferences
to open a symbolics file without launching the program, so that you
can examine object code that executes before the main routine, such
as C++ static constructors. You can also avoid launching the target
program by holding down the Alt key (Windows, Solaris, and
Linux) or Option key (Mac OS) when opening a symbolics file.
Confirm “Kill Process” when closing or quitting
Enable this checkbox to allow the debugger to prompt you for
confirmation before aborting a process after you kill a target
program.
Select stack crawl window when task is stopped
Enable this checkbox to automatically bring the Thread window to
the foreground after the debugger stops a task. Disable the
checkbox to leave the Thread window in its previous position.
Enabling this checkbox is useful if you have several Variable
windows open and you want to see the variables change as you step
through your code. You can control the Thread window even if it is
not the active window.
Don’t step into runtime support code
Enable this checkbox to allow the IDE to execute constructor code
for C++ static objects normally, without displaying the execution in
the runtime library.
Auto Target Libraries
Enable this checkbox to allow the debugger to try debugging
dynamically linked libraries (DLLs) loaded by the target
application. The debugger attempts to automatically debug the
loaded DLLs that have symbolics information.
Enabling this checkbox is useful if you use the debugger to debug a
file that is not a project file, such as when you attach a running
process. For more information about attaching processes, see
“Processes window toolbar” on page 433
NOTE You might notice slower performance when you enable the Auto
Target Libraries checkbox. If you encounter this problem, try
disabling the checkbox to improve the IDE’s performance.
IDE User Guide IDE–295
Configuring IDE Options
Choosing Preferences
Remote Connections
The Remote Connections preference panel, shown in Figure 8.24,
lets you define general remote-debugging connections between
your computer and other computers. You can use these general
connections to define more specific connections for individual
projects. Using this approach, you need only make minor changes to
the general connections to maintain remote-debugging
functionality.
You use the Remote Connections preference panel in conjunction
with the Remote Debugging settings panel to configure remote-
debugging connections for individual projects. For more
information, see “Remote Debugging” on page 372.
Figure 8.24 Remote Connections Preference Panel
IDE–296 IDE User Guide
Configuring IDE Options
Choosing Preferences
Remote Connections list
This list shows all remote connections defined for use with the IDE.
The list contains two columns:
• Name—This column shows the name that you assign to each
remote connection. After you define a general connection, you
can use its name to define specific connections for individual
projects. See “Remote Debugging” on page 372 for more
information.
• Type—This column shows the connection type that you defined
for each remote connection. After transferring your project to a
new host, you might need to modify the connection type. Your
modifications automatically propagate to all project-specific
connections defined in terms of the general connection. See
“Change” on page 299 for more information about modifying
the current connection.
Add
To add a new remote connection, follow these steps:
1. Click Add.
The New Connection dialog box, shown in Figure 8.25 on page 298,
appears.
2. Enter a name for the new remote connection in the Name field.
On the Mac OS-hosted IDE, the name of the New Connection
dialog box changes to reflect the name that you enter in the field.
3. Choose the desired debugging nub from the Debugger pop-up
menu.
The debugging nub provides low-level debugging services to the
IDE. For example, the debugging nub allows the IDE to set
breakpoints and watchpoints in source code.
4. Configure the Browse In Process Window checkbox as desired.
Enable the checkbox to view the remote connection as a process in
the Processes window. Disable the checkbox to prevent the remote
connection from appearing in the Processes window. For more
information about the Processes window, see “Processes Window”
on page 432.
IDE User Guide IDE–297
Configuring IDE Options
Choosing Preferences
5. Choose the desired connection type from the Connection Type
pop-up menu.
The connection type that you choose determines the remaining
options that appear in the dialog box. Complete these options as
desired.
Figure 8.25 New Connection Dialog Box
6. Click OK to add the new remote connection to the Remote
Connections list.
IDE–298 IDE User Guide
Configuring IDE Options
Choosing Preferences
Repeat these steps until you finish adding general remote
connections, then click Save. You can then define project-specific
connections in terms of the general connections.
Change
To modify an existing remote connection, follow these steps:
1. Select the connection that you wish to modify from the Remote
Connections list.
2. Click Change.
Alternatively, double-click the connection’s name. The dialog box
shown in Figure 8.25 on page 298 appears with the details of the
connection that you wish to change.
3. Modify the remote connection as desired.
To restore the factory default settings for the remote connection,
click Factory Settings. To restore the dialog box to its last saved
state, click Revert.
4. Click OK.
Your modifications appear in the Remote Connections list.
Alternatively, click Cancel to discard your changes and return to
the Remote Connections list.
Repeat these steps until you finish modifying general remote
connections, then click Save. You can then define project-specific
connections in terms of the general connections.
Remove
To remove an existing remote connection, follow these steps:
1. Select the remote connection that you wish to delete from the
Remote Connections list.
2. Click Remove.
The IDE deletes the selected remote connection from the Remote
Connections list.
Repeat these steps until you finish deleting general remote
connections, then click Save to commit your changes.
IDE User Guide IDE–299
Configuring IDE Options
Choosing Preferences
Figure 8.26 Java Settings Preference Panel
Java Settings (Windows)
The Java Settings preference panel, shown in Figure 8.26, lets you
configure general Java debugger options. For more information
about debugging Java programs and applets, see Targeting Java.
Class for debugging
Enter in this field the class file that you wish to debug.
Program Arguments
Enter in this field the command-line arguments to be used by your
project when debugging a Java application.
JView Arguments
Enter in this field any arguments JView might require while
debugging your project.
Java Debugging (Windows and Mac OS)
The Java Debugging preference panel, shown in Figure 8.27 on
page 301, allows you to set up your computer for connecting to a
virtual machine for Java debugging sessions. For more information
about Java debugging, refer to Targeting Java.
Timeout
Enter in this field the number of seconds that the CodeWarrior
debugger should wait for a virtual machine to attach to it.
IDE–300 IDE User Guide
Configuring IDE Options
Choosing Preferences
Figure 8.27 Java Debugging Preference Panel
Remote Debugging
Enable this checkbox to enable remote debugging of Java projects
from your computer.
Remote IP Address
Use this field if you have a network connection to the virtual
machine you plan to use for debugging. Enter in this field the
Internet Protocol (IP) address of the computer on which the virtual
machine is running. This field becomes available only after you
enable the Remote Debugging checkbox.
Port ID
Use this field if you have a network connection to the virtual
machine you plan to use for debugging. Enter in this field the port
ID number to be used for the connection between the virtual
machine and the CodeWarrior debugger. This field is enabled only
after you enable the Remote Debugging checkbox.
Protocol (Windows)
Choose from this pop-up menu the desired protocol for
transmissions between your computer and the remote virtual
IDE User Guide IDE–301
Configuring IDE Options
Choosing Preferences
machine during the debugging session. This pop-up menu becomes
available only after you enable the Remote Debugging checkbox.
JDK version (Windows)
Choose from this pop-up menu the Java Development Kit™ (JDK)
version to use during the remote debugging session. This pop-up
menu becomes available only after you enable the Remote
Debugging checkbox and choose the 1.1.X Wire Protocol from the
Protocol pop-up menu.
MetroNub Settings (Windows and Mac OS)
The MetroNub Settings preference panel, shown in Figure 8.28,
allows you to configure the CodeWarrior debugger nub. The nub
provides low-level debugging services, such as setting breakpoints
and watchpoints.
Figure 8.28 MetroNub Settings Preference Panel
IDE–302 IDE User Guide
Configuring IDE Options
Choosing Preferences
Keep program in background while stepping
Enable this checkbox to step through a program’s code while the
program runs in the background. This option accelerates stepping
and avoids screen flicker. If you disable the checkbox, the program’s
windows briefly come to the foreground and then return to the
background. With rapid stepping, the constant movement of the
program’s windows could cause screen flicker.
WARNING! The Keep program in background while stepping option might
affect the execution of a program that behaves differently in the
background and in the foreground.
Always use file mapping for symbolics
This checkbox determines whether MetroNub or the IDE handles
symbolics files. Enable the checkbox to let MetroNub handle the
files. Disable the checkbox to let the IDE handle the files.
Debugger Trap Settings
These settings determine how the debugger handles Debugger()
and DebugStr() traps during program execution.
Log DebugStr messages Enable this checkbox to log
DebugStr() messages encountered during a program’s execution.
If you do not want to log these messages, disable the checkbox.
PPC Use this pop-up menu to determine how the debugger
handles PowerPC™ traps. You can choose to let MacsBug handle the
traps (MacsBug handles traps), halt the program’s execution after
executing the traps (Stop for traps), or disregard the traps and
continue the program’s execution (Ignore traps).
68K Use this pop-up menu to determine how the debugger
handles 68K traps. You can choose to let MacsBug handle the traps
(MacsBug handles traps), halt the program’s execution after
executing the traps (Stop for traps), or disregard the traps and
continue the program’s execution (Ignore traps).
Remote Debugging (Windows)
Enable this checkbox to enable remote debugging of Mac® OS 8,
Mac OS 9, or Mac OS X projects from your computer.
IDE User Guide IDE–303
Configuring IDE Options
Choosing Preferences
Remote IP:Port Enter in this field the Internet Protocol (IP)
address of the remote computer, followed by a colon, followed by
the port ID number of the remote computer. The field shows a
sample value.
x86 Settings (Windows and Mac OS)
The x86 Settings preference panel, shown in Figure 8.29, provides
settings for connecting a Mac OS computer to a remote Windows
computer for debugging sessions. To learn more about this
preference panel, refer to Targeting Mac OS.
Figure 8.29 x86 Settings Preference Panel
Remote debugging
Enable this checkbox to enable remote debugging of Windows
projects from your computer.
Remote IP Address
Enter in this field the Internet Protocol (IP) address of the remote
computer.
Port ID
Enter in this field the port ID number of the remote computer.
NOTE You should leave the port ID number at its default setting. Changing
the default number might cause CodeWarrior to fail to connect to the
remote computer.
IDE–304 IDE User Guide
Configuring IDE Options
Choosing Preferences
RAD Tools Preferences
This section discusses preference panels that control the
CodeWarrior rapid application development (RAD) tools:
• Layout Editor
Layout Editor
The Layout Editor preference panel, shown in Figure 8.30, provides
options for configuring the Layout Editor’s behavior.
Figure 8.30 Layout Editor Preference Panel
Show the component palette when opening a form
Enable this checkbox to automatically display the Component
Palette after opening a layout in the Layout Editor. For more
information, see “Layout Editor” on page 553 and “Component
Palette” on page 563.
Show the object inspector when opening a form
Enable this checkbox to automatically display the Component
Palette after opening a layout in the Layout Editor. For more
information, see “Layout Editor” on page 553 and “Component
Palette” on page 563.
Grid Size X
Enter in this field the number of pixels between markings on the x-
axis of the Layout Editor grid.
IDE User Guide IDE–305
Configuring IDE Options
Customizing the IDE
Grid Size Y
Enter in this field the number of pixels between markings on the y-
axis of the Layout Editor grid.
Customizing the IDE
The IDE lets you customize menus, key bindings, and toolbars to
better suit your programming needs. You customize these items in
the Customize IDE Commands window. To display this window,
choose Edit > Commands & Key Bindings.
This section discusses the following topics:
• Window Buttons
• Customizing Commands
• Customizing Key Bindings
• Customizing Toolbars
Window Buttons
There are several buttons in the Customize IDE Commands
window that control how the IDE applies your settings.
This section discusses the following topics:
• Discarding changes
• Factory Settings button
• Revert Panel button
• Save button
Discarding changes
If you change the settings in the Customize IDE Commands
window and then try to close the window, the dialog box shown in
Figure 8.31 on page 307 appears. To discard your changes, click
Don’t Save. To keep your changes, click Save. To discard your
changes and return to the Customize IDE Commands window, click
Cancel.
IDE–306 IDE User Guide
Configuring IDE Options
Customizing the IDE
Figure 8.31 Commands and Key Bindings Confirmation Dialog Box
Factory Settings button
Click Factory Settings and then Save to revert the Customize IDE
Commands window to its default settings.
WARNING! The IDE resets all settings to their default values after you click the
Factory Settings button. If you do not export your customized
command groups or menu commands before restoring the default
settings, you will lose your customized items. See “Exporting
commands and key bindings” on page 319 for more information.
Revert Panel button
Click Revert Panel to undo the changes you made to the Customize
IDE Commands window. Clicking this button resets the window to
its last saved state.
Save button
Click Save to commit the current settings in the Customize IDE
Commands window. After closing the window, the CodeWarrior
IDE behaves according to the settings that you saved.
Customizing Commands
You can customize the menu commands that appear in the IDE’s
menu bar. You can control the appearance of specific menu
commands, create new command groups in which to place menu
IDE User Guide IDE–307
Configuring IDE Options
Customizing the IDE
commands, and associate a command line (Windows) or a script
(Mac OS) with a new menu command. The customized menu
commands that you create have access to IDE information, such as
the current editor selection, the frontmost window, the current
project, and the output file of the current project.
For example, you can create a command group called MyMenu and
place in it a menu command called RunApp, which launches an
external application. The Customize IDE Commands window
helps you define the new command group and menu command.
Click the Commands tab at the top of the Customize IDE
Commands window to display the Commands view, shown in
Figure 8.32 (Windows) and Figure 8.33 on page 309 (Mac OS). You
use this view to create and modify new command groups and menu
commands for use with the IDE.
Figure 8.32 Customize IDE Commands - Commands View (Windows)
IDE–308 IDE User Guide
Configuring IDE Options
Customizing the IDE
Figure 8.33 Customize IDE Commands - Commands View (Mac OS)
This section discusses the following topics:
• Modifying existing command groups and menu commands
• Adding customized command groups and menu commands
• Deleting customized command groups and menu commands
Modifying existing command groups and menu commands
You can use the Commands view of the Customize IDE Commands
window to examine and modify existing command groups and
menu commands. The Commands view includes a Commands list,
shown in Figure 8.32 on page 308 (Windows) and Figure 8.33
(Mac OS). This hierarchical list organizes individual menu
commands into command groups. Click the hierarchical control
next to a command group to expand that group and view its
contents.
To examine a particular item, select it in the Commands list. The
information for the selected item appears on the right-hand side of
the Customize IDE Commands window. The window provides the
following information for each selected item:
IDE User Guide IDE–309
Configuring IDE Options
Customizing the IDE
• Name—This field shows the name of the selected item. If the
IDE does not permit you to change the name of the selected item,
this field is grayed out.
• Appears in Menus—Enable this checkbox to display the
selected item in the specified position in the CodeWarrior menu
bar. For example, enabling this checkbox for the RunApp menu
command in Figure 8.33 on page 309 allows that menu
command to appear under the MyMenu command group in the
menu bar. Disabling the checkbox prevents the RunApp menu
command from appearing in the menu bar under the MyMenu
command group.
• Action—This section shows various information about the
action performed by the selected item. For default menu
commands, this section describes the command type, such as
Command or Hierarchical Menu. For customized menu
commands that you create, this section lets you specify a
command line (Windows) or a script (Mac OS) that runs after
you choose the customized menu command.
• Key Bindings—For more information about the Key Bindings
list, New Binding button, and Auto Repeat checkbox, see
“Customizing Key Bindings” on page 314.
Adding customized command groups and menu commands
The Customize IDE Commands window lets you add new menu
commands to the CodeWarrior menu bar and arrange those new
menu commands into command groups. You can configure your
new menu commands to run a command line (Windows) or an
application or script (Mac OS).
Click the Commands tab at the top of the Customize IDE
Commands window to display the Commands view, shown in
Figure 8.32 on page 308 (Windows) and Figure 8.33 on page 309
(Mac OS). You use this view to create new menu commands and
arrange them into command groups. The top-most level of the
Commands list shows existing command groups. Existing menu
commands appear within the command groups.
This section discusses the following topics:
• Creating a command group
• Creating a menu command
• Defining menu-command actions (Windows)
IDE–310 IDE User Guide
Configuring IDE Options
Customizing the IDE
• Defining menu-command actions (Mac OS)
Creating a command group
To create a new command group in which to place menu
commands, follow these steps:
1. Click the New Group button.
The IDE creates a new command group named New Group, adds it
to the Commands list, and displays its information in the Customize
IDE Commands window.
2. Enter a name for the new command group.
You can change the default name of New Group. Enter a new name
in the Name field of the Customize IDE Commands window.
3. Enable or disable the appearance of the new command group in
the IDE’s menu bar.
The Appears in Menus checkbox toggles the appearance of the new
command group. Enable the checkbox to display the command
group in the menu bar. Disable the checkbox to prevent the
command group from appearing in the menu bar.
4. Click Save.
The IDE saves your new command group. If you enabled the
Appears in Menus checkbox, the new command group appears in
the menu bar.
Creating a menu command
To create a new menu command, follow these steps:
1. Select a command group in which to place the new menu
command.
You must select an existing command group in the Commands list.
To create a new command group in which to place the menu
command, follow the steps described in “Creating a command
group” on page 311.
2. Click the New Command button.
The IDE creates a new menu command named New Command and
places it within the selected command group. The information for
the new menu command appears in the Customize IDE Commands
window.
IDE User Guide IDE–311
Configuring IDE Options
Customizing the IDE
3. Enter a name for the new menu command.
You can change the default name of New Command. Enter a new
name in the Name field of the Customize IDE Commands window.
4. Enable or disable the appearance of the new menu command
within the selected command group.
The Appears in Menus checkbox toggles the appearance of the new
menu command. Enable the checkbox to display the menu
command within the command group. Disable the checkbox to
prevent the menu command from appearing within the command
group.
5. Define the desired Action for the new menu command.
See Defining menu-command actions (Windows) or “Defining
menu-command actions (Mac OS)” on page 313 for more
information.
6. Click Save.
The IDE saves your new menu command. If you enabled the
Appears in Menus checkbox, the new menu command appears
within the selected command group.
Defining menu-command actions (Windows)
After creating a new menu command as described in “Creating a
menu command” on page 311, the Customize IDE Commands
window shows three fields in the Action section. These fields help
you associate an action with the new menu command:
• Execute—Enter in this field a command line to run an
application. Alternatively, click the ellipsis button next to the
field, shown in Figure 8.32 on page 308, to select the application
using a standard dialog box.
• Arguments—Enter in this field the arguments that the IDE must
pass to the application specified in the Execute field.
Alternatively, choose the desired arguments from the pop-up
menu next to the field, shown in Figure 8.32 on page 308.
• Directory—Enter in this field the directory that the IDE must
pass to the application specified in the Execute field.
Alternatively, choose the desired directory from the pop-up
menu next to the field, shown in Figure 8.32 on page 308.
IDE–312 IDE User Guide
Configuring IDE Options
Customizing the IDE
Defining menu-command actions (Mac OS)
After creating a new menu command as described in “Creating a
menu command” on page 311, the Customize IDE Commands
window shows the Run App/Script field. This field appears in the
Action section of the window, shown in Figure 8.33 on page 309.
Click the Choose button next to the field to display a standard Open
dialog box. Use the dialog box to select an application or script. The
IDE launches this application or script each time you choose the
menu command. The path to the selected application or script
appears in the Run App/Script field.
Deleting customized command groups and menu commands
You can delete the command groups and menu commands that you
create for use with the IDE. Once removed, the command groups no
longer appear in the IDE’s menu bar, and the menu commands no
longer activate their associated command lines (Windows) or
applications or scripts (Mac OS).
TIP If you need to temporarily remove your customized command
groups and menu commands, consider exporting your settings.
Using this approach, you do not need to reconstruct your settings if
you need to use them in the future. Instead, you can import your
settings into the IDE and make them available for use once again.
See “Exporting commands and key bindings” on page 319.
To delete a command group or menu command, follow these steps:
1. Select the command group or menu command that you wish to
delete.
If necessary, click the hierarchical control next to a group to expand
and view its contents.
2. Click Delete.
After clicking the Delete button, shown in Figure 8.32 on page 308,
the selected command group or menu command disappears from
the Commands list.
IDE User Guide IDE–313
Configuring IDE Options
Customizing the IDE
3. Click Save.
Click the Save button to confirm the deletion. The IDE removes
deleted command groups from its menu bar. Deleted menu
commands disappear from their respective command groups.
Customizing Key Bindings
You can customize the keyboard shortcuts used for menu,
keyboard, and editor commands in the CodeWarrior IDE. You can
attach, or bind, a set of keystrokes to virtually any command. To
activate the command, you can type its associated keystroke set, or
key binding. The Customize IDE Commands window lets you
manipulate IDE key bindings.
For example, you can look up default key bindings for specific
commands. You can also change existing key bindings to better suit
your needs. In either case, you use the Customize IDE Commands
window to find and modify key bindings.
Click the Commands tab at the top of the Customize IDE
Commands window to display the Commands view, shown in
Figure 8.34 on page 315. You use this view to configure the key
bindings for menu commands, editor actions, and other
miscellaneous actions. You can also specify special prefix keys.
This section discusses the following topics:
• Restrictions on choosing key bindings
• Modifying key bindings
• Adding key bindings
• Deleting key bindings
• Setting Auto Repeat for key bindings
• Exporting commands and key bindings
• Importing commands and key bindings
• Prefix keys
• Quote Key prefix
• Assigning the Quote Key prefix
• Setting the Prefix Key Timeout
IDE–314 IDE User Guide
Configuring IDE Options
Customizing the IDE
Figure 8.34 Customize IDE Commands - Key Bindings
NOTE (Solaris and Linux) You can map modifier keys to any key on the
keyboard by using the Keyboard Preferences dialog box in the Info
menu. Since this manual assumes that the mappings retain their
default values, you must remember any changes that you make.
See “Keyboard Preferences Dialog Box” on page 711 for more
information on changing the default modifier key mappings.
Restrictions on choosing key bindings
When you customize key bindings, you must take into account
specific keys that you can and cannot use:
• The Escape and Space keys are invalid for key bindings.
• Function keys and the Clear key are valid for creating key
bindings.
• (Windows) The Return and Tab keys require at least the Ctrl or
Shift key. This restriction does not apply to the second key of a
two-key sequence.
IDE User Guide IDE–315
Configuring IDE Options
Customizing the IDE
• (Mac OS) The Return and Tab keys require at least one of the
following keys: Control, Command, or Shift. This restriction
does not apply to the second key of a two-key sequence.
• (Mac OS) The Command-Period (Command-.) key combination
is invalid for key bindings.
Modifying key bindings
The Commands view of the Customize IDE Commands window
includes a Commands list, shown in Figure 8.34 on page 315. This
hierarchical list organizes the IDE’s commands into categories. Click
the hierarchical control next to a category to expand that category
and view its contents.
To modify a key binding, follow these steps:
1. From the Commands list, select the command that you wish to
modify.
Click the hierarchical controls next to categories to expand them as
necessary so that you can see individual commands. Select the
individual command that you wish to modify.
NOTE If you want to use your keyboard’s numeric keypad as part of the
new key binding, enable the Numeric Keypad Bindings checkbox
in the Customize IDE Commands window.
2. In the Key Bindings list, double-click the key binding that you
wish to change.
The Key Bindings list appears in Figure 8.34 on page 315. After
double-clicking the desired command in this list, the Edit Key
Binding dialog box appears (Figure 8.35 on page 317).
3. Press the key combination that you wish to use for the selected
command.
For example, to change the key combination to Ctrl-8, press the Ctrl
key and the 8 key at the same time.
If you decide against the key combination that you just entered, or if
you make a mistake, click Cancel in the Edit Key Binding dialog
box. The IDE returns you to the Customize IDE Commands
window.
IDE–316 IDE User Guide
Configuring IDE Options
Customizing the IDE
Figure 8.35 Edit Key Binding Dialog Box
NOTE (Mac OS) If you use a Dvorak keyboard and the IDE has trouble
recognizing the Command key, enable the Dvorak KCHR Support
checkbox in the Customize IDE Commands window.
4. Click OK in the Edit Key Binding dialog box.
The new key binding appears in the Key Bindings list of the
Customize IDE Commands window.
5. Click Save in the Customize IDE Commands window to save your
changes.
The new key binding is now available for use in the IDE.
Adding key bindings
You can use the Customize IDE Commands window to specify
additional key bindings for a particular command.
To add a key binding, follow these steps:
1. From the Commands list, select the command to which you want
to add a new key binding.
Click the hierarchical controls next to categories to expand them as
necessary so that you can see individual commands. Select the
individual command that you wish to modify.
NOTE If you want to use your keyboard’s numeric keypad as part of the
new key binding, enable the Numeric Keypad Bindings checkbox
in the Customize IDE Commands window.
IDE User Guide IDE–317
Configuring IDE Options
Customizing the IDE
2. Click New Binding.
The New Binding button appears in Figure 8.34 on page 315. After
clicking this button, the Edit Key Binding dialog box appears
(Figure 8.35 on page 317).
3. Press the key combination that you wish to use for the selected
command.
For example, to add the key combination Ctrl-8, press the Ctrl key
and the 8 key at the same time.
If you decide against the key combination that you just entered, or if
you make a mistake, click Cancel in the Edit Key Binding dialog
box. The IDE returns you to the Customize IDE Commands
window.
NOTE (Mac OS) If you use a Dvorak keyboard and the IDE has trouble
recognizing the Command key, enable the Dvorak KCHR Support
checkbox in the Customize IDE Commands window.
4. Click OK in the Edit Key Binding dialog box.
The new key binding appears in the Key Bindings list of the
Customize IDE Commands window.
5. Click Save in the Customize IDE Commands window to save your
changes.
The new key binding is now available for use in the IDE.
Deleting key bindings
You can delete key bindings that you do not wish to use with the
CodeWarrior IDE. Once removed, the key bindings no longer
activate their assigned commands.
To delete a key binding, follow these steps:
1. From the Commands list, select the command that contains the
key binding that you wish to delete.
Click the hierarchical controls next to categories to expand them as
necessary so that you can see individual commands.
IDE–318 IDE User Guide
Configuring IDE Options
Customizing the IDE
2. In the Key Bindings list, select the key binding that you wish to
delete.
The Key Bindings list appears in Figure 8.34 on page 315.
3. Delete the selected key binding.
Press the Backspace key (Windows, Solaris, and Linux) or Delete
key (Mac OS). The CodeWarrior IDE removes the key binding from
the Key Bindings list.
4. Click Save in the Customize IDE Commands window to save your
changes.
The removed key binding no longer activates its associated
command.
Setting Auto Repeat for key bindings
The Auto Repeat checkbox, shown in Figure 8.34 on page 315,
changes the automatic behavior of the items shown in the Key
Bindings list.
Enable the Auto Repeat checkbox to automatically repeat the
assigned command while you hold down the key combination.
Disable the checkbox to require you to press the key combination
each time you wish to activate its assigned command.
A useful example is the Find Next command. If you enable Auto
Repeat for the Find Next key binding, you can hold down the key
combination while you watch the search engine find all text
matching your search criteria in the open file. This technique
quickly searches the file, finding all matching patterns and
displaying them on the screen. If you disable Auto Repeat, then you
must release and press the key combination each time you wish to
activate the Find Next command.
Exporting commands and key bindings
You can export commands and key bindings for later use by
following these steps:
1. Click Export in the Customize IDE Commands window.
After you click this button, a standard Save dialog box appears.
2. Select a location in which to save the commands and key bindings
file
IDE User Guide IDE–319
Configuring IDE Options
Customizing the IDE
3. Click Save.
The IDE exports the current commands and key bindings to a file at
the specified location.
TIP You should complete the name of the commands and key bindings
file with a .mkb file-name extension, like this: MyCmdsAndKbs.mkb.
This naming convention helps you quickly identify the file as a
Metrowerks Key Bindings file. Furthermore, the Windows-hosted
version of the CodeWarrior IDE uses this extension to properly
recognize the commands and key bindings file.
Importing commands and key bindings
You can import commands and key bindings from a previously
exported file by following these steps:
1. Click Import in the Customize IDE Commands window.
After you click this button, a standard Open dialog box appears.
2. Use the dialog box to locate and open the commands and key
bindings file that you wish to import.
The IDE adds the imported commands and key bindings to the
Commands list in the Customize IDE Commands window.
Prefix keys
Prefix keys let you create multiple-keystroke command keys, such
as those used in the Emacs text editor available on several computer
platforms. For example, the Emacs key sequence to save a file is
Control-X followed by Control-S.
To emulate this Emacs key binding in the CodeWarrior IDE, you
can set a prefix key to Control-X and then set the command key for
the Save menu command to Control-X Control-S.
You can also adjust the maximum time to wait for a keypress after
entering a prefix key. To learn how to do this, see “Setting the Prefix
Key Timeout” on page 323.
IDE–320 IDE User Guide
Configuring IDE Options
Customizing the IDE
Quote Key prefix
The Quote Key is a special prefix key with a very simple function.
This key lets you use a simple printing character as a key equivalent
(without any modifier key), and still retain the ability to use that
character in editor windows.
In typical use, a key equivalent involves two keys: a modifier key
(such as the Ctrl key) combined with a printing key. The IDE does
not require a modifier key.
For example, you can assign the 2 key (with no modifier) to a
command. However, if you make this assignment, you can no
longer type a 2 into your source code in the editor. This conflict
occurs because the IDE interprets the 2 as a command key instead of
a printing key. The Quote Key prefix provides the solution to such
conflicts.
You can configure the IDE to recognize any key as the Quote Key
prefix. For more information, see “Assigning the Quote Key prefix”
on page 321. Despite its name, the Quote Key prefix does not have
to be the key that creates the quote character (") in source code.
After typing an assigned Quote Key prefix, the IDE interprets the
next keypress as a keystroke, not as a command.
Returning to the earlier example, assume that you assign the 2 key
to a command and the tilde key (~) to be your Quote Key prefix. To
execute the command, you would type the 2 key. To enter the
character 2 into source code, you would type the tilde key first, then
the 2 key. To enter the tilde character into source code, you would
press the tilde key twice.
WARNING! The Quote Key only affects the next key or key combination that you
type. You must use the Quote Key once for each bound key or key
combination for which you want to type the equivalent character on
the screen.
Assigning the Quote Key prefix
To assign the Quote Key prefix, follow these steps:
IDE User Guide IDE–321
Configuring IDE Options
Customizing the IDE
1. Click the hierarchical control next to the Miscellaneous item.
The Miscellaneous item, shown in Figure 8.36 on page 322, is part of
the Commands list in the Customize IDE Commands window.
2. Select the Quote Key item.
The Quote Key item is part of the Miscellaneous command group.
NOTE If you want to use your keyboard’s numeric keypad as part of the
new key binding, enable the Numeric Keypad Bindings checkbox
in the Customize IDE Commands window.
3. Click New Binding.
The New Binding button appears in Figure 8.36 on page 322. After
clicking this button, the Edit Key Binding dialog box appears
(Figure 8.35 on page 317).
Figure 8.36 Customize IDE Commands - Quote Key Prefix
IDE–322 IDE User Guide
Configuring IDE Options
Customizing the IDE
4. Type the desired Quote Key prefix.
The keys you type appear in the dialog box. If you make a mistake
or decide against the keys you typed, click Cancel to return to the
Customize IDE Commands window.
NOTE (Mac OS) If you use a Dvorak keyboard and the IDE has trouble
recognizing the Command key, enable the Dvorak KCHR Support
checkbox in the Customize IDE Commands window.
5. Click OK in the Edit Key Binding dialog box.
The new Quote Key prefix appears in the Key Bindings list.
Setting the Prefix Key Timeout
The Prefix Key Timeout field specifies the length of time that the
IDE waits for the second key after you press a prefix key. The larger
the value in this field, the longer the IDE waits for you to press the
second key.
The IDE measures the timeout value in ticks, where each tick equals
1/60th of a second (16.67 milliseconds). Legal values range from 1
to 999 ticks. The default value is 120 ticks.
Customizing Toolbars
A toolbar contains a series of elements, represented by icons, which
act as buttons. Each element typically represents a menu command.
After you click the element, the IDE executes the associated menu
command. The toolbar can also contain elements that execute
actions other than menu commands. Figure 8.37 (Windows) and
Figure 8.38 on page 324 (Mac OS, Solaris, and Linux) show the
toolbar in the Project window.
Figure 8.37 Project Window Toolbar (Windows)
IDE User Guide IDE–323
Configuring IDE Options
Customizing the IDE
Figure 8.38 Project Window Toolbar (Mac OS, Solaris, and Linux)
TIP To display a ToolTip that names a toolbar icon, rest the cursor over
the icon. On the Mac-hosted IDE, activate Balloon Help and rest the
cursor over the icon.
This section discusses the following topics:
• Kinds of toolbars
• Toolbar elements
• Showing and hiding a toolbar
• Modifying a toolbar
• Restoring a toolbar to default settings
• Anchoring the floating toolbar (Mac OS, Solaris, and Linux)
Kinds of toolbars
There are two types of toolbars in the IDE:
• the floating toolbar (also known as the global toolbar or the main
toolbar) that you can use at all times
• toolbars that appear in particular windows, such as the Project
window toolbar and the Browser window toolbar
This distinction is important, because you show, hide, clear, and
reset the different toolbar types by using different sets of menu
commands. These commands distinguish between the floating
toolbar and the other window toolbars.
Your changes to one of these toolbar types apply to every instance
of that toolbar type subsequently created. For example, if you
modify the toolbar in an editor window, your changes appear in all
editor windows opened thereafter. For more information, see
“Modifying a toolbar” on page 327.
Each of the toolbars has a default configuration of elements that you
can restore at any time. For more information, see “Restoring a
toolbar to default settings” on page 330.
IDE–324 IDE User Guide
Configuring IDE Options
Customizing the IDE
After you choose a menu command related to a window toolbar, the
command affects the toolbar in the active window. For more
information, see “Toolbar Submenu” on page 698.
Toolbar elements
A toolbar can contain the following types of elements.:
• Commands—buttons that execute IDE menu commands when
clicked
• Controls—IDE pop-up menus (Document Settings, Functions,
Header Files, Markers, and Version Control), and the Current
Target pop-up menu
• Miscellaneous —other elements, such as the File Dirty Indicator
and File Path field
• Scripts (Mac OS)—buttons that execute one of the scripts
available through the Scripts menu in the IDE.
Click the Toolbar Items tab at the top of the Customize IDE
Commands window to display the Toolbar view, shown in Figure
8.39 on page 326. You use this view when adding new elements to a
toolbar. For more information on adding elements to a toolbar, see
“Adding a toolbar element” on page 328.
Showing and hiding a toolbar
Use the commands in the Toolbar Submenu to show or hide a
toolbar. Hiding a toolbar does not change the toolbar’s
configuration of elements.
This section discusses the following toolbar types:
• Main toolbar (Windows)
• Floating toolbar (Mac OS, Solaris, and Linux)
• Window toolbar
Main toolbar (Windows)
To display the main toolbar, choose View > Toolbars >
Show Main Toolbar. To hide the main toolbar, choose View >
Toolbars > Hide Main Toolbar. See “Restoring a toolbar to default
settings” on page 330 for more information.
IDE User Guide IDE–325
Configuring IDE Options
Customizing the IDE
Figure 8.39 Customize IDE Commands - Toolbars
Floating toolbar (Mac OS, Solaris, and Linux)
To display the floating toolbar, choose Window > Toolbar >
Show Floating Toolbar. To hide the floating toolbar, choose
Window > Toolbar > Hide Floating Toolbar. See “Restoring a
toolbar to default settings” on page 330 and “Anchoring the floating
toolbar (Mac OS, Solaris, and Linux)” on page 330 for more
information.
NOTE (Mac OS, Solaris, and Linux) Hiding the floating toolbar does not
change its anchored state. For example, if the floating toolbar is
unanchored when hidden, it will remain unanchored when displayed
again. For more information, see “Anchoring the floating toolbar
(Mac OS, Solaris, and Linux)” on page 330.
IDE–326 IDE User Guide
Configuring IDE Options
Customizing the IDE
Window toolbar
To hide an active window’s toolbar, choose Hide Window Toolbar
from the Toolbar Submenu. The other components of the window
shift to fill the space previously occupied by the window’s toolbar.
All subsequently opened windows of that type will have hidden
toolbars.
To display an active window’s hidden toolbar, choose
Show Window Toolbar from the Toolbar Submenu. The other
components of the window shift to allow room for the window’s
toolbar. All subsequently opened windows of that type will display
toolbars.
After you hide the editor window toolbar, the default toolbar
elements appear in smaller form along the bottom of the editor
window, as shown in Figure 8.40 on page 327. When you show the
toolbar again, the tools reappear along the top of the editor window,
as shown in Figure 5.1 on page 139.
Figure 8.40 Editor Window With Hidden Toolbar
You can also show or hide the editor window toolbar with the
Toolbar Disclosure button. For more information, refer to “Seeing
Window Controls” on page 146.
Modifying a toolbar
You can modify a toolbar in the following ways:
• Adding a toolbar element
IDE User Guide IDE–327
Configuring IDE Options
Customizing the IDE
• Removing a toolbar element (Windows)
• Removing all toolbar elements
In certain circumstances, there are restrictions on which elements
you can add or remove from a toolbar. See “Adding a toolbar
element” on page 328 and “Removing a toolbar element
(Windows)” on page 329 for more information.
After you modify a toolbar, the changes apply to every instance of
that toolbar subsequently created. For example, if you customize the
Project window toolbar, those changes will affect every Project
window that you open, not just the toolbar in the active Project
window. Windows that are already open are not affected.
Adding a toolbar element
You add an element to a toolbar by dragging and dropping it from
the Toolbar Items list onto a toolbar. This list is part of the Toolbar
Items view in the Customize IDE Commands window.
To add an element to a toolbar, follow these steps:
1. From the Toolbar Items list, select the element that you want to
add to a toolbar.
Ensure that the destination toolbar is visible.
2. Drag the element’s icon from the Toolbar Items list to the
destination toolbar.
On the Windows-hosted IDE, if the destination toolbar accepts the
element, a framing bracket appears in the toolbar. This framing
bracket shows you where the new element will appear after you
release the cursor. If the destination toolbar does not accept the
element, the framing bracket does not appear.
3. Release the element at the desired position.
After release, the IDE inserts the element in the destination toolbar.
The toolbar might not accept an element for the following reasons:
• The toolbar is full.
• The element already exists in the toolbar.
• You cannot use the desired element in the toolbar because the
window does not support that element.
IDE–328 IDE User Guide
Configuring IDE Options
Customizing the IDE
• You cannot add the following elements to any toolbar except the
editor window toolbar: Document Settings, Functions, Header
Files, Markers, and Version Control pop-up menus; File Dirty
Indicator; and File Path field.
• You cannot add the Current Target pop-up menu element to any
toolbar except the Project window toolbar.
Removing a toolbar element (Windows)
To remove an element from a toolbar, right-click the element and
choose Remove Toolbar Item from the contextual menu that
appears. The IDE removes the element from the toolbar.
Removing all toolbar elements
You can clear all elements from a toolbar and build your own
toolbar from scratch. Table 8.2 shows how to clear the floating
toolbar and window toolbars.
Table 8.2 Clearing Toolbars
To clear the… Windows Mac OS, Solaris, and Linux
main toolbar Choose View > Toolbars > Choose Window > Toolbar >
Clear Main Toolbar Clear Floating Toolbar
window toolbar Choose View > Toolbars > Choose Window > Toolbar >
Clear Window Toolbar Clear Window Toolbar
TIP (Windows) You can also clear all elements by right-clicking the
toolbar and choosing Clear Toolbar from the contextual menu that
appears.
In some cases, the IDE might not remove certain elements after you
choose the Clear Window Toolbar command. The elements that the
IDE does not remove are critical to the toolbar’s basic purpose.
NOTE If the floating toolbar is currently hidden, you cannot clear it. You
must display the floating toolbar before clearing it. See “Showing
and hiding a toolbar” on page 325 for more information.
IDE User Guide IDE–329
Configuring IDE Options
Customizing the IDE
Restoring a toolbar to default settings
You can reset a toolbar to its original (default) factory settings. Table
8.3 on page 330 shows how to reset the floating toolbar and window
toolbars.
TIP (Windows) You can also reset the toolbar by right-clicking it and
choosing Restore Toolbar from the contextual menu that appears.
NOTE If the floating toolbar is currently hidden, you cannot reset it. You
must display the floating toolbar before resetting it. See “Showing
and hiding a toolbar” on page 325.
Table 8.3 Resetting Toolbars
To reset the… Windows Mac OS, Solaris, and Linux
main toolbar Choose View > Toolbars > Choose Window > Toolbar >
Reset Main Toolbar Reset Floating Toolbar
window toolbar Choose View > Toolbars > Choose Window > Toolbar >
Reset Window Toolbar Reset Window Toolbar
Anchoring the floating toolbar (Mac OS, Solaris, and Linux)
You can anchor the floating toolbar to the top-left corner of the
screen, just below the menu bar. In its anchored state, the floating
toolbar is joined to the IDE’s menu bar. You cannot close or move an
anchored floating toolbar.
To anchor the floating toolbar when it is currently free-floating,
choose Window > Toolbar > Anchor Floating Toolbar.
To release the floating toolbar when it is currently anchored, choose
Window > Toolbar > Unanchor Floating Toolbar.
IDE–330 IDE User Guide
9
Configuring Target Options
This chapter discusses the options available in the CodeWarrior®
Target Settings window. This window handles settings for
individual projects and their respective build targets.
After customizing options for a particular project, you can create
project stationery that incorporates your settings. To learn more
about this topic, refer to “Creating Your Own Project Stationery” on
page 62.
This chapter includes the following topics:
• Target Settings Guided Tour
• Choosing Target Settings
Target Settings Guided Tour
To open the Target Settings window, choose Edit > Target Settings.
The actual name of the Target Settings command includes the name
of the current build target. For example, if the name of your current
build target is ANSI Console Win32, then the Target Settings
command becomes ANSI Console Win32 Settings.
The Target Settings window organizes settings into a group of
panels, where each panel contains settings for related features. For
example, a single panel can contain several linker-related options.
This section discusses the following topics:
• Settings Panels
• Window Buttons
IDE User Guide IDE–331
Configuring Target Options
Target Settings Guided Tour
Settings Panels
The Target Settings window contains two parts. The left side of the
window shows a hierarchical list of available settings panels. The
right side of the window displays settings for a selected panel. The
available panels vary, depending on the current build target and the
CodeWarrior product that you use.
To display a particular settings panel, select its name in the list. You
can use the arrow keys or click the name of the panel. Figure 9.1
shows a selected panel in the Target Settings window.
Each settings panel contains related options that you can modify.
These options apply to the current build target in the active project.
See the following section, “Window Buttons,” for more information
about saving, discarding, and restoring the settings panels.
Figure 9.1 Selecting a Settings Panel
Window Buttons
Several buttons in the Target Settings window control how the IDE
applies your settings to the project.
This section covers the following topics:
• Discarding changes
• Factory Settings button
• Revert Panel button
IDE–332 IDE User Guide
Configuring Target Options
Target Settings Guided Tour
• Save button
• Export Panel and Import Panel buttons
• OK, Cancel, and Apply buttons (Windows)
Discarding changes
If you change the options in the Target Settings window and then
try to close the window, the dialog box shown in Figure 9.2 appears.
To discard your changes, click Don’t Save. To keep your changes,
click Save. To discard your changes and return to the Target
Settings window, click Cancel.
Figure 9.2 Settings Confirmation Dialog Box
Factory Settings button
Click Factory Settings to revert the current settings panel to its
default state. Clicking this button does not affect the options in
other settings panels.
WARNING! The IDE resets all options within the settings panel to their default
values after you click the Factory Settings button. If you do not
export the settings panel before restoring its default options, you will
lose your settings in that panel. See “Export Panel and Import Panel
buttons” on page 334 for more information.
Revert Panel button
Click Revert Panel to undo the changes you made to the current
settings panel. Clicking this button resets the settings panel to its
last saved state.
IDE User Guide IDE–333
Configuring Target Options
Target Settings Guided Tour
Save button
Click Save to commit the current options in all of the settings
panels. If you change an option that requires the IDE to recompile
your project, the IDE displays the dialog box shown in Figure 9.3.
Click OK to keep your changes and allow the IDE to re-compile
your project, or click Cancel to discard your changes.
After closing the Target Settings window, the IDE handles target
builds according to the settings that you saved.
Figure 9.3 Save Changes Dialog Box
Export Panel and Import Panel buttons
Click Export Panel to save the options in the current settings panel
to an Extensible Markup Language (XML) file. Click Import Panel
to open an existing XML file and apply its options to the current
settings panel.
OK, Cancel, and Apply buttons (Windows)
Click OK to commit the current options in all of the settings panels
and close the Target Settings window. Click Cancel to discard your
changes and close the window. Click Apply to commit the current
options in all of the settings panels without closing the window.
After you click the Apply button, the Cancel button becomes the
Close button. Click Close to dismiss the Target Settings window.
IDE–334 IDE User Guide
Configuring Target Options
Choosing Target Settings
Choosing Target Settings
This section discusses how to configure settings for individual build
targets. These settings customize the IDE to suit your needs when
building the targets in your project. The settings mainly affect the
compiler, linker, and debugger.
See “Target Settings Guided Tour” on page 331 for instructions on
viewing a particular settings panel.
The specific settings panels that appear in the Target Settings
window depend on the operating system or chip family of your
build target and the programming language that you use.
For example, if you work with an x86 project, you do not see any
settings panels for Motorola® 68K configurations. If the C++
language does not apply to a particular build target, panels related
to that language do not appear.
In addition, the IDE marks for re-compilation those files affected by
changes in the settings panels. For example, changing a setting in
the resource compiler causes the IDE to mark resource-compiler
source code for re-compilation. By marking only those files that
require re-compilation, the IDE reduces link time during the next
Make operation.
This manual does not discuss settings panels specific to a particular
operating system, microprocessor family, or programming
language. To learn about target-specific settings panels, refer to the
CodeWarrior targeting documentation for your particular platform.
For example, to learn about operating system-, processor-, and
language-specific settings panels for Mac OS development, refer to
Targeting Mac OS.
This section discusses general settings panels that apply to virtually
all build targets. The following groups organize the panels:
• Target Settings
• Code-Generation Settings
• Editor Settings
• Debugger Settings
IDE User Guide IDE–335
Configuring Target Options
Choosing Target Settings
Target Settings
The following settings panels apply to most build targets:
• Target Settings
• Access Paths
• Build Extras
• Runtime Settings
• File Mappings
• Source Trees
Target Settings
The Target Settings panel, shown in Figure 9.4 on page 337, is a
very important settings panel for your project. You use this panel to
perform all of the following tasks:
• Choose a target operating system or microprocessor for your
project
• Set the name of the current build target
• Set the linker that you wish to use with the project
Selecting a particular linker specifies the target operating system or
microprocessor. The hierarchical list in the Target Settings window
updates to reflect your linker choice. Thus, you must set your build
target before you can configure options that apply to that build
target, such as compiler and linker settings.
You can use this settings panel to completely change the build
target. However, if you make such a change, the IDE cannot change
related project files for you. For example, if you change the build
target such that the IDE requires a new compiler and linker, you
must manually remove inappropriate libraries as well as add
required libraries for use with the new compiler and linker.
TIP To avoid the complexities involved with manually changing a build
target in your project, consider using the project stationery included
with your CodeWarrior product. These stationery files include the
appropriate libraries and support files for a variety of build targets.
For more information, see “Creating a New Project” on page 55.
IDE–336 IDE User Guide
Configuring Target Options
Choosing Target Settings
Figure 9.4 Target Settings Panel
Target Name
Use this field to set or change the name of the current build target.
This name appears in the Targets view in the Project window.
The name you enter in this field is not the name of your final output
file. Rather, this field shows the name that you assign to the build
target for your personal use. You typically set the name of the final
output file in the settings panel for the linker you choose for your
build target.
Linker
Choose from this pop-up menu the linker that you wish to use with
the project.
To learn more about the linkers available to you, refer to the
Targeting manual for your selected build target. The choices depend
on the plug-in linkers that you have for your CodeWarrior product.
For example, CodeWarrior for Windows provides linkers for Win32
on x86. CodeWarrior for PlayStation® provides a linker for the
PlayStation OS running on MIPS, as well as a post-linker.
IDE User Guide IDE–337
Configuring Target Options
Choosing Target Settings
NOTE See “File Mappings” on page 350 for more information about the file
mappings associated with the linker you choose. The IDE uses
these file mappings to recognize the files in your project.
Pre-linker
Some build targets have pre-linkers that perform additional work
on the object code in your project. This work takes place before the
IDE links the object code into the final executable file. For more
information about the pre-linkers available for your build target,
refer to the information in the appropriate Targeting manual.
Post-linker
Some build targets have post-linkers that perform additional work
(such as format conversion) on the final executable file. For more
information about the post-linkers available for your build target,
refer to information in the appropriate Targeting manual.
Output Directory
This field shows the location in which the IDE places your final
linked output file. The default location is the directory that contains
your project file. Click Choose to specify a different location. Click
Clear to remove the current location.
Save project entries using relative paths
Enable this checkbox to remember the location of a project entry as a
relative path from one of the access paths. This extra location
information allows the IDE to distinctly identify different source
files with the same name. The IDE remembers the location
information even if it needs to re-search for files in the access paths.
Disable the checkbox to remember project entries only by name.
This situation can cause unexpected results if two or more files
share the same name. In this case, re-searching for files could cause
the IDE to find the project entry in a different access path.
See “Re-search for Files” on page 681 and “Reset Project Entry
Paths” on page 684 for more information.
IDE–338 IDE User Guide
Configuring Target Options
Choosing Target Settings
Access Paths
If you need to define additional access paths for the CodeWarrior
IDE to search while compiling and linking your project, use the
Access Paths settings panel, shown in Figure 9.5 (Windows) and
Figure 9.6 on page 340 (Mac OS).
Figure 9.5 Access Paths Settings Panel (Windows)
If a folder icon appears beside the name of a folder in either the User
Paths pane or the System Paths pane, the IDE performs a recursive
search on the path. That is, the CodeWarrior IDE searches the folder
and all of its subfolders.
Clicking the folder icon to the left of any path in the User Paths pane
or the System Paths pane toggles recursive searching of the
subdirectories in that path. If the folder icon is visible, recursive
searching is enabled. If the folder icon is not visible, recursive
searching is disabled.
IDE User Guide IDE–339
Configuring Target Options
Choosing Target Settings
Figure 9.6 Access Paths Settings Panel (Mac OS)
TIP If you disable recursive searching of paths and add each specific
path of every directory that contains your files to either the User
Paths pane or the System Paths pane, you can speed compilation
of your project.
Clicking the checkmark icon to the left of any path in the User Paths
pane or the System Paths pane toggles searching that path in the
current host computer. If the access path is checked, the current host
computer searches that path. If the access path is not checked, the
current host computer ignores that path.
If the files or libraries in your project are not located in the default
access paths, the IDE cannot find them when compiling, linking, or
running your project. You must explicitly add their access paths in
order for the IDE to find them.
IDE–340 IDE User Guide
Configuring Target Options
Choosing Target Settings
For more information about access paths, see “Interface pop-up
menu” on page 114.
Windows The IDE automatically excludes Resource.frk files
from the search list.
TIP You can prevent the IDE from searching a folder and all its
subfolders in an access path by using the Shielded Folders
preference panel. For more information, see “Shielded Folders” on
page 266.
User Paths (Windows)
Click this radio button to display the User Paths pane in the Access
Paths preference panel.
System Paths (Windows)
Click this radio button to display the System Paths pane in the
Access Paths preference panel.
Always Search User Paths
Enable this checkbox to search for system header files or interface
files in the same way as user header files. Disable the checkbox to
treat #include <…> directives differently from #include "…"
directives.
341 Paths (Mac OS)
This checkbox determines how the IDE treats file names for
interface files. Enable the checkbox to treat the backslash (\) and
forward slash (/) characters as sub-folder separator characters.
Disable the checkbox to treat these characters as part of the file
name in an interface file.
For example, consider the following directive:
#include "sys/socks.h"
If the Interpret DOS and Unix Paths checkbox is disabled, the IDE
attempts to search for a file named “sys/socks.h” for use with
the project. If the checkbox is enabled, the IDE looks for a subfolder
named “sys” that has a file named “socks.h”.
IDE User Guide IDE–341
Configuring Target Options
Choosing Target Settings
User Paths pane
This pane shows the access paths specific to your project. In C, an
#include "…" directive causes the IDE to search these access
paths. In Pascal, the IDE first searches these access paths. By default,
the User Paths pane contains {Project}, which is the folder that
contains the current project.
System Paths pane
This pane shows the access paths for system headers and similar
files. In C, an #include <…> directive causes the IDE to search
these access paths. In Pascal, the IDE searches these access paths
after those in the User Paths pane. By default, the System Paths
pane contains {Compiler}, which is the folder that contains the
CodeWarrior IDE.
Add Default
The CodeWarrior IDE lets you restore the default access paths in the
User Paths pane or System Paths pane after you delete them. To add
the default path to the active pane, click the Add Default button.
The IDE adds the default path back into the active pane. Note that
this button is not available if the default access path is currently
present in the active pane.
Host Flags
This pop-up menu specifies the host platform that can use an access
path. To allow a host platform to use a selected access path in the
User Paths pane or System Paths pane, choose the host platform
from the Host Flags pop-up menu.
To allow all host platforms to use the access path, choose All from
the pop-up menu. To prevent any host from using the access path,
choose None from the pop-up menu.
For example, selecting a path and choosing Mac OS in the Host
Flags pop-up menu specifies that the IDE must search the access
path on a Mac OS computer and ignore the access path when
running on any other host platform.
IDE–342 IDE User Guide
Configuring Target Options
Choosing Target Settings
Add
To add a new access path, first select the User Paths pane or the
System Paths pane, then click the Add button. The dialog box
shown in Figure 9.7 (Windows) or Figure 9.8 on page 344 (Mac OS)
appears. Use the dialog box to select the item for which you want to
add an access path. You can also drag and drop folders onto the
appropriate pane in order to add access paths.
Figure 9.7 Access Path Selection Dialog Box (Windows)
You can specify how CodeWarrior stores an access path by
choosing one of the following options:
• Absolute Path—Using this option, the IDE stores the access path
from the root level of the startup hard drive to the folder whose
access path you want to add, including all folders in between.
You must update absolute access paths if you move the project
IDE User Guide IDE–343
Configuring Target Options
Choosing Target Settings
to another system, rename the hard disk, or rename any of the
folders along the access path.
• Project Relative—Using this option, the IDE stores the access
path from the folder that contains the project to the folder whose
access path you want to add. You do not need to update project
relative access paths if you move a project, as long as the
hierarchy of the relative path is the same. You cannot create a
relative path to a folder on a different hard drive than where
your project file resides.
Figure 9.8 Access Path Selection Dialog Box (Mac OS)
• Compiler Relative—Using this option, the IDE stores the access
path from the folder that contains the CodeWarrior IDE to the
folder whose access path you want to add. You do no need to
update compiler relative access paths if you move a project, as
long as the hierarchy of the relative path is the same. You cannot
create a relative path to a folder on a different hard drive than
IDE–344 IDE User Guide
Configuring Target Options
Choosing Target Settings
where your CodeWarrior IDE resides. On the Mac OS-hosted
IDE, the Compiler Relative option is named CodeWarrior
Relative.
• System Relative—Using this option, the IDE stores the access
path from the operating system’s base folder to the folder whose
access path you want to add. You do not need to update system
relative access paths if you move a project, as long as the
hierarchy of the relative path is the same. You cannot create a
relative path to a folder on a different hard drive than where
your active operating system’s base folder resides.
• Source Tree Relative—Using this option, the IDE stores the
access path from the folder specified in the source tree. The
actual name of this option includes the name of the source tree.
For example, if you create a source tree named Sample, you can
choose the Sample option when specifying how the IDE stores
the access path. For more information about defining global
source trees, see “Source Trees” on page 269. For information
about defining project-specific source trees, see “Source Trees”
on page 355.
NOTE Relative paths allow projects to contain two or more files with
identical names. However, for large projects, you might notice
slower performance when adding relative paths to a project.
Select an access-path type from the available types, and then select
the folder whose access path you want to add. Click OK to add the
selected item’s access path to the User Paths pane or the System
Paths pane, or click Cancel to discard your changes and leave the
panes unchanged.
Change
To change an access path, first select the path in the User Paths pane
or the System Paths pane, then click the Change button. The dialog
box shown in Figure 9.7 on page 343 (Windows) or Figure 9.8 on
page 344 (Mac OS) appears. Use this dialog box to select a new
access path. To learn more about the options in the dialog box, refer
to “Add” on page 343.
IDE User Guide IDE–345
Configuring Target Options
Choosing Target Settings
Remove
To remove an access path, select the path that you want to remove
from the User Paths pane or the System Paths pane. Click Remove
to delete the path from the pane.
Windows You can also remove access paths by dragging them to
the Recycle Bin on the Desktop.
Mac OS You can also remove access paths by dragging them to
the Trash on the Desktop.
Build Extras
The Build Extras panel, shown in Figure 9.9, contains various
options that affect the way the IDE builds a project.
Figure 9.9 Build Extras Settings Panel
Use modification date caching
This checkbox determines whether the IDE checks the modification
date of each project file prior to making the project. Enabling the
checkbox causes the IDE to cache the modification dates of the files
in a project. At compilation time, the IDE refers to this cache to
determine whether a specific file should be recompiled. Disabling
the checkbox causes the IDE to check every file each time you
recompile the project.
IDE–346 IDE User Guide
Configuring Target Options
Choosing Target Settings
If you exclusively use the CodeWarrior editor to create and modify
the text files in your project, enable the checkbox to shorten
compilation time. If you use other text editors in addition to the
CodeWarrior editor, disable the checkbox to ensure that the IDE
checks every file at compilation time.
Cache Subprojects
Enable this checkbox to improve multi-project updating and
linking. Enabling the checkbox also allows the IDE to generate
symbolics information for both the build targets and the subprojects
within each build target. Disable the checkbox to reduce the amount
of memory required by the CodeWarrior IDE.
Activate Browser
Enable this checkbox to allow the IDE to generate symbolics
information for your project during each build. The CodeWarrior
browser requires the symbolics information. Without this
information, you cannot open browser windows for your project.
See “Making a Project” on page 380 for more information about re-
building your project. To learn more about browser settings and
options, see “Browsing Source Code” on page 205.
Dump Internal Browse Information After Compile
Enable this checkbox to view the raw browser information that a
plug-in compiler or linker provides for the IDE. This option is useful
if you develop plug-ins for use with the IDE.
NOTE After enabling the Dump internal browse information after
compile checkbox, you should only compile single files or small
files. The internal browser information that the IDE displays can be
huge when compiling an entire project.
Use third party debugger (Windows)
Enable this checkbox to use a third-party debugger in place of the
CodeWarrior debugger. Enter the path to the third-party debugger
application in the field provided, or click Browse to open a dialog
box. Use the dialog box to locate the debugger application.
IDE User Guide IDE–347
Configuring Target Options
Choosing Target Settings
Runtime Settings
The Runtime Settings panel, shown in Figure 9.10 for a Windows
build target, includes options for specifying a debugging
application for non-executable files, defining a working directory,
listing program arguments, and creating environment variables.
Figure 9.10 Runtime Settings Panel (for a Windows Build Target)
Host Application for Libraries & Code Resources
This field lets you specify a host application to use when debugging
a non-executable file, such as a shared library, dynamic link library
(DLL), or code resource. The application that you specify in this
field is not the debugger application, but rather the application with
which the non-executable file interacts.
For example, if you write a Photoshop® plug-in, you would select
Photoshop as the host application. After you choose Project >
Debug, the IDE builds the plug-in, loads the symbolics information
for that plug-in, and then launches Photoshop to allow you to
debug the plug-in.
IDE–348 IDE User Guide
Configuring Target Options
Choosing Target Settings
To specify a host application, type the path to that application
directly into the field. Alternatively, click Choose to display a dialog
box. Use the dialog box to select the application. Click Clear to
remove the current path from the field.
General Settings
This section has the following fields:
• Working Directory—Use this field to specify the default
directory to which the current project has access. Debugging
occurs in this location. If you do not specify a directory,
debugging occurs in the same directory as the executable file.
• Program Arguments—Use this field to enter command-line
arguments to pass to the project at the beginning of a debugging
session. Your program receives these arguments after you
choose Project > Run.
NOTE The General Settings section appears only when you develop code
for a Windows build target. The section does not appear for any
other build target.
Environment Settings
This section allows you to specify environment variables to pass to
your program as part of the environment parameter in your
program’s main() function, or as part of environment calls. These
variables are only available to the target program. When your
program terminates, the settings are no longer available. For
example, if you write a program that logs into a server, you could
use variables for PASSWORD and USER as shown in Figure 9.10 on
page 348.
NOTE The Environment Settings section appears only when you develop
code for a Windows build target. The section does not appear for
any other build target.
To create a new environment variable, follow these steps:
1. Type a name for the environment variable in the Variable field.
2. Type a value for the environment variable in the Value field.
IDE User Guide IDE–349
Configuring Target Options
Choosing Target Settings
3. Click Add.
The new environment variable appears in the environment list
shown in Figure 9.10 on page 348.
To modify an existing environment variable, follow these steps:
1. Select from the environment list the environment variable that
you wish to modify.
2. Modify the Variable and Value fields as desired.
3. Click Change.
The modifications appear in the environment list shown in Figure
9.10 on page 348.
To delete an existing environment variable, follow these steps:
1. Select from the environment list the environment variable that
you wish to delete.
2. Click Remove.
The selected environment variable is removed from the
environment list shown in Figure 9.10 on page 348.
File Mappings
The File Mappings settings panel, shown in Figure 9.11 on page
351, allows you to associate a file-name extension such as “.c” or
“.p” with a plug-in compiler. This association assigns a particular
CodeWarrior compiler to process files with matching file-name
extensions.
NOTE The IDE recognizes a project’s files based on the file mappings
defined in the File Mappings settings panel. If you have trouble
adding files to your project, or if the IDE refuses a folder or file that
you drag and drop into the Project window, check the File Mappings
settings panel. Because the IDE associates file mappings with the
current linker, the mappings change as you select different linkers.
For more information, see “Linker” on page 337.
IDE–350 IDE User Guide
Configuring Target Options
Choosing Target Settings
Figure 9.11 File Mappings Settings Panel
File Mappings list
The File Mappings list contains a File Type, associated Extension,
and Compiler choice for each file-name extension in the list. This
list determines the compiler that the IDE invokes to process a file
with a matching extension.
To add a new extension to this list, you choose an existing entry in
the list, edit the information in the Mapping Info section as desired,
and click Add.
For example, to add a documentation file mapping to the current
project, you would follow these steps:
1. Choose an existing file mapping.
2. Delete the text in the File Type field.
3. Change the text in the Extension field to “.doc” (without the
quotes).
4. Choose None from the Compiler pop-up menu.
5. Click the Add button.
IDE User Guide IDE–351
Configuring Target Options
Choosing Target Settings
File Type
Enter in this field the file type for the selected file mapping in the
File Mappings list.
Extension
This flag lets you enter a file-name extension, such as the “.c” or
“.h” extensions, for a selected File Type in the File Mappings list.
Table 9.1 shows the default file-name extensions used by the
CodeWarrior IDE.
Table 9.1 Default File-name Extensions
Type Extension Description
Minimum .iSYM CodeWarrior Intel®
CodeWarrior Symbols
Installation
.mch CodeWarrior
Precompiled Header
.mcp CodeWarrior Project File
.SYM CodeWarrior Mac OS
68K Debug Symbols
.xSYM CodeWarrior Mac OS
PPC Debug Symbols
Default .dbg CodeWarrior Debug
CodeWarrior Preferences
Installation .exp Exported Symbol File
.iMAP CodeWarrior Link Map
.MAP CodeWarrior Link Map
.xMAP CodeWarrior Link Map
IDE–352 IDE User Guide
Configuring Target Options
Choosing Target Settings
Type Extension Description
Library .lib Library File
.o Object File
.obj Object File
.pch Precompiled Header
Source File
.pch++ Precompiled Header
Source File
Default .c C Source File
C and C++ .cp C++ Source File
.cpp C++ Source File
.h C and C++ Header File
Default Java .class Java Class File
.jar Java Archive File
.jav Java Source File
.java Java Source File
Default Pascal .p Pascal Source File
.pas Pascal Source File
Assembly .a Assembly Source File
.asm Assembly Source File
.dump CodeWarrior
Disassembled File
C and C++ .c++ C++ Source File
.cc C++ Source File
.hh C++ Header File
.hpp C++ Header File
.i C Inline Source File
.icc C++ Inline Source File
.m Object C Source File
.mm Object C++ Source File
IDE User Guide IDE–353
Configuring Target Options
Choosing Target Settings
Type Extension Description
Java .JMAP Java Import
Mapping Dump
.jpob Java Constructor File
.mf Java Manifest File
Pascal .ppu Pascal Precompiled Unit
Compiler
This pop-up menu allows you to choose a compiler for the selected
File Type in the File Mappings list.
Flags
This pop-up menu allows you to enable and disable flag options.
The File Mappings list contains a column for each flag option. The
following icons label these columns (see Figure 9.11 on page 351):
Resource File Enabling this flag causes the IDE to
include in your finished product the resources from files
with the selected file mapping.
Launchable Enabling this flag causes the IDE to open
the source-code file with the application that created it
after you double-click the file in the Project window.
Precompiled Enabling this flag causes the IDE to
compile files with the selected file mapping before
compiling other files. This flag is useful if the original
files create documents that other source files or
compilers use. For example, this option lets you create a
compiler that translates a file into a C source-code file
and then compiles the C file. YACC (Yet Another
Compiler Compiler) files are treated as precompiled files
because YACC generates C source code to be compiled
by a C compiler.
Ignored by Make Enabling this flag causes the IDE
to ignore files with the selected file mapping when
compiling or linking the project. This flag is useful if the
files contain comments or documentation that you want
to include with your project but ignore during the
compile-and-link process.
IDE–354 IDE User Guide
Configuring Target Options
Choosing Target Settings
Source Trees
The Source Trees settings panel, shown in Figure 9.12, lets you
define project-specific source trees (root paths) for use in your
projects. You can define your project’s access paths and build-target
output in terms of source trees. Using this approach, you can easily
share projects across various hosts. You need only make minor
changes to the source trees’ paths to maintain your project’s
functionality.
Figure 9.12 Source Trees Settings Panel
There is also a Source Trees preference panel that applies globally to
the IDE. For more information about this preference panel, see
“Source Trees” on page 269. The source trees defined in the Target
Settings window can only be used with the current build target in
the active project. You can use the source trees defined in the IDE
Preferences window with all projects. If you define the same source
IDE User Guide IDE–355
Configuring Target Options
Choosing Target Settings
trees in both panels, the target-specific source trees take precedence
over the global source trees.
Source Trees list
This list shows all of the project’s source trees. The list consists of
two columns:
• Name—This column shows the name of each source tree. When
you define access paths in terms of source trees, you use this
name in your access path’s definition. For more information, see
“Add” on page 343.
• Path—This column shows the path to each source tree. You
might need to modify the source trees’ paths when you transfer
your project to a new host. Refer to “Change” on page 359 for
more information about modifying the current path.
Name
Use this field to enter a name for a new source tree, or to change the
name of an existing source tree.This field is part of the Source Tree
Info section shown in Figure 9.12 on page 355.
Type
This field is part of the Source Tree Info section shown in Figure
9.12 on page 355. Use the Type field to choose one of the following
types of source trees:
• Absolute Path—This type of source tree is based on a file path.
• Environment Variable—This type of source tree is based on an
existing environment-variable definition. You cannot create or
modify this type of source tree on the Mac OS-hosted IDE.
• Registry Key—(Windows) This type of source tree is based on
an existing key entry in the registry.
Add
To add a new source tree, first select the appropriate type of source
tree from the Type pop-up menu. Next, enter a name for the new
source tree in the Name field.
When you create an Absolute Path source tree, the Choose button is
available. Click this button to select a path using a standard dialog
box, as shown in Figure 9.13 on page 357 (Windows) and Figure 9.14
on page 358 (Mac OS).
IDE–356 IDE User Guide
Configuring Target Options
Choosing Target Settings
On the Windows-hosted IDE, you can specify how CodeWarrior
stores a path by choosing one of these path type options:
• Absolute Path—Using this option, the IDE stores the path from
the root level of the startup hard drive to the folder whose path
you want to add, including all folders in between. You must
update absolute paths if you move the project to another system,
rename the hard drive, or rename any of the folders along the
path.
Figure 9.13 Access Path Selection Dialog Box (Windows)
• Compiler Relative—Using this option, the IDE stores the path
from the folder that contains the CodeWarrior IDE to the folder
whose path you want to add. You do no need to update
compiler-relative paths if you move a project, as long as the
hierarchy of the relative path is the same. You cannot create a
relative path to a folder on a different hard drive than where
your CodeWarrior IDE resides.
IDE User Guide IDE–357
Configuring Target Options
Choosing Target Settings
Figure 9.14 Access Path Selection Dialog Box (Mac OS)
• System Relative—Using this option, the IDE stores the path
from the operating system’s base folder to the folder whose path
you want to add. You do not need to update system relative
paths if you move a project, as long as the hierarchy of the
relative path is the same. You cannot create a relative path to a
folder on a different hard drive than where your active
operating system’s base folder resides.
NOTE Relative paths allow projects to contain two or more files with
identical names. However, for large projects, you might notice
slower performance when adding relative paths to a project.
When you create an Environment Variable or Registry Key source
tree, the field below the Type pop-up menu becomes available, as
shown in Figure 9.15 on page 359. Enter in this field the path to the
environment variable or registry key.
IDE–358 IDE User Guide
Configuring Target Options
Choosing Target Settings
Figure 9.15 Creating a Registry Key (Windows)
After you finish adding source trees, click the Save button in the
Target Settings window to save your changes. The saved source
trees appear in the path pop-up menus for your project. For
example, if you create a source tree named Sample, you can use it to
create an access path, as shown in Figure 9.16 on page 360. You can
also define your project’s target output in terms of the source trees
by using the Output Directory field in the Target Settings panel. For
more information about this settings panel, refer to “Target
Settings” on page 336.
Change
To change a source tree, first select its name in the Source Trees list.
Next, modify the Name and Type fields as desired. Then click
Change. After you finish modifying the source trees, click Save in
the Target Settings window to save your changes.
IDE User Guide IDE–359
Configuring Target Options
Choosing Target Settings
NOTE After changing a source tree, you might need to modify your project
so that you do not refer to the source tree in its original form.
Therefore, the IDE displays a message reminding you to update
your project.
Figure 9.16 Choosing Source Trees in Access Path Pop-up Menus
If your project’s files or libraries are not in the source trees, the IDE
cannot find them when compiling, linking, or running your project.
Therefore, after you change an existing source tree, the IDE displays
a message reminding you to update your project.
Remove
To remove a source tree, first select its name in the Source Trees
panel. Click Remove to delete the source tree. After you finish
IDE–360 IDE User Guide
Configuring Target Options
Choosing Target Settings
removing source trees, click Save in the Target Settings window to
save your changes.
NOTE After removing a source tree, you might need to modify your project
so that you do not refer to the removed source tree. Therefore, the
IDE displays a message reminding you to update your project.
Code-Generation Settings
The following panels customize the way the IDE generates code:
• Global Optimizations
Global Optimizations
The Global Optimizations panel, shown in Figure 9.17 on page 362,
configures the way the compiler rearranges its object code. You can
set up the compiler to produce smaller and faster-executing object
code. Some optimizations remove redundant program operations,
while other optimizations analyze an item’s use in the program. The
optimizations seek to improve your program’s performance.
All optimizations rearrange object code without affecting the object
code’s logical execution sequence. In other words, an unoptimized
program and its optimized counterpart produce the same results.
NOTE Use compiler optimizations only after you finish debugging your
program. Using a debugger on an optimized program might affect
the debugger’s ability to view source code.
To find specific information on how these settings apply to a build
target, see “Targeting Documentation” on page 29.
IDE User Guide IDE–361
Configuring Target Options
Choosing Target Settings
Figure 9.17 Global Optimizations Settings Panel
Optimize For
Use these options to configure how the CodeWarrior IDE optimizes
your code:
Faster Execution Speed This option improves the execution
speed of object code. Object code is faster, but can be larger.
Smaller Code Size This option reduces the size of object code
produced by the compiler. Object code is smaller, but can be slower.
Optimization Level Slider
Use the slider to determine the optimizations that are applied to
your code. You can choose to disable code optimizations entirely, or
you can choose to apply different levels of optimizations. The
higher the level you select, the more optimizations the IDE applies
to your code.
IDE–362 IDE User Guide
Configuring Target Options
Choosing Target Settings
Details
The Details field, below the Optimization Level Slider, lists the
optimizations applied to the project. The following list describes
each optimization:
• Global Register Allocation—Stores working values of heavily
used variables in registers instead of memory. This option also
appears as Global Register Allocation Only for Temporary
Values when you set the Optimization Level Slider to
“Optimizations Off.”
• Dead Code Elimination—Removes statements that, logically,
can never be executed or are never referred to by other
statements. With this option enabled, object code is smaller.
• Branch Optimizations—The optimizer merges and restructures
portions of the intermediate code translation. These
optimizations eliminate some branch instructions. With this
option enabled, the object-code size is smaller and the execution
speed improves.
• Arithmetic Optimizations—Replaces intensive computational
instructions with faster equivalent instructions that produce the
same result. For example, a multiply instruction can replace
several add instructions. Also, several multiply instructions can
replace a library call for raising a variable to a specified power.
These optimizations result in faster object code.
• Expression Simplification—These optimizations find
equivalent and simplified arithmetic expressions. For example, p
replaces 1*p, p+q replaces p-(-q), x&y replaces x&(x&y), and
x replaces x&(x|y).
• Common Subexpression Elimination—Replaces similar
redundant expressions with a single expression. For example, if
two consecutive statements both use the expression a*b*c+10,
the compiler generates object code that computes the expression
only once and applies the resulting value to both statements.
With this option enabled, object code is smaller and faster.
• Copy Propagation—Replaces multiple occurrences of one
variable with a single occurrence. With this option enabled,
object code is smaller and faster. This option also appears as
Copy and Expression Propagation for some build targets.
• Peephole Optimization—Applies local optimizations to small
sections of your code. With this option enabled, the optimized
code sections are faster.
IDE User Guide IDE–363
Configuring Target Options
Choosing Target Settings
• Dead Store Elimination—Removes assignments to a variable if
the variable is not used before being reassigned again. With this
option enabled, object code is smaller and faster.
• Live Range Splitting—This optimization handles a local
variable used in two completely separate contexts in a program.
For example, note the two disjoint uses of the variable i in
Listing 9.1. The second use of the variable i can be replaced by a
different compiler temporary variable. Live range splitting
reduces the lifetimes of variables so that they can be optimally
allocated. Long live ranges cause unnecessary spilling in
registers.
Listing 9.1 Live Range Splitting Example
int a[100], b[100], c[100], d[100], e[100], f[100];
foo(int n)
{
int i;
for(i=0; i<n; i++)
{
a[i] = b[i] + c[i];
}
for(i=0; i<n; i++)
{
d[i] = e[i] + f[i]
}
• Loop-Invariant Code Motion—Moves computations that do not
change on the inside of a loop to the outside of the loop to
improve the loop’s speed. With this option enabled, object code
is faster.
• Strength Reduction—Replaces multiplication instructions
inside loops with addition instructions to improve the loops’
speed. With this option enabled, object code is larger but
executes faster.
• Loop Transformations—Reorganizes translated code for a loop
in order to reduce the code overhead of setting up the loop or
IDE–364 IDE User Guide
Configuring Target Options
Choosing Target Settings
testing for loop completion. With this option enabled, object
code executes faster.
• Loop Unrolling—This optimization duplicates several times the
code inside the looping structure. This duplication spreads over
more operations the overhead of testing for loop completion and
branching back to the beginning of the loop. This option
improves execution speed, but the object code is larger. This
option also appears as Loop Unrolling (Opt for Speed Only)
when the optimization considers only speed improvements.
• Vectorization—For processors that support vector
optimizations, translates computations with arrays using code
loops into the appropriate vector instructions. This option
translates most types of code loops into vector instructions in
order to accelerate object code.
• Lifetime Based Register Allocation—Also known as Register
Coloring. Uses the same processor register for different
variables in the same routine if the variables are not used in the
same statement. With this option enabled, object code executes
faster.
• Instruction Scheduling—Rearranges a program’s instruction
sequence to reduce conflicts with register use and processor
resources. With this option enabled, object code executes faster.
• Repeated—Iterates the optimizations listed between {* and *}
in the Details field. Iterations provide additional optimization
opportunities.
Editor Settings
The following panels apply to the CodeWarrior Editor:
• Custom Keywords
Custom Keywords
The Custom Keywords settings panel, shown in Figure 9.18 on page
366, lets you define your own keyword sets to associate with certain
colors when they appear in your editor files. These keywords are
project-specific, not global to the CodeWarrior IDE.
See “Text Colors” on page 282 for information on defining keyword
sets, setting colors, specifying keywords, importing keywords, and
exporting keywords.
IDE User Guide IDE–365
Configuring Target Options
Choosing Target Settings
Figure 9.18 Custom Keywords settings panel
To change the color for a keyword set, click its associated color
swatch. To change the contents of a keyword set, click its associated
Edit button to display a dialog box. Using the dialog box, change
the entries as desired.
Debugger Settings
The following panels apply to the CodeWarrior debugger:
• Other Executables
• Debugger Settings
• Remote Debugging
Other Executables
The Other Executables settings panel, shown in Figure 9.19 on page
367, allows you to debug additional executable files along with the
current build target.
Executable Files list
This list shows the executable files that you can debug while
debugging the current build target. The list consists of two columns:
• File—This column shows the path to the executable file.
• Debug—This column indicates the current debugging status of
the executable file.
Click the Debug column to toggle debugging of the desired
executable file. For each executable file, a bullet in the column
indicates that debugging is enabled.
IDE–366 IDE User Guide
Configuring Target Options
Choosing Target Settings
Figure 9.19 Other Executables Settings Panel
Add
To add a new executable file to the Executable Files list, follow these
steps:
1. Click Add.
The Debug Additional Executable dialog box, shown in Figure 9.20
on page 368, appears.
2. Enter the path to the executable file in the File Location field.
Alternatively, click Choose to display a dialog box. Use the dialog
box to select the executable file. The path to the selected executable
file then appears in the field.
3. Configure the Download File During Remote Debugging
checkbox as desired.
Enable the checkbox to download files from a remote computer
during a remote-debugging session. Enter in the Remote download
IDE User Guide IDE–367
Configuring Target Options
Choosing Target Settings
path field the download path for files from the remote computer.
Alternatively, click Choose to open a dialog box and select the path.
Click Clear to remove the existing path from the field.
4. Configure the Debug Merged Executable checkbox as desired.
Enable the checkbox to debug a merged executable file. Specify in
the field the path to the file containing the merged executable file.
Alternatively, click Choose to open a dialog box and select the path.
Click Clear to remove the existing path from the field.
5. Click OK.
The new executable file appears in the Executable Files list of the
Other Executables settings panel.
Figure 9.20 Debug Additional Executable Dialog Box
IDE–368 IDE User Guide
Configuring Target Options
Choosing Target Settings
Change
To modify an existing entry in the Executable Files list, follow these
steps:
1. Select the entry that you wish to modify from the Executable Files
list.
2. Click Change.
Alternatively, double-click the entry. The dialog box shown in
Figure 9.20 on page 368 appears with the details of the entry that
you wish to change.
3. Modify the entry as desired.
Click Clear to remove existing path information from each field.
Click Choose to use a dialog box to select a new path.
4. Click OK.
Your modifications appear in the Executable Files list. Alternatively,
click Cancel to discard your changes and return to the Executable
Files list.
Remove
To remove an existing entry from the Executable Files list, follow
these steps:
1. Select the entry that you wish to delete from the Executable Files
list.
2. Click Remove.
The IDE deletes the selected entry from the Executable Files list.
Debugger Settings
The Debugger Settings panel, shown in Figure 9.21 on page 370,
includes options to log activities, change data-update intervals, and
set other related options.
Location of Relocated Libraries and Code Resources
Enter in this field the path to the relocated libraries and code-
resource files required by the current project. Alternatively, click
Choose to open a dialog box. Use the dialog box to select the
required files.
IDE User Guide IDE–369
Configuring Target Options
Choosing Target Settings
Figure 9.21 Debugger Settings Panel
Stop at temp breakpoint on application launch
Enable this checkbox to stop program execution at a specified
temporary breakpoint at the beginning of a debugging session.
Click the Default radio button to always stop at the main()
function, or click the User specified radio button and enter in the
field the function at which you want to stop.
Auto-target Libraries
This checkbox applies to the current project when you debug a non-
project file. For example, this situation can occur when you attach a
running process. For more information about attaching processes,
see “Processes window toolbar” on page 433.
Enable the Auto Target Libraries checkbox to allow the IDE to
attempt to debug dynamically linked libraries (DLLs) loaded by the
target application. The IDE attempts to automatically debug the
loaded DLLs for which symbolics information is available.
NOTE You might notice slower IDE performance after you enable the Auto
Target Libraries checkbox. If you encounter this problem, try
disabling the checkbox to improve performance.
IDE–370 IDE User Guide
Configuring Target Options
Choosing Target Settings
Cache symbolics between runs
Enable this checkbox to allow the debugger to cache a project’s
symbolics information and refer to that cached information during
subsequent debugging sessions. Disable the checkbox to force the
debugger to discard the project’s symbolics information after each
debugging session. Enabling the symbolics cache is useful for
improving the performance of successive debugging sessions.
Log System Messages
Enable this checkbox to log all system messages to a file. Disable the
checkbox if you do not wish to create a log file. For more
information about viewing log files, see “Log Window” on page
445.
NOTE On the Windows-hosted IDE, log information includes messages
about DLL loading and loading, as well as debug printf()
messages. On the Mac OS-hosted IDE, log information refers to
messages about the loading of PowerPC code fragments, as well as
DebugStr() messages.
Stop at Watchpoints
Enable this checkbox to halt a program’s execution when the
debugger encounters a watchpoint, regardless of whether the
watched value changes. Disable this checkbox to halt execution only
when the watched value changes.
Update Data
Enable this checkbox to update the information in debugging
windows after a specified time interval. Enter an interval in the
Update data every x seconds field, where x represents the number
of seconds you wish to elapse before the next update. Disable the
checkbox if you do not wish to update the debugging information.
In this case, debugging-window information stays the same
throughout the debugging session.
IDE User Guide IDE–371
Configuring Target Options
Choosing Target Settings
Figure 9.22 Remote Debugging Settings Panel
Remote Debugging
The Remote Debugging settings panel, shown in Figure 9.22, lets
you define target-specific remote-debugging connections between
your computer and other computers. You define these target
specific connections in terms of general remote-debugging
connections. Using this approach, you need only make minor
changes to the general connections to maintain remote-debugging
functionality.
You use the Remote Debugging settings panel in conjunction with
the Remote Debugging preference panel to configure remote-
debugging connections for individual projects. For more
information, see “Remote Connections” on page 296.
Enable remote debugging
Enable this checkbox to define a remote-debugging connection
specific to the current build target. Choose from the Connection
pop-up menu the general connection that you wish to use to define
the target-specific connection. For more information about defining
general connections, see “Remote Connections” on page 296.
Remote download path
Enter in this field the path to the folder in which you wish to
download files.
IDE–372 IDE User Guide
Configuring Target Options
Choosing Target Settings
Launch remote host application
Enable this checkbox to launch an application on the remote
computer to serve as a host application. Enter in the associated field
the path to the application that you wish to launch.
IDE User Guide IDE–373
Configuring Target Options
Choosing Target Settings
IDE–374 IDE User Guide
10
Compiling and Linking
This chapter discusses how to compile and link a project to produce
a final executable file, and how to correct common compiler and
linker errors using the Message window in the CodeWarrior® IDE.
The information in this chapter assumes you have already created a
project, added the necessary files, grouped these files, and set the
project’s options. To learn more about these tasks, refer to other
chapters in this book, including “Working with Projects” on page
43, “Working with Files” on page 109, “Editing Source Code” on
page 137, and “Configuring IDE Options” on page 253.
You should also be familiar with the columns and pop-up menus in
the Project window. To learn more about these features, refer to
“Working with Projects” on page 43.
This chapter does not describe in detail the various types of
programs the CodeWarrior IDE can create. For that information,
please see the Targeting manual appropriate for your platform. A
table describing some of these manuals is shown in “Targeting
Documentation” on page 29.
The CodeWarrior IDE can only compile and link files belonging to
an open project. In other words, you should have a project open
before trying to compile any files.
The topics in this chapter are:
• Choosing a Compiler
• Compiling and Linking a Project
• Using Precompiled or Preprocessed Headers
• Preprocessing Source Code
• Disassembling Source Code
• Guided Tour of the Message Window
• Using the Message Window
IDE User Guide IDE–375
Compiling and Linking
Choosing a Compiler
• Special Library Options (Mac OS)
Choosing a Compiler
When you create source-code files, you use a certain programming
language, such as C, C++, or Java. These languages have naming
conventions for the extensions you add to file names. For example,
in the C language, a source code file ends with a “.c” extension and
a header file ends with a “.h” extension.
This section describes how to correctly associate a file extension
with a compiler for a particular language in the CodeWarrior IDE.
Understanding Plug-in Compilers
The CodeWarrior IDE allows compilation of many different
programming languages. The IDE takes a modular approach to
compiling code by using various plug-in compilers.
Plug-ins are basically small, loadable code modules that allow the
IDE to have many different compilers at its disposal. For example,
there are plug-in compilers for C, C++, Pascal, Java, and assembly
language.
Plug-in compilers usually have default build-target settings to help
the CodeWarrior IDE decide which project files a plug-in handles.
During regular compile and link operations, the IDE assigns files to
the proper plug-in automatically.
Setting a File Extension
To associate a plug-in compiler with a given file, you must
configure the options in the File Mappings settings panel. For a
description of how to configure these options to assign a compiler to
your source code files, refer to “File Mappings” on page 350.
IDE–376 IDE User Guide
Compiling and Linking
Compiling and Linking a Project
Compiling and Linking a Project
The CodeWarrior IDE provides many different ways to build a
project. When you build a project, you compile it into object code
and then link the object code into a final executable file.
All compiling and linking commands are available from the Project
Menu. Depending on your project type, some of these commands
might be disabled or have different names. For example, you cannot
Run a shared library, but you can Make it. Also, a command for
compiling or linking might be dimmed because CodeWarrior is
busy executing another command, or the project is being debugged.
The CodeWarrior IDE can only compile and link files belonging to
an open project. That is, you should have a project open before
trying to compile any files.
If you have multiple projects open at the same time, you might want
to learn about selecting a default project before compiling and
linking. For more information, refer to “Choosing a Default Project”
on page 71.
The topics in this section are:
• Compiling Files
• Setting Link Order
• Updating a Project
• Making a Project
• Enabling Debugging
• Running a Project
• Debugging a Project
• Generating a Link Map
• Synchronizing Modification Dates
• Handling Object Code
• Advanced Compile Options
IDE User Guide IDE–377
Compiling and Linking
Compiling and Linking a Project
Compiling Files
You can instruct CodeWarrior to compile a single file or to compile
only certain files in your project. Of course, CodeWarrior can also
compile all of the files in your project.
You might want to switch between multiple build targets in a
project when compiling files. To learn more, refer to “Setting the
Current Build Target” on page 95.
The Compile command in the Project Menu is grayed out in the
following situations:
• There is no open project.
• The active editor window does not have a source-code file name
extension.
• The active window’s source code file is not included in your
project.
• (Windows) The binary file, such as the application you created
from the project, is running under the debugger.
• (Windows) An application created from the project is running.
As CodeWarrior compiles source-code files and libraries in the open
project, it highlights them in the Project window. The Build
Progress window (Figure 10.1) displays a line count and the name
of the file being compiled.
A status line displaying the total number of files to be compiled and
the number of files being compiled is also provided at the bottom of
the Project window.
Figure 10.1 Build Progress window
IDE–378 IDE User Guide
Compiling and Linking
Compiling and Linking a Project
Compiling One File
To compile a single file in your project, select that file in the Project
window and choose Compile from the Project Menu.
Alternatively, you can open the file in the CodeWarrior editor,
make the editor window the active window, and choose Compile
from the Project Menu.
Compiling Selected Files
You can compile several files in your project by selecting those files
in the Project window and then choosing Compile from the Project
Menu. To learn how to select several files in your project, refer to
“Selecting Files and Groups” on page 73.
Recompiling Files
CodeWarrior does not always recognize file changes and might not
automatically recompile the file. You can force CodeWarrior to
recompile a changed file by “touching” that file. To learn how to
touch a file, refer to “Touching and Untouching Files” on page 87.
After touching the file or files that you want to recompile, choose
Bring Up To Date or Make from the Project Menu.
Setting Link Order
You can specify the order in which the IDE compiles files by using
the Link Order View of the Project window. By re-arranging the
order of the files, you can prevent linkage errors caused by file
dependencies. In other words, if file Aleph depends on the
completed compilation of file Zeta, you can use change the link
order and position file Zeta to compile before file Aleph, thus
preventing an error message.
To set the link order in the current project:
1. Click the Link Order tab in the Project window.
The Link Order view appears in the Project window.
2. Sort the files into the desired link order.
Drag and drop each file into the desired build order.
IDE User Guide IDE–379
Compiling and Linking
Compiling and Linking a Project
The next time you Bring Up To Date, Make, Run, or Debug the
project, the IDE uses the new build order.
See “Link Order View” on page 53 for additional information.
NOTE (Mac OS) If you are building a 68K project, the Link Order tab is
named the Segments tab.
Updating a Project
When you have many newly-added, modified, or touched files in
your project, you can use the Bring Up To Date command in the
Project Menu to compile all of the files.
When using this command, the linker is not invoked, so the
compilation does not produce an output binary of your project. The
Bring Up To Date command only runs the compiler.
You might want to switch between multiple build targets when
updating a project. To learn how to do this, refer to “Setting the
Current Build Target” on page 95.
Making a Project
When you are ready to produce a binary file, such as an application,
library, or shared library, use the Make command in the Project
Menu. This command builds the selected project type by updating
the newly-added, modified, and touched files, and then linking the
project into a final executable file.
The results of a successful build depend on the selected project type.
For example, if the project type is an application, the Make
command builds an application and saves that application in the
same folder as your project. Table 10.1 lists some sample project
types and the resulting files after issuing a Make command. To find
a full list of the types of software products you can produce, refer to
the Targeting manual for your build target. See “Targeting
Documentation” on page 29 to determine which manual applies to
various build targets.
IDE–380 IDE User Guide
Compiling and Linking
Compiling and Linking a Project
Table 10.1 Sample files produced for certain project types
Project Type Build Target Make Command Creates…
Application Win32 Win32 Application
Library 68K/PowerPC Mac OS A4 or A5 Library
Dynamic link Solaris Solaris Shared Library (.o)
library
Once all the modified files and touched files have been compiled
successfully, CodeWarrior links all the files in the project to produce
your output binary. If the project has already been compiled using
Bring Up To Date or another command, then the Make command
only links the compiled source code files together.
You might want to switch between multiple build targets in a
project when making that project. Refer to “Setting the Current
Build Target” on page 95 for more information.
Enabling Debugging
After you choose Project > Enable Debugger, the IDE activates the
debugger. The following changes take place:
• The Enable Debugger menu command changes to the Disable
Debugger menu command
• The Run menu command changes to the Debug menu
command
The CodeWarrior debugger is now ready to debug your project. To
learn how to generate debugging information for all of your
project’s files, see “Controlling Debugging in a Project” on page 104.
After you choose Project > Disable Debugger, you can run your
project normally, without the debugger’s control. The following
changes take place:
• The Disable Debugger menu command changes back to the
Enable Debugger menu command
• The Debug menu command changes back to the Run menu
command
IDE User Guide IDE–381
Compiling and Linking
Compiling and Linking a Project
To learn more about running your project, see the following section,
entitled “Running a Project.”
Running a Project
After you choose Project > Run, the IDE compiles and links the
project (if necessary), creates a stand-alone application, and then
launches that application.
If the current project is not an executable file, the Run command is
not available. Non-executable projects include libraries, shared
libraries, dynamic linked libraries (DLLs), code resources, and tools.
When compiling and linking is successful, CodeWarrior saves the
new application to your hard disk. The new application is named
according to options you set in the Target Settings window. If you
would like to change these options, refer to “Choosing Target
Settings” on page 335.
If the current project is designed to operate on another platform,
you must connect your host computer to the target computer or
device before choosing the Run command. For additional
information, see the appropriate Targeting manual for the target
platform.
Debugging a Project
Debugging a project begins a debugging session with the
CodeWarrior debugger. The debugger allows you to examine your
program’s execution. You can also correct errors in your program.
To debug your project, follow these steps:
1. Ensure that the CodeWarrior debugger is active.
To learn how to activate the debugger, see “Enabling Debugging”
on page 381.
2. Ensure that your project is properly configured for debugging.
If your project is not properly prepared for debugging, a dialog box
appears after you activate the debugger. Click Yes in this dialog box
to allow the IDE to automatically configure your project for
debugging.
IDE–382 IDE User Guide
Compiling and Linking
Compiling and Linking a Project
3. If your project contains more than one build target, choose the
build target that you wish to debug.
For more information, see “Setting the Current Build Target” on
page 95.
4. If your project is designed to operate on another platform, connect
your host computer to the target computer or device.
For additional information, see the CodeWarrior Targeting
documentation for your target computer or device. You can find
this documentation on your CodeWarrior CD(s).
5. Choose Project > Debug.
The IDE compiles and links your project while generating
debugging information. After the compile-and-link phase
completes, the CodeWarrior debugger loads the debugging
information and starts a debugging session.
If the Debug menu command is grayed out or not visible, see
“Enabling Debugging” on page 381. If the Debug command is still
unavailable, you are probably attempting to debug a project whose
type cannot run (such as a shared library or dynamic link library).
Another possibility is that the application that you are attempting to
debug is already running.
NOTE The Debug menu command does not open any application that you
might need in order to debug your project. For example, if you
debug a project for an Adobe® Photoshop® plug-in, Photoshop must
already be running before you can debug the project. Choosing
Debug does not automatically open Photoshop.
Generating a Link Map
The CodeWarrior C/C++ compilers let you create a link-map file
that contains function and class-section information about the
generated object code.
CodeWarrior’s Pascal compilers let you create a make-map file that
contains a list of dependencies and the compilation order.
The settings to control this option are in the build target’s Linker
panels. After configuring these panels as desired, you must Make
IDE User Guide IDE–383
Compiling and Linking
Compiling and Linking a Project
your project. If the compile and link operations are successful, the
IDE generates a link-map file, names the file after your project, adds
a .MAP extension, and saves the link-map file in your project folder.
To learn more about a build target’s Linker panels, see the
discussion in the appropriate Targeting manual.
Synchronizing Modification Dates
If you want to update the modification dates of all the files stored in
the project, choose the Synchronize Modification Dates command
from the Project Menu.
To learn more about this topic, see “Synchronizing modification
dates” on page 88.
Handling Object Code
After compiling your project, the CodeWarrior IDE adds the object
code from each source file to the project file. This binary object code
increases the project file’s size. You can remove this additional
object code if you want the project file to consume less space on
your hard disk, or if you want to remove all object code and restart
the compilation process. You can also choose to mark your project’s
files for re-compilation, leaving existing object code intact.
Removing Object Code
In some cases, you might wish to remove all of the object code from
your project and restart the compilation process.
To remove all of the object code from a project, follow these steps:
1. Choose Project > Remove Object Code.
The dialog box shown in Figure 10.2 on page 385 appears.
2. Enable the Compact Targets checkbox.
After enabling this checkbox and completing the following step, the
IDE deletes the following items:
• Target data files. The names of these files end with a .tdt
extension.
IDE–384 IDE User Guide
Compiling and Linking
Compiling and Linking a Project
• Browser data (if you configured the project to produce it)
• Dependency information
• Additional data cached by the IDE during a build
After deleting these files, the IDE resets to zero the numbers in the
Code column and Data column of each file. The next time the IDE
builds your project, it re-creates the target data files.
Figure 10.2 Remove Object Code Dialog Box
3. Confirm the removal of the object code from your project.
The dialog box contains various buttons for removing object code,
depending on the number of build targets in your project:
• Click Cancel if you no longer wish to remove the object code.
The IDE leaves your project’s object code intact, even if you
enabled the Compact Targets checkbox.
• If your project contains only one build target, click OK to
remove the object code from that build target.
• If you project contains more than one build target, click Current
Target to remove object code only from the current build target,
or click All Targets to remove object code from all build targets
in the project.
To learn how to change the current build target of your project, refer
to “Setting the Current Build Target” on page 95.
IDE User Guide IDE–385
Compiling and Linking
Compiling and Linking a Project
Marking a Project for Re-compilation
In some cases, you might wish to mark your project’s files for re-
compilation while leaving the existing object code in your project
intact.
To mark a project for re-compilation, follow these steps:
1. Choose Project > Remove Object Code.
The dialog box shown in Figure 10.2 appears.
2. Disable the Compact Targets checkbox.
Disabling this checkbox preserves existing target data files in your
project. These files end with a .tdt extension.
3. Confirm the marking of the project’s files for re-compilation.
The dialog box contains various buttons for marking your project’s
files for re-compilation, depending on the number of build targets in
the project:
• Click Cancel if you no longer wish to mark your project’s files
for re-compilation. The IDE leaves your project intact.
• If your project contains only one build target, click OK to mark
all of your project’s files for re-compilation.
• If you project contains more than one build target, click Current
Target to mark only those files in the current build target for
compilation, or click All Targets to mark all files in the project.
To learn how to change the current build target of your project, refer
to “Setting the Current Build Target” on page 95.
Advanced Compile Options
This section describes two options that speed up your project-build
times or alert you when a build is completed.
Alerting Yourself After a Build (Mac OS)
You can start a project compile/link cycle in CodeWarrior, then
switch to another application running on your machine. To learn
how to receive notification when CodeWarrior completes the build
process, refer to “Play sound after ‘Bring Up To Date’ & ‘Make’
(Mac OS, Solaris, and Linux)” on page 258.
IDE–386 IDE User Guide
Compiling and Linking
Using Precompiled or Preprocessed Headers
Speeding Up a Build by Avoiding Date Checks
To learn how to optimize the speed of your builds in CodeWarrior,
refer to “Use modification date caching” on page 346.
Using Precompiled or Preprocessed Headers
Source code files in a project typically use many header files (“.h”
or “.hpp” files). Often, several different source-code files include
the same header file, forcing the compiler to (inefficiently) read the
same header file many times during the compilation process. Many
programming languages support precompiled headers, including C
and C++.
To shorten the time spent compiling and recompiling a header file,
use the Precompile command in the Project Menu. A precompiled
header file takes the compiler significantly less time to process than
an ordinary, uncompiled header file.
For instance, a header file that contains the most frequently used
headers in your project could be made into one precompiled header
file. Instead of having to compile the same thousands of lines of
header files for each source file in your project, the compiler only
has to load one precompiled header file.
WARNING! You can only include one precompiled header in a source file.
Including more than one precompiled header results in an error. If
an error occurs, try including the precompiled header as a prefix file.
TIP The precompiled header format frequently changes in order to
accommodate new features in CodeWarrior IDE updates.
Therefore, precompiled header formats are often incompatible
between different IDE versions. After installing a new CodeWarrior
IDE update, you usually need to update your precompiled headers
to use the new format. You can also configure your precompiled
headers to automatically update to the new format. See “Automatic
updating” on page 389 for more information.
The topics in this section are:
IDE User Guide IDE–387
Compiling and Linking
Using Precompiled or Preprocessed Headers
• Creating Precompiled Headers
• Defining Symbols For C/C++
• Defining Symbols For Pascal
Creating Precompiled Headers
To create a precompiled header file, you must first open a project.
The settings from this project are used when precompiling. A file to
be precompiled does not have to be a header file (“.h” or “.hpp”),
but it must meet these requirements:
• The file must be a text file. You cannot precompile libraries or
other files.
• The file must be saved with a recognized extension, such as
“.pch” or “.pch++,” at the end of its file name.
• The file does not have to be in a project, although a project must
be open to precompile.
• The file must not contain any statements that generate data or
code. However, C++ source code can contain inline functions
and constant variable declarations (const).
• Precompiled header files for different build targets are not
interchangeable. For example, to generate a precompiled header
for use with Win32 compilers, you must use a Win32 compiler.
• A source file can include only one precompiled header file using
the #include directive.
To create a precompiled header file, create a text file using New
Text File in the File Menu. In that text file, place your #include
directives. For example, if you want to create a precompiled header
file of the files string.h and stdio.h, place the following in your
text file:
#include <stdio.h>
#include <string.h>
After you save the text file, the IDE can use that text file to create a
precompiled header. You can specify the name of the precompiled
header at the time of precompilation. You can also specify the name
by including the following line at the beginning of your text file,
where name is the name you wish to call the precompiled header:
IDE–388 IDE User Guide
Compiling and Linking
Using Precompiled or Preprocessed Headers
#pragma precompile_target "name"
Windows Append the extension “.mch” to name. This extension
is required for precompiled headers.
Precompile command
To precompile a saved text file, choose Precompile from the Project
Menu. This command precompiles the text file in the active
window, creating a precompiled header file. If compiler errors are
detected, a Message window appears.
To learn more about the Message window and correcting compiler
errors, consult “Correcting Compiler Errors and Warnings” on page
400.
To learn more about automatic updating of precompiled headers,
see the next section, “Automatic updating.”
Automatic updating
If the source code has been modified, the CodeWarrior IDE
automatically updates a precompiled header during a Make or
Bring Up To Date operation.
If CodeWarrior encounters a “.pch” or “.pch++” file that was
modified since it was last precompiled, the IDE precompiles it again
to ensure that the resulting precompiled header is up-to-date.
To create a precompiled header file that is automatically updated,
open the project that uses the precompiled header. Then, create a
text file that will be used to create the precompiled header.
To read about the requirements for a precompiled header text file,
refer to “Creating Precompiled Headers” on page 388.
In the first line of the text file, add the line:
#pragma precompile_target "name"
This pragma tells the compiler to create a precompiled header with
the file name of name.
Windows Append the extension “.mch” to name. This extension
is required for precompiled headers.
IDE User Guide IDE–389
Compiling and Linking
Using Precompiled or Preprocessed Headers
When you finish the text file, save it with a valid extension in the
same folder as your project.
Windows Save the text file with a “.pch” extension if it will be
used to create a precompiled header in either C or C++.
Mac OS Save the text file with a “.pch” extension if it will be
used to create a precompiled header in C. Use the “.pch++”
extension if the text file will be used to create a precompiled header
in C++.
Next, choose Precompile from the Project Menu.
Now add the text file to the open project using the Add Window
command in the Project Menu.
Whenever the precompiled header file is modified, the
CodeWarrior project manager automatically updates the header file
by precompiling it.
To include the precompiled header in a project source-code file, add
this line as the first #include directive in the source-code file:
#include "name"
Alternatively, you can specify a precompiled header as a prefix file,
using the settings for your build target. To learn how to do this,
refer to the discussion of the C/C++ Language settings panel in the
C Compiler Reference
NOTE Do not use the precompiled header text file (“.pch” or “.pch++”) in
#include directives; use the name of the resulting precompiled
header file instead (“.mch”). Although using the precompiled header
text file is legal and does not affect the final binary, you are not
taking advantage of the precompiled header’s speed.
Defining Symbols For C/C++
To automatically update and add predefined symbols and other
preprocessor directives, you can create a precompiled header file,
add it to your project, and include it in the prefix file specified in the
C/C++ Language settings panel.
IDE–390 IDE User Guide
Compiling and Linking
Using Precompiled or Preprocessed Headers
1. Create a new text file.
Open your project and create a new text file with the New Text File
command on the File Menu.
This new text file will contain your preprocessor directives. You will
use this file as a precompiled header file that you will add to your
project.
2. Open the C/C++ Compiler settings panel.
Choose Target Settings from the Edit Menu. The actual name of the
Target Settings command includes the name of the current build
target. Select the C/C++ Language settings panel in the Target
Settings window.
3. Get the Prefix File name if it exists.
If there is a file name in the Prefix File field, Copy it, then close the
Target Settings window.
In the new text file window, paste the file name that you copied
from the Prefix File field into an #include directive. Make sure
this is the first directive in the text file.
For example, if the prefix file is MyHeaders, then the first directive
in the text-file window is:
#include <MyHeaders>
4. Add the #pragma statement.
Add the #pragma precompile_target statement to the text file.
This statement lets you name the precompiled file. For example, to
create a file named MyPrecomp, use the following statement:
#pragma precompile_target "MyPrecomp"
Windows Append the extension “.mch” to the desired file name.
This extension is required for precompiled headers. In this example,
“MyPrecomp.mch” is the correct file name.
5. Type in all your own preprocessor directives.
Type in all your own #define, #include, and other preprocessor
directives corresponding to the needs of your source code. The text
file cannot contain any source code that generates data or executable
code. However, C++ source code can contain inline functions and
constant variable declarations (const).
IDE User Guide IDE–391
Compiling and Linking
Using Precompiled or Preprocessed Headers
6. Save the text file.
Choose Add Window from the Project Menu to add the text file to
your project. Save the text file with a valid extension in the same
folder as your project.
Windows Save the text file with a “.pch” extension.
Mac OS Save the text file with a “.pch” extension if it will be
used to create a precompiled header in C. Use the “.pch++”
extension if the text file will be used to create a precompiled header
in C++.
7. Precompile the text file.
Choose Precompile from the Project Menu. The IDE uses the text
file to create a precompiled header file.
8. Open the C/C++ Compiler settings panel.
Choose Target Settings from the Edit Menu and select the C/C++
Language settings panel.
9. Set the new Prefix File.
In the Prefix File field, enter the name of your precompiled file, or
“MyPrecomp” in this example. Click Save to save your changes.
Windows In this example, you would enter “MyPrecomp.mch”
in the Prefix File field.
Whenever CodeWarrior builds your project, the project manager
updates your precompiled header and automatically includes it in
each source code file.
Defining Symbols For Pascal
Although the Pascal preprocessor is not as powerful as the C/C++
preprocessor, you can still create files that can automatically insert
your own preprocessor symbols and compiler directives into your
project.
1. Create a new text file.
Open your project and create a new text file with the New Text File
command.
This new text file will contain your compiler directives.
IDE–392 IDE User Guide
Compiling and Linking
Using Precompiled or Preprocessed Headers
2. Open the Pascal Compiler settings panel.
Choose Target Settings from the Edit Menu. The actual name of the
Target Settings command includes the name of the current build
target. Select the Pascal Language settings panel in the Target
Settings window.
3. Get the Prefix File name if it exists.
If there is a file name in the Prefix File field, Copy it, then close the
Target Settings window.
In the new text file window, paste the file name that you copied
from the Prefix File field into an include directive, {$I}. Make sure
this is the first directive in the file.
For example, if the prefix file is OtherDefs.p, then the first
directive in the editor window is:
{$I OtherDefs.p}
4. Type in all your own {$SETC}, {$I}, and other preprocessor
directives.
The text file cannot contain any source code that generates data or
executable code.
5. Save the text file.
Save the file as an ordinary Pascal file in the same folder as your
project. For example, save the file with “MyPrecomp.pas” as its
name.
6. Precompile the text file.
Choose Precompile from the Project Menu. The IDE uses the text
file to create a precompiled header file.
7. Open the Pascal Compiler settings panel.
Choose Target Settings from the Edit Menu, and select the Pascal
Language settings panel.
8. Set the new Prefix File.
In the Prefix File field, enter the name of your file, in this example
“MyPrecomp”, then click Save to save your changes.
Whenever CodeWarrior builds your project, the project manager
automatically includes the precompiled header in each source code
file.
IDE User Guide IDE–393
Compiling and Linking
Preprocessing Source Code
Preprocessing Source Code
The preprocessor prepares source code for the compiler. This
preprocessor interprets directives beginning with the “#” and “$”
symbols (such as #define, $pragma and #ifdef), removes
extra spaces and blank lines, and removes comments (such as /
*…*/ and //). You might want to preprocess a file if you want to
see what the code looks like just before compilation.
Open a file that you want to preprocess, or select a file in your
currently-open Project window. To preprocess a file, select the
Preprocess command from the Project Menu. The results of the
Preprocess command are stored in a new file. This new file is named
after the preprocessed source-code file and begins with the “#”
character.
To save the contents of the new window, choose one of the save
commands in the File Menu.
Disassembling Source Code
If you want to see the code that would be generated for your file,
you can disassemble the file. Disassembling is useful if you want to
view the machine-level code that is being executed when your
source code is executed. In addition, the disassembled code can be a
model for writing your own assembly routines. Library files can
also be examined using this command.
The Disassemble command in the Project Menu disassembles the
compiled source-code file selected in the Project window and
displays its assembly-language code in a new window. The title of
the new window consists of the name of the source code file with
the extension “.dump.”
To save the contents of the “.dump” window, choose one of the save
commands in the File Menu.If the file being disassembled has not
been compiled, choosing the Disassemble command causes the IDE
to compile the file before disassembling it.
IDE–394 IDE User Guide
Compiling and Linking
Guided Tour of the Message Window
Guided Tour of the Message Window
The Message window, shown in Figure 10.3, is used to display
messages about events that have occurred when compiling, linking,
or searching files. There are a number of elements in the window
that are useful for accomplishing certain tasks, such as navigating to
error locations and scrolling to see all messages for a project.
There are some user interface items in the Message window that are
not discussed here. To learn about the Marker Pop-Up Menu,
Document Settings Pop-Up Menu, Path Pop-Up Menu (Mac OS),
File Path Caption and Line and Column Indicator, refer to “Guided
Tour of the Editor Window” on page 137.
The topics in this section include:
• Error Button
• Warning Button
• Project Information Caption
• Extra Information Button
• Stepping Buttons
• Message List Pane
• Source Code Disclosure Triangle
• Source Code Pane
• Pane Resize Bar
Error Button
The Error Button in the Message window toggles the view of
error messages on and off. This is useful if you have
changed the view of the window to something else and want
to get back to viewing the error messages.
To learn more about seeing error messages in the Message window,
refer to “Seeing Errors and Warnings” on page 398.
Warning Button
The Warning Button in the Message window toggles the
view of warning messages on and off
IDE User Guide IDE–395
Compiling and Linking
Guided Tour of the Message Window
To learn more about seeing error messages in the Message window,
refer to “Seeing Errors and Warnings” on page 398.
Figure 10.3 The CodeWarrior Message Window
Project Information Caption
The Project Information Caption gives a short description of the
view you are looking at in the Message window. Your project name
will appear here.
IDE–396 IDE User Guide
Compiling and Linking
Guided Tour of the Message Window
Extra Information Button
The Extra Information Button expands a message to show
information about the project, target, and file that caused the
message.
Stepping Buttons
The Stepping Buttons allow you to step up or down through the
messages in the window.
To learn more about stepping through messages in the Message
window, refer to “Stepping Through Messages” on page 400.
Message List Pane
The Message List Pane displays your messages.
To learn more about seeing messages in the Message window, refer
to “Seeing Errors and Warnings” on page 398.
Source Code Disclosure Triangle
The Source Code Disclosure Triangle allows you to hide the Source
Code Pane of the Message window.
Source Code Pane
The Source Code Pane of the Message window allows you to view
the source code at the location referred to by a message. To learn
more about the view in this window, refer to “Seeing Errors and
Warnings” on page 398.
Pane Resize Bar
The Pane Resize Bar allows you to reallocate the amount of space in
the Message window given to the Source Code Pane and Message
List Pane. By clicking and dragging this bar up or down you will
change the amount of space on your computer screen that is
allocated to both panes.
IDE User Guide IDE–397
Compiling and Linking
Using the Message Window
Using the Message Window
While compiling your project, the CodeWarrior IDE may detect a
syntax error or other type of compiler error in one of your project’s
source code files. If this happens, the Message window displays the
total number of errors and warnings, and information about each
one. See “Guided Tour of the Message Window” on page 395 for
information on the interface items in this window.
In this section, you will learn how to interpret, navigate, and use the
information that appears in the Message window. The topics in this
section include:
• Seeing Errors and Warnings
• Stepping Through Messages
• Correcting Compiler Errors and Warnings
• Correcting Linker Errors
• Correcting Pascal Circular References
• Saving and Printing the Message Window
• Locating Errors in Modified Files
Seeing Errors and Warnings
The Message window displays several types of messages:
Select this … To display this…
Errors Either compiler or linker errors. Both types of
errors prevent the compiler and linker from
creating a final binary.
IDE–398 IDE User Guide
Compiling and Linking
Using the Message Window
Select this … To display this…
Warnings Either compiler or linker warnings. Neither
type prevents the CodeWarrior IDE from
creating a binary. However, they indicate
potential problems during run time. You can
specify which conditions lead to warning
messages or you can upgrade all warnings to
errors.
Notes All other types of messages issued in the
Message window. For example, results of a
batch find are notes messages.
To close the Message window, click its close box or select Close in
the File Menu while the Message window is the active window. If
you close the message window and want to see it again, choose the
Errors & Warnings command from the Window Menu to reopen it.
To see only error messages in the Message List Pane, click on the
Error Button and turn off the Warning Button.
To see only warnings in the Message List Pane, click the Warning
Button and turn off the Error Button.
To see both errors and warnings in the Message List Pane, click both
buttons. Notes do not appear in the Errors & Warnings window.
You’ll also see other types of messages from time to time in a
Message window, such as:
• During Add Window or Add Files when a file being added does
not reside on an existing access path.
• During linking when a project contains conflicting resources.
• (Mac OS) During a Find Reference when more than one
definition for the same function is found (multiple definitions).
• (Mac OS) During a Find Reference on a C++ function that has
been overridden, the Message window appears with a warning
that there are two or more instances.
IDE User Guide IDE–399
Compiling and Linking
Using the Message Window
Stepping Through Messages
When the compiler finds errors during a build, or the CodeWarrior
IDE search command finds text you asked it to look for when
searching multiple files, you will see the message window.
The window is divided into two panes:
• Message List Pane, which lists the messages, or
• Source Code Pane, which displays the source code for the
selected message.
See “Guided Tour of the Message Window” on page 395 for
information on the interface items in this window.
To step through the list of messages, click the up or down Stepping
Buttons or click the error message you are interested in.
To navigate the source code that is shown in the Source Code Pane
for a given message, you use the Interface Pop-Up Menu, Function
Pop-Up Menu, or the Line and Column Indicator. To learn about
how to use these navigational features, refer to “Guided Tour of the
Editor Window” on page 137.
Correcting Compiler Errors and Warnings
When an error occurs during compilation, the Message window will
show you the error message in the Message List Pane. The location
in the source code that the message refers to will be shown in the
Source Code Pane. You can navigate to the spot in your source code
where the message refers to, and inspect or correct your code.
Correcting Errors in the Source Code Pane
To correct a compiler error or warning, you must first find the
cause. First, make sure that the Source Code Pane of the Message
window is visible. If it isn’t visible, refer to “Source Code Disclosure
Triangle” on page 397 to learn how to make it visible.
To view the statement that the compiler believes has caused the
error or warning, select the message in the Message List Pane of the
Message window. Notice that the Source Code Pane view now
shows the source code that corresponds to the message. A statement
IDE–400 IDE User Guide
Compiling and Linking
Using the Message Window
arrow points to the line of code that the compiler reports as an error.
The statement arrow is shown in Figure 10.4. Using the statement
arrow as a guide, you can then edit the erroneous line directly in the
Source Code Pane view.
Use the Interface Pop-Up Menu, Function Pop-Up Menu, or the
Line and Column Indicator in the Source Code Pane to navigate
your code or open interface files. To learn about how to use these
navigational features, refer to “Guided Tour of the Editor Window”
on page 137.
Opening the File for the Corresponding Message
To open a source code file that corresponds to a given message,
select the message in the Message List Pane and press Enter/
Return. You may also double-click the message in the Message List
Pane to open the relevant file.
Figure 10.4 Statement arrow pointing to an error
Statement arrow
Correcting Linker Errors
When your project is linked, any errors that may occur can be
viewed and corrected.
Viewing Linker Errors
If the linker encounters any errors while linking your project, the
Message window appears indicating these errors. This window can
be scrolled through by using the scroll bar or Stepping Buttons.
To learn about how to scroll through messages in the Message
window, refer to “Stepping Buttons” on page 397. To learn about
IDE User Guide IDE–401
Compiling and Linking
Using the Message Window
changing the view of messages in the Message window, refer to
“Seeing Errors and Warnings” on page 398.
Since Linker errors are a result of problems in the object code, the
CodeWarrior IDE cannot show their corresponding errors in the
project’s source code files.
Why Linker Errors Occur
Linker errors are usually the result of one of the following
circumstances:
• You have misspelled the name of a library routine. This means
that the routine that the Linker is searching for does not exist.
Check the name of the routine to make sure it is spelled
correctly.
• Your compiled code generates a reference too large to be
handled by the selected code model.
• Your project is missing the necessary libraries. Linker error
messages of this type occur when the project is missing a library.
To find out which libraries or shared libraries should be added
to your project, refer to the CodeWarrior Targeting manual
appropriate for your platform, as described in “Targeting
Documentation” on page 29.
NOTE (Mac OS) To find the libraries you should be using, refer to the next
section, “Finding Which Library to Use (Mac OS).”
Finding Which Library to Use (Mac OS)
Often a linker error occurs when a library is missing from a project.
As a result, one or more functions or identifiers cannot be found and
the linker reports a problem. The difficulty you face is trying to
figure out which library defines the function or identifier.
To find out which libraries or shared libraries should be added to
your project, you can refer to the CodeWarrior Targeting manual
appropriate for your target, as described in “Targeting
Documentation” on page 29. In addition, you can use the Find
Library tool included on the CodeWarrior Tools CD.
Find Library is a set of files with the internal names of functions and
global identifiers from many of the libraries included with the
IDE–402 IDE User Guide
Compiling and Linking
Using the Message Window
CodeWarrior IDE for Mac OS and ANSI Libraries. Use these files as
a file set with the CodeWarrior IDE Find dialog box. Search for the
missing identifier in these files, and you can quickly find the right
library to include in your project.
Here’s how to use the Find Library tool.
1. Create a File Set.
Use the Find window to create a file set that includes all the files in
the Find Library folder on your CodeWarrior Tools CD. To learn
how to create and use a file set, refer to “In Files” on page 189.
2. Set the search parameters to ignore case.
Be sure to disable the Case sensitive checkbox in the Find window.
Some identifiers may be all uppercase or lowercase.
3. Search for the symbol that the linker cannot find.
Enter the name of the unlinked symbol, and do a batch search of the
Find Library file set. When the search has found a matching
identifier, you only need to check the file name of the library to
determine the name of the library to include in your CodeWarrior
project. There is no path information given in the files, so you'll
have to locate the correct library in the appropriate CodeWarrior
subdirectory on your hard disk.
For example, if you do a batch search for the identifier num2dec in
this file set, you'll get a match in the MathLib file. You now know
that if you want to use the num2dec function, you must include the
MathLib file in your project.
WARNING! The files in the Find Library folder are just compilations of names
that have been taken out of the libraries and put into a special
naming file. These are not the actual library files. Do not include the
‘Find Library’ files in your projects.
NOTE Some names may be duplicated in more than one file. If the name
has a leading period, it is probably a declaration in that file, not a
definition. Be sure to use Command-G or batch search to retrieve all
files with matching identifiers. Then select the appropriate library for
your particular project.
IDE User Guide IDE–403
Compiling and Linking
Using the Message Window
Some of the 68K and PowerPC shared libraries differ slightly,
although the library names are the same. To identify the correct
library, we’ve added the suffix -68K or -PPC as appropriate. For
example, DragLib is listed in the Find Library as both DragLib
-68k and DragLib -PPC. Ignore the suffix when looking for the
library by name, but make sure you include the correct CPU version
of the library for your target platform.
The CodeWarrior IDE will report the lines on which matches occur,
but you can ignore those line numbers. The line information
reported is irrelevant with respect to the actual library, and refers
only to the line number in the special naming file.
There are several versions of the ANSI Libraries. They all contain
the same identifiers, so only one version is included. You should
assume that the appropriate library for your project will contain the
same functionality.
The ANSI C++ Library file will be difficult to understand because of
name mangling. However, most linker errors will list a function
name as well as the identifier. Searching for that function name
should give you good results. For example, you might get an error
message saying “__aad__9bitstringFRC9bitstring in
bitsand.c” is unknown. You could either search for the mangled
name or you could search for bitsand to get a match.
Correcting Pascal Circular References
The CodeWarrior Pascal compiler’s Make and Run commands
build your project by examining every Pascal file in your project
file. As this examination is performed, a tree of dependencies is
built for the interfaces of your units and for their implementations.
A circular reference occurs when a unit declares something that is
used in another unit and that same unit declares something used by
the former. To break this loop, the Pascal compiler does not allow
such things among the interface parts of units, but it is permitted for
implementations.
The example in Listing 10.1 is perfectly valid, since both A’s and B’s
interfaces depend on C’s, but are independent from one another.
Knowing everything that was declared, A’s implementation
depends on all interfaces, the same is true for B’s and C’s. For this
IDE–404 IDE User Guide
Compiling and Linking
Using the Message Window
example, the make utility will ask the compiler to compile Listing
10.1 in the following order:
Listing 10.1 A valid example of circular referencing
UNIT A; UNIT B; UNIT C;
INTERFACE INTERFACE INTERFACE
USES C; USES C;
TYPE TYPE TYPE
A_type = ... B_type = .... C_type = ...
IMPLEMENTATIONIMPLEMENTATION IMPLEMENTATION
USES B; USES A; USES A, B;
.... ... ...
1. C’s interface is compiled.
2. B’s interface is compiled.
3. All of unit A is compiled (unit and implementation),
4. B’s implementation is compiled.
5. C’s implementation is compiled.
After an interface compilation, the compiler writes a binary symbol
table, containing all the declarations of the interface, in an 'sbmf'
resource in the project file. This information is read back when the
unit’s name is encountered in a USES clause for another
compilation. A unit is recompiled only when one of the following
conditions occur:
• The source was modified,
• The source is currently open and edited, or,
• A unit on which the source depends was recompiled.
Saving and Printing the Message Window
To print or save the contents of the Message window, just follow
these steps.
IDE User Guide IDE–405
Compiling and Linking
Using the Message Window
To Print the Message Window:
1. Make the Message window active.
To accomplish this, either click on the deactivated Message
window, or select the Errors & Warnings command from the
Window Menu.
2. Select the Print command from the File Menu.
If you choose the Print command on the File Menu to print the
Message window, the print dialog box appears. Specify printing
options and click OK. All the errors, warnings, and messages will
be printed.
To learn more about printing, refer to the documentation that came
with your printer.
To Save the Message Window:
1. Make the Message window active.
To accomplish this, either click on the deactivated Message
window, or select the Errors & Warnings command from the
Window Menu.
2. Select the Save A Copy As command from the File Menu.
The Save A Copy As command will display a standard file dialog
box.
3. Specify the name of the file and the location.
A text file will be saved containing all the errors, warnings, and
messages that are listed in the message window.
Locating Errors in Modified Files
If an error is corrected or the source code is changed, the compiler
may not be able to find other errors in the source code file. This may
result in an alert telling the user that the position of the error could
not be found. When this happens, recompile your project to update
the list of errors in the Message window.
IDE–406 IDE User Guide
Compiling and Linking
Special Library Options (Mac OS)
Special Library Options (Mac OS)
There are a few special linker options you can use in your project.
These options are only accessible from the Project Inspector window
as shown in Figure 10.5, available from the Window Menu. These
options are only available for library files in the project, and are
disabled for text files in the project.
Figure 10.5 Special Library Options
The topics in this section are:
• Import Weak
• Initialize Before
IDE User Guide IDE–407
Compiling and Linking
Special Library Options (Mac OS)
• Merge Into Output
Import Weak
Import Weak tells the operating system to ignore unresolved
symbols at load time. Use this option for features not always
installed on all machines (such as QuickDraw GX or QuickTime).
For more information on shared libraries, see the Targeting Mac OS
manual.
Initialize Before
Initialize Before indicates which PEF container (shared library or
application) gets initialized first. By default, imported PEF
containers are initialized before the PEF containers that import
them. Use this option for mutually-dependent PEF containers, to
specify which gets initialized first.
Merge Into Output
Merge Into Output allows you to put a copy of a shared library into
your project’s output file. For instance, if you have created your
own custom shared library, you can merge it into the application’s
data fork, guaranteeing that the system finds the custom shared
library.
This option may be useful for creating fat libraries as well, where
you want to include both CFM68K and PowerPC code.
NOTE When you merge a shared library into your application, you are
copying all the code fragments in that library. If the library contains
both 68K and PowerPC code fragments, your application’s data file
gets them all, which is desirable for fat libraries, but in other cases
may increase size unnecessarily.
IDE–408 IDE User Guide
11
Debugging Source Code
This chapter describes the CodeWarrior® source-level debugger. To
a great extent, this debugger works for all supported chips,
operating systems, and languages (C, C++, Pascal, Java, and
assembly language).
A debugger controls program execution so that you can see what
happens internally as your program runs. You use a debugger to
find problems while a program executes. The debugger can execute
your program one statement at a time, suspend execution when
control reaches a specified point, or interrupt a program that
changes the value of a designated memory location. When the
debugger stops a program, you can view the chain of function calls,
examine and change the values of variables, and inspect the
contents of the processor’s registers.
NOTE This chapter describes the common functionality of the debugger
for all platform targets. However, there might be some differences
in debugger features for your particular build target. You should
read the appropriate CodeWarrior targeting documentation to
cover the specific differences for your build target. For information
on which Targeting manual to read, see “Targeting
Documentation” on page 29.
The Linux version of the CodeWarrior IDE does not include the
CodeWarrior debugger. You must use a third-party debugger
application to debug software developed with the Linux
CodeWarrior IDE.
This chapter discusses the following topics:
• Symbolics Files
• Preparing for Debugging
• Using the Debugger
IDE User Guide IDE–409
Debugging Source Code
Symbolics Files
• Guided Tour of the Debugger
• Basic Debugging
• Expressions
• Troubleshooting
Symbolics Files
A symbolics file contains information the debugger needs to debug
most types of project files. Symbolics files include items such as the
names of routines and variables (the symbols), their locations
within the source code, and their locations within the object code.
The debugger uses the symbolics file to show the source code that
corresponds to your object code. For example, when you stop
program execution, the debugger shows you the source code.
Additionally, the debugger lets you view assembly-language
instructions and memory addresses. See “Source pop-up menu” on
page 422 for more information.
The IDE generates several symbolics formats to support a variety of
build targets. Table 11.1 lists some of the supported formats.
NOTE (Embedded) For some build targets, it is possible to debug an
executable file that does not contain symbolics information. To learn
more, refer to the Targeting manual appropriate for your particular
build target.
Table 11.1 Supported Symbolics File Formats
Format Primary Build Target
CodeView Win32
DWARF Embedded systems
SYM Mac OS
See “Preparing for Debugging” on page 411 for information on
setting up projects and source files to create symbolics files.
IDE–410 IDE User Guide
Debugging Source Code
Preparing for Debugging
For more information on compiler and linker settings, refer to
“Configuring Target Options” on page 331.
To learn more about symbolics files for a particular build target, see
the corresponding Targeting manual.
Preparing for Debugging
To debug the code generated by a particular build target within
your CodeWarrior project file, you must configure both the build
target and the individual source files within it for debugging. After
properly configuring the build target and source files, the IDE can
generate symbolics information for use with the debugger.
NOTE (Embedded) It is possible to debug some build targets without first
creating a project file. In such cases, the debugger automatically
creates a default project file and uses default debug settings. For
more information, refer to the Targeting manual appropriate for your
particular build target.
This section describes the following topics:
• Setting Up a Build Target for Debugging
• Setting Up a File for Debugging
• Generating Symbolics Information
Setting Up a Build Target for Debugging
To prepare a build target for debugging, make sure it is the active
build target. Then, choose Project > Enable Debugger. When
debugging is enabled for a build target, the menu command
changes to Disable Debugger. Choosing Disable Debugger turns
off debugging for the build target and changes the menu command
back to Enable Debugger.
The Enable Debugger command activates the debugger. When
your project’s target settings are correctly configured, the compiler
and linker generate a symbolics file containing information for
debugging at the source-code level. By default, this symbolics file is
saved in the same location as the output directory.
IDE User Guide IDE–411
Debugging Source Code
Preparing for Debugging
See “Configuring Target Options” on page 331 for more information
about build target settings. To learn about symbolics files and their
use within the debugger, refer to “Symbolics Files” on page 410.
When you choose Enable Debugger, you might see an alert (Figure
11.1). CodeWarrior is reminding you that it will modify the build
target settings to prepare the project for debugging. Click Yes to
apply the debugging changes to your build target.
Figure 11.1 Accepting Changes Set by Enable Debugger
Setting Up a File for Debugging
After you enable debugging for the current build target, you have to
set up your individual files for debugging. If you intend to debug
your program, you typically enable debugging for all of your source
files.
The Project window includes a debug column, as shown in Figure
11.2. For files, a mark in this column means that symbolic
information is generated; no mark means that symbolic information
is not generated. For group names, a mark indicates that debugging
is enabled for every file in the group and no mark means that
debugging is disabled for one or more files in the group.
IDE–412 IDE User Guide
Debugging Source Code
Preparing for Debugging
Figure 11.2 Setting Debugging in the Project Window
To toggle debugging for a file, click in the Debug column for that
file. Clicking in the Debug column for a group name enables or
disables debugging for all files in that group. If a file cannot be
debugged (because it is a library or other non-source file), you
cannot enable debugging for that file.
Generating Symbolics Information
To generate symbolics information, both the current build target
and the source files within that target must be prepared for
debugging. See Setting Up a File for Debugging to learn how to do
this.
NOTE (Embedded) For some build targets, it is possible to debug an
executable file that does not contain symbolics information. To learn
IDE User Guide IDE–413
Debugging Source Code
Using the Debugger
more, refer to the Targeting manual appropriate for your particular
build target.
After you prepare the current build target and its source files,
choose Project > Make command to compile and link your final
code.
For more information on compiling and linking, see “Configuring
Target Options” on page 331 as well as the Targeting manual for
your particular platform target.
Using the Debugger
To debug a project, you must first enable debugging for that project.
Choose Project > Enable Debugger to enable debugging. After
debugging is enabled, the Enable Debugger command changes to
Disable Debugger.
When you enable debugging, the Run command in the Project
menu changes to Debug. For most projects, choosing the Debug
command causes the IDE to compile and link your project, generate
a symbolics file, and activate the debugger. The debugger
automatically loads the symbolics file so that you can debug your
project. See “Preparing for Debugging” on page 411 for more
information on this topic.
NOTE (Mac OS) If the debugger is currently disabled, you can Option-click
the Project menu to choose the Debug command.
There are many build targets or kinds of code that the IDE cannot
launch. For example, if you are writing an application plug-in, the
plug-in cannot run on its own. In addition, the CodeWarrior IDE
does not know which application must be running to invoke the
plug-in. In such cases, you would need to specify the application
that must launch in order to invoke the plug-in.
Usually, you open the symbolics file to debug the plug-in.
Alternatively, you can follow these steps:
IDE–414 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
1. Open the Target Settings window for the project.
Choose Project > Target Settings, where Target is the name of the
current build target. For example, if the name of the current build
target is MyAppRelease, the menu command changes from Target
Settings to MyAppRelease Settings.
2. Display the Runtime Settings panel.
Scroll through the list of panels on the left side of the Target Settings
window. Click Runtime Settings to display that panel on the right
side of the window.
3. Click the Choose button.
Use the dialog box that appears to choose an application for use
with debugging shared libraries, dynamic link libraries (DLLs), and
code resources. The IDE launches the application you specify when
debugging the plug-in.
Guided Tour of the Debugger
This section explains the various windows, panes, and displays you
can use when debugging. The topics discussed in this section
include:
• Thread Window
• Symbolics Window
• Symbol Hint
• Debugger Contextual Menu
• Processes Window
• Expressions Window
• Global Variables Window
• Breakpoints Window
• Watchpoints Window
• Register Windows
• Log Window
• Variable Window
• Array Window
• Memory Window
IDE User Guide IDE–415
Debugging Source Code
Guided Tour of the Debugger
Thread Window
At the beginning of a debugging session, the IDE opens a Thread
window, shown in Figure 11.3. CodeWarrior documentation uses
several names for the Thread window, depending on the part of the
window being emphasized. The following names might appear:
• Debugger window—This name emphasizes the use of the
Thread window to debug software.
• Stack Crawl window—This name emphasizes the Stack Crawl
pane within the Thread window.
• Program window—This name emphasizes the use of the Thread
window to monitor program execution.
The term Thread window appears throughout the remainder of the
CodeWarrior IDE User Guide. However, you should remember the
alternative names when reading other CodeWarrior documentation.
Figure 11.3 Thread Window
The debugger allows you to open several symbolics files at the same
time. This feature allows you to debug more than one program at a
IDE–416 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
time. For example, you can simultaneously debug an application
and its plug-ins. A Thread window appears for each active thread.
The Thread window shows debugging information about the
currently suspended process. The window has four points of
interest:
• Debugger toolbar
• Stack Crawl pane
• Variables pane
• Source pane
You can resize panes by clicking and dragging the resize bar
between them. Use the Tab key to switch keyboard focus among
panes. On the Mac OS-hosted IDE, the pane in focus has a heavy
border.
To select items in a focused Stack Crawl pane or Variables pane,
type the first few characters of the item’s name. Alternatively, use
the arrow keys to navigate among the items in an active pane.
Mac OS You can also press Control-Tab as another way to
navigate through items in an active Stack Crawl pane or Variables
pane. To learn more about such key bindings, see “Customizing
Key Bindings” on page 314.
There are additional controls along the bottom of the Source pane,
to the left of the horizontal scroll bar:
• the Function Pop-Up Menu
• the Line and Column Indicator
• the Source pop-up menu
Debugger toolbar
The debugger toolbar (Figure 11.4) contains shortcut buttons for
commonly used commands from the Project and Debug menus:
Run, Stop, Kill, Step Over, Step Into, and Step Out. Table 11.2 on
page 418 shows how to display and hide the debugger toolbar.
For more information about debugging, see “Basic Debugging” on
page 450.
IDE User Guide IDE–417
Debugging Source Code
Guided Tour of the Debugger
Table 11.2 Showing and Hiding the Debugger Toolbar
To do this… Windows Mac OS, Solaris, and Linux
Show the Choose View > Toolbars > Choose Window > Toolbar >
debugger toolbar Show Window Toolbar Show Window Toolbar
Hide the Choose View > Toolbars > Choose Window > Toolbar >
debugger toolbar Hide Window Toolbar Hide Window Toolbar
Figure 11.4 Debugger Toolbar
Stack Crawl pane
The Thread window includes a Stack Crawl pane. This pane
displays the current subroutine calling chain (Figure 11.5). Each
subroutine appears below the routine that called it. Select any
routine in the Stack Crawl pane to display its code in the Source
pane.
IDE–418 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.5 Stack Crawl Pane
Variables pane
The Variables pane displays a list of local variables used in the
program. The Variables Pane Listing icon ( ), shown in Figure 11.6,
controls the listing of these variables. Clicking the icon toggles the
list in the Variables pane among the types described in Table 11.3.
Table 11.3 Variables Pane List Types
Type Variables Listed
Variables:All All local variables in the code
Variables:Auto Local variables of the routine in which the
Current-statement arrow is currently located
Variables:None None. Use this type to improve stepping
performance for slow remote connections.
Mac OS The Variables pane also displays any global variables
referred to by the routine. A dashed line separates local and global
variables.
The Variables pane lists the variables in outline form. Click the
hierarchical control next to an entry to expand or collapse the view
of its contents.
For example, in Figure 11.6 on page 420, clicking the hierarchical
control next to the variable msg hides its members. Click the
hierarchical control again to display the members. To de-reference
IDE User Guide IDE–419
Debugging Source Code
Guided Tour of the Debugger
multiple levels of pointers and get directly to the data, use one of
the following techniques:
Windows, Solaris, and Linux Press the Ctrl key while
expanding an entry.
Mac OS Press the Option key while expanding an entry.
This feature is useful for expanding a handle to a structured type
and viewing the structure members.
Figure 11.6 Variables Pane
For more information about expanding and collapsing entries, see
“Expanding and Collapsing Groups” on page 72.
NOTE Use the General Registers and FPU Registers windows to view the
contents of the central-processor and floating-point registers. If the
current build target does not have an FPU, the FPU Registers
IDE–420 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
window is not available. For more information, see “Register
Windows” on page 440.
Source pane
The Source pane (Figure 11.7 on page 421) in the Thread window
displays source code. The debugger takes the source code directly
from the source code files in the current build target, including any
comments and white space. The pane shows C/C++, Pascal, Java,
and in-line assembly code exactly as it appears in your program’s
source code, using the font and color specified in the Editor Settings
preference panel.
Click the Source pane disclosure triangle, shown in Figure 11.3 on
page 416, to show or hide the Source pane. If you hide the Source
pane, the debugger opens both an editor window and a Thread
window after you step once through your code. The editor window
shows the same source code and breakpoints as the Source pane.
Figure 11.7 Source Pane in the Thread Window
IDE User Guide IDE–421
Debugging Source Code
Guided Tour of the Debugger
The Source pane lets you step through the source code line by line.
The current-statement arrow, which always points to the next
statement to be executed, indicates your progress. The program
counter in the central processing unit of your computer is set to the
instruction address pointed to by the current-statement arrow.
Thus, the current-statement arrow is also known as the program
counter.
The debugger executes all statements in a source-code line with
each step through your code. The current-statement arrow dims
whenever the program counter is within, but not at the beginning
of, a source-code line. If the source-code line contains more than one
routine, you must step over, step into, or step out of each routine of
interest.
Source pop-up menu
The Source pop-up menu, shown in Figure 11.7 on page 421, allows
you to view the code in the Source pane in a variety of formats. You
can choose among the following views:
• Source—In this view, shown in Figure 11.8 on page 423, the
source code appears in the programming language instructions
used to create it.
• Assembler—In this view, shown in Figure 11.9 on page 423, the
source code appears in the assembly language instructions used
to implement each line. You can step through the assembly code
and set breakpoints, one routine at a time.
• Mixed—In this view, shown in Figure 11.10 on page 424, the
assembly language instructions that implement each source-
code line appear immediately after that line. Syntax coloring is
not available in this view. You can step through code and set
breakpoints, but only for assembly language instructions, as
shown in Figure 11.10. The view reverts to Assembler for source
code that does not contain symbolics information.
NOTE Use the General Registers and FPU Registers windows to view the
contents of the central-processor and floating-point registers. If the
current build target does not have an FPU, the FPU Registers
window is not available. For more information, see “Register
Windows” on page 440.
IDE–422 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.8 Source View
Figure 11.9 Assembler View
IDE User Guide IDE–423
Debugging Source Code
Guided Tour of the Debugger
Figure 11.10 Mixed View
Function pop-up menu
The Function pop-up menu, at the bottom-left corner of the Source
pane, contains a list of the routines defined in the source file
selected in the Source pane (Figure 11.11). Selecting a routine in the
Function pop-up menu displays that routine in the Source pane.
You can also display the items in alphabetical order. Use one of the
following techniques:
Windows, Solaris, and Linux Alt-click the Function pop-up
menu
Mac OS Option-click the Function pop-up menu
IDE–424 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.11 Function Pop-up Menu
Symbolics Window
The Symbolics window, shown in Figure 11.12 on page 426, appears
after you open a file that contains symbolics information.
The Symbolics window somewhat resembles the Thread window in
both appearance and functionality, but displays different
information. The Symbolics window lets you view any file in the
build target for which the IDE generated a symbolics file, whereas
the Thread window only displays the file containing the routine
selected in the Stack Crawl pane. The Symbolics window lets you
view or edit all global variables for each project that contains
symbolics information; the Thread window lets you change only
IDE User Guide IDE–425
Debugging Source Code
Guided Tour of the Debugger
those global variables referenced by active routines in the call chain.
For more information about viewing global variables, see “Global
Variables Window” on page 437.
Figure 11.12 Symbolics Window
IDE–426 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
NOTE Do not confuse the Symbolics window with the Class Browser
window. Although the two look similar, the Symbolics window
opens only under the following circumstances:
• You open a symbolics file. On most hosts, the IDE appends the
extension .xSYM or .iSYM to the names of these files.
• You open an executable file for which the IDE previously
generated symbolics information. On most hosts, the IDE
appends the extension .EXE to the names of these files.
• You choose the Symbolics Window menu command.
For more information about the Class Browser window, see
“Browsing Source Code” on page 205.
TIP You can use the Global Variables window as an alternative to the
Symbolics window. For more information, see “Global Variables
Window” on page 437.
The Symbolics window contains the following items:
• Executables pane
• Files pane
• Functions pane
• Source pane
Like the Thread window, the Symbolics window has a debugger
toolbar, a Function pop-up menu, a line-number button, and a
Source pop-up menu. Click and drag the resize bar between two
panes to change their sizes. On the Mac OS-hosted IDE, the active
pane has a heavy border.
To select items in an active Files pane or Functions pane, type the
first few characters of the item’s name. Alternatively, use the arrow
keys to navigate through the items in an active pane. On the
Mac OS-hosted IDE, you can also press Control-Tab to navigate the
items in an active Files pane or Functions pane.
The debugger allows more than one symbolics file to be open at a
time, meaning that you can debug more than one program at a time.
For example, you can use this feature to debug an application and
IDE User Guide IDE–427
Debugging Source Code
Guided Tour of the Debugger
its plug-ins all at the same time. The Executables pane lists each
program that contains symbolics information.
To learn more about the contents of the Thread window, see
“Thread Window” on page 416.
Executables pane
The Executables pane, shown in Figure 11.13, lists recently used
executable files that contain symbolics information. Select an
executable file in the list to display information about that file in the
Files pane, Functions pane, and Source pane.
Figure 11.13 Executables Pane
Files pane
The Files pane, shown in Figure 11.14 on page 429, lists the source-
code files in the build target being debugged, for the selected
executable file. After you select a file in this pane, the Functions
pane lists the routines declared in the file. Use the Files pane in
conjunction with the Functions pane and the Source pane to set
breakpoints in your program.
For more information, see “Global Variables Window” on page 437
and “Breakpoints” on page 467.
IDE–428 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.14 Files Pane
Functions pane
The Functions pane, shown in Figure 11.15, lists the functions
defined in the file selected in the Files pane. Click a function name
to display that function’s declaration in the Source pane.
NOTE If your code is written in C++ or Object Pascal, the Sort functions
by method name in browser option in the Display Settings
preference panel (see “Display Settings” on page 288) alphabetizes
function names of the form className::methodName by
methodName instead of by className.
Figure 11.15 Functions Pane
Source pane
The Source pane, shown in Figure 11.16 on page 430, allows you to
view the contents of the source-code file selected in the Files pane.
IDE User Guide IDE–429
Debugging Source Code
Guided Tour of the Debugger
You can use the Source pane to set breakpoints in any file listed in
the Files pane. To learn about setting breakpoints, see “Breakpoints”
on page 467.
Figure 11.16 Source Pane
The Source pane in the Symbolics window does not show the
currently executing statement. The current-statement arrow in the
Thread window shows the currently executing statement. You can
also use the Thread window to view local variables. For more
information, see “Thread Window” on page 416.
The Source pane displays code in the font and colors specified in the
panels of the IDE Preferences window. For more information, see
“Editor Settings” on page 277 and “Display Settings” on page 288.
If an item selected in the Files pane does not contain source code,
the Source pane displays the message “Source text or disassembly
not available.”
For more information about other controls in the Source pane, see
“Function Pop-Up Menu” on page 141, “Line and Column
Indicator” on page 144, and “Source pop-up menu” on page 422.
IDE–430 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Symbol Hint
As you debug source code, the debugger shows useful information
about your program’s variables. This information appears
automatically as you move the cursor over particular variables in
source-code views. For example, suppose you start a debugging
session and examine your source code in the Source pane of the
Thread window. If you rest the cursor over the variable i, as shown
in Figure 11.17, the debugger displays the current value of that
variable.
Figure 11.17 Symbol Hint
NOTE The symbol hint is only available when the debugger is active. If you
do not see information about your program’s variables, you need to
activate the debugger. For more information, see “Preparing for
Debugging” on page 411.
Debugger Contextual Menu
The debugger includes a contextual menu (Figure 11.18) that
provides convenient access to various debugging commands. Use
one of the following techniques to display the contextual menu:
• (Windows) Right-click an item.
• (Mac OS) Control-click an item, or click and hold on an item.
• (Solaris and Linux) Ctrl-click an item, or click and hold on an
item.
IDE User Guide IDE–431
Debugging Source Code
Guided Tour of the Debugger
The debugger uses the context of the item you select to determine
the commands that appear in the contextual menu. For example, if
you choose a variable, the contextual menu includes commands for
viewing the contents of that variable.
Figure 11.18 Debugger Contextual Menu
TIP The debugger contextual menu is useful in a variety of situations.
For instance, you can use the contextual menu in the Variables
pane and the General Registers window to view variables in
different formats. You can also use the contextual menu in the
Source pane to manipulate breakpoints and move the program
counter. Experiment with the contextual menu to discover all of its
features.
Processes Window
The Processes window (Figure 11.19) lists currently running
processes, including some hidden processes. The Processes window
also lists tasks for a selected process. To open the Processes
window, use one of the following techniques:
• (Windows menu bar layout) Choose View > Processes.
• (Macintosh menu bar layout) Choose Window > Processes
Window.
The Processes window has two panes and a toolbar:
IDE–432 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
• Processes window toolbar—allows you to run, stop, or kill
processes and tasks under debugger control. The toolbar also
lets you attach processes and open Stack Crawl windows.
• Process pane—shows currently running processes
• Task pane—shows tasks in a selected process
Figure 11.19 Processes Window
Processes window toolbar
The Processes window toolbar (Figure 11.20) has controls to Run,
Stop, and Kill a process under debugger control. These controls
have no effect on any other currently running processes or tasks.
The Process Attach and Stack Crawl window controls affect selected
processes.
IDE User Guide IDE–433
Debugging Source Code
Guided Tour of the Debugger
Figure 11.20 Processes Window Toolbar
The Process Attach button assigns a debugging session to the
selected process in the Process pane. This button is useful for
debugging processes that the debugger cannot recognize normally.
For example, when debugging a program that uses dynamic link
libraries or shared libraries, you can use the Process Attach button
to place those libraries under debugger control. A check mark
appears next to attached processes.
The Thread window button opens a Thread window for the selected
process or task. You can have multiple Thread windows open at a
time. After clicking the button, the Stack Crawl window for the
selected process or task appears frontmost.
Process pane
The Process pane lists all currently running processes. A checkmark
appears next to each process under debugger control. To place a
selected process under debugger control, click the Process Attach
button. Double-clicking a process name activates that process.
IDE–434 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.21 Process Pane
Task pane
The Task pane lists all the currently running tasks for a given
process. Only tasks from programs under debugger control are
shown. Double-clicking a task name opens a Thread window with
the code for that task. You can also choose a task and then click the
Thread window button (Figure 11.20).
Figure 11.22 Task Pane
There are two columns in the Task pane. The left column shows the
task ID. The right column indicates the task status as either running,
stopped, or crashed.
IDE User Guide IDE–435
Debugging Source Code
Guided Tour of the Debugger
Expressions Window
The Expressions window (Figure 11.23) provides a convenient
location to place frequently used local variables, global variables,
structure members, and array elements.
To open the Expressions window, use one of the following
techniques:
• (Windows menu bar layout) Choose View > Expressions
• (Macintosh menu bar layout) Choose Window > Expressions
Window
Choose Data > Copy to Expression to add selected items to the
Expressions window. Alternatively, select the same command from
the debugger contextual menu (see “Debugger Contextual Menu”
on page 431). You can also use the mouse to drag and drop items
from other variable panes and windows into the Expressions
window. To reorder items in the Expressions window, drag each
item to its new position in the list.
Figure 11.23 Expressions Window
To remove an item from the Expressions window, select the item
and use one of the following techniques:
Windows Press Delete, or choose Edit > Delete.
IDE–436 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Mac OS Press Delete, or choose Edit > Clear.
Solaris, and Linux Press Backspace, or choose Edit > Clear.
Unlike local variables displayed in an ordinary Variables window,
the IDE does not remove local variables in the Expressions window
after execution exits the routines that define those local variables.
To learn about the Expressions window, refer to “Using the
Expressions window” on page 488.
Global Variables Window
The Global Variables window (Figure 11.24) shows all global
variables used by your program. You can also view static variables
by selecting a file in the File pane. The static variables appear in the
Variables pane.
Figure 11.24 Global Variables Window
IDE User Guide IDE–437
Debugging Source Code
Guided Tour of the Debugger
Placing globals in a separate window
To display a global variable in its own window, double-click the
name of the global variable in the Variables pane. A new Variable
window opens and shows the name and value of the global
variable. You can also open a Variable window by selecting the
desired variable in the Variables pane and choosing Data > View
Variable or Data > View Array, or choosing the same commands
from the debugger contextual menu (see “Debugger Contextual
Menu” on page 431). You can view and edit a global variable
displayed in its own window the same way as in the Variables pane.
You can also add global variables to the Expressions window.
Windows containing global variables remain open for the duration
of the debugging session. To close all open Variable windows, bring
forward one of the Variable windows, then choose File > Close All
Variable Windows.
For more information, refer to “Expressions Window” on page 436,
“Variable Window” on page 446, and “Array Window” on page
447.
Breakpoints Window
The Breakpoints window (Figure 11.25 on page 439) lists the
breakpoints in your current build target by source file and line
number. To open the Breakpoints window, use one of the following
techniques:
• (Windows menu bar layout) Choose View > Breakpoints
• (Macintosh menu bar layout) Choose Window > Breakpoints
Window
A breakpoint marker appears to the left of each listing. Clicking a
breakpoint marker toggles its current status. A solid dot indicates
that the breakpoint is active, while a circle that indicates that the
breakpoint is inactive. In either case, the IDE remembers the
position of the breakpoints in the program.
IDE–438 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.25 Breakpoints Window
You can also manipulate breakpoints with the following techniques:
• (Windows, Solaris, and Linux) In the Breakpoints Window, Alt-
click one of the breakpoint markers to simultaneously activate or
de-activate all listed breakpoints
• (Mac OS) In the Breakpoints Window, Option-click one of the
breakpoint markers to simultaneously activate or de-activate all
listed breakpoints
• Double-click a breakpoint listing to display the corresponding
source-code line in an editor window.
Each breakpoint can have an attached condition. If the condition is
true and the breakpoint is active, the breakpoint stops program
execution. If the breakpoint is inactive or the condition is false, the
breakpoint has no effect.
For more information, see “Breakpoints” on page 467, “Show
Breakpoints” on page 687, “Hide Breakpoints” on page 673, and
“Conditional breakpoints” on page 472.
Watchpoints Window
The Watchpoints window (Figure 11.26 on page 440) lists the
watchpoints in your current build target by memory address. To
open the Watchpoints window, use one of the following techniques:
• (Windows menu bar layout) Choose View > Watchpoints
• (Macintosh menu bar layout) Choose Window > Watchpoints
Window
IDE User Guide IDE–439
Debugging Source Code
Guided Tour of the Debugger
Figure 11.26 Watchpoints Window
You can clear a watchpoint by selecting it and performing any of the
following steps:
• Choose Debug > Clear Watchpoint.
• (Windows) Press Backspace, or choose Edit > Delete.
• (Mac OS) Press Delete, or choose Edit > Clear.
• (Solaris and Linux) Press Backspace, or choose Edit > Clear.
For more information, see “Watchpoints” on page 476.
Register Windows
A Register window displays register contents and allows you to edit
those contents. Different types of Register windows are available for
different build targets. This section describes the following Register
windows:
• General Registers window
• FPU Registers window
• AltiVec Registers window
General Registers window
The General Registers window (Figure 11.27) displays CPU
registers and allows you to edit register contents. To open a General
Registers window, choose Window > Registers Windows >
General Registers.
NOTE The appearance of the General Registers window depends on the
build target. The build target also determines the commands in the
IDE–440 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Registers Windows submenu. If a submenu is unavailable, simply
choose Register Window to see the window shown in Figure 11.27.
Figure 11.27 General Registers Window (Windows)
To change a register value, double-click the value or select the
register and press Enter/Return. You can then type in a new value.
Mac OS For PowerPC build targets, the General Registers
window is shown in Figure 11.28. You can toggle the bit values of
the XER and condition registers between 0 and 1. Select the bit you
want to change and press Return or Enter. You can also double-click
the bit to toggle its value.
IDE User Guide IDE–441
Debugging Source Code
Guided Tour of the Debugger
Figure 11.28 General Registers Window (Mac OS PowerPC)
FPU Registers window
The FPU Registers window (Figure 11.29) displays FPU registers
and allows you to edit register contents. To open an FPU Registers
window, choose Window > Registers Windows > FPU Registers.
NOTE The appearance of the FPU Registers window depends on the build
target. The build target also determines the commands in the
Registers Windows submenu. If a submenu is unavailable, simply
choose FPU Registers Window to see the window shown in Figure
11.29.
IDE–442 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.29 FPU Registers Window (Windows)
To change a register value, double-click the value or select the
register and press Enter/Return. You can then type in a new value.
WARNING! Changing the value of a register is a very dangerous thing to do.
The changes could corrupt your data and memory, or otherwise
cause a crash.
IDE User Guide IDE–443
Debugging Source Code
Guided Tour of the Debugger
Figure 11.30 FPU Registers Window (Mac OS)
AltiVec Registers window
The AltiVec Registers window (Figure 11.29) displays AltiVec
registers and allows you to edit register contents. To open an
AltiVec Registers window, choose Window > Registers Windows >
AltiVec Registers.
To change a register value, double-click the value or select the value
and press Enter/Return. You can then enter a new value.
IDE–444 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
TIP Use the debugger contextual menu to change the format of the
displayed data, as shown in Figure 11.31. This technique is a
convenient Data menu alternative.
Figure 11.31 AltiVec Registers Window
Log Window
The Log window (Figure 11.32) displays messages as your program
makes calls to system DLLs or starts new tasks.
To use the Log window, you must enable the Log System Messages
preference in the Debugger Settings preference panel. See
“Debugger Settings” on page 369 for more information.
NOTE In Windows, log information includes messages about the loading
and unloading of DLLs, as well as debug printf() messages. In
IDE User Guide IDE–445
Debugging Source Code
Guided Tour of the Debugger
the Mac OS, log information refers to messages about the loading of
PowerPC code fragments, as well as DebugStr() messages.
Figure 11.32 Log Window
You can copy selected text from the Log window with the Copy
menu command. You can also choose the Save As menu command
to save the Log window contents to a text file for later analysis.
Windows If you choose to save the log to a text file, be sure to
add the .txt extension to the file name, like this: log.txt
TIP (Mac OS) To learn how to print out the messages in the Log
window, see Targeting Mac OS.
Variable Window
The Variable window (Figure 11.33 on page 447) displays a single
variable and allows you to edit its contents. A Variable window
containing a local variable closes after execution exits the routine
that defines the variable.
IDE–446 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
Figure 11.33 Variable Window
Array Window
The Array window (Figure 11.34) displays a contiguous block of
memory as an array of elements and allows you to edit the contents
of those elements. To open the Array window, select an array
variable in a Variables pane (either locals or globals) and then
choose Data > View Array.
You can also choose Data > View Memory As to open an Array
window. This command opens a dialog box that lets you select a
data type, then opens an Array window interpreting memory as an
array of that type. For more information, see “View Memory As” on
page 695.
The Array window title bar describes the base address to which the
array is bound. A base address can be bound to an address, a
variable, or a register. Dragging a register name or variable name
from a Variables or Registers pane to an Array window sets the
array address. An array bound to a local variable closes when the
routine in which the local variable is defined returns to its caller.
The Information pane shows the data type of the array elements,
along with the base address of the array. To view more information
about the array, click the hierarchical control in the Information
pane. From the expanded Information pane, you can select the base
address, the array size, and specific members to view if the array
elements are of a structured type.
The Array window lists array contents sequentially, starting at
element 0. If array elements are cast as structured types, a
hierarchical control appears to the left of each array element,
allowing you to expand or collapse the element.
IDE User Guide IDE–447
Debugging Source Code
Guided Tour of the Debugger
Figure 11.34 Array Window
Memory Window
The Memory window displays the contents of memory in
hexadecimal and corresponding ASCII character values (Figure
11.35). To open a Memory window, select a variable, routine name,
or expression representing the desired base address in the Thread,
Symbolics, or Expressions windows and choose Data > View
Memory.
IDE–448 IDE User Guide
Debugging Source Code
Guided Tour of the Debugger
NOTE The View Memory As menu command opens an Array window
(see “Array Window” on page 447) displaying memory as an array of
data of a type you specify.
Figure 11.35 Memory Window
The source of the base address (which can be a variable, a routine,
an expression, or a raw address like 0xCAF64C) appears at the top
of the window. The Memory window appears blank if the IDE
cannot access the base address.
To change the base address, enter a new expression in the Display
field. You can also drag an expression to the field. If the expression
does not produce an object in memory (an lvalue), then the base
address uses the expression value. For example, the Memory
window expression
IDE User Guide IDE–449
Debugging Source Code
Basic Debugging
PlayerRecord
shows memory beginning at the address of PlayerRecord.
If the expression result is an lvalue, then the base address uses the
object address. For example, the expression
*myArrayPtr
shows memory beginning at the address of the object pointed to by
myArrayPtr.
You can use a Memory window to change the values of individual
bytes in memory. Click in the displayed data to select a starting
point and start typing. If you select a byte in the hexadecimal
display, you are restricted to typing hexadecimal digits. If you select
a byte in the ASCII display, you can type any alphanumeric
character. Certain keys (such as Backspace/Delete, Tab, Enter/
Return, and so forth) do not work. New data you type overwrites
the data already in memory.
Mac OS If the expression is a pointer-sized register, then the base
address uses the register contents. For example, ®A0 (type Option-r
for the first character) shows memory beginning at the address
contained in the 68K register A0. Note that 64-bit floating-point
registers cannot be used on a computer with a 32-bit central
processing unit (CPU). The register size must have the size of the
address bus of the CPU, so neither floating-point nor AltiVec
registers can be used in the Display field.
WARNING! Arbitrarily changing the contents of memory can be very dangerous
to computer stability and can result in a crash. Be sure you
understand the consequences of any changes you make.
Basic Debugging
This section describes the means by which the debugger helps you
locate and solve problems in your source code. This section covers
the following principal topics:
• Starting Up—things to note when starting the debugger
IDE–450 IDE User Guide
Debugging Source Code
Basic Debugging
• Running, Stepping, and Stopping Code—controlling program
execution one line at a time
• Navigating Code—moving around and finding code
• Breakpoints—stopping execution at specific points and times
• Watchpoints—stopping execution when the contents of a
memory location changes
• Viewing and Changing Data—seeing your variables and
modifying them at will
• Editing Source Code—editing source code while in a debugging
session
This section assumes you are familiar with the debugger user
interface, described in “Guided Tour of the Debugger” on page 415.
To learn how to prepare a build target for debugging, see
“Preparing for Debugging” on page 411. For information on setting
debugging preferences, see “Debugger Preferences” on page 288.
Starting Up
The steps you follow to start up the debugger depend on the build
target you wish to debug. Usually, the debugger requires a project
file and a symbolics file in order to successfully debug a project.
Some embedded build targets do not require these files to start a
debugging session.
Refer to “General start-up process” on page 451 to learn about the
typical start-up process for debugging a project. If you wish to
debug an embedded build target, refer to “Embedded start-up
process” on page 454 and the Targeting manual appropriate for your
particular build target.
General start-up process
To use the debugger, first open a project. Next, choose Project >
Enable Debugger. Then, choose Project > Debug to debug the
project.
When using the debugger with your code, pay careful attention to
what happens. The following situations can occur:
• If you use the Debug menu command to debug a project, the
debugger opens the Thread Window. Typically, the debugger
IDE User Guide IDE–451
Debugging Source Code
Basic Debugging
stops program execution at the first line of code in the main
function. If you encounter this situation, all is well. Your
program’s execution is stopped and ready to run.
• If you open a symbolics file, the debugger opens the Symbolics
Window. In this case, you must Project > Debug or click the Run
button in the Debugger toolbar. Then, the debugger launches the
build target, takes control of that build target, brings forward the
Thread window, and stops the program at the first line.
The debugger might ask you for the location of a particular file, as
shown in Figure 11.36 on page 453 (Windows) or Figure 11.37 on
page 453 (Mac OS).
You might see this dialog either upon startup (the debugger is
looking for the file with the main entry point) or by clicking on a
specific file in the Symbolics Window.
The debugger might ask you to locate files in these situations:
• a file has been moved to a different directory
• you received the project from another person in your team and
the paths are different
• you selected a file belonging to a compiled library and you do
not have the source files
The last case is most common if you compile a build target with
symbolics-file generation enabled for a library. This case is
especially true with some of the libraries distributed with
CodeWarrior.
Once you find the file, the debugger remembers the new location,
even between debugging sessions.
For more information, see “Generating Symbolics Information” on
page 413.
IDE–452 IDE User Guide
Debugging Source Code
Basic Debugging
Figure 11.36 Find the File (Windows)
Figure 11.37 Where is the Executable? (Mac OS)
IDE User Guide IDE–453
Debugging Source Code
Basic Debugging
Embedded start-up process
The typical debugging procedure described in “General start-up
process” on page 451 applies to most embedded projects as well.
However, for some embedded build targets, you do not need to
create a project file or generate symbolics information in order to
debug a project. In such cases, the IDE creates a default project with
default debugging settings. The debugger uses these default
settings during the debugging session.
Additionally, the debugger lets you download and run an
executable file without using symbolics information. For more
information, refer to the Targeting manual appropriate for your
particular build target.
Running, Stepping, and Stopping Code
This section explains how to run your code, step through it line by
line, and stop or kill the build target when you want to stop
debugging.
Moving through code line by line is often called “stepping” through
code. It is a linear approach to navigation, where you start at the
beginning and move steadily through the code. This concept is
important for understanding code navigation. The debugger lets
you navigate to any location directly, stop your code at specific
locations when certain conditions are met, and view as well as
modify your data.
To step through your code, you can use the debugger toolbar
buttons, the keyboard, or choose the appropriate menu command.
Figure 11.4 on page 418 lists the debugger toolbar buttons.
This section discusses the following topics:
• Current-statement arrow
• Running your code
• Stepping through a single line
• Stepping into routines
• Stepping out of routines
• Skipping statements
IDE–454 IDE User Guide
Debugging Source Code
Basic Debugging
• Stopping execution
• Killing execution
Current-statement arrow
The current-statement arrow in the Thread window (Figure 11.38)
indicates the next statement to be executed. It represents the
processor program-counter register. When you start a debugging
session, the current-statement arrow points to the first line of
executable code in your program.
Figure 11.38 Current-statement Arrow
Running your code
If the program is running but its execution has stopped, use the Run
command (Figure 11.39) to restart your program. The program
resumes execution at the current-statement arrow.
Figure 11.39 Run Command
IDE User Guide IDE–455
Debugging Source Code
Basic Debugging
After a breakpoint or a Stop command, the debugger regains
control and displays the Thread window with the current-statement
arrow and the current values of variables. The debugger places an
implicit breakpoint at the main entry point of the program and
stops there (Figure 11.40). Issuing another Run command resumes
program execution from the point of the interruption. After a Kill
command, Run restarts the program from its beginning.
TIP You can inhibit the automatic launch of the program by holding
down the Alt/Option key while opening the symbolics file. You can
also change the Automatically launch applications when SYM file
opened preference (see “Global Settings” on page 293). One use
for this feature is to debug C++ static constructors, which are
executed before entering the main routine of the program.
Figure 11.40 Starting Program Execution
IDE–456 IDE User Guide
Debugging Source Code
Basic Debugging
Stepping through a single line
To execute one statement, use the Step Over command (Figure
11.41). If the statement is a routine call, the entire called routine
executes and the current-statement arrow proceeds to the next line
of code. In other words, the Step Over command executes a routine
call without visiting the code in the called routine. This behavior
holds true if the routine does not have breakpoints and does not call
other routines. When you step over code and reach the end of a
routine, the current-statement arrow returns to the routine caller.
Figure 11.41 Step Over Command
Stepping into routines
Sometimes you want to follow execution into a called routine. To
execute one statement at a time and follow execution into a routine
call, use the Step Into command (Figure 11.42).
Figure 11.42 Step Into Command
IDE User Guide IDE–457
Debugging Source Code
Basic Debugging
Step Into moves the current-statement arrow down one statement,
unless the current statement contains a routine call. When Step Into
reaches a routine call, the debugger follows execution into the
routine being called.
Stepping out of routines
To execute statements until the current routine returns to its caller,
use the Step Out command (Figure 11.43). Step Out executes the
rest of the current routine normally and stops the program when the
routine returns to its caller. You go one level back up the calling
chain. See “Call-chain navigation” on page 463 for more
information.
Figure 11.43 Step Out Command
Skipping statements
Sometimes you might want to skip statements altogether and not
execute them at all. You can move the current-statement arrow to a
different part of the currently executing source code by using the
following techniques:
• Manipulating the current-statement arrow
• Using the Change Program Counter dialog box
WARNING! Skipping statements is equivalent to deliberately changing the
program counter in a Register window. This change is very
dangerous, because you might corrupt the stack by skipping routine
calls and returns. The debugger cannot prevent you from corrupting
your run-time environment.
IDE–458 IDE User Guide
Debugging Source Code
Basic Debugging
Manipulating the current-statement arrow
One way of skipping statements is to drag the current-statement
arrow to a new position, as shown in Figure 11.44. Note that
dragging the current-statement arrow up or down does not execute
the statements between the original arrow position and its new
position.
Figure 11.44 Dragging the Current-statement Arrow
To move the current-statement arrow without potentially
corrupting the run-time environment, Alt/Option click a statement
in the Breakpoint column (Figure 11.45). Alt/Option clicking the
statement sets a temporary breakpoint: Execution proceeds
normally until the current-statement arrow reaches the temporary
breakpoint, then stops. After execution stops, the debugger
automatically removes the temporary breakpoint. For more
information, see “Breakpoints” on page 467.
Figure 11.45 Setting a Temporary Breakpoint
Dragging the current-statement arrow is convenient when you want
to skip only a few statements at a time. However, if you want to
skip several statements, the dragging technique becomes
IDE User Guide IDE–459
Debugging Source Code
Basic Debugging
inconvenient. Instead of directly manipulating the current-
statement arrow, you can also use the Change Program Counter key
binding. The default key bindings for this command are as follows:
Windows Ctrl-Shift-F10
Mac OS, Solaris, Linux You can assign a custom key binding to
this command. See “Customizing the IDE” on page 306 for more
information.
To use this command, click the line of source code to which you
want to skip. Next, press the Change Program Counter key binding.
If possible, the debugger moves the current-statement arrow to the
line that you clicked. If the debugger cannot move the arrow to the
specified line, an error message appears.
Using the Change Program Counter dialog box
If you want to move the current-statement arrow by specifying a
new address or by specifying a symbol, use the Change Program
Counter dialog box shown in Figure 11.46. To open this dialog box,
choose Debug > Change Program Counter. Type in the field the
address or symbol name to which you want to skip, then click OK.
If possible, the debugger moves the current-statement arrow to the
specified address or symbol. If the debugger cannot move the arrow
to the destination you specified, or if the symbolics file does not
contain the address or symbol that you entered, an error message
appears.
Figure 11.46 Change Program Counter Dialog Box
IDE–460 IDE User Guide
Debugging Source Code
Basic Debugging
Stopping execution
While your program is running, you can use the Stop command
(Figure 11.47) to suspend execution and explore your code with the
debugger. You can then step through your code from that point, or
use the Run command to resume execution.
Stopping in this manner is not very precise. Code executes very
quickly, and there is no telling exactly where the debugger
suspends your program when you issue the Stop command. Instead
of stopping code, you can use breakpoints, which allow you to
suspend program execution at a specific point. To learn more, see
“Breakpoints” on page 467.
Figure 11.47 Stop Command
NOTE The Stop command is not available for some build targets because
it is dependent on operating system services. For details on any
particular build target, see the corresponding Targeting manual as
described in “Targeting Documentation” on page 29.
TIP (Mac OS) If your program hangs in an infinite loop, you can
sometimes regain control by pressing Command-Control-/ on your
keyboard. The debugger attempts to interrupt the program after you
press this key binding. If the debugger successfully regains control,
you can examine your code and remove the infinite loop.
IDE User Guide IDE–461
Debugging Source Code
Basic Debugging
Killing execution
Sometimes you want to terminate your program completely and
end the debugging session. The Kill command (Figure 11.48) ends
the program and returns control to the debugger. The Thread
window tells you when the program is running, and to choose
Debug > Stop to stop its execution.
Figure 11.48 Kill Command
Killing a program is not the same as stopping a program. The Stop
command suspends execution only temporarily: you can resume
from the point at which you stopped execution. The Kill command
permanently terminates a program.
Restarting execution
The Restart command achieves the equivalent of choosing the Kill
command, followed by choosing the Debug command. Choose
Restart to terminate the current debugging session and immediately
begin a new debugging session.
Navigating Code
This section discusses the various ways you can move around in
your code. This skill is vital when you want to set breakpoints at
particular locations. The debugger lets you navigate code in the
following ways:
• Linear navigation—stepping though code
• Call-chain navigation—moving to active routines
• Symbolics window navigation—moving to code in the
Symbolics window
IDE–462 IDE User Guide
Debugging Source Code
Basic Debugging
• Changing font and color—modifying font styles and text colors
to make your code easier to read
Linear navigation
You can “walk” through your code by using the Step Over, Step
Into, and Step Out commands as needed until you reach the place
you want. This technique is useful for short stretches of code, but
not very helpful when you want to get to a specific location several
steps away.
“Stepping through a single line” on page 457, “Stepping into
routines” on page 457, and “Stepping out of routines” on page 458
describe various ways to linearly navigate your code.
Call-chain navigation
The Stack Crawl pane of the Thread window (Figure 11.49) shows
routine call chain. Each routine in the chain appears below its caller,
so the currently executing routine is at the bottom of the chain and
the first routine to execute in the program is at the top.
Figure 11.49 Stack Crawl Pane
You can use the Stack Crawl pane to navigate to the routines that
called the halted routine. To find the point where a routine in the
Stack Crawl pane is called, click the name of the routine caller. The
source code for the caller appears in the Source pane at the point of
the call (Figure 11.50).
IDE User Guide IDE–463
Debugging Source Code
Basic Debugging
Figure 11.50 Finding the Point Where a Routine is Called
Symbolics window navigation
You can use the Symbolics window to jump to any location in your
source code. The debugger displays this window only when you
open a symbolics file. To view a specific routine, follow these steps:
1. Ensure that the Symbolics window (Figure 11.51) is active.
IDE–464 IDE User Guide
Debugging Source Code
Basic Debugging
Figure 11.51 Activating the Symbolics Window
2. In the Files pane of the Symbolics window, select the file that
contains the routine’s definition (Figure 11.52).
Click the desired file, or use the arrow keys to scroll through the list.
The source code for that file appears in the Source pane. You can
also type the name of the file.
IDE User Guide IDE–465
Debugging Source Code
Basic Debugging
Figure 11.52 Selecting a File to View Its Contents
3. Locate the desired code in the source file.
Scroll through the Source pane to find the code you want. A more
useful technique is to use the Functions pane or Function pop-up
menu to select the desired routine (Figure 11.53). The routine
appears in the Source pane, allowing you to set and clear
breakpoints. For more information, see “Breakpoints” on page 467.
IDE–466 IDE User Guide
Debugging Source Code
Basic Debugging
Figure 11.53 Choosing a Routine to View
Changing font and color
The debugger displays source code in the font and color specified in
the Editor preference panels of the IDE Preferences window.
For more information, see “Editor Preferences” on page 277.
Breakpoints
A breakpoint suspends execution of a program and returns control
to the debugger. When the debugger reaches a statement with a
breakpoint, it stops the program before the statement is about to
execute. The debugger then displays the routine containing the
breakpoint in the Thread window. The current-statement arrow
moves to the line containing the breakpoint and points to the next
statement that is ready to execute.
This section discusses:
• Setting and clearing breakpoints
• Temporary breakpoints
IDE User Guide IDE–467
Debugging Source Code
Basic Debugging
• Viewing breakpoints
• Conditional breakpoints
• Setting breakpoints for templated or re-defined functions
• Impact of optimizing code on breakpoints
Setting and clearing breakpoints
From the Source pane of the editor window, Thread window, or
Symbolics window, you can set a breakpoint on any line with a
dash marker—the short line to the left of a statement in the
Breakpoint column (see Figure 11.54). The dash becomes a dot (on
color monitors, the default dot color is red). This dot indicates that a
breakpoint has been set at this statement. Execution will stop just
before this statement is executed.
Figure 11.54 Setting Breakpoints
Another way to set a breakpoint is to click a particular line of source
code in the Thread window and choose Debug > Set Breakpoint.
A third way to set a breakpoint is to choose Debug > Set/Clear
Breakpoint. The Set/Clear Breakpoint dialog box, shown in Figure
11.55, appears. Use this dialog box to specify an address or symbol
at which to set a breakpoint. After clicking OK, the debugger
attempts to set a breakpoint at the specified address or symbol. If
the debugger cannot set the breakpoint, or if the symbolics file does
IDE–468 IDE User Guide
Debugging Source Code
Basic Debugging
not contain the specified address or symbol, an error message
appears.
TIP You can also use the Set/Clear Breakpoint dialog box to clear
previously set breakpoints. Enter the address or symbol at which a
breakpoint is currently set, and click OK. The debugger removes the
specified breakpoint.
Figure 11.55 Set/Clear Breakpoint Dialog Box
To clear a single breakpoint, click the breakpoint dot in the Source
pane. The dot turns back into a dash, indicating that you have
removed that breakpoint.
You can manipulate breakpoints with the following commands in
the Debug menu:
• Clear Breakpoint—removes the breakpoint from the current
line
• Enable Breakpoint—activates the breakpoint on the current line
• Disable Breakpoint—de-activates the breakpoint on the current
line
• Clear All Breakpoints—removes all breakpoints from the
current program
• Show Breakpoints—displays the Breakpoints column when it is
currently hidden
• Hide Breakpoints—removes the Breakpoints column when it is
currently visible
IDE User Guide IDE–469
Debugging Source Code
Basic Debugging
In addition, you can use the debugger contextual menu in source
code views and the Breakpoints window to choose the same menu
commands. For more information, see “Debugger Contextual
Menu” on page 431.
TIP Put one statement on each line of code. This makes your code not
only easier to read, but also easier to debug. The debugger allows
only one breakpoint per line of source code, no matter how many
statements a line contains.
Temporary breakpoints
Regular breakpoints stop a program’s execution each time you
debug your project. However, you can also set temporary
breakpoints that stop a program’s execution only once. After
reaching the temporary breakpoint, the debugger stops the program
and then removes the temporary breakpoint.
You can set a temporary breakpoint in the following ways:
• (Windows, Solaris, and Linux) Alt-click the breakpoint dash to
the left of the desired source-code line.
• (Mac OS) Option-click the breakpoint dash to the left of the
desired source-code line.
• In the Thread window, click within the source-code line at
which you want to set a temporary breakpoint, then choose
Debug > Run to Cursor.
NOTE If you set a temporary breakpoint on a source-code line that already
contains a regular breakpoint, you can remove the regular
breakpoint without affecting the temporary breakpoint.
If the debugger encounters other breakpoints before reaching the
temporary breakpoint, program execution stops at each breakpoint.
The debugger removes the temporary breakpoint after reaching it
and halting program execution.
Viewing breakpoints
To see a list of all active breakpoints in your program, open the
Breakpoints window. Use one of the following techniques:
IDE–470 IDE User Guide
Debugging Source Code
Basic Debugging
• (Windows menu bar layout) Choose View > Breakpoints.
• (Macintosh menu bar layout) Choose Window > Breakpoints
Window.
The debugger displays a window that lists the source file and line
number for each breakpoint (Figure 11.56). Clicking a breakpoint
marker in the Breakpoints window toggles the breakpoint’s status
between active and inactive. A dot indicates that the breakpoint is
active. The debugger stops the program’s execution upon reaching
an active breakpoint. A circle indicates that the breakpoint is
inactive. The debugger continues to execute the program without
stopping at an inactive breakpoint. The debugger remembers the
position of inactive breakpoints in the program.
NOTE Double-clicking a breakpoint location in the Breakpoints window will
take you to that line of code in the Thread window or Symbolics
window.
For more information, see “Breakpoints Window” on page 438.
IDE User Guide IDE–471
Debugging Source Code
Basic Debugging
Figure 11.56 Displaying the Breakpoints Window
Conditional breakpoints
You can set conditional breakpoints that stop your program’s
execution at a given point only when a specified condition is met. A
conditional breakpoint is an ordinary breakpoint with a conditional
expression attached. If the expression evaluates to a true (nonzero)
value when control reaches the breakpoint, the program’s execution
stops; if the value of the expression is false (zero), the breakpoint
has no effect and program execution continues.
Conditional breakpoints are created in the Breakpoints window. To
specify a conditional breakpoint:
1. Set a breakpoint at the desired statement.
2. Open the Breakpoints window.
Choose View > Breakpoints (Windows menu bar layout) or
Window > Breakpoints Window (Macintosh menu bar layout) to
open the Breakpoints window.
IDE–472 IDE User Guide
Debugging Source Code
Basic Debugging
3. In the Breakpoints window, double-click the breakpoint’s
Condition field.
4. Enter an expression in the Condition field.
Alternatively, drag an expression from a source-code view or from
the Expressions window to the Condition field.
In Figure 11.57, the debugger stops execution at line 162 in the
NewBall() routine if and only if the variable newTop is greater
than six.
Figure 11.57 Creating a Conditional Breakpoint
NOTE Conditional breakpoints are especially useful when you want to stop
execution inside a loop, but only after going through several
iterations of that loop. You can set a conditional breakpoint inside
the loop that stops the program’s execution when the loop index
reaches the desired value.
Setting breakpoints for templated or re-defined functions
You can set breakpoints for templated functions and re-defined
functions.
Suppose you have a file named file.h that defines a function
void FOO(args), where FOO is a macro. If you enter the code
shown in Listing 11.1, a pop-up menu appears in the Breakpoints
column during the debugging session. Use this pop-up menu to set
a breakpoint for function1 or function2.
IDE User Guide IDE–473
Debugging Source Code
Basic Debugging
Listing 11.1 Example for Templated and Re-defined Functions
#define FOO function1
#include file.h
#define FOO function2
#include file.h
Impact of optimizing code on breakpoints
In order to accurately set breakpoints, the debugger relies on a
direct correspondence between source code and object code.
Optimizing your code can disrupt this relationship and cause
problems when setting breakpoints.
If there is no breakpoint dash to the left of a line of source code, you
cannot set a breakpoint at that line. The potential causes are:
• Symbolics information was disabled for that line.
• The routine containing the line was unused and was therefore
deadstripped by the linker.
• The code has been optimized and the final object code no longer
corresponds to the original source code.
The code optimization cause is the most common. For example, the
PowerPC compiler lets you set a breakpoint when the start of a
source statement corresponds to the start of a “statement block” that
has at least one instruction in it. (You do not need to understand the
term “statement block” in this example.)
Normally, when debugging information is enabled for a source file,
the compiler tries to start a new statement block at each source
statement that actually generates some code. For example, consider
the source code in Listing 11.2:
Listing 11.2 Sample Code with Breakpoints
- int i = 1;
- if (i)
{ //This is the third line.
int k;
- int j = 1;
IDE–474 IDE User Guide
Debugging Source Code
Basic Debugging
- i = j;
}
Since the third line does not generate instructions, it does not have a
unique object code address. Therefore, the debugger does not
permit a breakpoint on that line.
After you start optimizing the code, the situation changes. For
example, when you enable Instruction Scheduling in the project’s
Global Optimizations preference panel, the compiler no longer
starts a new basic block for each source statement. The scheduler
gains the maximum flexibility for reordering instructions within the
block. The different instructions that correspond to a source
statement are no longer consecutive. Instead, they are intermingled
with the instructions from other source statements. Because of these
optimizations, the debugger no longer displays breakpoint dashes
as shown in Listing 11.2.
When you enable additional optimizations, the source statements
may not even appear in the generated code. For example, consider
the following code:
Listing 11.3 Sample Code with a Loop
i = 0;
j = 0;
while (i < 10)
{
j = j + 1;
i = i + 1;
}
With minimal optimization, the compiler translates the code from
Listing 11.3 into the following equivalent code:
j = j + 1; // duplicate 10 times
j = j + 1;
.
.
.
j = j + 1;
IDE User Guide IDE–475
Debugging Source Code
Basic Debugging
With even more optimization, the compiler totally eliminates
instructions corresponding to the while loop and uses the
following equivalent code:
j = 10;
While debugging your code, you should disable optimizations or
use optimizations that are “debug safe.” Different optimizations are
available for different build targets. See the appropriate Targeting
manual for additional details, as described in “Targeting
Documentation” on page 29.
You can view the current optimizations for your project in the
Global Optimizations preference panel of the Target Settings
window. For more information, refer to “Configuring Target
Options” on page 331.
After setting a breakpoint, you can continue debugging the
program. Refer to “Running, Stepping, and Stopping Code” on
page 454 for additional details.
Watchpoints
A watchpoint is a location or region of memory that you want the
debugger to observe for you. Whenever a new value is written to
that area of memory, the debugger suspends execution of the
program and notifies you with an alert message on your screen
(Figure 11.58). After dismissing the alert, you can examine the call
chain, inspect or change variables, step through your code, or use
any of the debugger’s other facilities. (In particular, from the
debugger level, you can change the contents of the location that
triggered the watchpoint without triggering it again.) Use the Run
command (or the Run button on the debugger toolbar) to continue
execution from the watchpoint.
The following sections discuss watchpoints in more detail:
• Setting and clearing watchpoints
• Viewing watchpoints
NOTE (Mac OS) Watchpoints require System 7.5 or later, and will not
work on 68K computers unless you enable virtual memory.
IDE–476 IDE User Guide
Debugging Source Code
Basic Debugging
Watchpoints are also known to be incompatible with the Speed
Emulator portion of Speed Doubler, and possibly with RAM
Doubler as well.
If you have a small program with a small set of global variables for
68K, the global data area is placed against the end of the stack.
Since the debugger cannot detect watchpoints for variables on the
stack, the global variables cannot be watched. One way to avoid
this problem is to declare a global array of type char, about four
kilobytes in size, to move the global variables away from the stack.
Figure 11.58 Watchpoint Alert
Setting and clearing watchpoints
You can set a watchpoint in any of the following ways:
• Select a variable, in a Variable window or in the Symbolics
window, and choose Debug > Set Watchpoint.
• Drag a variable from another window into the Watchpoints
window.
• Select a range of bytes in a Memory window and choose Debug
> Set Watchpoint.
• Invoke the debugger contextual menu (Figure 11.18 on page 432)
for an appropriate variable or memory range and choose the Set
Watchpoint command.
IDE User Guide IDE–477
Debugging Source Code
Basic Debugging
Variables or memory locations on which a watchpoint has been set
are underlined in red in the Variable and Memory windows. To
learn how to change this default color, refer to the section “Text
Colors” on page 282.
WARNING! There are some significant restrictions on where in memory you
can place a watchpoint. You can use watchpoints only on global
variables or on objects allocated from your application heap. You
cannot set a watchpoint on a stack-based local variable or on a
variable being held in a register
Mac OS You cannot set a watchpoint anywhere in low memory
or the system heap. If you attempt to set a watchpoint in this area
of memory, an alert box displays with the following text: “Could not
set a watchpoint because the page containing that memory
location overlaps low memory or the system heap.”
NOTE (Mac OS) When debugging small 68K projects, you might see an
alert box with the following text when trying to set watchpoints on a
global variable: “Could not set a watchpoint at that location because
it is on the stack.” This is a limitation of the classic 68K runtime
architecture, not the debugger.
You can clear a watchpoint in any of the following ways:
• After triggering the watchpoint, choose Debug > Clear
Watchpoint.
• Select a variable, in a Variable window or in the Symbolics
window, and choose Debug > Clear Watchpoint.
• Select a range of bytes in a Memory window and choose Debug
> Clear Watchpoint.
• Select an existing watchpoint in the Watchpoints window and
– Choose Debug > Clear Watchpoint
– (Windows, Solaris, and Linux) Press Backspace, or choose
Edit > Delete
– (Mac OS) Press Delete, or choose Edit > Clear
• Invoke the debugger contextual menu for a selected watchpoint
and choose the Clear Watchpoint command.
IDE–478 IDE User Guide
Debugging Source Code
Basic Debugging
All watchpoints are automatically cleared after the debugger kills
the program, or after the program’s execution terminates.
You can manipulate watchpoints with the following commands in
the Debug menu:
• Enable Watchpoint—activates the watchpoint for the selected
variable or memory range
• Disable Watchpoint—de-activates the watchpoint for the
selected variable or memory range
• Clear All Watchpoints—removes all watchpoints from the
current program
In addition, you can use the debugger contextual menu in source-
code views and the Watchpoints window to choose the same menu
commands. For more information, see “Debugger Contextual
Menu” on page 431.
Viewing watchpoints
To see a list of all watchpoints currently set in your program, open
the Watchpoints window (Figure 11.59). Use one of the following
techniques:
• (Windows menu bar layout) Choose View > Watchpoints.
• (Macintosh menu bar layout) Choose Window > Watchpoints
Window.
For more information, see “Watchpoints Window” on page 439.
IDE User Guide IDE–479
Debugging Source Code
Basic Debugging
Figure 11.59 Displaying the Watchpoints Window
Viewing and Changing Data
A critical feature of a debugger is the ability to see the current
values of variables, and to change those values when necessary.
This ability allows you to understand the details of your program’s
execution, and to experiment with new possibilities.
This section discusses the following topics:
• Viewing local variables
• Viewing global variables
• Placing data in a new window
• Viewing data types
• Viewing data in a different format
• Viewing data as different types
• Changing the value of a variable
• Using the Expressions window
• Viewing raw memory
IDE–480 IDE User Guide
Debugging Source Code
Basic Debugging
• Viewing memory at an address
• Viewing Processor Registers
For additional information on viewing and changing data for a
particular target, see the corresponding Targeting manual.
Viewing local variables
Local variables are displayed in the Variables pane of the Thread
window (Figure 11.60). If the variable is a handle, pointer, or
structure, you can click the hierarchical control to the left of the
name to expand the view. This allows you to see the members of the
structure, or the data referenced by the pointer or handle.
To learn some useful tips for using hierarchical controls, see
“Expanding and Collapsing Groups” on page 72. For more
information about the Variables pane of the Thread window, refer
to “Variables pane” on page 419.
Figure 11.60 Viewing Local Variables
Viewing global variables
To view global variables, open the Global Variables window. Use
one of the following techniques:
• (Windows menu bar layout) Choose View > Global Variables
Window.
• (Macintosh menu bar layout) Choose Window > Global
Variables Window.
IDE User Guide IDE–481
Debugging Source Code
Basic Debugging
Next, click the Global Variables item in the File pane (Figure 11.61).
Then, the Variables pane displays the global variables in your
program.
For more information, see “Global Variables Window” on page 437.
Figure 11.61 Viewing Global Variables
Placing data in a new window
Sometimes the Variables pane and Global Variables window are not
the most convenient places to view data. You can place any variable
or group of variables in a separate window.
To place a variable or memory location in its own window, double-
click its name (Figure 11.62) or select the name and choose Data >
View Variable, or choose the View Variable command from the
debugger contextual menu (Figure 11.18 on page 432). If the
variable is an array, use the View Array command instead. To view
the memory the variable occupies as a memory dump, use either the
View Memory or View Memory As command.
For more information, see “Variable Window” on page 446, “Array
Window” on page 447, and “Memory Window” on page 448.
IDE–482 IDE User Guide
Debugging Source Code
Basic Debugging
Figure 11.62 Placing a Variable in Its Own Window
Viewing data types
If you wish, the debugger can display the data types of variables on
a window-by-window basis. Select the window or pane in which
you want data types displayed and choose Data > Show Types, or
choose the Show Types command from the debugger contextual
menu (Figure 11.18 on page 432). Then, the relevant data type
follows the names of the variables and memory locations in that
window or pane (Figure 11.63).
IDE User Guide IDE–483
Debugging Source Code
Basic Debugging
Figure 11.63 Viewing Data Types
TIP To show data types automatically, enable the following preference
in the Display Settings preference panel of the IDE Preferences
window:
In variable panes, show variable types by default
See “Display Settings” on page 288 for more information.
IDE–484 IDE User Guide
Debugging Source Code
Basic Debugging
Figure 11.64 Selecting a Data Format
Viewing data in a different format
You display a variable’s value in several formats:
• binary
• signed decimal
• unsigned decimal
• hexadecimal
• character
• C string
• Pascal string
• unicode string
• floating point
• enumeration
IDE User Guide IDE–485
Debugging Source Code
Basic Debugging
• Fixed
• Fract
To view data in a particular format, select either the name or the
value of the variable in any window in which it is displayed, then
choose the format from the Data menu (Figure 11.64) or the
debugger contextual menu (Figure 11.18 on page 432).
Not all formats are available for all data types. For example, if a
variable is an integral value (such as type short or long), you can
view it in signed decimal, unsigned decimal, hexadecimal,
character, or string format. However, you cannot view the same
variable in floating-point, Fixed, or Fract format.
Viewing data as different types
The View As command in the Data menu lets you change the data
type in which a variable, register, or memory value appears:
1. Select the item in a window or pane.
2. Choose Data > View As.
Alternatively, you can use the debugger contextual menu (Figure
11.18 on page 432) to select the same command. After you choose
the View As menu command, the debugger displays the View As
dialog box, shown in Figure 11.65.
3. Select the data type by which to view the item.
The data type you select is displayed in the New Type text field near
the bottom of the dialog box. If you want to treat the item as a
pointer, append an asterisk (*) to the type name.
4. Click OK.
The display of the item’s value changes to the specified type.
IDE–486 IDE User Guide
Debugging Source Code
Basic Debugging
Figure 11.65 Selecting a Data Type
Changing the value of a variable
You can change the value of a variable in any variable view.
Variables are displayed in several debugging windows: the
Variables pane of the Thread window or Symbolics window, a
Variable window, an Array window, or the Expressions window.
To change the value, double-click the variable (or select it and press
Enter/Return) and type the new value (Figure 11.66).
You can enter variable values in any of the following formats:
• decimal
• hexadecimal
• floating point
• C string
• Pascal string
• character constant
IDE User Guide IDE–487
Debugging Source Code
Basic Debugging
Figure 11.66 Changing a Variable Value
To enter a string or character constant, you must include C-style
quotation marks (single quotes '' for a character constant, double
quotes "" for a string). For Pascal strings, include the escape
sequence \p as the first character in the string.
WARNING! Changing variable values can be dangerous. The debugger allows
you to set a variable to any value of the appropriate data type. For
example, you could set a pointer to nil and crash the machine.
Using the Expressions window
The Expressions window provides a single place to put frequently
used local variables, global variables, structure members, array
IDE–488 IDE User Guide
Debugging Source Code
Basic Debugging
elements, and complex expressions. To open this window, use one
of the following techniques:
• (Windows menu bar layout) Choose View > Expressions.
• (Macintosh menu bar layout) Choose Window > Expressions
Window.
You can add an item to the Expressions window in the following
ways:
• Choose Data > New Expression.
• Drag and drop an item from another window.
• Select an item and choose Data > Copy to Expression.
• Choose the Copy to Expression command from the debugger
contextual menu (Figure 11.18 on page 432).
The IDE updates the contents of the Expressions window whenever
execution stops in the debugger. The IDE leaves blank any variable
that is out of scope. You can use the Expressions window to perform
a number of tasks:
• Move a routine’s local variables to the Expressions window
before expanding them to observe their contents. When the
routine exits, its variables remain in the Expressions window
and are still expanded when execution returns to the routine.
The Expressions window does not automatically collapse local
variables when execution leaves a routine, like the Variables
pane in the Thread window.
• Keep multiple copies of the same item displayed as different
data types, by using the Copy to Expression and View As
commands in the Data menu and the debugger contextual
menu.
• Keep a sorted list of items. You can reorder items by dragging
them within the Expressions window.
• View local variables from calling routines. You don’t have to
navigate back up the calling chain to display a caller’s local
variables (which hides the local variables of the currently
executing routine). Add the caller’s local variables to the
Expressions window to view them without changing levels in
the Stack Crawl pane.
For more information, see “Expressions Window” on page 436.
IDE User Guide IDE–489
Debugging Source Code
Basic Debugging
Viewing raw memory
To examine and change the raw contents of memory:
1. Select an item or expression representing the base address of the
memory you want to examine.
2. Choose Data > View Memory.
A new Memory window opens and displays the contents of
memory in hexadecimal and ASCII format. You can change
memory directly from the Memory window by entering
hexadecimal values or characters. You can also change the
beginning address of the memory being displayed by changing the
expression in the Display text field at the top of the window.
Viewing memory at an address
The View Memory and View Memory As commands in the Data
menu allow you to follow any pointer—including an address stored
in a register—and view the memory to which it currently points.
To display the memory referenced by a pointer, follow these steps:
1. Select the value of the variable or register in a window in which it
appears.
2. Choose Data > View Memory or Data > View Memory As.
If you choose the View Memory menu command, stop with this
step. A Memory window opens and displays a raw memory dump,
starting at the address referenced by the pointer.
If you choose the View Memory As menu command, continue to
the next step. A dialog box (Figure 11.67) opens and prompts you to
select a data type.
3. If you chose Data > View Memory As, select a data type in the
View As dialog box.
The data type you select appears in the New Type field. To view the
memory pointed to by a register, append an asterisk (*) to the type
name.
4. Click OK in the View As dialog box.
A new window opens (Figure 11.68) and displays the contents of
memory, starting at the address referenced by the pointer.
IDE–490 IDE User Guide
Debugging Source Code
Basic Debugging
Figure 11.67 Choosing a Data Type to View Memory
NOTE You can use this technique to view the contents of the stack. If your
target processor stores the stack pointer in a particular register,
select the value of that register. Then follow the previously
described steps.
For more information, refer to “Memory Window” on page 448.
IDE User Guide IDE–491
Debugging Source Code
Basic Debugging
Figure 11.68 Viewing Memory as a Specified Data Type
Viewing Processor Registers
To view the contents of the processor’s general registers, choose
Window > Registers Windows > General Registers (Figure 11.69
on page 493).
For more information, see “Register Windows” on page 440.
IDE–492 IDE User Guide
Debugging Source Code
Expressions
Figure 11.69 Viewing General Processor Registers
Editing Source Code
You cannot edit source code directly in the debugger. However, you
can use the debugger to open the source-code file so that you can
modify your code. In the Files pane of the Symbolics window, you
can double-click a file name to open the file in an editor window.
Windows You can specify that a third-party editor open the file.
See “IDE Extras” on page 259 for more information.
Expressions
An expression represents a computation that produces a value that
the debugger displays in the Expressions window. You can attach
IDE User Guide IDE–493
Debugging Source Code
Expressions
an expression’s value to breakpoints and watchpoints. The
debugger evaluates all expressions each time it executes a
statement.
An expression can combine literal values (numbers and character
strings), variables, registers, pointers, and C++ object members with
operations such as addition, subtraction, logical and, and equality.
An expression can appear in the Expressions window, the
Breakpoints window, or a Memory window. The debugger treats
the result of the expression differently, depending on the window in
which the expression appears.
This section discusses how the debugger handles expressions. This
section includes the following topics:
• How Expressions are Interpreted
• Using Expressions
• Example Expressions
• Expression Syntax
• Using Vector Variables in Expressions (Mac OS)
How Expressions are Interpreted
The debugger interprets expressions in various ways, depending on
their locations:
• Expressions in the Expressions Window
• Expressions in the Breakpoints Window
• Expressions in a Memory Window
Expressions in the Expressions Window
The Expressions window displays expressions and their values. To
see the value of an expression, place it in the Expressions window.
To create a new expression, follow these steps:
1. Open the Expressions window.
Use one of the following techniques:
• (Windows menu bar layout) Choose View > Expressions.
IDE–494 IDE User Guide
Debugging Source Code
Expressions
• (Macintosh menu bar layout) Choose Window > Expressions
Window.
If the Expressions window is already open, click it to make it active.
2. Choose Data > New Expression
3. Enter a new expression.
The expression’s value appears in the Value column next to that
expression (Figure 11.70). You can also create a new expression by
dragging a variable or expression from another window to the
Expressions window.
Figure 11.70 An Expression in the Expressions Window
The Expressions window treats all expressions arithmetically; the
debugger does not interpret the expression’s result as a logical
value, like it does in the Breakpoints window.
For more information, see “Expressions Window” on page 436.
Expressions in the Breakpoints Window
You can attach an expression to a breakpoint in the Breakpoints
window. The Breakpoints window treats expressions logically
rather than arithmetically.
If the expression yields a false (zero) result, the debugger ignores
the breakpoint and continues execution. If the result is true
(nonzero), the debugger stops at the breakpoint if the breakpoint is
active. To learn how to set a breakpoint, see “Setting and clearing
breakpoints” on page 468.
IDE User Guide IDE–495
Debugging Source Code
Expressions
You can attach an expression to a breakpoint to make the
breakpoint conditional on that expression:
1. Open the Breakpoints window.
Use one of the following techniques:
• (Windows menu bar layout) Choose View > Breakpoints.
• (Macintosh menu bar layout) Choose Window > Breakpoints
Window.
If the Breakpoints window is already open, click it to make it active.
2. Set a condition.
Double-click the condition field for the desired breakpoint and type
an expression (Figure 11.71). You can also add or change a
breakpoint’s condition by dragging an expression from another
window and dropping it on the breakpoint’s condition.
Figure 11.71 A Conditional Expression in the Breakpoints Window
A conditional breakpoint stops the program if the expression yields
a true (nonzero) result when execution reaches the breakpoint. If the
expression produces a false (zero) result, execution continues
without stopping.
For more information, see “Breakpoints Window” on page 438 and
“Conditional breakpoints” on page 472.
Expressions in a Memory Window
In a Memory window, expressions are treated as addresses. The
expression in the Display text field at the top of the window defines
IDE–496 IDE User Guide
Debugging Source Code
Expressions
the base address for the memory displayed in the window. To
change a Memory window’s base address, follow these steps:
1. Choose Data > View Memory.
If a Memory window is already open, click it to make it active.
2. Enter a new expression.
Double-click the Display field and type an expression. You can also
drag and drop an expression from another window into the Display
field.
The Memory window displays the contents of memory beginning at
the address obtained by evaluating the new expression.
Refer to “Memory Window” on page 448 for more information.
Using Expressions
The debugger’s expression syntax is similar to that of C/C++, with
a few additions and limitations. The syntax also supports Pascal-
style expressions. This section discusses the following topics:
• Special Expression Features
• Expression Limitations
Special Expression Features
Expressions can refer to specific items:
• The debugger considers integer values to be 4 bytes long. Use
the short data type to denote a 2-byte integer value.
• The debugger treats double values as objects 10 bytes (80 bits)
in length, rather than 8 bytes (64 bits).
• To compare character strings, use the == (equal) and != (not
equal) operators. The debugger distinguishes between Pascal-
and C-format strings. Use the prefix \p when comparing Pascal
string literals. The following expression yields a false result
because it compares a C string to a Pascal string:
"Nov shmoz ka pop" == "\pNov shmoz ka pop"
• (Mac OS) To refer to register values, use the ® symbol and a
register name. (Type Option-r to get the ® symbol.)
IDE User Guide IDE–497
Debugging Source Code
Expressions
Expression Limitations
Expressions have the following limitations:
• Do not use C/C++ preprocessor definitions and macros (defined
with the #define directive). They are not available to the
expression evaluator, even though the source code defines them.
• Do not use operations involving side effects. The increment
(i++) and decrement (i--) operators, as well as assignments
(i = j), are not allowed.
• Do not call functions.
• Do not use function names or pointers to functions.
• Do not use expression lists.
• Do not use pointers to C++ class members.
• The debugger cannot distinguish between identical variable
names used in nested blocks to represent different variables (see
Listing 11.4).
• Avoid using type definitions that are not available to the
debugger (see Listing 11.5 on page 499).
Listing 11.4 Identical Variable Names in Nested Blocks (C++)
// The debugger cannot distinguish between x the
// int variable and x the double variable. If x is
// used in an expression, the debugger will not
// know which one to use.
void f(void)
{
int x = 0;
.
.
.
{
double x = 1.0;
.
.
.
}
}
IDE–498 IDE User Guide
Debugging Source Code
Expressions
Listing 11.5 Type Definitions in Expressions (C/C++)
// Use long in expressions; Int32 not available
typedef long Int32;
// Use Rect* in expressions; RectPtr not available
typedef Rect* RectPtr;
• Nested type information is not available. In Listing 11.6, use
Inner, not Outer::Inner in a debugger expression.
Listing 11.6 Nested Type Information (C/C++)
// To refer to the i member, use Inner.i,
// not Outer::Inner.i
struct Outer
{
struct Inner
{
int i;
};
};
Example Expressions
The list below provides example expressions that you can use in any
window that supports expressions.
• A literal decimal value:
160
• A literal hexadecimal value:
0xA0
• The value of a variable:
myVariable
• The value of a variable shifted 4 bits to the left:
myVariable << 4
• The difference of two variables:
myRect.bottom - myRect.top
• The maximum of two variables:
IDE User Guide IDE–499
Debugging Source Code
Expressions
(foo > bar) ? foo : bar
• The value of the item pointed to by a pointer variable:
*MyTablePtr
• The size of a data structure (determined at compile time):
sizeof(myRect)
• The value of a member variable in a structure pointed to by a
variable:
myRectPtr->bottom
or
(*myRectPtr).bottom
• The value of a class member in an object:
myDrawing::theRect
Below are examples of logical expressions: the result is considered
true if non-zero, false if zero.
• Is the value of a variable false?
!isDone
or
isDone == 0
• Is the value of a variable true?
isReady
or
isReady != 0
• Is one variable greater than or equal to another?
foo >= bar
• Is one variable less than both of two others?
(foo < bar) && (foo < car)
• Is the fourth bit in a character value set to 1?
((char)foo >> 3) & 0x01
• Is a C string variable equal to a literal string?
cstr == "Nov shmoz ka pop"
• Is a Pascal string variable equal to a literal string?
pstr == "\pScram gravy ain't wavy"
• Always true:
1
• Always false:
0
IDE–500 IDE User Guide
Debugging Source Code
Expressions
Expression Syntax
This section defines the debugger’s expression syntax. Each listing
follows several conventions to make it easier to read:
• The first line in a definition identifies the item being defined.
• Each indented line represents a definition for that item.
• An item with more than one definition has each definition listed
on a new line.
• Items enclosed in angle brackets (<>) are defined elsewhere.
• Items in italic typeface are to be replaced by a value or symbol.
• All other items are literals to be used exactly as they appear.
For example,
<name>
identifier
<qualified-name>
defines the syntax of a name. A name can be either an identifier or a
qualified name; the latter is a syntactic category described in
another of the definitions listed in this section.
The following list describes expression syntax:
<name>
identifier
<qualified-name>
<typedef-name>
identifier
<class-name>
identifier
<qualified-name>
<qualified-class-name>::<name>
<qualified-class-name>
<class-name>
<class-name>::<qualified-class-name>
<complete-class-name>
<qualified-class-name>
:: <qualified-class-name>
IDE User Guide IDE–501
Debugging Source Code
Expressions
<qualified-type-name>
<typedef-name>
<class-name>::<qualified-type-name>
<simple-type-name>
<complete-class-name>
<qualified-type-name>
char
short
int
long
signed
unsigned
float
double
void
<ptr-operator>
*
&
<type-specifier>
<simple-type-name>
<type-specifier-list>
<type-specifier> <type-specifier-list>(opt)
<abstract-declarator>
<ptr-operator> <abstract-declarator>(opt)
(<abstract-declarator>)
<type-name>
<type-specifier-list> <abstract-
declarator>(opt)
<literal>
integer-constant
character-constant
floating-constant
string-literal
<register-name>
®PC
®SP
®Dnumber
®Anumber
IDE–502 IDE User Guide
Debugging Source Code
Expressions
<register-name>
®Rnumber
®FPnumber
®RTOC
<register-name>
$PC
$SP
$RTOC
$Anumber
NOTE Registers not targeted by the processor do not display random
values for unknown register expressions.
NOTE For specifying a register, the range for number depends on the
number of registers available on the target processor.
<primary-expression>
<literal>
this
::identifier
::<qualified-name>
(<expression>)
<name>
<register-name>
<postfix-expression>
<primary-expression>
<postfix-expression>[<expression>]
<postfix-expression>.<name>
<postfix-expression>-><name>
<unary-operator>
*
&
+
-
!
~
<unary-expression>
<postfix-expression>
<unary-operator> <cast-expression>
IDE User Guide IDE–503
Debugging Source Code
Expressions
sizeof <unary-expression>
sizeof(<type-name>)
<cast-expression>
<unary-expression>
(<type-name>)<cast-expression>
<multiplicative-expression>
<cast-expression>
<multiplicative-expression> * <cast-
expression>
<multiplicative-expression> / <cast-
expression>
<multiplicative-expression> % <cast-
expression>
<additive-expression>
<multiplicative-expression>
<additive-expression> + <multiplicative-
expression>
<additive-expression> - <multiplicative-
expression>
<shift-expression>
<additive-expression>
<shift-expression> << <additive-expression>
<shift-expression> >> <additive-expression>
<relational-expression>
<shift-expression>
<relational-expression> < <shift-
expression>
<relational-expression> > <shift-
expression>
<relational-expression> <= <shift-
expression>
<relational-expression> >= <shift-
expression>
<equality-expression>
<relational-expression>
<equality-expression> == <relational-
expression>
<equality-expression> != <relational-
expression>
IDE–504 IDE User Guide
Debugging Source Code
Expressions
<and-expression>
<equality-expression>
<and-expression> & <equality-expression>
<exclusive-or-expression>
<and-expression>
<exclusive-or-expression> ^ <and-
expression>
<inclusive-or-expression>
<exclusive-or-expression>
<inclusive-or-expression> | <exclusive-or-
expression>
<logical-and-expression>
<inclusive-or-expression>
<logical-and-expression> && <inclusive-or-
expression>
<logical-or-expression>
<logical-and-expression>
<logical-or-expression> || <logical-and-
expression>
<conditional-expression>
<logical-or-expression>
<logical-or-expression> ? <expression> :
<conditional-expression>
<expression>
<conditional-expression>
Using Vector Variables in Expressions
(Mac OS)
You can use vector variables in expressions. Vector variables are
defined as opaque structures in the C programming language, but
you might find it useful to access the scalar elements inside the
vector variable while debugging.
You can drag a vector variable into the Variable window or the
Expressions window to change the values of its elements, but you
sometimes still need to access the elements in expressions.
IDE User Guide IDE–505
Debugging Source Code
Troubleshooting
The C language does not provide the ability to access elements in
expressions. However, the CodeWarrior IDE allows such access
(only in expressions, not in your source code) by using unary
operators.
Suppose you define an unsigned short variable x. You can access
any of the scalar elements in x with the following statement:
x.[index]
The index is an integer from 0-7 (there are 8 shorts) that represents
the element that you wish to access.
You can use the following notation in equality tests or other
expression statements:
x.[0] >= 0x12
More usefully, you can use the following notation to set a
conditional breakpoint:
o main, line 765 | x.[0] == 0xFFFF
You cannot access vectors in the Expressions window by register
name. For example, the following expressions are invalid:
®VR31
®VR30 == 'some 128-bit number'
®VR29.[3]
®VR28.[0] == 0xDEADBEEF
To avoid this situation, access a vector through its variable
identifier. If you must manipulate or examine a register for which a
variable identifier does not exist, use the AltiVec Registers window.
Troubleshooting
This section discusses various problems people have encountered
while debugging their programs. There are suggested solutions for
each problem.
The general topics include:
• General Problems
IDE–506 IDE User Guide
Debugging Source Code
Troubleshooting
• Problems Launching the Debugger
• Problems Running/Crashing the Debugger
• Problems with Breakpoints
• Problems with Variables
• Problems with Source Files
General Problems
There may come a time when one of the solutions in this section
does not seem to work, or your specific problem is not discussed.
The following list details additional steps you can take to try
resolving the problem:
• Remove easily regenerated files and data, including .(x)sym
files, .dbg files, preferences, binaries in your project (by
choosing Project > Remove Object Code. See “Handling Object
Code” on page 384 for more information).
• Copy the newest version of the IDE to your hard drive.
• (Mac OS) Check for extension conflicts.
• (Mac OS) Try a few sample sessions with all possible extensions
disabled.
Problems Launching the Debugger
This section lists questions and problems with launching the
debugger.
The debugger does not launch
Problem
Even if I choose Project > Enable Debugger, when I debug my
application the debugger does not launch.
The Run or Debug command in the CodeWarrior Project menu is
dimmed.
Background
You can launch the debugger automatically from the CodeWarrior
IDE only if the project is an application project, the debugger is
IDE User Guide IDE–507
Debugging Source Code
Troubleshooting
enabled, and the project is properly configured to generate
debugging information.
Solutions
• Make sure your project generates an application. The Run
command is only available when creating an application.
• Make sure that the debugger is enabled. Choose Project >
Enable Debugger to enable the debugger. If you see the Disable
Debugger command instead, the debugger is already enabled.
• Set up your project to generate symbolics information for the
debugger. For more information, see “Preparing for Debugging”
on page 411.
The Debug command does nothing
Problem
The Debug command does nothing.
Background
You must have everything configured properly for the debugger to
work correctly. In addition, make sure your code actually does
something!
Solutions
• Make sure debugging is enabled for the project. See “Preparing
for Debugging” on page 411 for more information.
• Consult the IDE release notes for the latest information on
incompatibilities with third-party software.
Errors reported on launch (Mac OS)
Problem
I get error -27 when I start debugging and -619 when I quit.
Background
You may be using an older version of Ram Doubler that is not
compatible with the debugger.
Solution
• Upgrade Ram Doubler to version 1.5.2 or later.
IDE–508 IDE User Guide
Debugging Source Code
Troubleshooting
Problems Running/Crashing the Debugger
This section covers problems that occur while you are running the
debugger.
Project works in the debugger, crashes without
Problem
My project works fine when running under the debugger’s control.
When I run the project without the debugger, my program crashes.
Background
Running a program under the debugger changes the operating
environment in which the program runs. This can have the strange
effect of making an otherwise flawed program work correctly. It is
difficult to pinpoint the cause of this problem in your code, but
there are two likely factors that can cause the odd behavior.
• The debugger slows down the program’s execution. If you have
code that is time-sensitive, things may happen too quickly when
the debugger is not present. Keep this in mind when studying
the problem.
• The presence of the debugger can also modify memory
management of the project. A block of memory cannot move if
the debugger is running, for example. With the debugger absent,
the block moves and a memory-related bug results.
Solutions
• Look for time-sensitive problems, race conditions, and similar
factors in your code.
• Look for memory-related problems, such as accessing null
pointers or handles, improperly disposing of resource handles,
or disposing of handles more than once.
Problems with Breakpoints
This section covers problems related to setting and clearing
breakpoints.
IDE User Guide IDE–509
Debugging Source Code
Troubleshooting
Statements don’t have breakpoints
Problem
Some statements don’t have dashes in the Breakpoint column,
making it impossible to set them.
Background
The CodeWarrior linkers do not generate symbolics information for
source code that is not linked into the final output file. If a statement
is never actually used, the linker does not include it in the final
object code. You cannot set a breakpoint on such a statement,
because the object code does not exist.
Code optimization may also reorganize the object code extensively,
affecting the correspondence between object code and source code
and making it difficult or impossible to set breakpoints accurately.
Solutions
• Make sure all your code is used. Change the source code if
necessary.
• Check your source code to see if statements were ignored by the
compiler because of compiler directives.
• Disable all compiler optimizations and rebuild your project.
Optimization may make changes in object code that do not
correspond to your source code. You should get a breakpoint
marker at every available statement after disabling
optimizations. For more information, see “Impact of optimizing
code on breakpoints” on page 474.
• Use a coding style wherein you place only one statement on a
source line. The compiler outputs breakpoint information for
multiple statements on a line, but the debugger only displays the
current source line. You might step multiple times on the same
source line.
Breakpoints do not respond
Problem
I set a breakpoint, but it does not work.
IDE–510 IDE User Guide
Debugging Source Code
Troubleshooting
Background
A breakpoint stops execution only if it is reached, it is active, and its
condition (if it has one) is true.
Solutions
• Step through your code to verify whether you reach the
statement at which you placed the breakpoint. To learn more,
refer to “Setting and clearing breakpoints” on page 468.
• Look in the Breakpoints window to see if the breakpoint is
inactive.
• If the breakpoint has a condition, make sure it evaluates to true.
The debugger ignores breakpoints with false conditions. See
“Conditional breakpoints” on page 472 for more information.
Problems with Variables
This section covers problems related to variables.
A variable does not change
Problem
I have a variable and I assign it a value, but the value does not
change in the debugger.
Background
You are not using the variable in the code. As a result, the compiler
optimizes the final output file so that the variable is not used.
Solutions
• Remove the unused variable from your code.
• Modify your code to use the variable.
Variables are assigned incorrect values
Problem
I notice that values seem to be changing incorrectly. I encounter one
of these two problems:
• Two or more variables are set to the same value simultaneously.
IDE User Guide IDE–511
Debugging Source Code
Troubleshooting
• One variable receives a value that is supposed to be assigned to
another.
Background
The compiler has recognized that the variables are not used
concurrently, and has given the variables the same storage location.
What you are seeing is a kind of automatic compiler optimization
called “lifetime based register allocation,” also known as “register
coloring.” Register coloring checks to see how variables are used in
a routine. If two or more variables are in the same scope but are not
used at the same time, the compiler may use the same processor
register for both variables. Using registers instead of memory to
store and manipulate variables improves a program’s performance.
Listing 11.7 is a good example of the kind of code that results in
register coloring. Because four different variables are set but never
used simultaneously, the compiler has arranged for all four to use
the same register. The debugger, however, has no way of knowing
that all four variables share the same register, so it shows all four
variables changing with each assignment.
Listing 11.7 Variables changing with register coloring
void main(void)
{
long a = 0, b = 0, c = 0, d = 0;
a = 1; /* a is set to 1 */
a = 2; /* a is set to 2, b remains unchanged */
a = 3; /* a is set to 3, c remains unchanged */
a = 4; /* a is set to 4, d remains unchanged */
}
Solutions
• Do nothing. Register coloring is not a problem.
• To prevent register coloring in C/C++, declare your variables
with the volatile keyword. Do this with a preprocessor
directive so that you can easily remove the volatile storage
class specifiers after debugging. See the C Compilers Reference
and the Assembler Guide for more information.
IDE–512 IDE User Guide
Debugging Source Code
Troubleshooting
Strange variable names
Problem
The debugger shows variables in the Variables pane or Global
Variables window that are not declared in the source code.
Background
The compiler often creates its own temporary variables in the object
code as it translates source code. These temporary variables have a
dollar sign ($) in their names. The debugger also displays C++
virtual base class types with a $ prefix.
The compiler and linker often add variables from libraries and run-
time routines that help initialize and terminate your program.
Solution
• None. This is not a problem that needs correction.
Strange data types
Problem
After I choose Data > Show Types, some enumerated values
appears as having type “?anonx,” where x is an arbitrary number.
Background
The debugger cannot display the names of enumerated types if the
names are not defined in the source code. At compile time, the
compiler assigns a generic type name to such enumerated types. It
is this generic name that the debugger displays.
For example, in Listing 11.8, with Show Types selected, variable
myMarx appears as having the anonymous type ?anonx, because
its enumerated type has no name. On the other hand, variable
myBeatle appears with type Beatle, because its enumerated type
is defined with that name.
Listing 11.8 Unnamed enumerated types (C/C++)
// Debugger displays as anonymous type
enum {Groucho,
Harpo,
IDE User Guide IDE–513
Debugging Source Code
Troubleshooting
Chico,
Zeppo } myMarx = Harpo;
// Debugger displays as type Beatle
typedef enum Beatle {John,
Paul,
George,
Ringo} myBeatle = John;
Solution
• None. This is not a problem that needs correction.
Unrecognized data types
Problem
I declared my own data type. Why can I not view a variable as that
type?
Background
The symbolics file includes information only about types that are
used in the program. Types defined in typedef statements are not
stored in the symbolics file, so you need to view the variable as the
type from which it is derived. For example, if you declare a type
MyLong based on the long data type, you can view it as a long, but
not as a MyLong. For more information, refer to “Viewing data as
different types” on page 486.
Solution
• Use the base data type.
• Choose Data > Show Types to see how the debugger labels the
type.
“undefined identifier” in the Expressions window
Problem
A user-defined type in an expression in the Expressions window
gives an “• undefined identifier •” value.
IDE–514 IDE User Guide
Debugging Source Code
Troubleshooting
Background
The debugger does not recognize data types that are simply aliases
of another type, because such alias types are not included in the
symbolics file.
For example, given the Pascal type declaration
TYPE
MYBIGINT = LONGINT;
the expression
MYBIGINT(thePtr)
in the Expressions window will display its value as
“• undefined identifier •.” To get the correct result, use the
following expression instead:
LONGINT(thePtr)
To learn more, see “Expression Limitations” on page 498.
Solution
• Use the original data type instead of the defined data type.
Problems with Source Files
This section covers problems related to source-code files.
No source-code view
Problem
All I see in the source pane is assembly-language code. The Source
pop-up menu does not let me display source code.
Background
There is no symbolics information available for that code. You may
not have enabled debugging for a file, or you may be stepping
through some ancillary code added by the linker that has no
corresponding source code (for example, glue code). Without
symbolics information, the debugger can only display the code in
assembly language.
IDE User Guide IDE–515
Debugging Source Code
Troubleshooting
Solutions
• If the code is from your own source file, make sure to generate
symbolics information for the file. For more information, refer to
“Setting Up a File for Debugging” on page 412.
• If the code is from some other source (such as a compiled
library), step out of the function to return to the caller. There is
no source code to view.
Outdated source files
Problem
When I run my project, I get a warning that says the modification
dates do not match.
Background
The symbolics file keeps track of when the source file on which it is
based was last changed. If the date and time stored in the symbolics
file do not match those of the original file, the debugger warns you
that the symbolics information may no longer be current.
Solution
• Touch the source file (or make a do-nothing change and save the
file), then rebuild your project or bring it up to date.
Spurious ANSI C code in Pascal projects
Problem
I am working on a Pascal program, and when I step through code I
find ANSI C routines. I have not included any ANSI C libraries.
Background
The Pascal runtime library was written in C and uses ANSI C
routines. These are the routines that are displayed when debugging
a Pascal program.
Solution
• None. This is not a problem that needs correction.
IDE–516 IDE User Guide
Debugging Source Code
Troubleshooting
Debugger Error Messages
The following list explains error messages that you might receive
from the debugger, with some hints about the possible causes or
circumstances of the error. Messages listed without comment are
self-explanatory.
An unknown error occurred while trying to target an existing
process.
Internal error.
Bad type code
Internal error.
Bus Error
Attempt to read or write to an invalid address.
can't display value -- type information not supported
The symbolics file contains a data type that the debugger does not
support.
Can't use this source file, it was not saved before running, or
was edited after linking.
The debugger does not have access to the same text available to the
compiler. The debugger just issues a warning unless the debugging
information references nonexistent text, in which case it gives you
this error message.
class name expected
Unexpectedly encountered something other than a class name while
evaluating an expression.
Could not complete your request because the process is not
suspended.
The command you issued cannot be performed while the program
is running.
IDE User Guide IDE–517
Debugging Source Code
Troubleshooting
Could not set a watch point because the page containing that
memory location overlaps low memory or the system heap.
Watchpoints cannot be set in low memory or in the system heap.
Could not set a watch point because the page containing that
memory location overlaps the stack.
Watchpoints are implemented via the memory write-protection
mechanism, which operates at the page level. You cannot write-
protect a page of memory containing part of the stack.
Couldn't locate the program entry point, program will not stop
on launch.
When launching a program, the debugger normally sets an implicit
breakpoint at the beginning of the function named main() (in C/
C++) or the main program (in Pascal). If the debugger cannot find
such a routine, it just launches the program without suspending
that program’s execution.
identified or qualified name expected
Unexpectedly encountered something other than an identifier or
qualified name while evaluating an expression.
illegal character constant
Invalid character constant encountered while evaluating an
expression.
illegal string constant
Invalid string constant encountered while evaluating an expression.
illegal token
Invalid token encountered while evaluating an expression.
Invalid C or Pascal string.
An ill-formed string was encountered in evaluating an expression.
IDE–518 IDE User Guide
Debugging Source Code
Troubleshooting
Invalid character constant.
An invalid character constant was encountered in evaluating an
expression.
Invalid escape sequence inside string or character constant.
C/C++ escape sequence in a string was not valid syntax.
invalid pointer or reference expression
Invalid pointer or reference expression encountered while
evaluating an expression.
invalid type declaration
Invalid type encountered while evaluating an expression.
invalid type information in SYM file
The debugger is unable to display a variable because of bad data in
the symbolics file.
New variable value is too large for the destination variable.
For example, you have attempted to assign a 20-byte string to a 10-
byte string variable.
No type with that name exists.
The debugger does not recognize a type name you have entered in
the View As dialog box.
Register not available
The debugger is unable to get a valid register value to display a
register variable. For example, when looking at routines up the
stack from the current routine, the debugger cannot retrieve the
saved register values unless all routines below it on the stack have
debugging information.
string too long
String exceeds maximum permissible length.
IDE User Guide IDE–519
Debugging Source Code
Troubleshooting
The new variable value is the wrong type for the destination
variable.
You have attempted to assign a value of the wrong type to a
variable, such as a string to an integer variable.
typedef name expected
Unexpectedly encountered something other than a typedef name
while evaluating an expression.
Unable to step from here.
The debugger cannot step execution from this point.
Unable to step out from here.
The debugger cannot step out from this point.
undefined identifier
Undefined identifier encountered while evaluating an expression.
unexpected token
Unexpected token encountered while evaluating an expression.
unknown error "^0"
An internal error that was not expected to reach the user.
unterminated comment
A closing comment bracket is missing.
Variable or expression cannot be used as an address.
For example, if r is a Rect, *(char*)r is invalid.
Warning - this SYM file has some invalid or inconsistent data.
The debugger may show incorrect information.
Your symbolics file may have been corrupted.
IDE–520 IDE User Guide
Debugging Source Code
Troubleshooting
'*' or '&' expected
Unexpectedly encountered something other than a pointer or
reference operator while evaluating an expression.
IDE User Guide IDE–521
Debugging Source Code
Troubleshooting
IDE–522 IDE User Guide
12
RAD Designs and Layouts
This chapter helps you understand the major features of
CodeWarrior® Rapid Application Development (RAD) tools. You
can also learn about the motivations for RAD development, as well
as the concepts of designs and layouts in CodeWarrior projects.
The sections in this chapter are:
• About RAD
• CodeWarrior RAD Tools
• Creating RAD Projects
• RAD Wizards
• Working with Designs
• Working with Layouts
About RAD
Traditional application programming requires tedious and manual
work. When you create a new application, you are responsible for
coding every aspect of the program. You must specify all
initialization routines, the interactions between the various pieces of
the program, and the user interface.
RAD tools automate some of these manual processes, so you can
concentrate your efforts on the application itself. The tools
automatically generate code that handles generic initialization
routines and the drawing of user interface elements on the screen. In
addition, you can modify the generated code to suit your
application’s specific needs.
CodeWarrior includes RAD tools as part of the development
environment. These tools support the development of applications,
applets, and components through a plug-in architecture. You can
IDE User Guide IDE–523
RAD Designs and Layouts
CodeWarrior RAD Tools
use existing RAD plug-ins with the IDE, or you can create your
own. This flexibility supports multiple languages, platforms, and
application frameworks.
CodeWarrior RAD Tools
CodeWarrior RAD tools let you visually construct an application.
The tools included with the IDE are for use with Java. They extend
the graphical capabilities of the IDE for use with RAD. Additional
programming frameworks will be supported in the future.
This section discusses the following topics:
• Class Authoring
• Component Model
Class Authoring
RAD tools let you create and modify classes through a high-level
visual interface. You can use this interface to create, rename, and
delete the various classes, member functions, and data members in
your application. The RAD tools automatically synchronize
declarations and definitions as you modify the application.
Because CodeWarrior uses a plug-in architecture for RAD, you can
easily extend the IDE’s capabilities. The RAD tools automatically
generate source code via scripts. You can modify existing scripts to
customize the generated code for your application.
Component Model
CodeWarrior RAD tools use a component model to create
applications. A component in RAD context is a self-describing
object. The component represents an object in the programming
framework you use to create an application. All of the properties,
methods, and events that describe an object are included in the
component.
Components enable a powerful and intuitive user interface for
applications across a wide variety of platforms. RAD tools use these
IDE–524 IDE User Guide
RAD Designs and Layouts
Creating RAD Projects
components to provide several services, including persistence and
automation.
CodeWarrior uses these tools to implement the component model:
• Layout Editor
• Catalogs
Layout Editor
One major part of the RAD tools is the Layout editor. This
application builder uses a visual development environment. User
interface elements are visually represented as components. You can
drag and drop components to form your application. As you make
changes, the IDE updates the Layout editor display and modifies
the generated source code accordingly.
Catalogs
Catalogs comprise the second major part of the RAD tools. Catalogs
are repositories of available components for the application. The
IDE provides catalogs based on the programming framework you
use. For example, when you create a Java application, you can
choose components from Java-specific catalogs. The properties and
events of the components in a catalog are fully customizable.
Creating RAD Projects
To create a CodeWarrior RAD project, choose New from the File
menu. The IDE displays the New window, as shown in Figure 12.1.
Click the Project tab at the top of the window to display the Project
panel. This panel shows the available stationery and wizards that
you can use to create new CodeWarrior projects. When you select
an item in the list, various options become available along the right
side of the Project panel.
IDE User Guide IDE–525
RAD Designs and Layouts
Creating RAD Projects
Figure 12.1 New dialog box
To create a new RAD project, select one of the following wizards in
the project list:
• Java Applet Wizard—helps you create a Java applet. The wizard
asks for information about the applet’s class, HTML page,
parameters, and description.
• Java Application Wizard—helps you create a Java application.
The wizard asks for information about the application’s class,
frame class, and description.
• Java Bean Wizard—helps you create a Java bean. The wizard
asks you for information about the bean’s class, location,
package, and modifiers.
After you select a project wizard, type a name for your new project
in the Project name field.
IDE–526 IDE User Guide
RAD Designs and Layouts
Creating RAD Projects
Figure 12.2 Save dialog box (Windows)
TIP We suggest naming your project file with a .mcp file name
extension, like this: MyProject.mcp. This naming convention
helps you quickly identify the project file on your hard disk. In
addition, the Windows-hosted version of the CodeWarrior IDE uses
this extension to identify the project file.
The Location field displays the full path to the folder in which the
project is saved. To change the current path, type a new path
directly into the field. Alternatively, click the Set button to the right
of the field to display a dialog box, which is shown in Figure 12.2
(Windows) and Figure 12.3 (Mac OS). Use the dialog box controls to
navigate to a location on your hard disk where you want to save the
project. To create a new folder to contain the project file and all of its
associated files, make sure the Create Folder checkbox is enabled.
IDE User Guide IDE–527
RAD Designs and Layouts
Creating RAD Projects
Then click Save to confirm the location and return to the New
window.
WARNING! If you try to save the new project, and you already have an existing
project with the same name in the same location on the hard disk,
the IDE displays an error message. Be sure to use a unique name
for your new project.
Figure 12.3 Save dialog box (Mac OS)
IDE–528 IDE User Guide
RAD Designs and Layouts
RAD Wizards
When you finish typing a name for the RAD project and choosing a
location in which to save that project, click OK in the New window.
The IDE opens the wizard you selected in the Project panel. The
selected wizard guides you through the remaining steps of the
project-creation process. For detailed information about each
wizard, see “RAD Wizards” on page 529.
RAD Wizards
When creating a new RAD project or design, as described in
“Creating RAD Projects” on page 525 and “Adding Designs to a
Project” on page 546, you select a RAD wizard. The wizard helps
you complete the item-creation process. This section describes the
following RAD wizards:
• Java Applet Wizard
• Java Application Wizard
• Java Bean Wizard
For beginners Each wizard assumes you have a basic understanding of the
associated programming language. For example, if you use the
Java Application wizard, you should understand the difference
between an Abstract Window Toolkit (AWT) frame and a Swing
frame. If the items displayed in the wizard are unfamiliar, you should
consult additional programming language references for more
information.
The RAD wizards include the following navigation buttons:
• Back—return to the previous step
• Next—proceed to the subsequent step
• Finish—display a summary of current information
• Cancel—discard all changes
Each wizard is divided into a series of steps. You progress through
these steps in sequence, and each step builds on the information
provided in previous steps. When you supply enough information
in a particular step, click Next to continue.
IDE User Guide IDE–529
RAD Designs and Layouts
RAD Wizards
You can modify the default settings in each step. To accept all
current settings in the wizard, click Finish. The wizard displays a
summary of all the current settings for the new project. Click
Generate to accept the current settings and create the new RAD
item, or click Cancel to return to the wizard and continue
modifying settings.
Java Applet Wizard
The Java Applet wizard is divided into the following steps:
1. Describe the applet class for the Java applet.
2. Specify an HTML page for the Java applet. (optional)
3. Create parameters for the Java applet.
4. Provide additional information for the Java applet.
To use the Java Applet wizard, follow these steps:
1. Describe the applet class for the Java applet.
This section of the wizard, shown in Figure 12.4, lets you specify the
class name, package name, and location for the new applet. Other
options are available to further describe the applet.
This section includes the following parts:
• Class Name
• Package Name
• Location
• Can run as a standalone application
• Generate standard methods
• Generate HTML Page
• Choose from this pop-up menu the desired base-class applet
type. You can choose AWT applet or Swing applet.
• Choose from this pop-up menu the desired base-class applet
type. You can choose AWT applet or Swing applet.
IDE–530 IDE User Guide
RAD Designs and Layouts
RAD Wizards
Figure 12.4 Java Applet wizard - Applet Class
Class Name
Enter a name for the applet’s class in this field. An example name is
provided.
Package Name
If you wish, you can enter in this field a package for the applet class.
A sample package name is provided.
Location
In this field, type a location in which to save the applet class for the
new applet. Alternatively, click the button next to the field. A
standard window displays. Use the window controls to select a
location. Note that a valid location depends on your settings for
strict filenames and strict package roots.
IDE User Guide IDE–531
RAD Designs and Layouts
RAD Wizards
Can run as a standalone application
Enable this checkbox if you want the new applet to operate without
needing to be called from another application. Disable this checkbox
otherwise.
Generate standard methods
Enable this checkbox if you want the new applet to generate
standard methods for its interface, such as show() and
dispose(). Disable this checkbox otherwise.
Generate HTML Page
Enable this checkbox if you want to create an HTML page to help
you test the new applet. Disable this checkbox otherwise. Note that
the Java Applet wizard displays the HTML Page section only when
you enable the Generate HTML Page checkbox. This checkbox is
enabled by default.
Base Class
Choose from this pop-up menu the desired base-class applet type.
You can choose AWT applet or Swing applet.
2. Specify an HTML page for the Java applet. (optional)
This section of the wizard, shown in Figure 12.5, is displayed only
when you enable the Generate HTML Page checkbox from the
previous section. The HTML Page section lets you define a
Hypertext Markup Language (HTML) page to test the new applet.
This section includes the following parts:
• Title
• Applet Name
• Codebase/Archive
• Use Archive (JAR)
• Width
• Height
• HSpace
• VSpace
• Align
IDE–532 IDE User Guide
RAD Designs and Layouts
RAD Wizards
Title
Enter in this field a title for the HTML page you wish to generate.
An example title is provided.
Applet Name
Your HTML browser displays messages about the applet by using
the name you type in this field. A sample applet name is shown.
Codebase/Archive
If desired, use this field to specify a codebase or archive for use with
the new applet. An example is shown.
Figure 12.5 Java Applet wizard - HTML Page
Use Archive (JAR)
Enable this checkbox if you want to use a Java archive (JAR) with
the new applet. If this checkbox is enabled, a “.jar” extension is
appended to the name in the Codebase/Archive field.
IDE User Guide IDE–533
RAD Designs and Layouts
RAD Wizards
Width
The number you type in this field represents the number of pixels
that span the width of the applet within the HTML page.
Height
The number typed in this field specifies the number of pixels that
span the height of the applet within the HTML page.
HSpace
The number in this field defines the number of pixels placed on the
left side and on the right side of the applet within the HTML page.
VSpace
The number in this field defines the number of pixels placed above
and below the applet within the HTML page.
Align
Use this pop-up menu to determine the alignment of the applet
within the HTML page:
• absbottom—position at the absolute bottom of the page
• absmiddle—position at the absolute middle of the page
• baseline—position at the baseline of the page
• bottom—position at the bottom of the page
• left—position at the left side of the page
• middle—position at the middle of the page. This is the default
option.
• right—position at the right side of the page
• texttop—position at the top of the text on the page
• top—position at the top of the page
3. Create parameters for the Java applet.
This section of the wizard, shown in Figure 12.6, lets you create a set
of parameters for the new applet. Each parameter has the following
fields:
IDE–534 IDE User Guide
RAD Designs and Layouts
RAD Wizards
• Name—the name of the parameter
• Type—the data type of the parameter
• Default—the default value for the parameter
• Variable—the variable that represents the parameter
• Description—a short description of the parameter
A sample <New> parameter is ready for you to modify. To change a
particular field, double-click it, enter a new value, and press Enter/
Return to confirm your changes.
Figure 12.6 Java Applet wizard - Applet Parameters
NOTE By default, new applet parameters are named <New>. You should
change this default name. The wizard ignores parameters named
<New> when creating the applet.
IDE User Guide IDE–535
RAD Designs and Layouts
RAD Wizards
When you double-click the Type field, choose a new value from the
pop-up menu that appears inside the field. Alternatively, use the
keyboard in one of the following ways:
• Choose via data-type name—Repeatedly type the first letter of
the data type you wish to choose until the desired data type
appears in the field, then press Enter/Return. The matching data
types appear in the order listed in the pop-up menu.
• Choose via arrow keys—Press the Down Arrow key or Right
Arrow key to choose the subsequent data type in the order listed
in the pop-up menu. Press the Up Arrow key or Left Arrow key
to choose the previous data type in the order listed in the pop-up
menu. Press Enter/Return when the desired data type appears
in the field.
For example, if you want to choose the short data type, double-click
the Type field and type the letter s to change the field to String,
then type the letter s again to change the field to short, and press
Enter/Return to confirm the short data type.
To add another parameter to the applet, click Add. The wizard
creates a <New> parameter for you to modify. To remove a
particular parameter, select one of its fields and click Remove.
4. Provide additional information for the Java applet.
This section of the wizard, shown in Figure 12.7, lets you provide
additional information to describe the applet.
This section includes the following parts:
• Applet title
• Description
• Insert information in every file
IDE–536 IDE User Guide
RAD Designs and Layouts
RAD Wizards
Figure 12.7 Java Applet wizard - Information
Applet title
If desired, enter a title for the new applet in this field.
Description
If you wish, type a description for the new applet in this field.
Insert information in every file
To add the information contained in the Applet title and
Description fields to the beginning of every applet file, enable this
checkbox. Disable the checkbox otherwise. The checkbox is enabled
by default.
Java Application Wizard
The Java Application wizard is divided into the following steps:
1. Describe the application class for the Java application.
2. Describe the frame class for the Java application.
IDE User Guide IDE–537
RAD Designs and Layouts
RAD Wizards
3. Provide additional information for the Java application.
To use the Java Application wizard, follow these steps:
1. Describe the application class for the Java application.
This section of the wizard, shown in Figure 12.8, lets you specify
application class information for the Java application.
Figure 12.8 Java Application wizard - Application Class
This section includes the following parts:
• Class Name
• Package Name
• Location
• Create a frame on startup
IDE–538 IDE User Guide
RAD Designs and Layouts
RAD Wizards
Class Name
Enter a name for the application’s class in this field. An example
name is provided.
Package Name
If you wish, you can enter in this field a package for the application
class. A sample package name is provided.
Location
In this field, type a location in which to save the application class for
the new application. Alternatively, click the button next to the field.
A standard window displays. Use the window controls to select a
location.
Create a frame on startup
Enable this checkbox if you want the IDE to automatically generate
a new layout frame. This option automatically displays the Layout
Editor, Component Palette, and Object Inspector. Disable the
checkbox if you do not want to automatically display these tools.
2. Describe the frame class for the Java application.
This section of the wizard, shown in Figure 12.9, lets you specify
frame class information for the Java application.
This section includes the following parts:
• Class Name
• Package Name
• Location
• Choose from this pop-up menu the desired base-class frame
type. You can choose AWT frame or Swing frame.
• Choose from this pop-up menu the desired base-class frame
type. You can choose AWT frame or Swing frame.
IDE User Guide IDE–539
RAD Designs and Layouts
RAD Wizards
Figure 12.9 Java Application wizard - Frame Class
Class Name
Enter a name for the frame’s class in this field. An example name is
provided.
Package Name
If you wish, you can enter in this field a package for the frame class.
A sample package name is provided.
Location
In this field, type a location in which to save the frame class for the
new application. Alternatively, click the button next to the field. A
standard window displays. Use the window controls to select a
location. Note that a valid location depends on your settings for
strict filenames and strict package roots.
IDE–540 IDE User Guide
RAD Designs and Layouts
RAD Wizards
Base Class
Choose from this pop-up menu the desired base-class frame type.
You can choose AWT frame or Swing frame.
3. Provide additional information for the Java application.
This section of the wizard, shown in Figure 12.10, lets you provide
additional information to describe the application.
This section includes the following parts:
• Application title
• Description
• Insert information in every file
Figure 12.10 Java Application wizard - Information
Application title
If desired, enter a title for the new application in this field.
IDE User Guide IDE–541
RAD Designs and Layouts
RAD Wizards
Description
If you wish, type a description for the new application in this field.
Insert information in every file
To add the information contained in the Application title and
Description fields to the beginning of every application file, enable
this checkbox. Disable the checkbox otherwise. The checkbox is
enabled by default.
Java Bean Wizard
The Java Bean wizard is divided into the following steps:
1. Choose a name and location for the Java bean.
2. Specify a base class and a list of implementations.
To use the Java Bean wizard, follow these steps:
1. Choose a name and location for the Java bean.
This section of the wizard, shown in Figure 12.11, lets you specify
the name and location of the new bean, as well as the modifiers for
the bean.
This section includes the following parts:
• Class Name
• File
• Package
• Modifiers
IDE–542 IDE User Guide
RAD Designs and Layouts
RAD Wizards
Figure 12.11 Java Bean wizard - Name and Location
Class Name
Enter a name for the bean’s class in this field. An example is
provided below the field. The Class is a Bean checkbox below the
field remains enabled. This status indicates that you are creating a
Java bean.
NOTE If you want the applet to be compatible with other development
tools, the class name should match the applet file name.
File
This pop-up menu indicates that you are creating a New File. No
additional options are available.
IDE User Guide IDE–543
RAD Designs and Layouts
RAD Wizards
Type the path to which you want to save the file in the field above
the Package field, as shown in Figure 12.11 on page 543.
Alternatively, click Choose next to the field. A window opens that
lets you browse your computer’s contents. Use the window controls
to select the location to which you want to save the file.
Package
If you wish, you can enter in this field a package for the bean.
NOTE If you want the applet to be compatible with other development
tools, the file path and package path should match.
Modifiers
Use the Specifier pop-up menu to choose the method specifier for
the new bean. Possible specifiers include None, Abstract, and Final.
The Access pop-up menu in this section indicates that you are
creating a bean with Public access. No additional options are
available for this pop-up menu.
2. Specify a base class and a list of implementations.
This section of the wizard, shown in Figure 12.12, lets you specify
the base class and implementations for the new bean.
This section includes the following parts:
• Base Class
• Implements List
Base Class
The settings in this part determine the base-class type of the new
bean. There are two possibilities:
• Visual Bean—Enable this option if the base class is a visual
bean. The pop-up menu below this option lists common AWT
and Swing base classes. Choose a base class from this pop-up
menu.
• Non-Visual Bean/Custom—Enable this option if the base class
of the event set is a non-visual bean or a custom class. Type the
name of the base class in the field below this option.
IDE–544 IDE User Guide
RAD Designs and Layouts
Working with Designs
Figure 12.12 Java Bean wizard - Base Class and Interfaces
Implements List
In this part, type a list of interfaces to be implemented by the base
class. Example interfaces are provided. Separate multiple interfaces
with commas.
Working with Designs
The IDE uses designs to organize and manage RAD projects. A
design includes a particular set of user interface layouts and
components that are part of the application. A CodeWarrior project
can include several designs. Each design can include several build
targets.
IDE User Guide IDE–545
RAD Designs and Layouts
Working with Designs
This section discusses the following topics:
• Adding Designs to a Project
• Design View in the Project Window
• Designs in the Targets View
Adding Designs to a Project
To add a design to an open project in the IDE, choose New from the
File menu. The IDE displays the New window, shown in Figure
12.13. Click the Project tab at the top of the window to display a list
of available wizards.
The wizards you use to create designs are the same wizards you use
to create projects:
• Java Applet Wizard—helps you create a Java applet. The wizard
asks for information about the applet’s class, HTML page,
parameters, and description.
• Java Application Wizard—helps you create a Java application.
The wizard asks for information about the application’s class,
frame class, and description.
• Java Bean Wizard—helps you create a Java bean. The wizard
asks you for information about the bean’s class, location,
package, and modifiers.
For example, if you want to create a Java applet design, select the
Java Applet Wizard.
To add the new design to the project, enable the Add Design to
Project checkbox. Because you are adding the design to an existing
project rather than creating a new project, the Location field grays
out, as shown in Figure 12.13. Type a name for the new design in the
Design Name field.
Select the project’s name from the Project pop-up menu, as shown
in Figure 12.13. The design is added to the project you choose from
this pop-up menu.
IDE–546 IDE User Guide
RAD Designs and Layouts
Working with Designs
Figure 12.13 Adding a design to a project
After you click OK, the selected wizard opens and guides you
through the design-creation process. See “RAD Wizards” on page
529 for more information about each wizard. When you complete
the wizard, the IDE adds the design to the project.
Each RAD project can have multiple designs. However, a single
project file can have at most 255 build targets. Because each design
can have several build targets, you should keep this limit in mind as
you add designs to your project. Many of the suggestions in
“Strategy for Creating Complex Projects” on page 92 apply when
creating multiple designs for a single RAD project.
IDE User Guide IDE–547
RAD Designs and Layouts
Working with Designs
Figure 12.14 Design view in Project window
Design View in the Project Window
When you create a RAD project, click the Design tab in the Project
window to display the Design view. This view, shown in Figure
12.14, provides information about the design for the active build
target. For example, Figure 12.14 shows the design for the Java
Application build target. To view another build target’s design,
select that build target’s name from the Current Target pop-up
menu.
Some of the objects displayed in the Design view are hierarchical.
Click the hierarchical control next to an object to expand that object
and view its contents. Click the control again to collapse the view.
IDE–548 IDE User Guide
RAD Designs and Layouts
Working with Layouts
Designs in the Targets View
Click the Targets tab in the Project window to view the hierarchy of
build targets within each design, as shown in Figure 12.15 on page
549. A build target’s icon includes a design badge ( ) when it is
part of the current design. For example, the JavaApp Debug build
target in Figure 12.15 is part of the current design because its icon
includes the design badge. Since the JavaApp Release build target
is not part of the current design, its icon does not include the design
badge.
Figure 12.15 Designs in the Targets view
Working with Layouts
Each RAD project can include multiple layouts. A layout is a
collection of user interface elements that comprise an application. A
specific layout describes the content of a window, dialog box, or
alert. Additionally, a layout describes the content of all the possible
views in a particular window when you perform various actions.
The IDE features a Layout editor that displays each layout in your
project. The Layout editor uses the IDE’s plug-in architecture to
display the user interface. For example, when you create a Java
IDE User Guide IDE–549
RAD Designs and Layouts
Working with Layouts
RAD project, the IDE uses the Java RAD plug-in to display the user
interface in the Layout editor. Figure 12.16 on page 550 shows a
sample layout.
Figure 12.16 A layout in the Layout editor
The Layout editor works in conjunction with the catalogs to build
an application. All of the available components for your RAD
project are managed by catalogs. The Component Palette and the
Component Catalog window let you view and use the contents of
these catalogs. When you add a new interface element to the layout,
you can drag a component from the Component Catalog window
and drop that component into the layout. You can also select the
same component from the Component Palette, which is shown in
Figure 12.17.
IDE–550 IDE User Guide
RAD Designs and Layouts
Working with Layouts
Figure 12.17 Component Palette
To learn how to create layouts and use the Layout editor, see “RAD
Layout Editing” on page 553.
“Component Palette” on page 563 and “Component Catalog
window” on page 567 describe the two catalog tools you use with
the Layout editor.
“RAD Components” on page 585 describes the individual
components inside the catalogs included with CodeWarrior.
IDE User Guide IDE–551
RAD Designs and Layouts
Working with Layouts
IDE–552 IDE User Guide
13
RAD Layout Editing
CodeWarrior® Rapid Application Development (RAD) tools include
a Layout editor, Component Palette, Component Catalog window,
and Object Inspector. These tools help you visually build an
application’s user interface. This chapter describes the four tools
and their use with RAD.
The following topics are discussed:
• Layout Editor
• Layout Wizards
• Component Palette
• Component Catalog window
• Object Inspector
Layout Editor
The Layout editor displays the graphical user interface for your
RAD project. The IDE uses a RAD plug-in architecture to display
the Layout editor’s environment. For example, when you develop a
Java application with the RAD tools, the IDE uses the Java plug-in
to draw the layout on the screen.
This section describes the following:
• Creating a Layout
• Modifying a Layout
Creating a Layout
When you create a new layout for your RAD project, the layout’s
default state does not contain any user interface components. You
use the Component Catalog window or the Component Palette to
IDE User Guide IDE–553
RAD Layout Editing
Layout Editor
place user interface components in the layout. As you build the
application’s interface, the RAD tools automatically generate source
code to create that interface at runtime.
Each RAD design can have several layouts. However, to maintain
peak performance, you should limit the number of layouts you use
in a single project. If your project includes more than 30 layouts, you
should consider other ways to organize those layouts. Many of the
suggestions in “Strategy for Creating Complex Projects” on page 92
apply when creating multiple layouts for a single RAD project.
If you want to add a new layout to an open project in the IDE,
choose New from the File menu. In the New window, click the
Object tab to display a list of object wizards, as shown in Figure
13.1.
Choose a wizard that corresponds to the layout you wish to create:
• Java Frame Wizard—helps you create a new layout frame for a
Java RAD project. The wizard asks for information about the
frame’s class, package, and location.
From the Project pop-up menu, select the project to which you want
to add the new layout. Use the Design pop-up menu to select the
particular design in the project to which you want to add the new
layout.
When you click OK, the wizard guides you through the layout-
creation process. After you configure the new layout’s settings in
the wizard, click Finish to add the layout to the project and open a
new layout window. For detailed information about the available
layout wizards, see “Layout Wizards” on page 560.
Modifying a Layout
To modify an existing layout, you use the Layout editor in
conjunction with the Component Palette, Component Catalog
window, and Object Inspector. You select components from the
Component Catalog window or the Component Palette and then
place those components in the layout window. You manipulate the
components in the layout as you would manipulate graphic objects
in a drawing application.
IDE–554 IDE User Guide
RAD Layout Editing
Layout Editor
Figure 13.1 Creating a new layout
A layout is modified in the following ways:
• Creating objects
• Manipulating objects
• Examining objects
• Removing objects
• Layout editor contextual menu
IDE User Guide IDE–555
RAD Layout Editing
Layout Editor
Creating objects
The RAD tools access available project components from the current
catalog. The Component Palette and Component Catalog window
give you two convenient ways to access the components.
If you use the Component Catalog window, you drag components
to the layout window to create new interface objects. If you use the
Component Palette, you click the button representing the
component you want to add, and then you drag a cursor in the
layout window to place that component in the layout.
For more information about the Component Palette, see
“Component Palette” on page 563. To learn more about the
Component Catalog window, see “Component Catalog window”
on page 567.
Manipulating objects
To move an object in a layout, select it in the layout window. A
selected object is shown in Figure 13.2. The heavy border around the
object indicates that it is currently selected. Drag selected objects to
move them to a new positions in the layout window. Alternatively,
use the arrow keys on your keyboard to move the selected objects.
To resize or reshape an object, drag one of its resize handles in the
desired direction. A heavy outline is displayed as you drag the
resize handle. This outline represents the final shape of the object
when you release the resize handle.
You can select multiple objects in two different ways:
• Shift-click each object that you want to add to your selection. A
heavy border is displayed around all selected objects. If you
decide against an object in the selection, Shift-click that object
again.
• Draw a marquee around a group of objects to quickly select
them, as shown in Figure 13.3 on page 558. Position the cursor
near the group of objects you want to select, then drag the cursor
to display a marquee. Release the marquee when it encloses the
objects you want to select. To add additional objects to the
selection, position the cursor near the additional objects and then
press the Shift key while dragging the cursor. This action
displays another marquee. Release the marquee when it encloses
the additional objects.
IDE–556 IDE User Guide
RAD Layout Editing
Layout Editor
Figure 13.2 A selected object
You can also manipulate objects with the Layout editor contextual
menu. To learn more, refer to “Layout editor contextual menu” on
page 559.
TIP The Tab key on your keyboard is useful for layouts with several
objects. After you select a particular object in the layout window,
press the Tab key to quickly select a different object. The order in
which the Tab key selects objects is based on the order in which
those objects were placed in the layout window.
Examining objects
After you place objects in the layout, you can edit the various
properties that characterize each object, as well as the events
handled by that object. The Object Inspector displays the available
properties and events for a selected object. For more information,
see “Object Inspector” on page 578.
Removing objects
To remove objects in a layout, select them and press Delete.
Alternatively, select the objects and choose Edit > Delete (Windows
menu bar layout) or Edit > Clear (Macintosh menu bar layout). The
Layout editor removes the selected objects from the layout.
IDE User Guide IDE–557
RAD Layout Editing
Layout Editor
Figure 13.3 Marquee selection of two objects
IDE–558 IDE User Guide
RAD Layout Editing
Layout Editor
Layout editor contextual menu
The Layout editor features a contextual menu that conveniently
duplicates the commands in the Layout menu. The available
commands in the contextual menu depend on the selected item. A
sample contextual menu is shown in Figure 13.4.
Figure 13.4 Layout editor contextual menu
To display the Layout editor contextual menu, use one of the
following techniques:
Windows Right-click an item.
Mac OS Control-click an item.
The following list describes some common graphical editing
commands in the contextual menu:
• Align—displays a submenu from which you can choose
different ways to position selected objects.
IDE User Guide IDE–559
RAD Layout Editing
Layout Wizards
• Resize—displays a submenu from which you can choose
different ways to change the size of selected objects.
• Send To Back—moves the selected objects so that they are
displayed behind all other objects.
• Bring To Front—moves the selected objects so that they are
displayed in front of all other objects.
• Display Grid—when checked, displays the graphical grid in the
layout window.
• Snap To Grid—when checked, the Layout Editor automatically
aligns objects with the graphical grid.
• Group—combines selected objects so that they move together as
a group.
• Ungroup—separates a selected group so you can move each
object independently.
• Customize—opens a customization utility for the selected
component. For example, after selecting a menu component,
choosing this command opens the Menu Editor.
• Properties—displays the Object Inspector to examine the
properties of the selected object.
Layout Wizards
When you create a new layout for your RAD project, as described in
“Creating a Layout” on page 553, you select a layout wizard. The
wizard helps you complete the layout-creation process. This section
describes the following layout wizards:
• Java Frame Wizard
For beginners Each wizard assumes you have a basic understanding of the
associated programming language. For example, if you use the
Java Frame wizard, you should understand the difference between
an Abstract Window Toolkit (AWT) frame and a Swing frame. If the
items displayed in the wizard are unfamiliar, you should consult
additional programming language references for more information.
The layout wizards include the following navigation buttons:
• Back—return to the previous step
IDE–560 IDE User Guide
RAD Layout Editing
Layout Wizards
• Next—proceed to the subsequent step
• Finish—display a summary of current information
• Cancel—discard all changes
A wizard is divided into a series of steps. You progress through
these steps in sequence, and each step builds on the information
provided in previous steps. When you supply enough information
in a particular step, click Next to continue.
You can modify the default settings in each step. To accept all
current settings in the wizard, click Finish. The wizard displays a
summary of all the current settings for the new project. Click
Generate to accept the current settings and create the new layout, or
click Cancel to return to the wizard and continue modifying
settings.
Java Frame Wizard
The Java Frame wizard consists of one step:
1. Describe the frame class for the Java frame.
This section of the wizard, shown in Figure 13.5, lets you specify the
class name, package name, and location for the new frame. Other
options are available to further describe the frame.
This section includes the following parts:
• Class Name
• Package Name
• Location
• Choose from this pop-up menu the desired base-class frame
type. You can choose AWT frame or Swing frame.
• Choose from this pop-up menu the desired base-class frame
type. You can choose AWT frame or Swing frame.
Class Name
Enter a name for the frame’s class in this field. An example name is
provided.
IDE User Guide IDE–561
RAD Layout Editing
Layout Wizards
Package Name
If you wish, you can enter in this field a package for the frame class.
A sample package name is provided.
Figure 13.5 Java Frame wizard - Frame Class
Location
In this field, type a location in which to save the frame class for the
new layout. Alternatively, click the button next to the field. A
standard window displays. Use the window controls to select a
location.
Base Class
Choose from this pop-up menu the desired base-class frame type.
You can choose AWT frame or Swing frame.
IDE–562 IDE User Guide
RAD Layout Editing
Component Palette
Component Palette
The Component Palette displays graphical tools that represent the
components from the current catalog. These tools help you to
conveniently build the application’s user interface. Choose
Component Palette from the Window menu to display the
Component Palette, shown in Figure 13.6 on page 563.
Figure 13.6 Component Palette
The Component Palette has three main parts:
• Component Palette Toolbar
• Catalog Pop-up Menu
• Component Tools
Component Palette Toolbar
The Component Palette toolbar provides convenient access to the
components detailed in the Component Catalog window. Table 13.1
describes each button in the Component Palette toolbar.
IDE User Guide IDE–563
RAD Layout Editing
Component Palette
Catalog Pop-up Menu
The Component Palette displays component tools from a particular
catalog. To use component tools from another catalog, choose the
catalog’s name from the Catalog pop-up menu, shown in Figure
13.6.
Table 13.1 Component Palette toolbar buttons
Button Name Description
Open Catalog Lets you open an additional
catalog file and add it to the
Component Palette.
Close Catalog Closes an added catalog file.
The closed catalog is removed
from the Component Palette
and the Component Catalog
window.
Component Opens the Component Catalog
Catalog window.
Component Tools
The bottom of the Component Palette displays tools from the
current catalog. You click a particular tool and then “draw” an
object in the layout window. When you finish drawing the object,
the Layout editor updates the layout window display. The process
is illustrated in Figure 13.7 on page 566.
To use the Component Palette, do the following:
1. Click the tool representing the component you want to place in
the layout window.
If you decide against using the tool you selected, click the
Unselect tool. After you click this tool, you can click a
different component tool to use in the layout window.
IDE–564 IDE User Guide
RAD Layout Editing
Component Palette
2. Drag the cursor while inside the layout window.
As you drag the cursor, the Layout editor displays a heavy outline
to indicate the final position and shape of the component in the
layout.
Windows The cursor’s icon changes to a crosshair during this
step. While you drag the crosshair, a pop-up window displays the
layout window’s coordinate system. If you decide against using the
component tool while dragging the crosshair, press the Esc key. The
Layout editor dismisses the component tool and removes the heavy
outline from the layout window.
IDE User Guide IDE–565
RAD Layout Editing
Component Palette
Figure 13.7 Drawing an object in the layout window
3. Release the outline.
The component is placed in the layout window. You can modify the
component’s properties and events using the Object Inspector.
For more information about the various component tools in the
Component Palette, refer to “RAD Components” on page 585.
IDE–566 IDE User Guide
RAD Layout Editing
Component Catalog window
TIP (Windows) If you position the cursor over a component tool and wait
briefly, the IDE displays the name of that tool. Use this feature to
quickly distinguish the various tools.
Component Catalog window
The Component Catalog window lets you drag and drop
components from the current catalog onto the layout window. You
can also view existing catalogs, import additional catalogs, and
create new catalogs. Choose Component Catalog from the Window
menu to display the Component Catalog window, shown in Figure
13.8.
Figure 13.8 Component Catalog window
This section describes the following:
• Component Catalog Toolbar
• Catalog Pane
IDE User Guide IDE–567
RAD Layout Editing
Component Catalog window
• Component Pane
• Component Catalog Contextual Menu
• Creating Component Catalogs
Component Catalog Toolbar
The Component Catalog toolbar lets you view and manipulate
catalogs and their contents. Table 13.2 describes the buttons in the
toolbar.
Table 13.2 Component Catalog toolbar buttons
Button Name Description
New Catalog Creates a new catalog file to
store a customized collection of
components
New Folder Creates a new folder within
your own catalog so you can
further organize components
Open Catalog Opens a catalog file and adds it
to the Catalog pane
Close Catalog Closes a catalog file that was
added to the Catalog pane
Import Imports components into the
Components active catalog
Toggle Index View Displays or hides the Catalog
pane in the Component
Catalog window
Edit Item Opens the Object Inspector for
Properties the selected item so you can
edit that item’s properties
Component Palette Displays the Component
Palette and makes it frontmost
IDE–568 IDE User Guide
RAD Layout Editing
Component Catalog window
Catalog Pane
The Catalog pane, shown in Figure 13.8 on page 567, displays
information about available catalogs, including the customized
catalogs you create or import. Click the hierarchical control next to a
catalog to expand it and view its contents. Click the control again to
collapse the view. Alternatively, double-click an item to expand or
collapse its view in the Catalog pane.
You can create customized catalogs to store the components you use
most frequently. These customized catalogs make it easier for you to
build your application’s layouts. To learn how to create your own
catalogs, see “Creating Component Catalogs” on page 574.
TIP If you tend to work with the components in a single catalog, you can
hide the Catalog pane by clicking the Toggle Index View button in
the Component Catalog toolbar.
Component Pane
The Component pane, shown in Figure 13.8 on page 567, displays
various information about the items in each catalog. The name of
the catalog is displayed in the upper-left corner of the pane. You
drag components directly from the Component pane into a layout
window to create user interface objects.
The Component pane is discussed in the following topics:
• Content View buttons
• Component Information Bar
• Component list
• Sorting and resizing component lists
Content View buttons
The Content View buttons toggle the display of the components in
the current catalog:
Click the List View button to display the contents of the
Component pane as a list. The List view, shown in Figure
13.9, displays all the components in the current catalog.
IDE User Guide IDE–569
RAD Layout Editing
Component Catalog window
Click the Live View button to display the contents of the
Component pane as live objects. The Live view, shown in
Figure 13.10, is only available for component catalogs that
you create. Refer to “Creating Component Catalogs” on page
574 for more information.
NOTE If you try to use the Live view for a catalog that you did not create,
the IDE displays the error message “No contents to show for
Catalog,” where Catalog is the name of the selected catalog in the
Catalog Pane.
Figure 13.9 Component pane - List view
The two views in the Component pane help you accomplish
different tasks. The List view is useful for quickly browsing a
catalog’s components. The Live view shows graphical
representations of your own catalog’s components.
IDE–570 IDE User Guide
RAD Layout Editing
Component Catalog window
The Live view also helps you create a customized set of components
for your application’s layouts. For example, you can change the
default size and shape of a component in the Live view. When you
use the component to create a new interface object in the layout
window, the new object retains the size and shape of the
component.
Figure 13.10 Component pane - Live view
Component Information Bar
The List view of the Component pane includes a Component
Information Bar, shown in Figure 13.11. This information bar helps
you organize the components in the current catalog.
You can sort the component list according to the columns in the
Component Information Bar. You can also resize each column in the
list. For more information, see “Sorting and resizing component
lists” on page 573.
IDE User Guide IDE–571
RAD Layout Editing
Component Catalog window
Figure 13.11 Component Information Bar
Table 13.3 details the columns displayed in the Component
Information Bar for various catalog types.
Component list
The component list, shown in Figure 13.9 on page 570, displays all
components in the current catalog and their associated Component
Palette button icons. To place a particular component in your
layout, drag it from the component list in the Component Catalog
window and drop it into the layout window. As you drag the
component inside the layout window, a heavy outline indicates the
final position of the component. After you release the outline, the
component is placed in the layout window.
Table 13.3 Component Information Bar items
Catalog Type Column Description
Java catalogs Name The name of the
(AWT Components, component.
Swing Components) Class The class of which the
component is a member.
Customized catalogs Name The name of the
(created or imported) component.
Identifies whether the
component is locked.
Modified The date the component
was last modified.
Class The class of which the
component is a member.
Comments Shows comments for the
component.
If you decide against using the component while dragging it in the
layout, just drag the component outside the layout window and
IDE–572 IDE User Guide
RAD Layout Editing
Component Catalog window
release it. After releasing the component, you can go back to the
component list and drag another component to the layout window.
For more information about removing objects from your layouts,
see “Removing objects” on page 557. Refer to “Layout editor
contextual menu” on page 559 for more information about
contextual menu commands. To learn about the components in the
component list, see “RAD Components” on page 585.
Sorting and resizing component lists
You can sort the components in the List view according to the
columns in the Component Information Bar, shown in Figure 13.11
on page 572.
Click the column for which you want to sort the components. Each
time you click the column, you toggle the sort order between
ascending order and descending order. For example, if you want to
sort the components by name, click the Name column in the
Component Information Bar. Click the column again to sort the
components in descending order.
To resize the columns in the Component Information Bar,
position the cursor between two column titles. The cursor’s
icon changes to the icon shown at left. Drag and release this
cursor to resize the columns.
Component Catalog Contextual Menu
The Component Catalog window features a contextual menu that
gives you convenient access to several menu commands. The
commands displayed in this menu depend on the item you select. A
sample contextual menu is shown in Figure 13.12.
To display the Component Catalog contextual menu, use one of the
following techniques:
Windows Right-click an item.
Mac OS Control-click an item, or click and hold on an item.
The following list describes the most common commands in this
contextual menu:
• Close—removes the item from the Catalog pane.
IDE User Guide IDE–573
RAD Layout Editing
Component Catalog window
• View—changes the current view in the Component pane. You
can choose List view or Live view.
• New Folder—creates a new folder in the current catalog.
Figure 13.12 Component Catalog contextual menu
• Rename—changes the name of the selected item. After you
select this command, type a new name for the item and press
Enter/Return.
• Lock—locks the selected item. When an item is locked, you
cannot change any of its properties (except its “locked” status).
However, you can add sub-items to a locked container (such as a
folder or catalog), remove sub-items from a locked container,
and modify sub-items of a locked container (assuming the items
to be modified are not locked). A small lock icon indicates that
an item is currently locked.
• Unlock—unlocks the selected item.
• Properties—displays the properties for the selected item in the
Object Inspector.
Creating Component Catalogs
You can create your own customized component catalogs to store
the RAD components you use most frequently. These catalogs let
you combine components from several catalogs into a single catalog
file. Whenever you need to create a new layout, your customized
catalog file can provide all the components you need.
IDE–574 IDE User Guide
RAD Layout Editing
Component Catalog window
To create a catalog, click the New Catalog button in the toolbar of
the Component Catalog window. Alternatively, choose New from
the File menu, click the File tab at the top of the New window, and
then select Component Catalog File in the File view. You see the
window shown in Figure 13.13.
Figure 13.13 Creating a new catalog file
Type a name for your new catalog file in the File name field.
TIP We suggest naming your catalog with a .ctlg file name extension,
like this: MyCatalog.ctlg. This naming convention helps you
quickly identify the catalog file on your hard disk. In addition, the
IDE User Guide IDE–575
RAD Layout Editing
Component Catalog window
Windows-hosted version of the CodeWarrior IDE uses this
extension to identify the catalog file.
The Location field displays the full path to the folder in which the
catalog file is saved. To change the current path, type a new path
directly into the field. Alternatively, click the Set button to the right
of the field to display a dialog box. Use the dialog box controls to
navigate to a location on your hard disk where you want to save the
project.
When you finish typing a name for the catalog and choosing a
location in which to save that catalog, click OK in the New window.
The IDE displays the Component Catalog window and adds the
new catalog to the Catalog Pane, as shown in Figure 13.14.
Figure 13.14 A new catalog added to the Catalog pane
To add a component to your new catalog, follow these steps:
1. Select an existing catalog with the component you wish to add.
For example, if you want to add the Java AWT Button component to
your catalog, select AWT Components in the Catalog pane.
IDE–576 IDE User Guide
RAD Layout Editing
Component Catalog window
2. Select the component you wish to add from the Component pane.
In the example, you would select the Button component.
3. Drag and release the selected component onto your catalog.
In the example, you would drag the Button component onto
MyCatalog in the Catalog pane, as shown in Figure 13.15. After you
release the Button component, it is added to MyCatalog.
Figure 13.15 Adding a component to your catalog
TIP To add several components simultaneously, Ctrl/Shift click the
components before dragging them onto your catalog. To
automatically expand the view of a hierarchical catalog, drag the
components onto the catalog and wait briefly.
You can also add components to your catalog using the Cut, Copy,
and Paste commands in the Edit menu and the Layout editor
IDE User Guide IDE–577
RAD Layout Editing
Object Inspector
contextual menu. To use these commands, perform the following
steps:
1. Select an existing catalog with the component you wish to add.
2. Select the component you wish to add from the Component pane.
3. Choose the Cut or Copy command.
4. Select the catalog to which you want to add the component.
5. Choose the Paste command.
Object Inspector
The Object Inspector displays the properties and events for a
selected object. You can edit each object characteristic by using pop-
up menus, dialog boxes, or by directly typing a new value. Choose
Object Inspector from the Window menu to display the Object
Inspector, shown in Figure 13.16 on page 579 (Windows) and Figure
13.17 on page 580 (Mac OS, Solaris, and Linux).
This section describes the following Object Inspector parts:
• Object Pop-up Menu
• Properties Tab
• Events Tab
• Object Inspector Contextual Menu
Object Pop-up Menu
The Object Inspector displays information about the object whose
name is displayed in the Object pop-up menu. To inspect other
items within the selected object’s hierarchy, choose the item’s name
from the Object pop-up menu.
Windows The arrow keys on the keyboard let you quickly access
other objects in the current layout. After clicking the Object pop-up
menu, press the Up Arrow key to select the object listed above the
current one, or press the Down Arrow key to select the object listed
below the current one. Press Enter/Return to confirm the selection
and display the object’s properties in the Object Inspector.
IDE–578 IDE User Guide
RAD Layout Editing
Object Inspector
Figure 13.16 Object Inspector (Windows)
Properties Tab
To view the properties of the selected object, click the Properties
tab. The Object Inspector displays a list of applicable properties.
Each line in the list displays the name of a property and the current
value of that property.
Click the hierarchical control next to a specific property to expand
and view its contents. Click the control again to collapse the view.
To resize the columns in the list, position the cursor between the
columns and drag the cursor. An outline shows the final sizes of the
columns. Release the cursor to resize the columns accordingly.
To change the value of a particular property, click its current value.
A border is displayed around the line containing the selected
property, and the property is highlighted. Type a new value to
replace the current one.
IDE User Guide IDE–579
RAD Layout Editing
Object Inspector
Figure 13.17 Object Inspector (Mac OS)
Alternatively, you can change the value of a property by clicking
buttons displayed next to the current value:
Click this button to display a pop-up menu. Choose pre-
defined options from the pop-up menu to change the current
property value.
Click this button to display a dialog box. Configure the
property value using the options in the dialog box. The
current RAD plug-in determines the contents of the dialog
box.
If you decide against changing the property’s value, press the Esc
key on your keyboard. The Object Inspector discards your changes.
The arrow keys on the keyboard provide quick navigation of a
component’s properties. When a property is currently selected in
the Object Inspector, the Up Arrow key selects the property listed
IDE–580 IDE User Guide
RAD Layout Editing
Object Inspector
above the current one, and the Down Arrow key selects the
property listed below the current one.
TIP (Windows) The Left Arrow and Right Arrow keys are useful for
toggling between pre-defined property values. Selecting a boolean
value, for example, you can use the Left Arrow and Right Arrow
keys to toggle the current value between True and False.
Events Tab
The Events tab displays information about the selected
component’s events. By default, all events are disabled. After you
modify an event, the RAD tools automatically generate source code.
This generated code provides a structured framework to handle the
event. You supply the code that determines the way the object
behaves and interacts with other objects in your user interface.
To modify a particular event, click its blank text field. The Object
Inspector displays and highlights a default name for the event. If
you want to change this default name, type a new name.
TIP You can quickly create a new event by double-clicking its blank text
field. This double-click accepts the default name for the event.
After you make changes, press Enter/Return to let the RAD tools
automatically generate source code. An editor window opens,
displays the generated code, and highlights the name you chose for
the event. Listing 13.1 shows the generated code for a
componentResized event in a Java AWT checkbox component.
Listing 13.1 Sample generated code
public
void checkbox1componentResized(java.awt.event.ComponentEvent e)
{
}
You must supply the code that specifies the component’s behavior.
For example, the generated code in Listing 13.1 does not include any
IDE User Guide IDE–581
RAD Layout Editing
Object Inspector
code inside the braces. You must create the code within these braces
in order to control the component’s behavior in your application.
Choose Save from the File menu or press Ctrl/Command-S to
immediately save your changes.
If you decide against modifying an event, press the Esc key on your
keyboard. The Object Inspector discards your changes.
Object Inspector Contextual Menu
The Object Inspector contextual menu provides several convenient
commands for manipulating objects. The available commands in
this menu depend on the object you select. A sample Object
Inspector contextual menu is shown in Figure 13.18 on page 583.
To display the Object Inspector contextual menu:
Windows Right-click an item.
The following list describes some of the commands in the Object
Inspector contextual menu:
• Select All—selects the contents of the current text field.
• Delete—removes the contents of the current text field.
• Customize Object—lets you change object characteristics.
• View Alphabetical—changes the Events view so that all object
events are listed in alphabetical order, regardless of the groups
to which those events belong.
• View In Groups—changes the Events view so that object events
are displayed in group hierarchies.
IDE–582 IDE User Guide
RAD Layout Editing
Object Inspector
Figure 13.18 Object Inspector contextual menu
IDE User Guide IDE–583
RAD Layout Editing
Object Inspector
IDE–584 IDE User Guide
14
RAD Components
CodeWarrior® Rapid Application Development (RAD) tools use
components to build an application’s user interface. These
components address specific elements of the interface, such as
buttons, scroll bars, and checkboxes. This chapter describes the
components supplied with the CodeWarrior RAD tools.
This chapter discusses the following:
• Java AWT Components
• Java Swing Components
• Component Editors
Java AWT Components
Table 14.1 describes the components that belong to the Java AWT
Components catalog. The icons shown in the following table are
displayed in the Component Palette and Component Catalog
window.
Table 14.1 Java AWT components
Icon Description
Button—represents a button in the user interface that
you click to yield a result
Canvas—represents a container for other user interface
elements
Checkbox—represents a checkbox option that you
enable or disable
IDE User Guide IDE–585
RAD Components
Java Swing Components
Icon Description
Choice—represents a pop-up menu that you use to
select an option from a list of possible options
Label—represents an area of text that identifies or
describes other user interface elements
List—represents a scrollable list from which you choose
one or more options
MenuBar—displays an icon in the layout window, but
not in the actual application. Double-click the icon to
open the Menu Editor.
Panel—represents a means by which to organize
arrangements of user interface elements
PopupMenu—displays an icon in the layout window, but
not in the actual application. Double-click the icon to
open the Pop-up Menu Editor.
Scrollbar—represents a scrollbar in the user interface
that is used to adjust options
ScrollPane—represents a pane that can create scrollbars
along its edges when entered text exceeds the pane’s
boundaries
TextArea—represents an area in the user interface that
lets you enter multiple lines of text
TextField—represents an area in the user interface that
lets you enter a single line of text
Java Swing Components
Table 14.2 describes the components that belong to the Java Swing
Components catalog. Many of these components are similar to
those in the AWT Components catalog, but are more extensively
configurable. The icons shown in the following table are displayed
in the Component Palette and Component Catalog window.
IDE–586 IDE User Guide
RAD Components
Java Swing Components
Table 14.2 Java Swing components
Icon Description
JButton—represents a button in the user interface that
you click to yield a result
JCheckBox—represents a checkbox option that you
enable or disable
JComboBox—represents a combination box that lets you
select options either by typing the option’s name or by
choosing the option from a pop-up list
JEditorPane—represents an editing pane that adapts
its characteristics to the required editing task
JLabel—represents an area of text that identifies or
describes other user interface elements
JList—represents a scrollable list from which you
choose one or more options
JMenuBar—displays an icon in the layout window, but
not in the actual application. Double-click the icon to
open the Menu Editor.
JOptionPane—displays a dialog box that alerts the
user, asks for additional input, or provides information
JPanel—represents a means by which to organize
arrangements of user interface elements
JPasswordField—represents a single line of text that
lets you enter passwords without displaying onscreen
the actual characters you type
JPopupMenu—displays an icon in the layout window,
but not in the actual application. Double-click the icon to
open the Pop-up Menu Editor.
JProgressBar—represents the visual display of a bar
whose size grows in proportion to the percentage of a
task being completed
JRadioButton—represents a radio button that you
enable or disable, one at a time
IDE User Guide IDE–587
RAD Components
Component Editors
Icon Description
JScrollBar—represents a scrollbar in the user
interface that is used to adjust options
JScrollPane—represents a pane that can create
scrollbars along its edges when entered text exceeds the
pane’s boundaries
JSlider—represents an onscreen mechanism, in the
form of a slider control, for choosing options
JSplitPane—represents a means by which to control
the size and display of two user interface elements
JTabbedPane—represents a pane divided into several
parts, with each part accessible through a tab control
JTable—represents a table of rows and columns
JTextArea—represents an area in the user interface that
lets you enter multiple lines of text
JTextField—represents an area in the user interface
that lets you enter a single line of text
JTextPane—represents an area of text with graphical
attributes
JToggleButton—represents a button that has two
possible states
JToolBar—represents a toolbar in the layout window
JTree—represents a hierarchical control in the user
interface
Component Editors
Certain components display representative icons of the user
interface, rather than the actual interface. These representative icons
appear in the layout window only, and are not displayed in the
IDE–588 IDE User Guide
RAD Components
Component Editors
application. Such components require separate editors to modify
the way they are displayed in the application.
For example, the Java AWT MenuBar component produces a square
icon in the layout window. This icon does not show the menu bar as
it would appear in the application. Instead, you double-click the
icon to open the Menu editor. The editor shows the true form of the
menu bar.
This section describes the various component editors in the catalogs
supplied with the CodeWarrior IDE. These editors include:
• Menu Editor
• Pop-up Menu Editor
Menu Editor
The Menu editor lets you create and modify an application’s menu
bar and its associated hierarchy of menu commands. This editor
displays the menu bar onscreen so that you can see the menus as
they appear in the application.
Double-click the representative icon in the layout window to
display the Menu editor. Initially, the display is blank, as shown in
Figure 14.1. As you build the menu hierarchy, the Menu editor
updates the display to reflect your changes.
This section discusses the following topics:
• Creating menu items
• Modifying menu items
• Removing menu items
IDE User Guide IDE–589
RAD Components
Component Editors
Figure 14.1 A Menu editor
Creating menu items
To create a menu item in the application’s menu bar, double-click
the rectangular outline shown in the Menu editor. A dialog box
displays to help you customize a new menu item. The contents of
the dialog box depend on the catalog that contains the component.
For example, when you use the Menu editor to customize a Java
Swing menu bar, the dialog box has the items shown in Figure 14.2.
IDE–590 IDE User Guide
RAD Components
Component Editors
Figure 14.2 Menu editor dialog box for Java Swing menu items
After you enter some information in the dialog box and click OK,
the Menu editor updates the menu-bar display. For example, if you
enter File in the Text field of the dialog box and click OK, the Menu
editor display shows the new File menu item in the menu bar. The
rectangular outline moves to the right of the File menu item.
Modifying menu items
You can continue modifying your application’s menu bar by
double-clicking existing menu items or by clicking rectangular
outlines. For example, if you click the File menu item shown in
Figure 14.3, the Menu editor displays a rectangular outline beneath
the File menu. This way, you modify the commands that are
displayed for each menu item in the menu bar.
IDE User Guide IDE–591
RAD Components
Component Editors
Figure 14.3 A Menu editor with modified menu items
When you finish modifying the menu bar, close the Menu editor
window. Although the original representative icon appears in the
layout window, your changes to the menu bar remain in place. To
immediately save changes to the menu bar, choose Save from the
File menu after closing the Menu editor window.
Removing menu items
To remove a particular menu item, click its name in the Menu editor
window and press Delete. The Menu Editor removes the menu item
and updates the display. Removing a menu item from the menu bar
also removes that menu item’s associated commands.
NOTE When removing menu items from the menu bar, you might need to
close and then re-open the Menu editor to accurately reflect your
changes.
IDE–592 IDE User Guide
RAD Components
Component Editors
Pop-up Menu Editor
The Pop-up Menu editor is very similar to the Menu editor in its
behavior. The only difference between the two editors is that the
Pop-up menu editor handles one pop-up menu at a time. Figure
14.4 shows the initial display of a Pop-up menu editor.
Figure 14.4 A Pop-up menu editor
For more information about creating, modifying, and removing
menu items in the Pop-up Menu editor, consult “Menu Editor” on
page 589. The same techniques you use in the Menu Editor can be
applied to the Pop-up Menu editor.
IDE User Guide IDE–593
RAD Components
Component Editors
IDE–594 IDE User Guide
15
RAD Browsing
The CodeWarrior® browser has additional capabilities for browsing
rapid application development (RAD) projects. When you configure
your project to generate a browser database, the IDE automatically
includes additional RAD-specific information in the database. The
browser displays a tab control in the Browser window to help you
explore the additional information.
This chapter assumes that you are experienced with the general
features of the browser, and that you want to learn how to use the
browser’s RAD capabilities. See “Browsing Source Code” on page
205 for more information about activating and configuring the
browser for your project.
The topics in this chapter include:
• Browser Window RAD Features
• RAD Windows
Browser Window RAD Features
When exploring the browser database for RAD projects, the
CodeWarrior browser enables additional functionality. This added
functionality lets you use the following RAD capabilities:
• Tab Control
• Properties View
• Methods View
• Events View
Tab Control
The tab control is useful for browsing a RAD component’s
supporting items, such as properties, methods, and events.
IDE User Guide IDE–595
RAD Browsing
Browser Window RAD Features
The tab control displays one view at a time. Click a tab name to
display its associated view. For example, click the Java tab in Figure
15.1 to display the Java view. This particular view shows Java RAD
information for the selected component in the Classes pane.
Figure 15.1 The Browser window for a Java RAD project
When you click a Properties, Methods, or Events tab, the
corresponding view only displays information for public data not
inherited from other member functions. In such views, both the
Browser Access Filters pop-up menu and the Show Inherited
checkbox are grayed out, indicating that you cannot change these
settings. Figure 15.2, Figure 15.3, and Figure 15.4 show the resulting
Browser window.
IDE–596 IDE User Guide
RAD Browsing
Browser Window RAD Features
Properties View
The Properties view, shown in Figure 15.2, displays information
about the properties of the selected component in the Classes pane.
This view is divided into the Properties pane and the
Implementation pane.
Figure 15.2 Browsing properties
The Properties pane lists the properties for the selected component.
When you select a property in this list, the implementation for that
property is shown in the Implementation pane. To learn how to
create new properties, see “New Property Window” on page 600.
The Implementation pane is similar to the Source pane. This pane
displays the selected property’s implementation in your source
code. The source code in the pane is fully editable. The top of the
pane shows the path to the file containing the implementation.
IDE User Guide IDE–597
RAD Browsing
Browser Window RAD Features
Methods View
The Methods view, shown in Figure 15.3, displays information
about the methods of the selected component in the Classes pane.
This tab view is divided into the Methods pane and the
Implementation pane.
Figure 15.3 Browsing methods
The Methods pane lists the methods for the selected component.
When you select a method in this list, the implementation for that
method is shown in the Implementation pane. To learn how to
create new methods, see “New Method Window” on page 602.
The Implementation pane is similar to the Source pane. This pane
displays the selected method’s implementation in your source code.
The source code in the pane is fully editable. The top of the pane
shows the path to the file containing the implementation.
IDE–598 IDE User Guide
RAD Browsing
Browser Window RAD Features
Events View
The Events view, shown in Figure 15.4, displays information about
the events of the selected component in the Classes pane. This tab
view is divided into the Event Sets pane and the Events pane.
Figure 15.4 Browsing event sets and events
The Event Sets pane lists groupings of events for the selected
component. The Events pane shows the individual events for a
selected event set. To learn how to create new event sets, see “New
Event Set Window” on page 605. To learn how to create new events,
refer to “New Event Window” on page 613.
IDE User Guide IDE–599
RAD Browsing
RAD Windows
RAD Windows
When you create a new property, method, event set, or event for a
component in your RAD project, the IDE displays a window to
assist you. Different options are available for each window type.
This section describes the following windows:
• New Property Window
• New Method Window
• New Event Set Window
• New Event Window
New Property Window
The New Property window helps you create a new property for a
selected component in the Browser window. To display this
window, make sure that the Browser window is frontmost, then
choose New Property from the Browser menu. Alternatively, click
the new item icon ( ), as shown in Figure 15.2 on page 597. The
New Property command changes slightly, based on the framework
you use to develop your code. For example, when developing a Java
RAD project, the command changes to New Bean Property.
The New Property window is shown in Figure 15.5. This window
consists of the following parts:
• Name
• Type
• Package required for type
• Accessors
• Has Data Member
• Summary
• Add and Cancel buttons
Name
Enter a name for the new property in this field. The name you enter
must comply with naming conventions in the framework
programming language. For example, you cannot use spaces in
names for some languages.
IDE–600 IDE User Guide
RAD Browsing
RAD Windows
Figure 15.5 New Property window
Type
Enter an appropriate property type in this field. The type you
specify must be a valid property type in the framework language.
IDE User Guide IDE–601
RAD Browsing
RAD Windows
Package required for type
If you wish, you can enter in this field a required package for the
property type.
Accessors
These checkboxes determine the accessor characteristics for the
property.
Has Data Member
Enable this checkbox if you want the property to have a data
member. If you enable the checkbox, the Name and Initializer fields
become available, as well as the Transient and Volatile checkboxes.
Enter the data member name in the Name field. You can supply the
remaining information as desired.
Summary
This section shows you a synopsis of the information currently
specified in the window. As you change a particular value or
checkbox, the Summary field updates to reflect your changes. This
field displays information only after you complete the Name and
Type fields and enable at least one of the Accessors.
Add and Cancel buttons
Click Add to confirm the current window information and add the
new property, or click Cancel to discard your changes.
New Method Window
The New Method window helps you create a new method for a
selected component in the Browser window. To display this
window, make sure that the Browser window is frontmost, then
choose New Method from the Browser menu. Alternatively, click
the new item icon ( ), as shown in Figure 15.3 on page 598. The
New Method command changes slightly, based on the framework
you use to develop your code. For example, when developing a Java
RAD project, the command changes to New Bean Method.
IDE–602 IDE User Guide
RAD Browsing
RAD Windows
The New Method window is shown in Figure 15.6. This window
consists of the following parts:
• Name
• Return type
• Parameters
• Optional throws
• Package required for parameters
• Modifiers
• Declaration
• Add and Cancel buttons
Name
Enter a name for the new method in this field. The name you enter
must comply with naming conventions in the framework
programming language. For example, you cannot use spaces in
names for some languages.
Return type
Enter an appropriate method return type in this field. The type you
specify must be a valid return type in the framework language.
Parameters
If desired, enter method parameters in this field. Some example
parameters are listed above this field.
Optional throws
If desired, enter exception-handling information (throws) in this
field. Some example throws are listed above this field.
Package required for parameters
If you wish, you can enter in this field a required package for the
parameter. Some example packages are listed above this field.
IDE User Guide IDE–603
RAD Browsing
RAD Windows
Figure 15.6 New Method window
Modifiers
Use the Access and Specifier pop-up menus to choose the access
level and method specifier for the new method. Possible access
levels include Public, Protected, and Private. Possible specifiers
IDE–604 IDE User Guide
RAD Browsing
RAD Windows
include None, Abstract, Final, and Static. You can enable the
Native or Synchronized checkboxes as desired to further describe
the method’s modifiers.
Declaration
This section shows you the current form of the declaration as
specified in the window. After you change a particular value or
checkbox, the Declaration field updates to reflect your changes.
This field displays information only after you complete the Name
and Type fields and specify an Access level.
Add and Cancel buttons
Click Add to confirm the current window information and add the
new method, or click Cancel to discard your changes.
New Event Set Window
The New Event Set window helps you create a new event set for a
selected component in the Browser window. To display this
window, make sure that the Browser window is frontmost, then
choose New Event Set from the Browser menu. Alternatively, click
the new item icon ( ), as shown in Figure 15.4 on page 599. The
New Event Set command changes slightly, based on the framework
you use to develop your code. For example, when developing a Java
RAD project, the command changes to New Bean Event Set. The
New Event Set window is shown in Figure 15.7.
This window lets you specify the type of event set you want to
create. There are two possibilities:
• New Custom Event Set
• Existing Custom Set
IDE User Guide IDE–605
RAD Browsing
RAD Windows
Figure 15.7 New Event Set window
New Custom Event Set
When you enable this option and click OK, a wizard opens to help
you create a custom event set. See “New Event Set wizard” on page
607 for more information.
Existing Custom Set
When you enable this option and click OK, the Existing Event Set
window, shown in Figure 15.8, displays. Select from the list the
event set you wish to add and click Add. This existing event set is
then added to the selected component in the Browser window.
IDE–606 IDE User Guide
RAD Browsing
RAD Windows
Figure 15.8 Adding an existing event set
New Event Set wizard
The New Event Set Window contains an option to create a New
Custom Event Set. When you enable this option and click OK, the
New Event Set wizard appears.
The wizard includes the following navigation buttons:
• Back—return to the previous section
• Next—proceed to the subsequent section
• Finish—display a summary of current information
• Cancel—discard all changes
The New Event Set wizard is divided into the following steps:
1. Choose a name and location for the new event set.
2. Specify a base class and a list of implementations.
IDE User Guide IDE–607
RAD Browsing
RAD Windows
3. Assign the new event set to the project’s build targets.
You progress through these steps in sequence. Each step builds on
the information provided in previous steps. When you supply
enough information in a particular step, click Next to continue.
To accept all current settings in the wizard and quickly create a new
event set, click Finish. The wizard displays a summary of all the
current settings for the new event set. You can always click Cancel
while viewing the summary to continue modifying settings.
To use the New Event Set wizard, follow these steps:
1. Choose a name and location for the new event set.
This section of the wizard, shown in Figure 15.9, lets you specify the
name and location of the new event set, as well as the modifiers for
the set.
This section includes the following parts:
• Class Name
• File
• Package
• Modifiers
Class Name
Enter a name for the event set’s class in this field. An example is
provided below the field. The Class is a Bean checkbox below the
field remains disabled. This status indicates that you are not
creating a Java bean.
File
This pop-up menu lets you specify the type of event set:
• New File—an event set file
• Relative to class—an event set that depends on an existing class
in the project
IDE–608 IDE User Guide
RAD Browsing
RAD Windows
Figure 15.9 New Event Set wizard - Name and Location
Depending on the option you choose, different fields become
enabled below the File pop-up menu. The enabled fields for the
New File option are shown in Figure 15.9, and the enabled fields for
the Relative to class option are shown in Figure 15.10.
If you choose the New File option, type in the enabled field the path
to which you want to save the file. Alternatively, click Set next to
the field. A standard Save window opens. Use the window controls
to select the location to which you want to save the file and click
Save.
IDE User Guide IDE–609
RAD Browsing
RAD Windows
Figure 15.10 Choosing the Relative to class option
If you choose the Relative to class option, the class field and the
pop-up menu beside it become enabled, as shown in Figure 15.10. In
the class field, type the name of the class you want to relate to the
event set. Alternatively, click Set next to the class field, select a class
in the window that opens, and then click Select. Next, use the pop-
up menu to place the event set event set Before, After, or Inside the
specified class.
Package
If you wish, you can enter in this field a package for the event set.
This field is not available if you choose the Relative to class option
from the File pop-up menu.
IDE–610 IDE User Guide
RAD Browsing
RAD Windows
Modifiers
Use the Access and Specifier pop-up menus to choose the access
level and method specifier for the new event set. Possible access
levels include Public, Protected, and Private. Possible specifiers
include None, Abstract, Final, and Static.
2. Specify a base class and a list of implementations.
This section of the wizard, shown in Figure 15.11, lets you specify
the base class and implementations for the new event set.
Figure 15.11 New Event Set wizard - Base Class and Interfaces
IDE User Guide IDE–611
RAD Browsing
RAD Windows
This section includes the following parts:
• Base Class
• Implements List
Base Class
The settings in this part determine the base-class type of the new
event set. There are two possibilities:
• Visual Component—Enable this option if the base class is a
visual component. The pop-up menu below this option lists
classes recognized by the installed RAD plug-ins for the IDE.
Choose a component from this pop-up menu.
• Custom—Enable this option if the base class of the event set is a
non-visual component or a custom class. Type the name of the
base class in the field below this option. A default name is
provided.
Implements List
In this part, type a list of interfaces to be implemented by the base
class. Example interfaces are provided. Separate multiple interfaces
with commas.
3. Assign the new event set to the project’s build targets.
This section of the wizard, shown in Figure 15.12, lets you assign the
event set to particular build targets within the active project.
To assign the event set to a specific build target, enable the checkbox
next to the build target’s name in the Add file to targets list. For
example, in Figure 15.12, the new event set is assigned to the
JavaApp Debug build target, and it is not assigned to JavaApp
Release.
IDE–612 IDE User Guide
RAD Browsing
RAD Windows
Figure 15.12 New Event Set wizard - Targets
New Event Window
The New Event window helps you create a new event for a selected
event set in the Browser window. To display this window, make
sure that the Browser window is frontmost and that an event set is
selected, then choose New Event from the Browser menu.
Alternatively, click the icon described in the Events pane, shown in
Figure 15.4 on page 599. The New Event command changes slightly,
based on the framework you use to develop your code. For
example, when developing a Java RAD project, the command
changes to New Bean Event.
IDE User Guide IDE–613
RAD Browsing
RAD Windows
Figure 15.13 New Event window
The New Event Set window is shown in Figure 15.13. This window
consists of the following parts:
• Name
• Parameters
• Optional throws
• Package required for parameters
IDE–614 IDE User Guide
RAD Browsing
RAD Windows
• Modifiers
• Declaration
• Add and Cancel buttons
Name
Enter a name for the new method in this field. The name you enter
must comply with naming conventions in the framework
programming language. For example, you cannot use spaces in
names for some languages.
Parameters
If desired, enter event parameters in this field. A sample construct
for a parameter is listed above this field.
Optional throws
If desired, enter exception-handling information (throws) in this
field.
Package required for parameters
If you wish, you can enter in this field a required package for the
event.
Modifiers
Enable the Synchronized checkbox to modify the event
accordingly.
Declaration
This section shows you the current form of the declaration as
specified in the window. After you change a particular value or
checkbox, the Declaration field updates to reflect your changes.
This field displays information only after you complete the Name
field.
Add and Cancel buttons
Click Add to confirm the current window information and add the
new method, or click Cancel to discard your changes.
IDE User Guide IDE–615
RAD Browsing
RAD Windows
IDE–616 IDE User Guide
16
®
Using the CodeWarrior
IDE with Version Control
Systems
This chapter explains how to use the CodeWarrior IDE version
control integration facilities to control your source code. Topics
include:
• Using Version Control Systems
• Activating VCS Operations
• Accessing VCS Features
• Common VCS Operations
Using Version Control Systems
A revision control or version control system (VCS) allows you to
maintain a database of your source code, and then check files in or
out of the database. This makes it easy to track changes to your
code, particularly when more than one person is working on a
software project.
Commercially Available VCS Plug-ins
The CodeWarrior IDE plug-in architecture supports a variety of
version control systems. Table 16.1 describes some of the major
version control plug-ins available from Metrowerks and third
parties.
IDE User Guide IDE–617
Using the CodeWarrior ® IDE with Version Control Systems
Using Version Control Systems
Table 16.1 Version control plug-ins
Product Vendor Windows Mac OS Solaris/
Linux
ClearCase Rational 1 1
Metrowerks 3 3
CVS Electric Fish ✔
Metrowerks ✔ 2 2
Perforce Perforce 1 ✔ 1
Projector Apple 1
Computer
Electric Fish 3
Metrowerks 3
PVCS Intersolv 1 1
Synergex ✔
SourceSafe Metrowerks 3 ✔
Microsoft ✔
Mainsoft 1
VOODOO UNI ✔
Software
LEGEND: ✔ IDE support
1 Platform support only
2 Under development
3 Requires VCS vendor’s tools be pre-installed
A blank field indicates an unsupported plug-in.
For the latest plug-in tool list, visit the Metrowerks web site at the
following URL:
http://www.metrowerks.com/desktop.qry?x=Version_Control
IDE–618 IDE User Guide
Using the CodeWarrior ® IDE with Version Control Systems
Activating VCS Operations
Activating VCS Operations
Before you can use any version control system with the
CodeWarrior IDE, it must be properly installed and activated.
Installing VCS Software
Installing most revision control system software is as simple as
copying the VCS plug-in to the appropriate folder for your platform
and restarting the CodeWarrior IDE. This is usually all it takes to
make the VCS software available for use.
NOTE Be sure to follow the installation instructions that accompany the
VCS software you plan to use. If you encounter any problems,
contact the VCS software vendor for assistance.
VCS plug-ins normally reside in the Version Control folder. Use
the following path descriptions to help you locate where your VCS
plug-in should be copied to:
Windows {Compiler}\Plugins\Version Control
Mac OS {Compiler}:CodeWarrior Plugins:
Version Control
Solaris and {Compiler}/Plugins/Version_Control
Linux
Activating VCS Software
The VCS Setup panel, as shown in Figure 16.1, is present if you
have installed recognized revision control software. You use the
VCS Setup panel to specify client options for connecting to a
revision control systems.
IDE User Guide IDE–619
Using the CodeWarrior ® IDE with Version Control Systems
Activating VCS Operations
Figure 16.1 The VCS settings panel
Setting up a CodeWarrior project for version control is simple. You
just need to enter some information in the VCS Setup panel while a
project is open. You’ll need to input the information separately for
each project that uses revision control.
NOTE Be sure to follow the activation instructions that accompany the VCS
software you plan to use. If you encounter any problems, contact the
VCS software vendor for assistance.
To Activate Your VCS Settings:
1. Choose Version Control Settings from the Edit menu.
The VCS Settings window appears (Figure 16.1).
2. Enable the Use Version Control option.
Click the Use Version Control option to activate version control.
IDE–620 IDE User Guide
Using the CodeWarrior ® IDE with Version Control Systems
Activating VCS Operations
3. Choose a version control system from the Method menu.
The CodeWarrior IDE is capable of supporting several different
types of version control. If your VCS software has been correctly
installed, its name should be present on the Method list as shown in
Figure 16.2.
Figure 16.2 Method pop-up list.
4. Enter your username.
Enter your user name in the Username field.
5. Enter your password (optional).
Enable the Remember Password option, then enter your password
in the Password field.
6. Set additional Login Settings options.
To customize your development interaction with the chosen VCS
setting you can enable any or all of the following options:
• Connect on Open
• Always Show Login Dialog
• Remember Password (required to save password)
7. Choose the Database Path.
Click Choose to select the VCS database that you want to access.
The actual setting of the Database Path field is dependent upon
which VCS software you are using. See the VCS software
documentation for more information.
8. Choose the Local Path.
Click Choose to select the destination folder where your local files
will be stored. The actual setting of the Local Path field is dependent
IDE User Guide IDE–621
Using the CodeWarrior ® IDE with Version Control Systems
Accessing VCS Features
upon which VCS software you are using. See the VCS software
documentation for more information.
9. Click Save.
Save your changes using the Save button.
If all your data was correct, you should be connected to the VCS
database set in the Database Path field. If you aren’t, review the
above steps, ensuring that the data entered is correct.
NOTE Some VCS software may have additional setup requirements. If you
encounter any problems, contact the VCS software vendor for
assistance.
Accessing VCS Features
The CodeWarrior IDE provides several ways to access common
VCS operations and view status and log information. These include:
• VCS Menu
• VCS Login dialog
• VCS Pop-up
• Project Window
• VCS Messages Window
VCS Menu
Once version control is activated for a project, a VCS menu appears
as shown in Figure 16.3. You select commands from the VCS menu
to perform Get, Checkout, Checkin, and other common operations
available from the specified version control system.
Macintosh On the Macintosh, the VCS menu appears on the
menubar as an icon that looks like this: .
NOTE The VCS menu appearance may differ depending upon which VCS
operations are available. See the documentation that came with the
VCS software for more information.
IDE–622 IDE User Guide
Using the CodeWarrior ® IDE with Version Control Systems
Accessing VCS Features
Figure 16.3 VCS menus for Windows and Mac OS
Table 16.2 Supported VCS Operations
Command Description
Synchronize Updates the VCS Status column in the Project
Status window by examining each project file’s
status and updating its information.
Project Contains a submenu of VCS commands that
enable you to perform Get, Checkout, Undo
Checkout, Checkin, Status, and Add
operations on project files themselves.
Recursive Contains a submenu of VCS commands that
enable you to perform recursive operations.
Get Retrieves a copy of the file without checking
it out of the project database.
IDE User Guide IDE–623
Using the CodeWarrior ® IDE with Version Control Systems
Accessing VCS Features
Command Description
Checkout Checkout files for exclusive modification.
Undo Checkout Cancels a checkout, voiding all changes.
Checkin Returns a modified file to the database and
relinquishes the checkout.
History Displays a modification history of a project
or file.
Status Displays a file’s checkout status.
Properties Displays database information about a
project or file.
Comment Changes a comment for a specific version of
a project or file.
Label Assigns a label to a project or file.
Add Adds a file to the database.
Connect or Connects or disconnects you from the project
Disconnect database depending upon the current open
status.
About Displays VCS plug-in copyright and version
information.
Variables Displays the VCS user’s variable settings in
an editor window.
NOTE Each VCS plug-in may assign different names to these operations.
See the documentation that accompanied your VCS software to
determine which operations are supported.
IDE–624 IDE User Guide
Using the CodeWarrior ® IDE with Version Control Systems
Accessing VCS Features
Figure 16.4 VCS Login dialog
Version Control Login Window
The Version Control Login window (Figure 16.4) appears when
you open a project that uses a revision control system and the
Always Show Login Dialog option has been enabled. Enter your
username and password, then click OK to continue opening the
project. Otherwise, click Cancel to stop.
VCS Pop-up
The VCS Pop-up menu ( ) (Figure 16.5) appears in editor
windows when a version control system is activated. The icon that
represents the VCS Pop-up menu indicates the current permission
setting for the file. For more information on permission settings, see
“VCS States” on page 626.
IDE User Guide IDE–625
Using the CodeWarrior ® IDE with Version Control Systems
Accessing VCS Features
Figure 16.5 VCS Pop-Up Menu
VCS States
When using a version control system, each file in a project can have
a different permission setting. A file’s permission setting can be
viewed in the Project window’s Checkout Status Column (Figure
16.6) and as part of the file’s editor window’s VCS Pop-up menu
(Figure 16.6). See Table 16.3 for a description of each state indicator.
Table 16.3 VCS state Icons
If the icon is… Then…
Checked out You can edit the file and add your changes to
the revision control database.
Checked in You cannot edit the file, and it is part of the
revision control database.
Writable You can edit the file, but you cannot add
your changes to the revision control database
because the file was not properly checked-
out for modification.
IDE–626 IDE User Guide
Using the CodeWarrior ® IDE with Version Control Systems
Accessing VCS Features
If the icon is… Then…
Unlocked The file can be edited, and it is not checked
into a revision control database.
Locked You cannot edit the file, and it is not part of
the revision control database. You may not
have the access privileges needed to access
the file, or someone may have locked the file.
Depending on the state of the VCS Pop-Up menu when you click on
it, certain operations may be performed on the file you are editing.
These supported operations are described in Table 16.4.
You choose an item from the VCS Pop-up menu to execute a VCS
operation. If the menu item contains an ellipsis character “…”, a
dialog box of advanced options for the operation appears, enabling
you to customize the operation before executing it.
Mac OS Press the Option key before choosing a menu command
to access any advanced VCS options. If an ellipsis character “…”
appears next to a menu command, advanced VCS options are
available for that operation.
For more information on these operations, refer to the
documentation that came with your revision control system.
Table 16.4 Supported VCS Pop-up Operations
Command Description
Unlock Change the lock on the file (if possible) so
that the file is writable.
Add Add the file to the revision control database.
Get Retrieve a fresh copy of the file from the
revision control database.
Checkout Check the file out from the revision control
database for modifications.
Undo Checkout Discard any changes made to the file, and tell
the revision control database to cancel the
checkout of the file.
IDE User Guide IDE–627
Using the CodeWarrior ® IDE with Version Control Systems
Accessing VCS Features
Command Description
Checkin Tell the revision control database to accept
the file with the changes that have been made
to it.
Make Writable Make the file writable for experimentation,
though it will not be able to be checked into
the revision control database.
Project Window
When version control is activated for a project, the Checkout Status
column appears in the Project window (Figure 16.6). This column
uses various icons to represent the current checkout status, or file
permission, of the project files. Whenever you change the checkout
status of a file in the CodeWarrior IDE, this column updates to
reflect the change.
Figure 16.6 Checkout Status Column
IDE–628 IDE User Guide
Using the CodeWarrior ® IDE with Version Control Systems
Common VCS Operations
VCS Messages Window
The CodeWarrior IDE uses a message window to display a log of
revision control messages, as shown in Figure 16.7. To learn how to
use the controls in the window, refer to “Using the Message
Window” on page 398.
Figure 16.7 VCS Messages window
Common VCS Operations
In addition to the standard revision control operations like Add,
Get, Checkout, Checkin, and others, various other operations are
possible. These include:
• Getting a File’s Status
• Modifying a Checked In File
• Dealing with ‘ckid’ Resources (Mac OS)
• Other Operations
Getting a File’s Status
If you have configured your project file to use a version control
system, and have checked in your files in accordance with the
procedures described in the VCS documentation, you will see one of
the icons of Table 16.3 in the Checkout Status column of the Project
window for every file under revision control in your project. Refer
to Figure 16.6 to see where the Checkout Status column is located in
the Project window.
IDE User Guide IDE–629
Using the CodeWarrior ® IDE with Version Control Systems
Common VCS Operations
Clicking the Checkout Status column icon at the top of the column
will perform a Synchronize Status command on the project’s files
against the revision control database. The status of all files you have
on your hard disk will be compared and synchronized with the
status of the files in the revision control database.
In addition, the VCS Pop-up menu in the file’s editor window will
always indicate the current checkout status of the file.
Modifying a Checked In File
You can change the status of a Checked in source code control file so
you can modify it, but after modification, you will not be able to
check it back into the source code control database. This feature is
provided to allow you to experiment with a file by temporarily
making it writable. If the revision control database allowed you to
override permissions on files without consequence, it would not be
providing any valuable control services for you.
Windows Right-click on the file in Explorer, then click
Properties. In the window see if the Locked
attribute is checked. If you uncheck it, the file
can then be edited.
Mac OS Choose Make Writable from the VCS Pop-up
menu in the editor window (Figure 16.8). You
can now modify the file, but you won’t be able to
check it back into its source code control
database.
Figure 16.8 Changing Read-Only to Modify Read-Only
IDE–630 IDE User Guide
Using the CodeWarrior ® IDE with Version Control Systems
Common VCS Operations
Dealing with ‘ckid’ Resources (Mac OS)
The CodeWarrior IDE almost always respects the presence of 'ckid'
resources in text files. The 'ckid' resources was created for use by
Projector and is used by most Macintosh VCS products.
The one time that the CodeWarrior IDE may do something different
than indicated by a 'ckid' resource is when dealing with a project
file that contains a 'ckid' resource.
Other Operations
Other operations may be available depending upon which revision
control system plug-in you use. You will need to refer to the
documentation that accompanied the VCS software you are using in
order to determine this.
IDE User Guide IDE–631
Using the CodeWarrior ® IDE with Version Control Systems
Common VCS Operations
IDE–632 IDE User Guide
A
®
CodeWarrior IDE Menu
Reference
This appendix provides an overview of the menu commands in the
CodeWarrior IDE. Table 16.5 lists the menus in the IDE’s menu bar.
Table 16.5 CodeWarrior IDE Menus
Menu For more information, see…
Info Menu (Solaris™ only) “Info Menu” on page 635
File Menu “File Menu” on page 635
Edit Menu “Edit Menu” on page 637
View Menu “View Menu” on page 638
Search Menu “Search Menu” on page 639
Project Menu “Project Menu” on page 642
Debug Menu “Debug Menu” on page 644
Data Menu “Data Menu” on page 647
Browser Menu “Browser Menu” on page 649
Layout Menu “Layout Menu” on page 650
Window Menu “Window Menu” on page 651
VCS Menu “VCS Menu” on page 653
Tools Menu (Mac® OS only) “Tools Menu” on page 653
Scripts Menu (Mac OS, Solaris, “Scripts Menu” on page 654
and Linux only)
Editor Extensions Menu “Editor Extensions Menu” on
(Mac OS only) page 654
Help Menu “Help Menu” on page 655
IDE User Guide IDE–633
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
The remainder of this appendix uses the following structure to
describe the menu commands and submenus:
• IDE Menu Tables—This section presents a series of tables. Each
table shows a particular IDE menu and its collection of menu
commands.
• Alphabetical Menu-Command Listing—This section presents an
alphabetical listing of all menu commands.
• Submenu Listing—This section describes submenus that appear
for some of the menu commands.
The tables organize menu commands according to the following
menu bar layouts: Windows and Macintosh. By default, the IDE
uses the Windows menu bar layout on Windows hosts and the
Macintosh menu bar layout on all other hosts. See “Menu bar
layout” on page 259 for more information about changing this
default setting.
To learn about a particular menu command, look up its name in the
menu tables, then follow the page reference to its description in the
alphabetical list. The description of the menu command provides a
page reference to a submenu description when needed.
NOTE Not all menus are visible at all times. Some menus appear only
when their associated menu commands become applicable in
context. For example, after you open the class browser, the Browser
Menu appears. After closing the class browser, the menu
disappears because its associated menu commands lose context.
IDE Menu Tables
This section presents a series of tables. Each table represents an IDE
menu and its collection of menu commands. You choose a menu bar
layout to organize the menu commands in different ways. Each
table title indicates the relevant menu bar layout. For more
information about these layouts, see “Menu bar layout” on page
259.
IDE–634 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Info Menu
The Info menu contains commands for copying files, mounting
volumes, and configuring keyboard preferences. Table 16.6 lists the
commands as they appear in the IDE menu bar layouts.
Table 16.6 Info Menu Commands (Windows and Macintosh Layouts)
Menu command For more information, see…
About Metrowerks “About Metrowerks
CodeWarrior CodeWarrior” on page 656
Copy Files “Copy Files” on page 663
File Systems “File Systems” on page 668
Keyboard Preferences “Keyboard Preferences” on
page 675
File Menu
The File menu contains commands that you use when opening,
creating, saving, closing, and printing source-code files and projects.
The File Menu also provides different methods for saving edited
files. Table 16.7 and Table 16.8 on page 636 list the commands as
they appear in the IDE menu bar layouts.
Table 16.7 File Menu Commands (Windows Layout)
Menu command For more information, see…
New “New” on page 676
Open “Open” on page 678
Find and Open File “Find and Open File” on page
669
Close “Close” on page 660
Save “Save” on page 685
Save All “Save All” on page 685
Save As “Save As” on page 686
Save A Copy As “Save A Copy As” on page 685
Revert “Revert” on page 684
IDE User Guide IDE–635
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Import Components “Import Components” on page
674
Close Catalog “Close Catalog” on page 661
Import Project “Import Project” on page 674
Export Project “Export Project” on page 668
Page Setup “Page Setup” on page 680
Print “Print” on page 679
Open Recent “Open Recent” on page 678
Exit “Exit” on page 667
Table 16.8 File Menu Commands (Macintosh Layout)
Menu command For more information, see…
New Text File “New Text File” on page 677
New “New” on page 676
Open “Open” on page 678
Open Recent “Open Recent” on page 678
Find and Open File “Find and Open File” on page
669
Close “Close” on page 660
Close All “Close All” on page 661
Save “Save” on page 685
Save All “Save All” on page 685
Save As “Save As” on page 686
Save A Copy As “Save A Copy As” on page 685
Revert “Revert” on page 684
Import Components “Import Components” on page
674
Close Catalog “Close Catalog” on page 661
Import Project “Import Project” on page 674
Export Project “Export Project” on page 668
IDE–636 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Page Setup “Page Setup” on page 680
Print “Print” on page 679
Quit “Quit” on page 680
Edit Menu
The Edit menu contains all the customary editing commands, along
with some CodeWarrior additions. This menu also includes the
commands that open the Preferences and Target Settings windows.
Table 16.9 and Table 16.10 on page 638 list the commands as they
appear in the IDE menu bar layouts.
Table 16.9 Edit Menu Commands (Windows Layout)
Menu command For more information, see…
Undo “Undo” on page 691
Redo “Redo” on page 681
Cut “Cut” on page 664
Copy “Copy” on page 662
Paste “Paste” on page 679
Delete “Delete” on page 664
Select All “Select All” on page 686
Balance “Balance” on page 657
Shift Left “Shift Left” on page 687
Shift Right “Shift Right” on page 687
Preferences “Preferences” on page 679
Target Settings “Target Settings” on page 690
Version Control Settings “Version Control Settings” on
page 692
Commands & Key Bindings “Commands & Key Bindings”
on page 661
IDE User Guide IDE–637
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Table 16.10 Edit Menu Commands (Macintosh Layout)
Menu command For more information, see…
Undo “Undo” on page 691
Redo “Redo” on page 681
Cut “Cut” on page 664
Copy “Copy” on page 662
Paste “Paste” on page 679
Clear “Clear” on page 660
Select All “Select All” on page 686
Balance “Balance” on page 657
Shift Left “Shift Left” on page 687
Shift Right “Shift Right” on page 687
Insert Reference Template “Insert Reference Template” on
page 674
Preferences “Preferences” on page 679
Target Settings “Target Settings” on page 690
Version Control Settings “Version Control Settings” on
page 692
Commands & Key Bindings “Commands & Key Bindings”
on page 661
View Menu
The View menu contains commands for viewing toolbars, RAD
windows, the class browser, the Message Window, and various
debugging windows. Table 16.11 on page 638 lists the commands as
they appear in the Windows menu bar layout.
Table 16.11 View Menu Commands (Windows Layout)
Menu command For more information, see…
Toolbars “Toolbars” on page 691
Component Catalog “Component Catalog” on page
662
IDE–638 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Component Palette “Component Palette” on page
662
Object Inspector “Object Inspector” on page 678
Project Inspector “Project Inspector” on page 680
Browser Contents “Browser Contents” on page
658
Class Browser “Class Browser” on page 659
Symbolics Window “Symbolics Window” on page
689
Class Hierarchy “Class Hierarchy” on page 659
Errors & Warnings “Errors & Warnings” on page
667
Processes “Processes” on page 680
Breakpoints “Breakpoints” on page 657
Watchpoints “Watchpoints” on page 695
Registers Windows “Registers Windows” on page
682
Expressions “Expressions” on page 668
Global Variables Window “Global Variables Window” on
page 672
Search Menu
The Search menu contains commands for finding text, replacing
text, comparing files, and navigating code. Table 16.12 on page 640
and Table 16.13 on page 640 list the commands as they appear in the
IDE menu bar layouts.
Mac OS Use the commands in this menu to find the definitions of
routines in your source code and in library reference databases such
as THINK Reference™ or Apple® Macintosh Programmer’s Toolbox
Assistant™.
IDE User Guide IDE–639
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Table 16.12 Search Menu Commands (Windows Layout)
Menu command For more information, see…
Find “Find” on page 668
Replace “Replace” on page 682
Find in Files “Find in Files” on page 670
Find Next “Find Next” on page 671
Find In Next File “Find In Next File” on page 670
Enter Find String “Enter Find String” on page 667
Find Selection “Find Selection” on page 672
Replace Selection “Replace Selection” on page
683
Replace and Find Next “Replace and Find Next” on
page 682
Replace All “Replace All” on page 683
Find Definition “Find Definition” on page 669
Go Back “Go Back” on page 673
Go Forward “Go Forward” on page 673
Go to Line “Go to Line” on page 673
Compare Files “Compare Files” on page 662
Apply Difference “Apply Difference” on page
657
Unapply Difference “Unapply Difference” on page
691
Table 16.13 Search Menu Commands (Macintosh Layout)
Menu command For more information, see…
Find and Replace “Find and Replace” on page
669
Find in Files “Find in Files” on page 670
Find Next “Find Next” on page 671
Find Previous “Find Previous” on page 671
IDE–640 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Find In Next File “Find In Next File” on page 670
Find In Previous File “Find In Previous File” on page
671
Enter Find String “Enter Find String” on page 667
“Enter Replace String” on page
Enter Replace String 667
Find Selection “Find Selection” on page 672
Find Previous Selection “Find Previous Selection” on
page 671
Replace Selection “Replace Selection” on page
683
Replace and Find Next “Replace and Find Next” on
page 682
Replace and Find Previous “Replace and Find Previous”
on page 683
Replace All “Replace All” on page 683
Find Definition “Find Definition” on page 669
Find Definition & Reference “Find Definition & Reference”
on page 670
Find Reference “Find Reference” on page 672
Go Back “Go Back” on page 673
Go Forward “Go Forward” on page 673
Go to Line “Go to Line” on page 673
Compare Files “Compare Files” on page 662
Apply Difference “Apply Difference” on page
657
Unapply Difference “Unapply Difference” on page
691
IDE User Guide IDE–641
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Project Menu
The Project menu contains commands for manipulating files,
handling libraries, compiling projects, building projects, and linking
projects. Table 16.14 and Table 16.15 on page 643 list the commands
as they appear in the IDE menu bar layouts.
Table 16.14 Project Menu Commands (Windows Layout)
Menu command For more information, see…
Add Window “Add Window” on page 656
Add Files “Add Files” on page 656
Create Group “Create Group” on page 663
Create Target “Create Target” on page 663
Create Segment/Overlay “Create Segment/Overlay” on
page 663
Check Syntax “Check Syntax” on page 659
Preprocess “Preprocess” on page 679
Precompile “Precompile” on page 679
Compile “Compile” on page 662
Disassemble “Disassemble” on page 665
Bring Up To Date “Bring Up To Date” on page
658
Make “Make” on page 675
Stop Build “Stop Build” on page 689
Remove Object Code “Remove Object Code” on page
682
Re-search for Files “Re-search for Files” on page
681
Reset Project Entry Paths “Reset Project Entry Paths” on
page 684
Synchronize Modification “Synchronize Modification
Dates Dates” on page 689
IDE–642 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Enable Debugger “Enable Debugger” on page
666
Disable Debugger “Disable Debugger” on page
665
Run “Run” on page 684
Debug “Debug” on page 664
Resume “Resume” on page 684
Set Default Project “Set Default Project” on page
686
Set Default Target “Set Default Target” on page
687
Table 16.15 Project Menu Commands (Macintosh Layout)
Menu command For more information, see…
Add Window “Add Window” on page 656
Add Files “Add Files” on page 656
Create Group “Create Group” on page 663
Create Target “Create Target” on page 663
Create Segment/Overlay “Create Segment/Overlay” on
page 663
Check Syntax “Check Syntax” on page 659
Preprocess “Preprocess” on page 679
Precompile “Precompile” on page 679
Compile “Compile” on page 662
Disassemble “Disassemble” on page 665
Bring Up To Date “Bring Up To Date” on page
658
Make “Make” on page 675
Stop Build “Stop Build” on page 689
IDE User Guide IDE–643
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Remove Object Code “Remove Object Code” on page
682
Re-search for Files “Re-search for Files” on page
681
Reset Project Entry Paths “Reset Project Entry Paths” on
page 684
Synchronize Modification “Synchronize Modification
Dates Dates” on page 689
Enable Debugger “Enable Debugger” on page
666
Disable Debugger “Disable Debugger” on page
665
Run “Run” on page 684
Debug “Debug” on page 664
Resume “Resume” on page 684
Set Default Project “Set Default Project” on page
686
Set Default Target “Set Default Target” on page
687
Debug Menu
The Debug menu contains commands for managing program
execution. Table 16.16 on page 644 and Table 16.17 on page 646 list
the commands as they appear in the IDE menu bar layouts.
Table 16.16 Debug Menu Commands (Windows Layout)
Menu command For more information, see…
Break “Break” on page 657
Kill “Kill” on page 675
Restart “Restart” on page 684
Step Over “Step Over” on page 688
IDE–644 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Step Into “Step Into” on page 688
Step Out “Step Out” on page 688
Run to Cursor “Run to Cursor” on page 685
Change Program Counter “Change Program Counter” on
page 658
Set Breakpoint “Set Breakpoint” on page 686
Clear Breakpoint “Clear Breakpoint” on page 660
Set/Clear Breakpoint “Set/Clear Breakpoint” on
page 687
Enable Breakpoint “Enable Breakpoint” on page
666
Disable Breakpoint “Disable Breakpoint” on page
665
Clear All Breakpoints “Clear All Breakpoints” on
page 660
Show Breakpoints “Show Breakpoints” on page
687
Hide Breakpoints “Hide Breakpoints” on page
673
Set Watchpoint “Set Watchpoint” on page 687
Clear Watchpoint “Clear Watchpoint” on page
660
Enable Watchpoint “Enable Watchpoint” on page
666
Disable Watchpoint “Disable Watchpoint” on page
665
Clear All Watchpoints “Clear All Watchpoints” on
page 660
Break on C++ Exception “Break on C++ Exception” on
page 657
IDE User Guide IDE–645
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Break on Java Exceptions “Break on Java Exceptions” on
page 657
Connect “Connect” on page 662
Table 16.17 Debug Menu Commands (Macintosh Layout)
Menu command For more information, see…
Kill “Kill” on page 675
Restart “Restart” on page 684
Step Over “Step Over” on page 688
Step Into “Step Into” on page 688
Step Out “Step Out” on page 688
Stop “Stop” on page 689
Set Breakpoint “Set Breakpoint” on page 686
Clear Breakpoint “Clear Breakpoint” on page 660
Set/Clear Breakpoint “Set/Clear Breakpoint” on
page 687
Enable Breakpoint “Enable Breakpoint” on page
666
Disable Breakpoint “Disable Breakpoint” on page
665
Clear All Breakpoints “Clear All Breakpoints” on
page 660
Show Breakpoints “Show Breakpoints” on page
687
Hide Breakpoints “Hide Breakpoints” on page
673
Set Watchpoint “Set Watchpoint” on page 687
Clear Watchpoint “Clear Watchpoint” on page
660
IDE–646 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Enable Watchpoint “Enable Watchpoint” on page
666
Disable Watchpoint “Disable Watchpoint” on page
665
Clear All Watchpoints “Clear All Watchpoints” on
page 660
Run to Cursor “Run to Cursor” on page 685
Change Program Counter “Change Program Counter” on
page 658
Break on C++ Exception “Break on C++ Exception” on
page 657
Break on Java Exceptions “Break on Java Exceptions” on
page 657
Switch to Monitor “Switch to Monitor” on page
(Mac OS only) 689
Data Menu
The Data menu contains commands that control how the
CodeWarrior debugger displays data values. This menu only
appears during a debugging session. For information about
enabling the debugger, see “Enabling Debugging” on page 381.
Table 16.18 on page 647 and Table 16.19 on page 648 list the
commands as they appear in the IDE menu bar layouts.
Table 16.18 Data Menu Commands (Windows Layout)
Menu command For more information, see…
Show Types “Show Types” on page 688
New Expression “New Expression” on page 677
Copy to Expression “Copy to Expression” on page
663
View As “View As” on page 692
View Variable “View Variable” on page 695
IDE User Guide IDE–647
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
View Array “View Array” on page 692
View Memory “View Memory” on page 695
View Memory As “View Memory As” on page
695
View As Default “View As Default” on page 693
View As Binary “View As Binary” on page 693
View As Signed Decimal “View As Signed Decimal” on
page 694
View As Unsigned Decimal “View As Unsigned Decimal”
on page 695
View As Hexadecimal “View As Hexadecimal” on
page 694
View As Character “View As Character” on page
693
View As C String “View As C String” on page
693
View As Pascal String “View As Pascal String” on
page 694
View As Unicode String “View As Unicode String” on
page 694
View As Floating Point “View As Floating Point” on
page 694
View As Enumeration “View As Enumeration” on
page 693
View As Fixed “View As Fixed” on page 693
Table 16.19 Data Menu Commands (Macintosh Layout)
Menu command For more information, see…
Show Types “Show Types” on page 688
New Expression “New Expression” on page 677
Copy to Expression “Copy to Expression” on page
663
View As “View As” on page 692
IDE–648 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
View Variable “View Variable” on page 695
View Array “View Array” on page 692
View Memory “View Memory” on page 695
View Memory As “View Memory As” on page
695
View As Default “View As Default” on page 693
View As Binary “View As Binary” on page 693
View As Signed Decimal “View As Signed Decimal” on
page 694
View As Unsigned Decimal “View As Unsigned Decimal”
on page 695
View As Hexadecimal “View As Hexadecimal” on
page 694
View As Character “View As Character” on page
693
View As C String “View As C String” on page
693
View As Pascal String “View As Pascal String” on
page 694
View As Unicode String “View As Unicode String” on
page 694
View As Floating Point “View As Floating Point” on
page 694
View As Enumeration “View As Enumeration” on
page 693
View As Fixed “View As Fixed” on page 693
View As Fract “View As Fract” on page 694
Browser Menu
The Browser menu contains commands that create new classes,
member functions, and data members in the active project. This
menu only appears after you enable the CodeWarrior browser and
choose the Browser Contents, Class Browser, or Class Hierarchy
IDE User Guide IDE–649
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
menu commands. For information about enabling the browser, see
“Activate Browser” on page 347. Table 16.20 lists the commands as
they appear in the IDE menu bar layouts.
Table 16.20 Browser Menu Commands (Windows and Macintosh Layouts)
Menu command For more information, see…
New Class “New Class” on page 676
New Member Function “New Member Function” on
page 677
New Data Member “New Data Member” on page
676
New Property “New Property” on page 677
New Method “New Method” on page 677
New Event Set “New Event Set” on page 677
New Event “New Event” on page 676
Layout Menu
The Layout menu contains commands that manipulate objects in a
Rapid Application Development (RAD) layout window. This menu
only appears after you open a RAD project. For information about
working with RAD projects, see “RAD Designs and Layouts” on
page 523. Table 16.21 lists the commands as they appear in the IDE
menu bar layouts.
Table 16.21 Layout Menu Commands (Windows and Macintosh Layouts)
Menu command For more information, see…
Align “Align” on page 656
Resize “Resize” on page 684
Display Grid “Display Grid” on page 665
Snap To Grid “Snap To Grid” on page 688
Group “Group” on page 673
Ungroup “Ungroup” on page 692
IDE–650 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Customize “Customize” on page 664
Properties “Properties” on page 680
Window Menu
The Window menu contains commands that manipulate IDE
windows. Table 16.22 and Table 16.23 on page 652 list the
commands as they appear in the IDE menu bar layouts.
The bottom portion of the Window menu lists the names of
currently open windows. To bring forward one of these windows,
choose its name from the list. The IDE associates key-binding
equivalents with the first nine names in the list. The IDE always
associates the active project with the number zero.
Use the following techniques to bring forward one of the nine
windows associated with key bindings:
Windows, Solaris, and Linux Press Ctrl and the number
associated with the window that you wish to open.
Mac OS Press Command and the number associated with the
window that you wish to open.
A check mark appears beside the active window. On the Mac OS-
hosted IDE, an underline denotes a modified and unsaved file.
Table 16.22 Window Menu Commands (Windows Layout)
Menu command For more information, see…
Close “Close” on page 660
Close All “Close All” on page 661
Cascade “Cascade” on page 658
Tile Horizontally “Tile Horizontally” on page 690
Tile Vertically “Tile Vertically” on page 690
Save Default Window “Save Default Window” on
page 686
IDE User Guide IDE–651
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Table 16.23 Window Menu Commands (Macintosh Layout)
Menu command For more information, see…
Stack Editor Windows “Stack Editor Windows” on
page 688
Tile Editor Windows “Tile Editor Windows” on page
690
Tile Editor Windows Vertically “Tile Editor Windows
Vertically” on page 690
Zoom Window “Zoom Window” on page 696
Collapse Window “Collapse Window” on page
(Mac OS only) 661
Expand Window “Expand Window” on page 668
(Mac OS only)
Save Default Window “Save Default Window” on
page 686
Toolbar “Toolbar” on page 691
Browser Contents “Browser Contents” on page
658
Class Hierarchy Window “Class Hierarchy Window” on
page 659
New Class Browser “New Class Browser” on page
676
Build Progress Window “Build Progress Window” on
page 658
Errors & Warnings Window “Errors & Warnings Window”
on page 667
Project Inspector “Project Inspector” on page 680
ToolServer Worksheet “ToolServer Worksheet” on
(Mac OS only) page 691
Symbolics Window “Symbolics Window” on page
689
Processes Window “Processes Window” on page
680
IDE–652 IDE User Guide
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Menu command For more information, see…
Expressions Window “Expressions Window” on
page 668
Global Variables Window “Global Variables Window” on
page 672
Breakpoints Window “Breakpoints Window” on
page 658
Watchpoints Window “Watchpoints Window” on
page 696
Registers Windows “Registers Windows” on page
682
Component Catalog “Component Catalog” on page
662
Component Catalog “Component Catalog” on page
662
Object Inspector “Object Inspector” on page 678
VCS Menu
The VCS (Version Control System) menu appears in the IDE’s menu
bar after you purchase and install the MW Visual SourceSafe
Version Control System (available separately).
(Mac OS) The icon at left represents the VCS menu in the
IDE’s menu bar.
Refer to the documentation that came with MW Visual SourceSafe
to learn about using revision control with your projects.
Tools Menu
The Tools menu appears in the IDE’s menu bar after you enable the
Use ToolServer menu checkbox in the IDE Extras preference panel.
The Tools menu contains commands for controlling Apple®
ToolServer™ and Macintosh Programmer’s Workbench (MPW).
(Mac OS) The icon at left represents the Tools menu in the
IDE’s menu bar.
IDE User Guide IDE–653
CodeWarrior ® IDE Menu Reference
IDE Menu Tables
Refer to Targeting Mac OS to learn about using ToolServer and
MPW with your projects.
Scripts Menu
The Scripts menu appears in the IDE’s menu bar after you enable
the Use Scripts menu checkbox in the IDE Extras preference panel
and create a (Scripts) folder in the Metrowerks CodeWarrior
folder of your CodeWarrior installation.
The Scripts menu uses the directory structure of the (Scripts)
folder to create a hierarchical menu. This hierarchical menu lists all
of the scripts in the (Scripts) folder. To learn more about the
scripts that might already exist in the (Scripts) folder, open them
using a script-editing utility or a text editor.
The Scripts menu also contains the Open Scripts Folder menu
command. See “Open Scripts Folder” on page 678 for more
information.
To learn more about scripting the CodeWarrior IDE, refer to the
CodeWarrior Scripting Reference.
Editor Extensions Menu
The Editor Extensions menu appears in the IDE’s menu bar after
you enable the Use BBEdit™ Extensions checkbox in the IDE Extras
preference panel and create an (Editor Extensions) folder in
the Metrowerks CodeWarrior folder of your CodeWarrior
installation.
(Mac OS) The icon at left represents the Editor Extensions
menu in the IDE’s menu bar.
The Editor Extensions menu uses the directory structure of the
(Editor Extensions) folder to create a hierarchical menu. This
hierarchical menu lists all of the extensions in the (Editor
Extensions) folder.
Refer to the documentation that came with BBEdit for more
information about its editor extensions.
IDE–654 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Help Menu
The Help menu contains commands for accessing the IDE’s online
help. Table 16.24 and Table 16.25 on page 655 list the commands as
they appear in the IDE menu bar layouts.
Mac OS The Help menu contains additional menu commands for
working with Balloon Help and for accessing specific parts of the
online help. The Apple menu contains the About Metrowerks
CodeWarrior menu command.
Table 16.24 Help Menu Commands (Windows Layout)
Menu command For more information, see…
CodeWarrior Help “CodeWarrior Help” on page
661
Index “Index” on page 674
Search “Search” on page 686
Glossary “Glossary” on page 672
Online Manuals “Online Manuals” on page 678
Metrowerks Website “Metrowerks Website” on page
675
About Metrowerks “About Metrowerks
CodeWarrior CodeWarrior” on page 656
Table 16.25 Help Menu Commands (Macintosh Layout)
Menu command For more information, see…
CodeWarrior Help “CodeWarrior Help” on page
661
How to “How to” on page 673
Glossary “Glossary” on page 672
Alphabetical Menu-Command Listing
This section presents an alphabetical listing of all menu commands
in the IDE. Use this listing as a reference to find information about a
IDE User Guide IDE–655
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
specific menu command. Most descriptions provide page references
to additional information.
Some menu commands reveal submenus that contain additional
commands. For more information about these submenus, see
“Submenu Listing” on page 696.
About Metrowerks CodeWarrior
Displays information about your CodeWarrior IDE version. Click
the information window to dismiss it.
Add Files
Adds files to the Project window.
To learn more about this feature, see “Using the Add Files
command” on page 76.
Add Window
Adds the file in the active Editor window to the open project. The
name of the menu command changes, based on the name of the
active window. For example, if the name of the active window is
MyFile, the name of the menu command changes to Add MyFile
to Project.
To learn more about this feature, see “Using the Add Window
menu command” on page 82.
Align
Reveals the Align submenu. To learn more about this submenu, see
“Align Submenu” on page 697.
IDE–656 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Apply Difference
Adds, removes, or changes text in the destination file of a file-
comparison window that is different from the text in the source file.
For more information about this feature, see “Examining and
Applying Differences” on page 132.
Balance
Selects the text enclosed in parentheses (), brackets [], or braces
{}. For a complete description of balancing punctuation while
typing, see “Balancing Punctuation” on page 153.
Break
Temporarily suspends execution of the target program and returns
control to the debugger. This menu command is equivalent to the
Stop menu command.
For more information, see “Stopping execution” on page 461.
Break on C++ Exception
Causes the debugger to break at __throw() each time a C++
exception occurs.
Break on Java Exceptions
Reveals the Java Exceptions submenu. To learn more about this
submenu, see “Java Exceptions Submenu” on page 696.
Breakpoints
Opens the Breakpoints window. For more information about this
window, see “Breakpoints Window” on page 438.
IDE User Guide IDE–657
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Breakpoints Window
See Breakpoints.
Bring Up To Date
Updates the current build target in the active project by compiling
all of the build target’s modified and touched files.
To learn more about this topic, see “Updating a Project” on page
380.
Browser Contents
Opens the Browser Contents Window. The IDE grays out this menu
command if the CodeWarrior browser is not activated.
To learn more about this feature, see “Contents Window” on page
213. To learn how to activate the browser, see “Activating the
Browser” on page 205.
Build Progress Window
Opens the Build Progress window so that you can monitor the IDE’s
status as it compiles your project.
For more information, see “Compiling Files” on page 378.
Cascade
Arranges open editor windows one on top of another, with their
window titles visible. This menu command is equivalent to the
Stack Editor Windows menu command.
Change Program Counter
Opens a dialog box that allows you to move the current-statement
arrow to a particular address or symbol.
IDE–658 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
For more information, see “Using the Change Program Counter
dialog box” on page 460.
Check Syntax
Checks the syntax of the source code file in the active Editor
window or the selected files in the open Project window. If the
active Editor window is empty, or no project is open, the IDE grays
out this menu command.
This menu command only checks source code for syntax errors. The
message area in the toolbar shows the progress of this operation.
Choosing the menu command does not generate object code.
If the IDE detects one or more errors, a Message window appears
and shows information about the errors. To learn how to correct
compiler errors, see “Correcting Compiler Errors and Warnings” on
page 400.
Class Browser
Opens the Browser window. The IDE grays out this menu
command if the CodeWarrior browser is not activated. This menu
command is equivalent to the New Class Browser menu command.
To learn more about this feature, see “Browser Window” on page
214. To learn how to activate the browser, see “Activating the
Browser” on page 205.
Class Hierarchy
Opens the Multi-Class Hierarchy Window. The IDE grays out this
menu command if the CodeWarrior browser is not activated.
To learn more about this feature, see “Multi-Class Hierarchy
Window” on page 222. To learn how to activate the browser, see
“Activating the Browser” on page 205.
Class Hierarchy Window
See Class Hierarchy.
IDE User Guide IDE–659
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Clear
Removes the selected text. This menu command is equivalent to
pressing the Backspace or Delete key.
Clear All Breakpoints
Clears all breakpoints in all source-code files belonging to the target
program.
For more information, see “Setting and clearing breakpoints” on
page 468.
Clear All Watchpoints
Clears all watchpoints in the current program.
To learn more, see “Setting and clearing watchpoints” on page 477.
Clear Breakpoint
Clears the breakpoint at the currently selected line.
For more information, see “Setting and clearing breakpoints” on
page 468.
Clear Watchpoint
Clears the watchpoint for the selected variable or memory range.
For more information, see “Setting and clearing watchpoints” on
page 477. To learn how to change watchpoint color, see “Display
Settings” on page 288.
Close
Closes the active window. See “Closing a File” on page 124 for more
information.
To learn how to close all open Editor windows, see “Closing All
Files” on page 125.
IDE–660 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Close All
Closes all open windows of a certain type. The name of this menu
command changes, based on the type of item selected. For example,
after you select one of several open Editor windows, the menu
command changes its name to Close All Editor Documents.
To learn more about this topic, see “Closing All Files” on page 125.
NOTE (Mac OS) Hold down the Option key to change the Close menu
command to the Close All menu command.
Close Catalog
Closes the current catalog and removes it from the Component
Catalog window and the Component Palette.
For more information about this command, see “Component
Catalog Toolbar” on page 568.
CodeWarrior Help
Displays online help for using the CodeWarrior IDE.
For more information about online help, see “Online References” on
page 162.
Collapse Window
Collapses the active window so that only its title is visible. To
expand the window to its original size, choose the Expand Window
menu command.
Commands & Key Bindings
Opens the Customize IDE Commands window.
For more information about this window, see “Customizing the
IDE” on page 306.
IDE User Guide IDE–661
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Compare Files
Opens a dialog box that allows you to choose two files or folders to
compare and merge. After choosing the items, a comparison
window appears and shows differences between the items.
For more information, see “Comparing and Merging Files &
Folders” on page 128.
Compile
Compiles the selected files. If the project window is active, the IDE
compiles both selected files and segments/groups. If a source-code
file in an Editor window is active, the IDE compile that source-code
file. The source-code file must belong to the active project.
To learn more about this topic, see “Compiling and Linking a
Project” on page 377.
Component Catalog
Opens the Component Catalog window for use with RAD projects.
For more information about this window, see “Component Catalog
window” on page 567.
Component Palette
Opens the Component Palette for use with RAD projects.
For more information about this window, refer to “Component
Palette” on page 563
Connect
Establishes communications between the IDE and the embedded
hardware to begin a debugging session.
Copy
Copies the selected text in the active Editor window to the system
Clipboard. If the Message Window is active, the Copy command
copies all the text in the Message Window to the Clipboard.
IDE–662 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Copy Files
Runs a desk accessory that allows you to copy files and folders
among file systems and devices accessible from your Solaris
environment. See “Copy Files Accessory” on page 703 for more
information about this accessory.
Copy to Expression
Copies the variable selected in the active pane to the Expressions
window.
For more information, see “Using the Expressions window” on page
488.
Create Group
Creates a new group in the current project. The IDE enables this
menu command after you click the Files tab in the active Project
window.
For more information about creating groups, see “Creating Groups”
on page 84.
Create Segment/Overlay
Creates a new segment or overlay in the current project. The IDE
enables this menu command after you click the Segments tab or the
Overlays tab in the active Project window.
For more information about managing segments and overlays, see
“Managing Files in a Project” on page 72.
NOTE (Mac OS, Solaris, and Linux) This menu command changes its
name to Create Segment or Create Overlay, depending on the
build-target type.
Create Target
Creates a new build target for the current project. The IDE enables
this menu command after you click the Targets tab in the active
Project window.
IDE User Guide IDE–663
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
For more information about creating targets, see “Working with
Complex Projects” on page 89.
Customize
Opens a customization utility for the selected component. For
example, after selecting a menu component and choosing this menu
command, the Menu editor opens.
For more information, see “Layout editor contextual menu” on page
559.
Cut
Moves the selected text to the system Clipboard, replacing the
previous Clipboard contents.
Debug
Compiles and links a project, then runs the debugger with the
project’s code, allowing you to examine your program’s execution.
For more information, see “Debugging a Project” on page 382.
NOTE (Mac OS) Press the Option key to toggle between the Debug menu
command and the Run menu command. Alternatively, choose the
Enable Debugger menu command to activate the debugger and
change the Run menu command to the Debug menu command.
Delete
Removes the selected text. This menu command is equivalent to
pressing the Backspace or Delete key.
IDE–664 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Disable Breakpoint
De-activates the breakpoint at the currently selected line.
For more information, see “Setting and clearing breakpoints” on
page 468
Disable Debugger
De-activates the debugger. This menu command appears only when
the debugger is currently active. After successfully de-activating the
debugger, the Disable Debugger menu command changes to the
Enable Debugger menu command.
To learn more about this topic, see “Controlling Debugging in a
Project” on page 104.
NOTE (Mac OS) After the IDE de-activates the debugger, the Debug menu
command changes to the Run menu command. Press the Option
key to toggle between these menu commands.
Disable Watchpoint
De-activates a watchpoint for the selected variable or memory
range.
For more information, see “Setting and clearing watchpoints” on
page 477. To learn how to change watchpoint color, see “Display
Settings” on page 288.
Disassemble
Disassembles the compiled source-code files selected in the Project
window. After disassembling a file, the IDE creates a .dump file that
contains the file’s object code. The .dump file appears in a new
window after the IDE completes the disassembly process.
To learn more about this feature, see “Disassembling Source Code”
on page 394.
Display Grid
When checked, displays a grid in the layout window.
IDE User Guide IDE–665
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
For more information, see “Layout editor contextual menu” on page
559.
Enable Breakpoint
Activates the breakpoint at the currently selected line.
For more information, see “Setting and clearing breakpoints” on
page 468.
Enable Debugger
The first time you choose this menu command for a particular
project, the IDE configures the project’s settings for debugging, asks
you to confirm the configuration if necessary, and then activates the
debugger. Each subsequent time you choose the menu command
for the same project, the IDE activates the debugger.
After successfully activating the debugger, the Enable Debugger
menu command changes to the Disable Debugger menu command.
To learn more about this topic, see “Controlling Debugging in a
Project” on page 104.
NOTE (Mac OS) After the IDE activates the debugger, the Run menu
command changes to the Debug menu command. Press the Option
key to toggle between these menu commands.
Enable Watchpoint
Activates the watchpoint for the selected variable or memory range.
For more information, see “Setting and clearing watchpoints” on
page 477. To learn how to change watchpoint color, see “Display
Settings” on page 288.
IDE–666 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Enter Find String
Copies the selected text in the active window into the Find field,
making it the target search string. Use this menu command as an
alternative to copying text and pasting that text into the Find
window.
To learn how to select text, see “Selecting Text” on page 151.
Enter Replace String
Copies the selected text in the active window into the Replace field,
making it the replacement string. Use this menu command as an
alternative to selecting text and copying that text into the Find
window.
To learn more about replacing text, refer to “Finding and Replacing
Text” on page 179.
NOTE (Mac OS) Hold down the Shift key to change the Enter Find String
menu command to the Enter Replace String menu command.
Errors & Warnings
Opens the Errors and Warnings window.
To learn more about this window, see “Guided Tour of the Message
Window” on page 395.
Errors & Warnings Window
See Errors & Warnings.
Exit
Exits the CodeWarrior IDE immediately, provided that one of the
following conditions is met:
• All changes to the open editor files are already saved, or
• The open editor files are not changed.
If a Project window is open, the IDE saves all changes to the project
file before exiting. If an Editor window is open and changes are not
IDE User Guide IDE–667
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
saved, the CodeWarrior IDE asks if you want to save your changes
before exiting.
Expand Window
Expands a collapsed window (a window with only its title visible).
This menu command reverses the effect of the Collapse Window
menu command.
Export Project
Exports a CodeWarrior project to a file in extensible markup
language (XML) format. The IDE prompts you to choose a name
and location to save the new XML file.
See “Importing and Exporting a Project” on page 103 for more
information.
Expressions
Opens the Expressions window.
For more information, see “Expressions Window” on page 436.
Expressions Window
See Expressions.
File Systems
Provides a facility that allows you to mount volumes from within
the IDE. For more information on using this facility, see “File
Systems Facility” on page 706.
Find
Opens the Find dialog box. Using this dialog box, you can perform
find operations within the active file.
IDE–668 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
To learn more about the Find dialog box and its capabilities, see
“Guided Tour of the IDE’s Find Features” on page 167.
Find and Open ‘Filename’
Opens an existing text file, using the currently selected text in the
Editor window as the target file name.
See “Opening Files from an Editor Window” on page 115 for more
information.
Find and Open File
Opens an existing file, searching the current access paths as
specified in the Access Paths panel of the Target Settings window.
See “Opening Files from an Editor Window” on page 115 for more
information.
Find and Replace
Opens the Find and Replace dialog box. Using this dialog box, you
can perform find-and-replace operations within the active file. This
menu command is equivalent to the Replace menu command.
To learn more about the Find and Replace dialog box and its
capabilities, see “Guided Tour of the IDE’s Find Features” on page
167.
Find Definition
Searches for the definition of the routine name selected in the active
window. Searching occurs in the source files belonging to the open
project. If the IDE finds the definition, the source-code file that
contains the definition appears in an Editor window, and the
routine name appears highlighted.
If the IDE finds more than one definition, a Message window
appears warning you of multiple definitions. For more information
about the Message window, see “Using the Message Window” on
page 398. If the IDE does not find a definition, a system beep
sounds.
IDE User Guide IDE–669
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
See “Finding Symbol Definitions” on page 163 for more
information.
Find Definition & Reference
Searches for the definition of the routine name selected in the active
Editor window. Searching starts within the source code files
belonging to the open project.
If the IDE does not find the routine definition within the project
files, searching continues in QuickHelp™, QuickView™, THINK
Reference™ version 2.x, or Toolbox Assistant™. If the IDE does not
find a definition, a system beep sounds.
For more information about choosing an online reference database,
see “IDE Extras” on page 259. To learn more about online databases,
see “Online References” on page 162.
NOTE (Mac OS) Hold down the Option key to change the Find Definition
menu command to the Find Definition & Reference menu
command.
Find in Files
Opens the Find in Files window. Using this window, you can
perform find-and-replace operations across a single file or multiple
files. You can also specify various search criteria.
To learn more about the Find in Files window and its capabilities,
see “Guided Tour of the IDE’s Find Features” on page 167.
Find In Next File
Finds the next occurrence of the Find field string in the next file
listed in the Find window. Use the menu command as an alternative
to using the Find window itself.
To learn more about this feature, see “Finding and Replacing Text in
Multiple Files” on page 182.
IDE–670 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Find In Previous File
Finds the next occurrence of the Find field string in the previous file
listed in the Multi-File Search portion of the Find window. Use the
menu command as an alternative to using the Find window.
To learn more about this feature, refer to “Finding and Replacing
Text in Multiple Files” on page 182.
NOTE (Mac OS) Hold down the Shift key to change the Find In Next File
menu command to the Find In Previous File menu command.
Find Next
Finds the next occurrence of the Find field string in the active
window. You can also click the Find button to invoke the same
command.
To learn more about this feature, see “Finding Text” on page 178.
Find Previous
Finds the previous occurrence of the Find field string in the active
window.
To learn more about this feature, see “Finding Text” on page 178.
NOTE (Mac OS) Hold down the Shift key to change the Find Next menu
command to the Find Previous menu command.
Find Previous Selection
Finds the previous occurrence of the selected text in the active
Editor window.
To learn more about this feature, see “Finding Text” on page 178. To
learn how to select text, see “Selecting Text” on page 151.
NOTE (Mac OS) Hold down the Shift key to change the Find Selection
menu command to the Find Previous Selection menu command.
IDE User Guide IDE–671
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Find Reference
Searches for the definition of the routine name selected in the active
Editor window, using the online help system specified in the IDE
Extras preference panel.
Searching takes place in QuickHelp™, QuickView™, THINK
Reference™ version 2.x, or Toolbox Assistant™.
If the IDE does not find a definition, a system beep sounds.
For more information about choosing an online reference database,
see “IDE Extras” on page 259. To learn more about online databases,
see “Online References” on page 162.
Find Selection
Finds the next occurrence of the selected text in the active Editor
window.
To learn more about this feature, see “Finding Text” on page 178.
Global Variables Window
Opens the Global Variables window. You can use this window to
view global variables for an entire project or for a single file. Click a
file name in the Files list to display in the Variables list the global
variables for that file.
For more information, see “Global Variables Window” on page 437.
Glossary
Displays a online-help list of vocabulary terms.
For more information about online help, see “Online References” on
page 162.
IDE–672 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Go Back
Returns to the previous view in the CodeWarrior browser.
See “Go Back and Go Forward” on page 245 for more information.
Go Forward
Moves to the next view in the CodeWarrior Browser (after you use
the Go Back command to return to a previous view).
See “Go Back and Go Forward” on page 245 for more information.
Go to Line
Opens a dialog box that allows you to move the text-insertion point
to a specific line number.
For more information about this feature, see “Going to a Particular
Line” on page 161.
Group
Combines selected objects so that they move together as a group.
To learn more, see “Layout editor contextual menu” on page 559.
Hide Breakpoints
Conceals the Breakpoints column, which appears to the left of the
source code shown in editor windows.
To learn more, see “Setting and clearing breakpoints” on page 468.
How to
Displays step-by-step online help topics for using the CodeWarrior
IDE.
IDE User Guide IDE–673
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
For more information about online help, see “Online References” on
page 162.
Import Components
Imports components from another catalog for use with the current
catalog.
For more information about this command, see “Component
Catalog Toolbar” on page 568.
Import Project
Imports an extensible markup language (XML) file into the IDE so
that you can save the XML file as a CodeWarrior project. The IDE
prompts you to choose a name and location to save the new project
file.
For more information, see “Importing and Exporting a Project” on
page 103.
Index
Displays an online-help topic index for the CodeWarrior IDE.
For more information about online help, see “Online References” on
page 162.
Insert Reference Template
Inserts a routine template corresponding to the selected Mac OS
Toolbox call in the active window. The IDE uses the online reference
database application specified in the Find Reference Using pop-up
menu to search for the routine’s definition.
To learn about configuring the online reference database application
with the Find Reference Using pop-up menu, see “Find Reference
using (Mac OS)” on page 264.
IDE–674 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Keyboard Preferences
Opens the Keyboard Preferences dialog box. Use this dialog box to
change the default modifier-key mappings. To learn more, see
“Keyboard Preferences Dialog Box” on page 711.
Kill
Permanently terminates execution of the target program and
returns control to the debugger.
For more information, see “Killing execution” on page 462.
Make
Builds the selected project by compiling and linking its modified
and touched files. The results of a successful build depend on the
selected project type.
To learn more about this topic, see “Making a Project” on page 380.
Metrowerks Website
Directs your web browser to the Metrowerks web site.
IDE User Guide IDE–675
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
New
Opens the New window. This window helps you create various
items in the CodeWarrior IDE.
For more information, see “Creating a New Project” on page 55.
New Class
Opens the New Class wizard so that you can create a new class for
your project.
To learn more, see “New Class Wizard” on page 230.
New Class Browser
Opens the Browser window. The IDE grays out this menu
command if the CodeWarrior browser is not activated. This menu
command is equivalent to the Class Browser menu command.
To learn more about this feature, see “Browser Window” on page
214. To learn how to activate the browser, see “Activating the
Browser” on page 205.
New Data Member
Opens the New Data Member wizard so that you can create a new
data member for your project.
For more information, see “New Data Member Wizard” on page
240.
New Event
Opens the New Event window so that you can create a new event
for a selected class in your project.
To learn more, see “New Event Window” on page 613.
IDE–676 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
New Event Set
Opens the New Event Set window so that you can create a new
event set for a selected class in your project.
For more information, see “New Event Set Window” on page 605.
New Expression
Creates a new entry in the Expressions window, prompting you to
enter a new expression.
To learn more, see “Using the Expressions window” on page 488.
New Member Function
Opens the New Member Function wizard so that you can create a
new member function for your project.
For more information, see “New Member Function Wizard” on
page 236.
New Method
Opens the New Method window so that you can create a new
method for a selected class in your project.
To learn more, see “New Method Window” on page 602.
New Property
Opens the New Property window so that you can create a new
property for a selected class in your project.
For more information, see “New Property Window” on page 600.
New Text File
Creates a new editable text file.
To learn more about this command, refer to “Creating a New File”
on page 109.
IDE User Guide IDE–677
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Object Inspector
Opens the Object Inspector for use with RAD projects.
For more information, see “Object Inspector” on page 578.
Online Manuals
Displays a list of online manuals about the CodeWarrior IDE and its
various parts.
For more information about online help, see “Online References” on
page 162.
Open
Use this menu command to open an existing file.
To learn more about this command, see “Opening Files from the File
Menu” on page 110.
Open Recent
Reveals a submenu of recently opened projects and files. You can
choose a file from the submenu to open that item.
If two or more files in the submenu have identical names, the
submenu shows the full paths to those files in order to help you
distinguish them.
To learn more about this command, see “Opening Files from the File
Menu” on page 110.
Open Scripts Folder
Opens the (Scripts) folder. This menu command is always
available if the Scripts menu is active. For more information, see
“Scripts Menu” on page 654.
IDE–678 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
P-Q
Paste
Pastes the contents of the system Clipboard into the active Editor
window.
The Paste command replaces the selected text with the contents of
the Clipboard. If no text is selected, the IDE places the Clipboard
contents at the text-insertion point.
If the Message Window is the active window, you cannot choose the
Paste command.
Precompile
Precompiles the text file in the active Editor window into a
precompiled header file.
To learn more about this topic, see “Using Precompiled or
Preprocessed Headers” on page 387.
Preferences
Opens the IDE Preferences window so that you can change the
global preferences for the CodeWarrior IDE.
To learn more about configuring preferences, see “Choosing
Preferences” on page 256.
Preprocess
Preprocesses selected source-code files in any language that has a
preprocessor, such as C, C++, and Pascal.
To learn more about this command, see “Preprocessing Source
Code” on page 394.
Print
Prints CodeWarrior IDE files on your printer.
IDE User Guide IDE–679
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
For more information on printing files, see “Printing a Window” on
page 126, or read the documentation that came with your printer.
Page Setup
Sets the options used for printing CodeWarrior IDE files.
For more information about this command, see “Setting Print
Options” on page 126.
Processes
Opens the Processes window.
For more information, see “Processes Window” on page 432.
Processes Window
See Processes.
Project Inspector
Opens the Project Inspector window so that you can view
information about your project. You can also use this window to
manipulate file-specific information.
To learn more, see “Using the Project Inspector” on page 98 and
“Special Library Options (Mac OS)” on page 407.
Properties
Opens the Object Inspector so that you can view or modify the
properties of the selected component.
For more information, see “Layout editor contextual menu” on page
559 and “Object Inspector” on page 578.
Quit
Quits the CodeWarrior IDE immediately, provided that one of the
following conditions is met:
• All changes to the open editor files are already saved, or
• The open editor files are not changed.
IDE–680 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
If a Project window is open, the IDE saves all changes to the project
file before quitting. If an Editor window is open and changes have
not been saved, the CodeWarrior IDE asks if you want to save your
changes before quitting.
Re-search for Files
To speed up builds and other project operations, the IDE caches the
locations of project files after finding them in the access paths. Re-
search for Files forces the IDE to forget the cached locations of files
and re-search for them in the access paths. This command is useful
if you moved several files and you want the IDE to find the files in
their new locations.
If you enabled the Save project entries using relative paths setting,
the IDE does not reset the relative-path information stored with
each project entry, so re-searching for files finds the source files in
the same location (the exception is if the file no longer exists in the
old location). In this case, the IDE only re-searches for header files.
To force the IDE to also re-search for source files, you must first
choose the Reset Project Entry Paths menu command.
If the Save Project Entries Using Relative Paths setting is disabled,
the IDE re-searches for both header files and source files.
For more information, see “Save project entries using relative
paths” on page 338.
Redo
After undoing an operation, you can redo it. For example, after
choosing the Undo Typing command to remove some text that you
typed, you can choose Redo Typing to override the undo and
restore the text that you typed.
You can enable the Use multiple undo option in the Editor Settings
preference panel to allow greater flexibility with regard to Undo
IDE User Guide IDE–681
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
and Redo operations. After enabling this option, you can choose
Undo multiple times to undo multiple actions, and you can Redo
multiple times to redo multiple actions.
To learn more about undo operations, see “Undoing the last edit”
on page 154 and “Undoing and redoing multiple edits” on page 154.
To learn about configuring multiple undo, see “Editor Settings” on
page 277.
Registers Windows
Reveals the Registers submenu, which you can use to view general
registers or FPU registers.
For more information, see “Register Windows” on page 440.
Remove Object Code
Displays the Remove Object Code dialog box. Use this dialog box to
remove binary object code from the active project, or to mark the
project’s files for re-compilation.
To learn more about this topic, see “Handling Object Code” on page
384.
Replace
Opens the Find and Replace dialog box. Using this dialog box, you
can perform find-and-replace operations within the active file. This
menu command is equivalent to the Find and Replace menu
command.
To learn more about the Find and Replace dialog box and its
capabilities, see “Guided Tour of the IDE’s Find Features” on page
167.
Replace and Find Next
Substitutes selected text with the text in the Replace field of the Find
window, and then performs a Find Next operation. If no text is
selected in the active Editor window and there is no text in the Find
field of the Find window, the IDE grays out this menu command.
IDE–682 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
To learn more about replacing text, see “Finding and Replacing
Text” on page 179. To learn how to select text, see “Selecting Text”
on page 151.
Replace and Find Previous
Substitutes selected text with the text in the Replace field of the Find
window, and then performs a Find Previous operation. If no text is
selected in the active Editor window and there is no text in the Find
field of the Find window, the IDE grays out this menu command.
To learn more about replacing text, see “Finding and Replacing
Text” on page 179. To learn how to select text, see “Selecting Text”
on page 151.
NOTE (Mac OS) Hold down the Shift key to change the Replace and Find
Next menu command to the Replace and Find Previous menu
command.
Replace All
Finds all occurrences of the Find field string and replaces them with
the Replace field string. If no text is selected in the active Editor
window and there is no text in the Find field, the IDE dims this
menu command.
Replace Selection
Substitutes the selected text in the active window with the text in
the Replace field of the Find window. If no text is selected in the
active Editor window, the IDE grays out the menu command.
Use the menu command to replace one instance of a text string
without having to open the Find window. Suppose that you
replaced all occurrences of the variable icount with jcount.
While scrolling through your source code, you notice an instance of
the variable icount misspelled as icont. To replace this
misspelled variable with jcount, select icont and use the Replace
Selection menu command.
IDE User Guide IDE–683
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
To learn more about replacing text, see “Finding and Replacing
Text” on page 179. To learn how to select text, see “Selecting Text”
on page 151.
Reset Project Entry Paths
Resets the location information stored with each project entry and
forces the IDE to re-search for the project entries in the access paths.
This menu command does nothing if you disable the Save project
entries using relative paths option.
For more information, see “Save project entries using relative
paths” on page 338.
Resize
Reveals the Resize submenu. To learn more about this submenu, see
“Resize Submenu” on page 697.
Restart
Terminates the current debugging session, then starts a new
debugging session.
For more information, see “Restarting execution” on page 462.
Resume
Switches from the IDE to the running application. This menu
command only appears after the IDE starts a debugging session and
the application being debugged is currently running.
Revert
Restores the last saved version of the active Editor window.
To learn more about reverting a file, see “Reverting to a Previously-
Saved File” on page 127.
Run
Compiles, links, creates a stand-alone application, and runs that
application. The IDE grays out this menu command for the
IDE–684 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
following project types: libraries, shared libraries, code resources
(Mac OS), and MPW Tools (Mac OS).
To learn more about this topic, see “Running a Project” on page 382.
Run to Cursor
Sets a temporary breakpoint at the line of source code in which the
text-insertion point is currently located, then runs the program.
For more information, see “Temporary breakpoints” on page 470.
Save
Saves the contents of the active window to disk.
For more information on this topic, see “Saving one file” on page
117.
Save A Copy As
Saves the active window to a separate file. This command operates
in different ways, depending on the active window.
For more information, see “Backing up files” on page 120.
Save All
Saves all currently open editor files.
For more information on this topic, see “Saving all files” on page
118.
NOTE (Mac OS) Hold down the Option key to change the Save menu
command to the Save All menu command.
IDE User Guide IDE–685
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Save As
Saves the contents of the active window to disk under a name that
you specify.
For more information, see “Renaming and saving a file” on page
118.
Save Default Window
Saves the settings of the active Browser window. The IDE applies
the saved settings to subsequently opened browser windows.
To learn more, see “Saving a Default Browser” on page 251.
Search
Displays a window that allows you to search the online help
included with the CodeWarrior IDE.
For more information about online help, see “Online References” on
page 162.
Select All
Selects all text in the active window. This command is usually used
in conjunction with other Edit menu commands such as Cut, Copy,
and Clear.
To learn more about selecting text, see “Selecting Text” on page 151.
Set Breakpoint
Sets a breakpoint at the currently selected line.
For more information, see “Setting and clearing breakpoints” on
page 468.
Set Default Project
Sets a particular project as the default project.
To learn more about default projects, see “Choosing a Default
Project” on page 71.
IDE–686 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Set Default Target
Use this menu command to work with a different build target
within the current project. Choose from the submenu the build
target that you wish to work with. This menu command is useful for
switching between multiple build targets in a project and
performing a build for each target.
Set Watchpoint
Sets a watchpoint for the selected variable or memory range.
For more information, see “Setting and clearing watchpoints” on
page 477. To learn how to change watchpoint color, see “Display
Settings” on page 288.
Set/Clear Breakpoint
Opens a dialog box that allows you to set or clear a breakpoint at a
particular address or symbol.
For more information, see “Setting and clearing breakpoints” on
page 468.
Shift Left
Shifts the selected source code one tab to the left. You can specify
the tab size by using the IDE Preferences window.
To learn more about this feature, see “Shifting Text Left and Right”
on page 154.
Shift Right
Shifts the selected source code one tab to the right. You can specify
the tab size by using the IDE Preferences window.
To learn more about this feature, see “Shifting Text Left and Right”
on page 154.
Show Breakpoints
Displays the Breakpoints column, which appears to the left of the
source code shown in editor windows.
IDE User Guide IDE–687
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
To learn more, see “Setting and clearing breakpoints” on page 468.
Show Types
Displays the data types of all local and global variables that appear
in the active variable pane or variable window.
For more information, see “Viewing data types” on page 483.
Snap To Grid
When checked, automatically aligns objects with the grid in the
layout window.
To learn more, see “Layout editor contextual menu” on page 559.
Stack Editor Windows
Arranges open editor windows one on top of another, with their
window titles visible. This menu command is equivalent to the
Cascade menu command.
Step Into
Executes a single statement, stepping into function calls.
For more information, see “Stepping into routines” on page 457.
Step Out
Executes the remainder of the current function, then exits to that
function’s caller.
To learn more about this topic, see “Stepping out of routines” on
page 458.
Step Over
Executes a single statement, stepping over function calls.
For more information, see “Stepping through a single line” on page
457.
IDE–688 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Stop
Temporarily suspends execution of the target program and returns
control to the debugger. This menu command is equivalent to the
Break menu command.
For more information, see “Stopping execution” on page 461.
Stop Build
Halts the build currently in progress.
To learn more about this topic, see “Compiling and Linking a
Project” on page 377.
Switch to Monitor
Transfers control from the CodeWarrior debugger to an external
debugger installed on your computer.
NOTE (Mac OS) Two examples of external debuggers are MacsBug and
the low-level Macintosh ROM Monitor program.
Symbolics Window
Opens the Symbolics window so that you can examine the
executable files in your project.
For more information, see “Symbolics Window” on page 425.
Synchronize Modification Dates
Updates the modification dates stored in the project file. The IDE
checks the modification date of each file in the project and marks for
recompilation those files modified since the last successful compile
process.
To learn more about this topic, see “Synchronizing modification
dates” on page 88.
IDE User Guide IDE–689
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Target Settings
Displays the Target Settings window. This window contains
settings for the active build target. The name of the menu command
changes, based on the name of the current build target. For example,
if the name of the current build target is ReleaseTarget, the name
of the menu command changes to ReleaseTarget Settings.
To learn more about the Settings window, see “Choosing Target
Settings” on page 335. To learn how to change the current build
target, see “Set Default Target” on page 687.
Tile Editor Windows
Arranges open editor windows horizontally so that none overlap.
This menu command is equivalent to the Tile Horizontally menu
command.
Tile Editor Windows Vertically
Arranges open editor windows vertically so that none overlap. This
menu command is equivalent to the Tile Vertically menu
command.
NOTE (Mac OS) The Tile Editor Windows Vertically menu command is
not available for use with Apple ToolServer worksheets.
Tile Horizontally
Arranges open editor windows horizontally so that none overlap.
This menu command is equivalent to the Tile Editor Windows
menu command.
Tile Vertically
Arranges open editor windows vertically so that none overlap. This
menu command is equivalent to the Tile Editor Windows
Vertically menu command.
IDE–690 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Toolbar
See Toolbars.
Toolbars
Reveals the Toolbar submenu. To learn more about this submenu,
see “Toolbar Submenu” on page 698.
For more information about customizing toolbars, see
“Customizing Toolbars” on page 323.
ToolServer Worksheet
Opens the ToolServer Worksheet window for use with Apple
ToolServer. The IDE can disable this menu command for the
following reasons:
• ToolServer is not installed on your computer.
• ToolServer is installed on your machine, but is not yet started.
To learn more about ToolServer, refer to Targeting Mac OS. You can
find this documentation on your CodeWarrior CD(s).
Unapply Difference
Reverses the action of the Apply Difference command in a file-
comparison window.
For more information about this feature, see “Examining and
Applying Differences” on page 132.
Undo
Reverses the effect of your last action. The name of this menu
command changes, depending on the editor settings as well as the
most recent action. For example, after typing some text in an open
Editor window, the Undo command changes its name to Undo
IDE User Guide IDE–691
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
Typing. Choose the Undo Typing command to remove the text that
you just typed.
To learn more about this topic, see “Undoing the last edit” on page
154 and “Undoing and redoing multiple edits” on page 154.
If you do not enable the Use multiple undo option in the Editor
Settings preference panel, the Undo command toggles between
Undo and Redo. To learn more about configuring this option, see
“Editor Settings” on page 277.
Ungroup
Separates a selected group so that you can move each component
independently.
For more information, see “Layout editor contextual menu” on page
559.
Version Control Settings
Opens the Version Control System preference panel.
For more information about this panel, see “Using the
CodeWarrior® IDE with Version Control Systems” on page 617.
View Array
Creates a separate window to display a selected array.
To learn more, see “Placing globals in a separate window” on page
438 and “Array Window” on page 447.
View As
Displays a selected variable as a value of a specified data type.
IDE–692 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
For more information, see “Viewing data as different types” on
page 486.
View As Binary
Displays the selected variable as a binary value.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As C String
Displays the selected variable as a C character string.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Character
Displays the selected variable as a character value.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Default
Displays the selected variable in its default format, based on the
variable’s type.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Enumeration
Displays the selected variable as an enumeration.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Fixed
Displays the selected variable as a fixed-type numerical value.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
IDE User Guide IDE–693
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
View As Floating Point
Displays the selected variable as a floating-point value.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Fract
Displays the selected variable as a fractional data type.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
NOTE The fractional data type is specific to the Mac OS.
View As Hexadecimal
Displays the selected variable as a hexadecimal value.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Pascal String
Displays the selected variable as a Pascal character string.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Signed Decimal
Displays the selected variable as a signed decimal value.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View As Unicode String
Displays the selected variable as a Unicode character string.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
IDE–694 IDE User Guide
CodeWarrior ® IDE Menu Reference
Alphabetical Menu-Command Listing
View As Unsigned Decimal
Displays the selected variable as an unsigned decimal value.
To learn more about viewing data in other formats, see “Viewing
data as different types” on page 486.
View Memory
Displays the contents of memory as a hexadecimal/ASCII character
dump.
To learn more, see “Memory Window” on page 448, “Viewing raw
memory” on page 490, and “Viewing memory at an address” on
page 490.
View Memory As
Displays the memory that a selected variable occupies or the
memory to which a selected register points.
For more information, see “Array Window” on page 447 and
“Viewing memory at an address” on page 490.
View Variable
Creates a separate window to display a selected variable.
To learn more, see “Placing globals in a separate window” on page
438.
W-Z
Watchpoints
Opens the Watchpoints window. For more information about this
window, see “Watchpoints Window” on page 439.
IDE User Guide IDE–695
CodeWarrior ® IDE Menu Reference
Submenu Listing
Watchpoints Window
See Watchpoints.
Zoom Window
Expands the active window to its previously set size. Choose the
menu command a second time to return the window to its original
size.
Submenu Listing
This section describes the submenus that appear for some of the
menu commands in the IDE. For more information about the menu
commands that reveal these submenus, see “Alphabetical Menu-
Command Listing” on page 655.
Java Exceptions Submenu
Choosing the Break on Java Exceptions menu command reveals the
Java Exceptions submenu. This submenu contains commands for
handling exceptions in the Java™ programming language. The
commands are only available for use with Java source code.
All Exceptions
Causes the debugger to break every time an exception occurs. This
behavior includes exceptions thrown by the virtual machine, your
own classes, the debugger, classes in classes.zip, and so on. Java
programs throw many exceptions in the normal course of execution,
so catching all exceptions causes the debugger to break often.
Exceptions in Targeted Classes
Causes the debugger to break only on exceptions thrown by your
own classes in the project. Choose this command to break on the
exceptions thrown by your classes, rather than on the exceptions
that Java programs throw in the normal course of execution.
Uncaught Exceptions Only
Causes the debugger to break only on unhandled exceptions.
IDE–696 IDE User Guide
CodeWarrior ® IDE Menu Reference
Submenu Listing
Align Submenu
Choosing the Align menu command reveals the Align submenu.
This submenu contains commands for arranging RAD components
in an onscreen layout. The commands are only available for use
with components in a layout.
To Grid
Aligns selected components to a grid in the layout. You can display
or hide the onscreen grid.
Left Edges
Aligns the left edges of the selected components.
Vertical Center
Aligns the vertical centers of the selected components.
Right Edges
Aligns the right edges of the selected components.
Top Edges
Aligns the top edges of the selected components.
Horizontal Center
Aligns the horizontal centers of the selected components.
Bottom Edges
Aligns the bottom edges of the selected components.
Resize Submenu
Choosing the Resize menu command reveals the Resize submenu.
This submenu contains commands for changing the size of RAD
components in an onscreen layout. The commands are only
available for use with components in a layout.
IDE User Guide IDE–697
CodeWarrior ® IDE Menu Reference
Submenu Listing
To Smallest Width
Resizes the selected components to match the width of the
component with the smallest width.
To Largest Width
Resizes the selected components to match the width of the
component with the largest width.
To Smallest Height
Resizes the selected components to match the height of the
component with the smallest height.
To Largest Height
Resizes the selected components to match the height of the
component with the largest height.
Toolbar Submenu
Choosing the Toolbars or Toolbar menu commands reveals the
Toolbar submenu. This submenu contains commands for
customizing the toolbars that appear in the CodeWarrior IDE.
Show Window Toolbar
Displays the toolbar in the active window. After displaying the
window toolbar, the command changes to Hide Window Toolbar.
Hide Window Toolbar
Conceals the toolbar in the active window. After concealing the
window toolbar, the command changes to Show Window Toolbar.
Reset Window Toolbar
Restores the default state of the toolbar in the active window. Use
this command to return the toolbar to its original default settings.
IDE–698 IDE User Guide
CodeWarrior ® IDE Menu Reference
Submenu Listing
Clear Window Toolbar
Removes all icons from the toolbar in the active window. Use this
command as the first step in creating a new set of toolbar icons. For
more information about creating toolbar icons, see “Customizing
Toolbars” on page 323.
To restore the toolbar to its original default state, use the Reset
Window Toolbar command.
Show Main Toolbar
Displays the IDE’s main toolbar. After displaying the main toolbar,
the command changes to Hide Main Toolbar.
This menu command is equivalent to the Show Floating Toolbar
menu command.
Hide Main Toolbar
Conceals the IDE’s main toolbar. After concealing the main toolbar,
the command changes to Show Main Toolbar.
This menu command is equivalent to the Hide Floating Toolbar
menu command.
Show Floating Toolbar
Displays the IDE’s floating toolbar. After displaying the floating
toolbar, the command changes to Hide Floating Toolbar.
This menu command is equivalent to the Show Main Toolbar
menu command.
Hide Floating Toolbar
Conceals the IDE’s floating toolbar. After concealing the floating
toolbar, the command changes to Show Floating Toolbar.
This menu command is equivalent to the Hide Main Toolbar menu
command.
IDE User Guide IDE–699
CodeWarrior ® IDE Menu Reference
Submenu Listing
Anchor Floating Toolbar
Attaches the floating toolbar beneath the menu bar. You cannot
move the anchored toolbar. To move the toolbar once again, use the
Unanchor Floating Toolbar command.
NOTE The Anchor Floating Toolbar command is not available in the
Windows-hosted IDE.
Unanchor Floating Toolbar
Detaches the floating toolbar from beneath the menu bar. Use the
Anchor Floating Toolbar command to prevent movement of the
floating toolbar.
NOTE The Unanchor Floating Toolbar command is not available in the
Windows-hosted IDE.
Reset Main Toolbar
Restores the default state of the main toolbar. Use this command to
return the main toolbar to its original default settings.
This menu command is equivalent to the Reset Floating Toolbar
menu command.
Reset Floating Toolbar
Restores the default state of the floating toolbar. Use this command
to return the floating toolbar to its original default settings.
This menu command is equivalent to the Reset Main Toolbar menu
command.
Clear Main Toolbar
Removes all icons from the main toolbar. Use this command as the
first step in creating a new set of toolbar icons. For more
information about creating toolbar icons, see “Customizing
Toolbars” on page 323.
IDE–700 IDE User Guide
CodeWarrior ® IDE Menu Reference
Submenu Listing
This menu command is equivalent to the Clear Floating Toolbar
menu command.
Clear Floating Toolbar
Removes all icons from the floating toolbar. Use this command as
the first step in creating a new set of toolbar icons. For more
information about creating toolbar icons, see “Customizing
Toolbars” on page 323.
This menu command is equivalent to the Clear Floating Toolbar
menu command.
IDE User Guide IDE–701
CodeWarrior ® IDE Menu Reference
Submenu Listing
IDE–702 IDE User Guide
B
™
Solaris and Linux Utilities
This appendix describes additional utilities provided in the Solaris
and Linux versions of the CodeWarrior IDE. These utilities are
accessible from the Info menu on the right-hand side of the menu
bar in the IDE windows. This menu is only available in the Solaris
and Linux versions of the CodeWarrior IDE.
This appendix discusses the following topics:
• Copy Files Accessory
• File Systems Facility
• Keyboard Preferences Dialog Box
Copy Files Accessory
When you choose the Copy Files menu command, CodeWarrior
launches a desk accessory. This desk accessory lets you copy files
and folders between the Solaris or Linux environment from within
the CodeWarrior IDE. The environment includes such file systems
and devices as Macintosh diskettes; AppleDouble; K-AShare;
EtherShare and Partner file systems; and NFS-mounted UNIX file
systems. For example, you can use the Copy Files command to copy
a file from a Macintosh diskette to a UNIX directory.
To display the Copy Files dialog box (Figure B.1 on page 704),
choose Info > Copy Files.
This dialog box contains three sections: Source File/Directory
Selection, Currently Selected Files/Directories, Destination
Directory Selection
IDE User Guide IDE–703
Solaris ™ and Linux Utilities
Copy Files Accessory
Figure B.1 The Copy Files Dialog Box
Source File/Directory Selection
This area of the dialog box is used for selecting files to copy from the
source volume. It contains the following items:
Path Display
The path display shows the path to the current directory being
listed.
IDE–704 IDE User Guide
Solaris ™ and Linux Utilities
Copy Files Accessory
Free Space Display
This display shows how much disk space is available on the
currently selected volume.
Source File/Directory List
This is a scrollable list of files in the current directory. Double-
clicking a directory or volume in the list displays the contents of that
directory or volume. Double-clicking a file adds it to the list of files
to be copied. Only one item can be selected at a time.
Get Info Button
Pressing this button displays a dialog box that provides file
information about the currently selected file or directory in the File/
Directory List. If no file or directory is currently selected in the list,
an alert message appears with instructions.
Add button
This buttons allows you to add the directory, volume, or file
currently selected in the source directory to the list of files to be
copied.
Currently Selected Files/Directories
This area of the dialog box is for viewing the files you have selected
for copying. It contains the following items:
Selected Files/Directories List
This list displays the truncated path(s) of the file(s) to be copied. As
entries are being copied, they are highlighted. After a file is copied,
it is removed from the list. If an error occurs during the copying
process, the copy is aborted and the list displays the names of files
that have not yet been copied.
Remove button
Pressing this button removes the selected files/directories from the
Source Files/Directories List.
IDE User Guide IDE–705
Solaris ™ and Linux Utilities
File Systems Facility
Destination Directory Selection
This area of the dialog box is for setting the destination directory
where files will be placed. It contains these items:
Destination Path Display
This display shows the path to the currently selected destination.
Free Space Display
This display shows how much disk space is available on the
destination volume.
Destination File/Directory List
This is a scrollable list of files in the current directory. Double-
clicking a directory or volume in the list displays the contents of that
directory or volume.
Cancel Button
Pressing this button closes the dialog box without performing the
copy operation.
Copy All Button
Pressing this button starts the copy procedure. You are first
prompted by a notice to verify the destination directory. Once you
verify this, the copy proceeds.
File Systems Facility
The Solaris and Linux versions of the CodeWarrior IDE provide the
File Systems Facility, which enables you to mount volumes on your
workstation. When the File Systems… menu item is chosen from the
Info menu, the File Systems Facility dialog box is displayed (Figure
B.2 on page 707).
IDE–706 IDE User Guide
Solaris ™ and Linux Utilities
File Systems Facility
The File Systems Dialog Box
The File Systems dialog box contains the following items: Hotlist
Directories, Erase Volume Button, Options Button, Floppy Button,
Unix Path Text Box, File System Type Display, Cancel Button,
Remove Button, Add Button.
Figure B.2 The File Systems Dialog Box
Hotlist Directories
This list shows all of the volumes currently mounted on your
system. You can select any volume listed and then unmount or
erase it, or display the volume's full pathname and file system type,
according to the options you choose below.
Erase Volume Button
Pressing this button deletes all files in the chosen volume.
IDE User Guide IDE–707
Solaris ™ and Linux Utilities
File Systems Facility
Options Button
When this button is pressed, the Options dialog box is displayed.
This dialog box lets you set line breaks in files you mount. See “The
File System Options Dialog Box” on page 708 for more information.
Floppy Button
Lists any diskette in the diskette drive (in the Unix Path field) and
enables the Mount button.
Unix Path Text Box
This text box contains the full UNIX pathname of the chosen
volume. If no volume is currently chosen, you can type a path into
this area to mount a volume by its path.
File System Type Display
This display shows the type of format for the chosen volume—
UNIX or HFS.
Cancel Button
Pressing this button closes the dialog box without mounting any file
systems.
Remove/Eject Button
If the chosen volume is on a hard drive, this option unmounts it. If
the chosen volume represents a diskette, this option ejects the
diskette from the diskette drive.
Add Button
Pressing this button mounts the currently selected volume. and
closes the dialog box.
The File System Options Dialog Box
Some applications may have difficulty representing line breaks
appropriately as their files move from foreign operating systems to
UNIX systems. The File System Options dialog box (Figure B.3 on
page 709) enables you to solve this problem by explicitly choosing
IDE–708 IDE User Guide
Solaris ™ and Linux Utilities
File Systems Facility
how to represent line breaks in certain types of files. To view this
dialog box, press the Options button described above.
Figure B.3 The File System Options Dialog Box
This dialog box contains the following items: Volume Display,
Default File Format, “Disk representation of line breaks” button
group, “Applies to” button group, Cancel button, OK button.
Volume Display
This display shows the name of the volume which will be affected
by the settings in this dialog box.
Default File Format
This popup menu lets you specify the file format for any new files
that will be created on the volume in question.
IDE User Guide IDE–709
Solaris ™ and Linux Utilities
File Systems Facility
Disk representation of line breaks
This group of buttons determines how the IDE will convert line
break characters when it reads or writes files on the current volume.
UNIX Style (LF)
If this option is chosen, line breaks are replaced with line feeds
whenever a file on the current volume is read or written by the
CodeWarrior IDE.
Macintosh Style (CR)
If this option is chosen, line breaks will be replaced with carriage
returns whenever a file on the current volume is read or written by
the CodeWarrior IDE.
Applies to
This group of buttons determines which files will be affected by
your settings in the File Systems dialog. Only one of these buttons
may be selected at a time.
All ‘TEXT’ Files
If this option is selected, conversion will be applied to all text files
read or written by the IDE on the current volume.
UNIX ‘TEXT’ Files
If this option is selected, conversion will be applied only to UNIX
(non-Macintosh) text files read or written by the IDE on the current
volume.
Specify per ‘TEXT’ Files
If this option is selected, a dialog box will be displayed each time a
text file is read or written by the IDE, allowing you to specify how
line breaks should be converted for that file.
Cancel button
Pressing this button dismisses the dialog box without applying any
settings.
IDE–710 IDE User Guide
Solaris ™ and Linux Utilities
Keyboard Preferences Dialog Box
OK button
Pressing this button applies the selected settings and dismisses the
dialog box.
Keyboard Preferences Dialog Box
Modifier keys are used in combination with other keys to generate
keyboard shortcuts to certain IDE functions. For instance, to execute
the Ctrl/Command - N keyboard shortcut, you depress the Ctrl or
Command modifier key, and while holding it down, press the N
key on your keyboard.
The Keyboard Preferences dialog box (Figure B.4) allows you to
define which physical keys on your keyboard correspond to certain
modifier keys used in the CodeWarrior IDE. To display the dialog
box, choose Keyboard Preferences from the Info menu.
Figure B.4 The Keyboard Preferences Dialog Box
This dialog box contains the following items: Keyboard Display,
Reassign Keyboard Modifiers Section, Import Button, Export
Button, Test Button, Factory Defaults Button, Cancel Button, Apply
Button.
Keyboard Display
This display shows the active keyboard.
IDE User Guide IDE–711
Solaris ™ and Linux Utilities
Keyboard Preferences Dialog Box
Reassign Keyboard Modifiers Section
The Shift, Command, Option, and Control buttons in this section
correspond to modifier keys used in the CodeWarrior IDE.
Pressing one of these buttons will cause CodeWarrior to scan the
keyboard and record keys that are pressed until a key is released.
The key(s) that are pressed during the scan will be mapped to the
corresponding modifier key. Once scanning is complete, a list of
keys that were pressed will appear to the right of the button.
Once the Apply button is pressed, the changes you have made go
into effect. From this point on, when you type any of these keys,
CodeWarrior will respond as if the corresponding modifier key has
been pressed.
For example, to map both the left and right Shift keys on your
keyboard to the Shift modifier key, follow these steps:
1. Press the Shift button in this dialog box.
2. Press and hold down both of the Shift keys on your
keyboard.
3. Release the Shift keys on your keyboard.
Shift_L and Shift_R should now appear next to the Shift button in
the dialog box.
Import Button
Press this button to display a file open dialog, which will allow you
to select a file to import keyboard modifier settings from.
Export Button
Press this button to display a file save dialog which will allow you
to export the current keyboard modifier settings to a file on disk.
Test Button
Press this button to test your settings.
Factory Defaults Button
Press this button to reset the settings to the factory defaults.
IDE–712 IDE User Guide
Solaris ™ and Linux Utilities
Keyboard Preferences Dialog Box
Cancel Button
Press this button to dismiss the dialog box without applying your
changes.
Apply Button
Press this button to apply any changes you have made and dismiss
the dialog box.
IDE User Guide IDE–713
Solaris ™ and Linux Utilities
Keyboard Preferences Dialog Box
IDE–714 IDE User Guide
C
Opening Project Files from
Earlier IDE Versions
Version 3.0 and later of the CodeWarrior® IDE cannot recognize files
created by version 1.7 or earlier. You must re-create the project file
from scratch using the new IDE, or convert the project file to work
with the new IDE. This appendix describes how to convert project
files to a format recognized by the current IDE version.
This appendix discusses the following topics:
• Converting a Single 1.7 Project
• Converting Multiple 1.7 Projects (Mac OS)
• Opening Project Files from Versions Prior to 1.7 (Mac OS)
Converting a Single 1.7 Project
The CodeWarrior IDE has the ability to convert project files to the
newest format from the format used by the 1.7 version of the IDE.
Windows To convert a single 1.7 project, open it from the latest
version of the IDE. The IDE prompts you to convert the project to
the newest format. The IDE uses the name of the original file as the
basis for the name of the converted project file.
Mac OS The IDE uses a conversion utility called Project
Converter. The IDE uses the name of the original file as the basis for
the name of the converted project file. You can find Project
Converter in the Other Metrowerks Tools subfolder of the
Metrowerks folder of your CodeWarrior installation. You can
convert a single project in one of the following ways:
• You can open the 1.7 project from the latest version of the IDE.
The IDE automatically runs Project Converter to convert the
project to the new format.
IDE User Guide IDE–715
Opening Project Files from Earlier ID E Versions
Converting Multiple 1.7 Projects (Mac OS)
• You can drag and drop the 1.7 project file onto Project Converter
itself.
The IDE backs up the project file before converting it. However, if
you enable the Use Local Project Data Storage checkbox in the
Build Settings preference panel and convert a project on locked
media, the IDE does not back up the project file before converting it.
WARNING! 1.7.x projects must be converted to the new format if you want to
work with them in the latest version of the IDE. The conversion of
the project to the newest format is permanent. The latest version of
the IDE cannot save a project in 1.7.x format.
Converting Multiple 1.7 Projects (Mac OS)
Project Converter has the ability to convert multiple 1.7 project files
into a series of separate projects under the new format, or into one
multi-target project file under the new format.
To use this feature, drag and drop a group of 1.7 project files onto
Project Converter. Next, the IDE asks you whether to keep the files
as separate projects or merge them into a multi-target project under
the new format. Choose the desired option.
Project Converter prompts you to select a folder and name for the
project or projects.
If you encounter problems, contact
[email protected].
Read the Project Converter release notes before converting your
projects. The release notes reside in the IDE Notes folder, which is
inside the CodeWarrior Release Notes folder of your
CodeWarrior installation. The release notes give you information on
any late-breaking topics regarding the IDE.
IDE–716 IDE User Guide
Opening Project Files from Earlier IDE Versions
Opening Project Files from Versions Prior to 1.7 (Mac OS)
Opening Project Files from Versions Prior to 1.7
(Mac OS)
Project Converter only converts project files from the 1.7 version of
the IDE, which shipped with CodeWarrior 10 and CodeWarrior 11.
If you have an earlier project, you must convert it to CW10 or CW11
format before using Project Converter.
To update a project to the 1.7 format, first ensure that the latest
version of the IDE is not running. Then launch the 1.7 IDE and open
the project.
The 1.7 IDE updates your project. You can then run the updated
project through Project Converter to update that project to the
newest format.
If you do not have version 1.7 of the IDE, you can find it on the CW
Pro Tools CD. Look for the CW11 IDE and Prefs.sit file in
the Other Metrowerks Tools folder.
IDE User Guide IDE–717
Opening Project Files from Earlier ID E Versions
Opening Project Files from Versions Prior to 1.7 (Mac OS)
IDE–718 IDE User Guide
Index
Symbols absmiddle option, of Java Applet wizard 534
#include files 234 Absolute Path option
caching 259 in Access Paths target settings panel 343
in Source Trees preference panel 271
#pragma, adding markers by using 157
in Source Trees settings panel 357
$ in variable name 513
in Type pop-up menu 271, 356
%file command-line string 262 absolute path, defined 272
%line command-line string 262 Abstract option, of Specifier pop-up menu 544,
(Editor Extensions) folder 654 605, 611
(Helper Apps) folder 262 Abstract Window Toolkit. See AWT.
(Scripts) folder 654, 678 accelerating
.*[_]Data 266 builds 259
.ctlg extension 575 compiling and linking 387
.dump 394 Access Path attribute
.EXE 427 in Project Inspector 101
.iSYM 427 access paths 339
.MAP extension 384 recursive search 339
.mcp extension 58, 527 Access Paths settings panel 339
.mkb extension 320 Add button 343
.tdt files 384, 386 Add Default button 342
.xSYM 427 Always Search User Paths checkbox 341
> in documentation 24 Change button 345
Host Flags pop-up menu 342
? in variable name 513
Interpret DOS And Unix paths checkbox
\(.*\) 266
(Mac OS) 341
__throw() 657 Remove button 346
System Paths pane 342
Numerics System Paths radio button (Windows) 341
0 User Paths pane 342
in Balance Flash Delay field 280 User Paths radio button (Windows) 341
in Code column 47 Access pop-up menu
in Context Popup Delay field 260 of Java Bean wizard 544
in Data column 48 of New Class wizard 234
1.1.X Wire Protocol option 302 of New Event Set wizard 611
Private option 238, 241, 604, 611
A Protected option 238, 241, 604, 611
Public option 238, 241, 544, 604, 611
about
Accessors section, of New Property dialog box 602
projects 19
Action section, of Customize IDE Commands
RAD 523–524
window 310
the CodeWarrior IDE 17–20
action types
About (VCS operation) 624
Command 310
About Metrowerks CodeWarrior menu
Hierarchical Menu 310
command 656
actions
absbottom option, of Java Applet wizard 534
defining for custom commands 312, 313
IDE User Guide IDE–719
Index
undoing and redoing a series of 279 files to projects (Windows) 77
Activate Browser checkbox, in Build Extras key bindings 317
settings panel 347 keyboard shortcuts 317
Activate Browser Coloring checkbox 288 keywords to a custom keyword set 284
Activate Syntax Coloring checkbox 283 markers 156
activating 105 markers by using #pragma 157
breakpoints 438 menu commands 310
debugging for projects 104 preprocessor symbols to projects 107
active pane 417 shielded folders 268
text in editor 150
Add (VCS operation) 624
Additional Header Include Files
Add Bookmark command 159
of New Class wizard 234
Add button of New Data Member wizard 243
in Access Paths settings panel 343 of New Member Function wizard 240
in Custom Keywords dialog box 285
adjusting
in File Mappings settings panel 351
tab size 282
in Java Applet wizard 536
time allotted to balancing punctuation 280
in New Event dialog box 615
time allotted to display contextual menu 260
in New Method dialog box 605
advanced options
in New Property dialog box 602
for compiling 386
in Other Executables settings panel 367
in Remote Connections preference panel 297 After option, of New Class wizard 232
in Shielded Folders preference panel 268 After option, of New Event Set wizard 610
in Source Trees preference panel 271 Alert Yourself After Build option (Mac OS) 386
in Source Trees settings panel 356 Align command 559
Add Default button Align menu command 656, 697
in Access Paths settings panel 342 Align pop-up menu, of Java Applet wizard 534
Add Design To Project checkbox, of Project Align submenu 697
panel 546 Bottom Edges command 697
Add File To Project menu command. See Add Horizontal Center command 697
Window menu command. 82 Left Edges command 697
Add File To Targets list, of New Event Set Right Edges command 697
wizard 612 To Grid command 697
Add Files button Top Edges command 697
of In Files tab 190 Vertical Center command 697
Add Files menu command 76, 656 All Exceptions command in Java Exceptions
Add Files To Targets list submenu 696
of New Class wizard 236 All Info option
Add Window command 390, 392 of Plugin Diagnostics 265
Add Window menu command 82, 83, 656 All option
in Host Flags pop-up menu 342
adding
bookmarks 159 All Projects option, in Project pop-up menu 174,
designs to projects 546 185
elements to toolbars 328 All Symbolics option, in Symbolics pop-up
file name extensions 351 menu 175, 188
files by using drag and drop 80 All Targets option, of Target pop-up menu 174,
files to projects 75 185
files to projects (Macintosh) 78 Alpha 89
files to projects (Solaris) 79 alphabetical sorting in Function pop-up menu 424
IDE–720 IDE User Guide
Index
alphabetizing Arguments field
C++ methods 290 of Customize IDE Commands window
AltiVec Registers command 444 (Windows) 312
AltiVec Registers window 444 Arithmetic Optimizations 363
Always option, in Build Before Running pop-up Array window 447
menu setting base address 447
Build Before Running pop-up menu arrays
Always option 257 in separate windows 482
Always Search User Paths checkbox setting default viewing size for
of Access Paths settings panel 341 unbounded 290
Always Show Login Dialog (VCS option) 621, 625 arrow keys 45
Always Use File Mapping For Symbolics checkbox Ask option, in Build Before Running pop-up
of MetroNub Settings preference panel menu 257
(Mac OS) 303 assembler 36
analyzing assembly language
inheritance in browser 249 memory display 420, 422
Ancestor Class pop-up menu 224 register display 420, 422
Anchor Floating Toolbar command in Toolbar viewing 410
submenu 700 assembly, viewing code as 422
Anchor Floating Toolbar menu command 330 assigning
anchoring files to build targets 98
floating toolbar 330 Quote Key prefix 321
ANSI assigning files
C code in Pascal project 516 with the Project Inspector 98
Appears in Menus checkbox with the Target column 98
of Customize IDE Commands window 310, assigning files with 98
311, 312 Attempt To Use Dynamic Type Of C++, Object
Apple menu 655 Pascal And SOM Objects checkbox
Apple® ToolServer™ 690 of Display Settings preference panel 290
AppleScript 261, 262 Auto Indent checkbox
Applet Class section, of Java Applet wizard 530 of Font & Tabs preference panel 282
Applet Name field, of Java Applet wizard 533 Auto Repeat checkbox
of Customize IDE Commands window 319
Applet Parameters section, of Java Applet
wizard 534 Auto Target Libraries checkbox
of Global Settings preference panel 295
Applet Title field, of Java Applet wizard 537
auto-completing
applets
names of symbols 247
additional information for 536, 541
creating parameters for 534 automatic
specifying HTML page for 532 launch of applications when opening SYM
files 294
Application Class section, of Java Application
wizard 538 automatic punctuation balancing 153
Application Title field, of Java Application Automatic updating 389
wizard 541 automatic updating
applications of precompiled headers 389
describing frame class for 539 automatically
Apply button 256, 334 indenting lines of text 282
Apply Difference menu command 133, 657 automatically editing symbols 247
IDE User Guide IDE–721
Index
automatically entering symbols 247 BBEdit™ Extensions Menu 654
Automatically Launch Applications When SYM beans
File Opened checkbox setting base class and interfaces of 544
of Global Settings preference panel 294 setting name and location of 542
automation Before option, of New Class wizard 232
with RAD tools 523 Before option, of New Event Set wizard 610
Auto-target Libraries checkbox beginners conventions 23
of Debugger Settings panel 370 binaries
AWT removing 384
RAD components 585–586 binary
viewing data as 485
B black debug info marker, meaning of 106
Back button blocks
of Browser wizards 229 shifting left and right 154
of RAD wizards 529, 560, 607 bookmarks 159
Background color setting 283 adding 159
Backing up files 120 defined 159
backup files 70, 120 navigating 160
removing 159
Balance command 153
Bottom Edges command in Align submenu 697
Balance Flash Delay field
entering 0 in 280 bottom option, of Java Applet wizard 534
of Editor Settings preference panel 280 Branch Optimizations 363
Balance menu command 657 Break menu command 657
Balance While Typing checkbox Break On C++ Exception menu command 657
of Editor Settings preference panel 279 Break On Java Exceptions menu command 657,
balancing punctuation 153 696
adjusting time allotted to 280 breakpoints
balancing punctuation automatically 153 and Files pane of Symbolics window 428
Balloon Help 264, 655 conditional 439, 472
conditional expressions 495
Base Class and Interfaces section
conditional, and loops 473
of Java Bean wizard 544
conditional, creating 473
of New Event Set wizard 611
defined 467
Base Class pop-up menu
effect of temporary breakpoints on 470
of Java Applet wizard 532
impact of optimizing code 474
of Java Application wizard 541
making active 438
of Java Frame wizard 562
making inactive 438
Base Class section missing 510
of Java Bean wizard 544 no response from 510
of New Event Set wizard 612 setting 468, 510
Base Classes and Methods section, of New Class setting and clearing 468
wizard 233 setting for re-defined functions 473
Base Classes field setting for templated functions 473
of New Class wizard 233 setting in Symbolics window 430
baseline option, of Java Applet wizard 534 temporary 459, 470
basic debugging 450–493 troubleshooting 509
basic navigation concepts 149 viewing 470
BBEdit 88 Breakpoints menu command 438, 471, 496, 657
IDE–722 IDE User Guide
Index
Breakpoints menu commands 472 Open File icon 221
Breakpoints window 438, 471 opening a source file 248
Breakpoints Window menu command 438, 471, Properties tab view(RAD) 597
496, 658 RAD dialog boxes 600–616
Bring To Front command 560 RAD features 595–599
Bring Up To Date command 379, 380, 381, 386, 389 resize bar 217
saving windows 251
Bring Up To Date menu command 257, 658
seeing a declaration 248
Browse button
seeing a routine definition 248
in Build Extras settings panel (Windows) 347
seeing MFC classes in 250
Browse button, In Folders tab of Find In Files seeing PowerPlant classes in 250
window 173 setting options 244
Browse In Process Window checkbox showing subclasses in hierarchy 223
of New Connection dialog box 297 single-class hierarchy 224
Browser Source pane 221
assigning build targets to classes 235 status area 222
specifying #include files for 234 strategy 206–210
specifying base classes and methods for Symbol window 225
classes 233 synchronized class selection 218, 222
specifying file locations for member synchronized data member selection 220
functions 238, 242 synchronized member function selection 220
browser tab control (RAD) 595
activating 205, 347 tab view limitations 596
analyzing inheritance 249 toolbar 216
automatic completion of symbols 247 using 243–251
base classes in hierarchy 224 view 208
Class Declaration button 219 viewing member functions and data
Classes pane 218 members 216
Classes Pane button 219 viewing options 206
Contents view 207, 213 Browser Access Filters pop-up menu 216
controlling lines in hierarchy window 222 Browser Contents menu command 213, 658
customizing windows 251 Browser menu 228, 278, 649
Data Members pane 220 New Class command 650
describing name and location of new New Data Member command 650
classes 230 New Event command 650
displaying tab views (RAD) 596 New Event Set command 650
editing code 249 New Member Function command 650
Events tab view(RAD) 599 New Method command 650
finding function overrides 249 New Property command 650
Hierarchy view 209
Browser window 214–222
identifier icon 220
pane zoom box 217
identifying symbols in database 244
browser window
including subprojects 347
navigating code in 464
interface 210–229
List button 218 Browser wizards 229–243
Member Functions pane 220 Back button 229
Methods tab view(RAD) 598 Cancel button 229
multi-class hierarchy 222–224 Finish button 229
navigating code with 211, 245 Generate button 230
Next button 229
IDE User Guide IDE–723
Index
browsing setting 95
across subprojects 246 setting using the Current Target pop-up
source code 38 menu 96
Build Before Running pop-up menu setting using the Set Default Target menu
Ask option 257 command 96
of Build Settings preference panel 257 setting using the Targets view 96
Build Extras settings panel 346 build, alert when completed 386
Activate Browser checkbox 347 building projects 60
Browse button 347 builds
Cache Subprojects checkbox 347 accelerating 259
Dump Internal Browse Information After Button component 585
Compile checkbox 347 buttons
Use Modification Date Caching checkbox 346 Add 343
Use Third Party Debugger checkbox Add Default 342
(Windows) 347 Apply 256, 334
Build Progress window 378 Cancel 255, 256, 306, 318, 333, 334, 345
Build Progress Window menu command 658 Change 345
Build Settings preference panel 257 Choose 313
Build Before Running pop-up menu 257 Close 256, 334
Compiler Thread Stack field 258 Close Catalog 564, 568
Failure pop-up menu 258 Component Catalog 564
Include File Cache field 259 Component Palette 568
Play Sound After ‘Bring Up To Date’ & ‘Make’ Delete 313
checkbox 258 Don’t Save 255, 306, 333
Save Open Files Before Build checkbox 257 Edit Item Properties 568
Show Message After Building Up-To-Date Export 319
Project checkbox 257 Factory Settings 255, 307, 333
Success pop-up menu 258 Find 177
Use Local Project Data Storage checkbox 257 Find All 177
build target for finding and replacing text 176
defined 20 for IDE preferences 254
preparing for debugging 411 for replacing and finding text 176
build target configurations, in Target Settings for searching 176
window 336 Import 320
build target settings 331–334 Import Components 568
guided tour 331–334 Import Panel 256, 334
build targets 37, 43 in Customize IDE Commands window 306
assigning files to 98 in IDE Preferences window 254
changing settings 95 List View 569
changing the name of 94 Live View 570
choosing settings 335–373 New Binding 322
creating 92 New Catalog 568
creating dependencies 96 New Command 311
defined 90 New Folder 568
how to create in a project 93 New Group 311
how to link 97 OK 256, 334, 345
how to specify dependencies 97 Open Catalog 564, 568
number limitation for projects 92 Replace 177
Replace All 177
IDE–724 IDE User Guide
Index
Revert Panel 255, 307, 333 Canvas 585
Save 255, 256, 306, 307, 311, 312, 314, 333, 334 Cascade menu command 658
Sort Order 50 Case Sensitive checkbox 171
Toggle Index View 568, 569 Case Sensitive checkbox, of Custom Keywords
By Type pop-up menu, of Find In Files dialog box 286
window 173 Catalog pane
of Component Catalog window 569
C Catalog pop-up menu 564
C popup parsing catalogs
relaxing in K&R-styled code 279 defined 525
C string Category pop-up menu, in Contents window 214
entering data as 487 CFM68K 408
viewing data as 485 Change button
C++ in Access Paths settings panel 345
debugging 295 in Other Executables settings panel 369
methods, alphabetizing 290, 429 in Remote Connections preference panel 299
Cache Edited Files Between Debug Sessions of Shielded Folders preference panel 269
checkbox of Source Trees preference panel 275
of Global Settings preference panel 294 of Source Trees settings panel 359
Cache Subprojects checkbox Change Program Counter dialog box
of Build Extras settings panel 347 and skipping statements 460
Cache Symbolics Between Runs checkbox Change Program Counter menu command 460,
of Debugger Settings panel 371 658
caching changing
#include files 259 background color 283
precompiled headers 259 build target names 94
call-chain navigation 463 build target settings 95
call-chain navigation through code 463 data in debugger 480
Can Run As A Standalone Application checkbox environment variables 350
of Java Applet wizard 532 font and color 467
foreground color 283
Cancel button 255, 256, 306, 318, 333, 334, 345
memory 450
buttons
memory, dangers of 450
Cancel 316
registers 441, 443
in Debug Additional Executable dialog
shielded folders 268
box 369
syntax highlighting colors 283, 288
in New Method dialog box 605
the current build target 95
in New Property dialog box
variable values 487
New Property dialog box
character
Cancel button 602
viewing data as 485
of Browser wizards 229
character constant
of Custom Keywords dialog box 286
entering data as 487
of Makefile Importer wizard 65
of New Event dialog box 615 Check Syntax command 52, 659
of RAD wizards 529, 561, 607 Checkbox components 585
Cancel button, in Find dialog box 177 checkboxes
Canvas component Activate Browser Coloring 288
components Activate Syntax Coloring 283
Checkin 622
IDE User Guide IDE–725
Index
Checkin (VCS operation) 624 describing name and location of 230
Checkout 622 specifying #include files for 234
Checkout (VCS operation) 624 specifying base classes and methods for 233
Checkout Status Column 626 Classes pane
Checkout Status column 52, 628 and items not displayed in 218
Choice component 586 Classes Pane button, in browser 219
Choose button 313 Classes pane, in browser 218
in Debug Additional Executable dialog classes.zip 696
box 367, 368, 369 Clear All Breakpoints command 469
in Debugger Settings panel 369 Clear All Breakpoints menu command 660
in Runtime Settings panel Clear All Watchpoints menu command 479
Runtime Settings panel Clear Breakpoint command 469
Choose button 349 Clear Breakpoint menu command 660
in Target Settings panel 338 Clear button
of Java Bean wizard 544 in Debug Additional Executable dialog
of Source Trees preference panel 271 box 368, 369
of Source Trees settings panel 356 in Runtime Settings panel 349
Choose button, In Folders tab of Find In Files in Target Settings panel 338
window 173 Clear command 52, 152
choosing Clear Floating Toolbar command in Toolbar
a compiler 376 submenu 701
a default project 71–72 Clear Floating Toolbar menu command 329
class authoring, in RAD 524 Clear List button
Class Browser menu command 659 of In Files tab 190
Class Declaration button, in browser 219 Clear Main Toolbar command in Toolbar
Class field, of New Class wizard 231 submenu 700
Class field, of New Event Set wizard 610 Clear Main Toolbar menu command 329
Class For Debugging field Clear menu command 85, 437, 440, 478, 557, 660
of Java Settings preference panel Clear Toolbar command 329
(Windows) 300 Clear Watchpoint menu command 440, 478, 660
Class Hierarchy menu command 659 Clear Window Toolbar command in Toolbar
Class Hierarchy Window menu command 659 submenu 699
Class Is A Bean checkbox Clear Window Toolbar menu command 329
of Java Bean wizard 543 ClearCase VCS plugin 618
of New Event Set wizard 608 clearing
Class item breakpoints 468
in Component Information Bar 572 watchpoints 440, 477
Class Name field Close All Editor Documents menu command 661
of Java Applet wizard 531 Close All menu command 661
of Java Application wizard 539, 540 Close All Variable Windows menu command 438
of Java Bean wizard 543
Close button 256, 334
of Java Frame wizard 561
Close Catalog button 564, 568
of New Class wizard 230
of New Event Set wizard 608 Close Catalog menu command 661
classes Close command
assigning to build targets 235 commands
auto-completion of names 247 Close 573
Close menu command 71, 660
IDE–726 IDE User Guide
Index
Close Non-Debugging Windows radio button and VCS 40
of Windowing preference panel 292 available tools 18
closing browser 205
projects 71 browser (RAD) 595
Closing all files 125 configuring options 253
Closing one file 124 configuring preferences 253
code configuring target options 331
compiling and linking 39 configuring target settings 331
deadstripping 48 converting makefiles to projects 64–67
debugging and refining 36 converting multiple IDE 1.7 projects to latest
editing and browsing 38 version 716
editing in browser 249 converting single IDE 1.7 project to latest
killing execution 462 version 715
navigating 462 customizing 40
navigating in the browser 245 debugging source code 409
navigation via Symbolics window 464 getting started 31
preprocessing 394 IDE 33
restarting execution 462 IDE, defined 17
running 454 installation 33
running in debugger 455 introduction 17, 37–41
selecting Linux system requirements 33
font and color 467 Mac system requirements 32
source-code file 34 menu reference 633–701
stepping into routines 457 online documentation 162
stepping out of routines 458 programming concepts 33–37
stepping through 454 RAD components 585
stepping through a single line 457 RAD designs and layouts 523
stopping 454 RAD Layout editor 553
stopping execution 461 RAD tools defined 40
viewing as assembly language 410 scripting 40
viewing source 422 software generation 36
viewing source as assembly 422 Solaris system requirements 33
viewing source as mixed 422 system requirements 31–33
Windows system requirements 32
Code column 47
working with projects 43
Code column, meaning of n/a 47
CodeWarrior Help menu command 661
Code column, zero in 47
CodeWarrior IDE
code generation configurations, in Target Settings
about 17
window 361
Browser menu 649
code navigation contextual menu 211 Data menu 647
code optimization Debug menu 644
and impact on breakpoints 474 Edit menu 637
Code Size attribute File menu 635
in Project Inspector 101 Help menu 655
Codebase/Archive field, of Java Applet Info menu 635
wizard 533 Layout menu 650
CodeView 410 overview 17–20
CodeWarrior Project menu 642
and threading 259 Scripts menu 654
IDE User Guide IDE–727
Index
Search menu 639 Browser Contents 213, 658
Tools menu 653 Build Progress Window 658
VCS menu 653 Cascade 658
View menu 638 Change Program Counter 460, 658
Window menu 651 Check Syntax 52, 659
CodeWarrior Relative 345 Class Browser 659
CodeWarrior Scripting Reference 40 Class Hierarchy 659
Collapse Non-Debugging Windows radio button Class Hierarchy Window 659
of Windowing preference panel (Mac OS) 292 Clear 52, 85, 437, 440, 478, 557, 660
Collapse Window menu command 661 Clear All Breakpoints 469, 660
Clear All Watchpoints 479
collapsing
groups 72 Clear Breakpoint 469, 660
Clear Floating Toolbar 329
color
Clear Main Toolbar 329
for syntax 155
Clear Toolbar 329
setting for background 283
Clear Watchpoint 440, 478, 660
setting for foreground 283
Clear Window Toolbar 329
Color Syntax option Close 71, 660
and printing 127 Close All 661
coloring Close All Editor Documents 661
comments 284 Close All Variable Windows 438
custom keywords 284 Close Catalog 661
keywords 284 CodeWarrior Help 661
strings 284 Collapse Window 661
colors Commands & Key Bindings 306, 661
changing for syntax highlighting 283, 288 Compare Files 662
COM See Common Object Model. 266 Compile 52, 257, 379, 662
Command action type 310 Component Catalog 567, 662
command groups Component Palette 563, 662
creating 311 Connect 662
deleting 313 Copy 181, 446, 662
commands Copy Files 663
About Metrowerks CodeWarrior 656 Copy To Expression 436, 489, 663
Add Bookmark 159 Create Group 84, 663
Add Files 76, 656 Create Overlay 663
Add Window 82, 83, 390, 392, 656 Create Segment 663
adding to menu bar 310 Create Segment/Overlay 663
Align 559, 656, 697 Create Target 93, 663
AltiVec Registers 444 creating 311
Anchor Floating Toolbar 330 creating groups for 311
Apply Difference 133, 657 Customize 560, 664
Balance 153, 657 Customize Object 582
Break 657 customizing 307
Break On C++ Exception 657 Cut 664
Break On Java Exceptions 657, 696 Debug 348, 380, 381, 383, 451, 664
Breakpoints 438, 471, 472, 496, 657 defining actions for 312, 313
Breakpoints Window 438, 471, 496, 658 Delete 52, 85, 436, 440, 478, 557, 582, 664
Bring To Front 560 deleting 313
Bring Up To Date 257, 379, 380, 381, 389, 658 Disable Breakpoint 469, 665
IDE–728 IDE User Guide
Index
Disable Debugger 381, 411, 665 How To 673
Disable Watchpoint 479, 665 Import Components 674
Disassemble 257, 394, 665 Import Project 104, 674
Display Grid 560, 665 importing 320
Enable Breakpoint 469, 666 Index 674
Enable Debugger 104, 381, 411, 414, 451, 507, Insert Reference Template 674
508, 666 Insert Template (in contextual menu) 278
Enable Watchpoint 479, 666 Keyboard Preferences 675
Enter Find String 194, 667 Kill 462, 675
Enter Replace String 667 Lock 574
Errors And Warnings 667 Make 186, 257, 380, 389, 414, 675
Errors And Warnings Window 667 Metrowerks Website 675
examining 309 modifying existing 309
Exit 667 New 56, 57, 63, 64, 525, 546, 554, 575, 676
Expand Window 668 New Class 228, 676
Export Project 104, 668 New Class Browser 676
exporting 319 New Data Member 676
Expressions 436, 489, 494, 668 New Event 613, 676
Expressions Window 436, 489, 495, 668 New Event Set 605, 677
File Path 47 New Expression 489, 495, 677
Find 168, 178, 180, 668 New Folder 574
Find and Open ‘FileName’ 669 New Member Function 229, 677
Find and Open File 669 New Method 602
Find And Replace 168, 179, 669 New Property 600, 677
Find Definition 163, 669 New Text File 137, 388, 391, 392, 677
Find Definition & Reference 163, 670 Object Inspector 578, 678
Find In Files 169, 670 Online Manuals 678
Find In Next File 184, 187, 189, 191, 670 Open 68, 678
Find In Previous File 184, 187, 189, 191, 671 Open In Windows Explorer 47
Find Next 178, 194, 195, 671 Open Recent 68, 259, 260, 678
Find Previous 179, 194, 195, 671 Open Scripts Folder 678
Find Previous Selection 671 Page Setup 126, 680
Find Reference 163, 672 Paste 181, 679
Find Selection 193, 195, 672 Precompile 257, 387, 389, 390, 392, 393, 679
FPU Registers 442 Preferences 253, 679
FPU Registers Window 442 Preprocess 257, 394, 679
General Registers 440, 492 Print 679
Global Variables Window 481, 672 Processes 432, 680
Glossary 672 Processes Window 432, 680
Go Back 161, 673 Project Inspector 99, 100
Go Forward 161, 673 Properties 560, 680
Go To Line 673 Quit 680
Go To Next Bookmark 159 Redo 681
Go To Previous Bookmark 159 Register Window 441
Group 560, 673 Registers Windows 682
Hide Breakpoints 469, 673 Remove Object Code 384, 386, 507, 682
Hide Floating Toolbar 326 Remove Toolbar Item 329
Hide Main Toolbar (Windows) 325 removing from menu bar 313
Hide Window Toolbar 327, 418 Rename 574
IDE User Guide IDE–729
Index
Replace 682, 683 Synchronize Modificatin Dates 88
Replace All 181, 683 Synchronize Modification Dates 384, 689
Replace and Find Next 682 Target Settings 95, 331, 391, 392, 393, 415, 690
Replace And Find Previous 683 Tile Editor Windows 690
Re-search For Files 681 Tile Editor Windows Vertically 690
Reset Floating Toolbar 330 Tile Horizontally 690
Reset Main Toolbar 330 Tile Vertically 690
Reset Project Entry Paths 684 Toolbar 691, 698
Reset Toolbar 330 Toolbars 691, 698
Reset Window Toolbar 330 ToolServer Worksheet 691
Resize 560, 684, 697 Touch 88
Restart 684 Unanchor Floating Toolbar 330
Resume 684 Unapply Difference 133, 691
Revert 155, 684 Undo 691
Run 257, 349, 380, 381, 382, 414, 455, 456, 461, Ungroup 560, 692
684 Unlock 574
Run To Cursor 470, 685 Untouch 88
Save 392, 393, 685 Version Control Settings 692
Save A Copy As 62, 70, 685 View 574
Save All 685 View Alphabetical 582
Save As 446, 686 View Array 438, 447, 692
Save Default Window 251, 686 View As 486, 692
Search 686 View As Binary 693
Select All 582, 686 View As C String 693
Send To Back 560 View As Character 693
Set Breakpoint 468, 686 View As Default 693
Set Default Project 686 View As Enumeration 693
Set Default Target 96, 687 View As Fixed 693
Set Watchpoint 477, 687 View As Floating Point 694
Set/Clear Breakpoint 468, 687 View As Fract 694
Shift Left 154, 687 View As Hexadecimal 694
Shift Right 154, 687 View As Implementor 217
Show Breakpoints 469, 687 View As Pascal String 694
Show Floating Toolbar 326 View As Signed Decimal 694
Show Main Toolbar (Windows) 325 View As Subclass 217
Show Private 217 View As Unicode String 694
Show Protected 217 View As Unsigned Decimal 695
Show Public 217 View As User 217
Show Types 483, 513, 514, 688 View In Groups 582
Show Window Toolbar 327, 418 View Memory 448, 490, 497, 695
Snap To Grid 560, 688 View Memory As 447, 449, 490, 695
Stack Editor Windows 688 View Variable 438, 482, 695
Step Into 457, 688 Watchpoints 439, 479, 695
Step Out 458, 688 Watchpoints Window 439, 479, 696
Step Over 457, 688 Zoom Window 696
Stop 456, 461, 462, 689 Commands & Key Bindings command 306
Stop Build 689 Commands & Key Bindings menu command 306,
Switch To Monitor 689 661
Symbolics Window 427, 689 Commands tab
IDE–730 IDE User Guide
Index
of Customize IDE Commands window 308, running 382
310 setting file extension 376
Comment (VCS operation) 624 speeding 387
comments synchronizing modification dates 384
coloring 284 compiling code 39
Comments item completing symbols 246
in Component Information Bar 572 completing symbols automatically 247
Common Object Model 266 complex projects
Common Subexpression Elimination 363 creation strategy 92
Compact Targets checkbox, in Remove Object working with 89–100
Code dialog box 384, 386 Component Catalog button 564
Compare Files menu command 662 Component Catalog command 567
Comparing and Merging Files & Folders 128 Component Catalog contextual menu 573
Comparison column, of File Comparison Component Catalog File option, of New
window 130 window 575
Compile command 52, 379 Component Catalog menu command 662
Compile menu command 257, 662 Component Catalog toolbar 568
compiler 36 Component Catalog window 567–578
avoiding crashes 259 Catalog pane 569
Compiler column Component Information Bar 571
in File Mappings settings panel 351 Component list 572
Compiler pop-up menu Component pane 569
of File Mappings settings panel 354 Content View buttons 569
Compiler Relative Path 272, 344, 357 creating catalogs 574
compiler thread stack component editors 588–593
and avoiding compiler crashes 259 Component Information Bar 571, 573
Compiler Thread Stack field Class item 572
of Build Settings preference panel 258 Comments item 572
Lock item 572
compiling 375–406
Modified item 572
one file 379
Name item 572
projects 377–387
resizing columns 573
selected files 379
source files 379 sort order 573
sorting 573
compiling and linking
Component list
choosing a compiler 376
in Component Catalog window 572
compiling files 378
debugging 382 component model, in RAD 524
disassembling 394 Component Palette 563–567
guided tour 395–397 Catalog pop-up menu 564
link map 383 component tools 564
making a project 380 toolbar 563
marking project for re-compilation 386 Component Palette button 568
options 386 Component Palette command 563
plugin compilers 376 Component Palette menu command 662
precompiling headers 387–393 Component pane
preprocessing 394 and Component Information Bar 571
removing binaries 384 of Component Catalog window 569
removing object code 384
IDE User Guide IDE–731
Index
Component pane views, contrasted 570 for debugger 366
component tools 564 for editor 365
components 585 configuring Makefile Importer wizard options 65
Button 585 configuring options 253
Checkbox 585 configuring preferences 253
Choice 586 configuring target options 331
defined 524 configuring target settings 331
Jbutton 587 Confirm “Kill Process” When Closing Or Quitting
JCheckBox 587 checkbox
JComboBox 587 of Global Settings preference panel 295
JEditorPane 587 Confirm Invalid File Modification Dates When
JLabel 587 Debugging checkbox
JList 587 of Global Settings preference panel 294
JMenuBar 587
confirming
JOptionPane 587
process kills when closing or quitting 295
JPanel 587
Connect (VCS operation) 624
JPasswordField 587
JPopupMenu 587 Connect menu command 662
JProgressBar 587 Connect on Open (VCS option) 621
JRadioButton 587 Connection pop-up menu
JScrollBar 588 in Remote Debugging settings panel 372
JScrollPane 588 Connection Type pop-up menu
JSlider 588 of New Connection dialog box 298
JSplitPane 588 connections
JTabbedPane 588 adding general remote connections 297
JTable 588 changing general remote connections 299
JTextArea 588 removing general remote connections 299
JTextField 588 consequences
JTextPane 588 of skipping statements 458
JToggleButton 588 Const checkbox
JToolBar 588 of New Data Member wizard 241
JTree 588 of New Member Function wizard 238
List 586 constants
MenuBar 586 auto-completion of names 247
Panel 586 Constructor Parameters field, of New Class
PopupMenu 586 wizard 234
Scrollbar 586 Content View buttons, Component Catalog
ScrollPane 586 window 569
TextArea 586
contents
TextField 586
of symbolics files 410–411
concepts
Contents view 207
programming 33–37
Contents window
conditional breakpoints 439, 472
browser 213
and loops 473
creating 473 Context Popup Delay field
expressions and 495 entering 0 in 260
of IDE Extras preference panel 260
configurations
for build targets 336 contextual menus
for code generation 361 adjusting time allotted to display 260
IDE–732 IDE User Guide
Index
File Path command 47 build target dependencies 96
for browser 211 build targets 92
for debugger 431 build targets in projects, how to 93
in Component Catalog window 573 conditional breakpoints 473
in Layout editor 559 environment variables 349
in Object Inspector 582 groups 84
in Project window 51 input files 34
Open In Windows Explorer command 47 layouts 553
Contextual Menus section menu command groups 311
of Editor Settings preference panel 278 menu commands 311
controlling menu items in Menu editor 590
color 155 panes in editor window 148
project debugging 104–106 precompiled headers 388
syntax highlighting within a window 284 project stationery 62
time allotted to balancing punctuation 280 projects 55–60
time allotted to display contextual menu 260 projects from stationery 57
controls RAD component catalogs 574
Pane Resize boxes 148 RAD objects in layouts 556
Pane Splitter 148 RAD projects 525–529
conventions 23 subprojects within projects 99
figures 25 .ctlg extension 575
for beginners 23 Current Target pop-up menu 96, 548
host terminology 24 current-statement arrow 422
hypertext 24 and skipping statements 459
keyboard shortcuts 25 and Symbolics window 430
notes 23 at breakpoint 467
tips 23 defined 455
typefaces 24 dragging 459
typographical 23 custom commands
use of > 24 defining actions for 312, 313
warnings 23 custom keyword list
Copy And Expression Propagation 363 of Custom Keywords dialog box 285
Copy command 152 custom keyword set
Copy Files menu command 663 adding keywords to 284
Copy menu command 181, 446, 662 custom keyword sets
Copy Propagation 363 exporting 287
Copy To Expression menu command 436, 489, 663 importing 286
crashing custom keywords
debugger 509 coloring 284
Create A Frame On Startup checkbox deleting 286
of Java Application wizard 539 Custom Keywords dialog box 284, 285, 287
Create Folder checkbox 527 Add button 285
Cancel button 286
Create Group menu command 84, 663
Case Sensitive checkbox 286
Create Overlay menu command 663
custom keyword list 285
Create Segment menu command 663 Done button 286
Create Segment/Overlay menu command 663 Export To File button 287
Create Target menu command 93, 663 Import From File button 287
creating
IDE User Guide IDE–733
Index
Custom Keywords settings panel 365 Data Member Declaration section, of New Data
Edit button 366 Member wizard 240
Custom option, of New Event Set wizard 612 data members
Customize command 560 declaring 240
Customize IDE Commands window viewing in browser 216
Action section 310 Data Members pane, in browser 220
Appears in Menus checkbox 310, 311, 312 Data menu 647
Arguments field (Windows) 312 Copy To Expression command 647, 648
Auto Repeat checkbox 319 New Expression command 647, 648
buttons 306 Show Types command 647, 648
Commands tab 308, 310 View Array command 648, 649
Directory field (Windows) 312 View As Binary command 648, 649
discarding changes 306 View As C String command 648, 649
Dvorak KCHR Support checkbox 317, 318, 323 View As Character command 648, 649
Execute field (Windows) 312 View As command 647, 648
Key Bindings section 310 View As Default command 648, 649
Name field 310, 311, 312 View As Enumeration command 648, 649
Numeric Keypad Bindings checkbox 316, 317, View As Fixed command 648, 649
322 View As Floating Point command 648, 649
Prefix Key Timeout field 323 View As Fract command 649
Run App/Script field 313 View As Hexadecimal command 648, 649
Customize menu command 664 View As Pascal String command 648, 649
Customize Object command 582 View As Signed Decimal command 648, 649
customizing View As Unicode String command 648, 649
commands 307 View As Unsigned Decimal command 648,
IDE 40, 306–330 649
key bindings 314 View Memory As command 648, 649
menu commands 310, 313 View Memory command 648, 649
toolbars 323 View Variable command 647, 649
Cut command 152 Data Size attribute
Cut menu command 664 in Project Inspector 101
CVS 266 data types
anon 513
CVS VCS plugin 618
enumerated 513
multiple 489
D showing 483
data viewing 483
in separate windows 482 viewing structured 419
viewing and changing in debuggger 480 Data Update Interval
viewing as different types 486 in Debugger Settings panel 371
viewing in different formats 485 Database Path (VCS option) 621
Data column 48 dates
Data column, meaning of n/a 48 synchronizing 384
Data column, zero in 48 synchronizing modification dates 88
data formats Dead Code Elimination 363
availability 486 Dead Store Elimination 364
for variables 487 deadstripping code 48
Debug Additional Executable dialog box 367
IDE–734 IDE User Guide
Index
Cancel button 369 Debug Merged Executable checkbox 368
Choose button 367, 368, 369 Debugger
Clear button 368, 369 Display Settings preference panel 288, 305
Debug Merged Executable checkbox 368 Global Settings preference panel 293
Download File During Remote Debugging Java Debugging preference panel 300
checkbox 367 Java Settings preference panel 300
File Location field 367 MetroNub Settings preference panel 302
Remote Download Path field 367 Remote Connections preference panel 296
Debug column 49, 105 Remote Debugging settings panel 372
in Other Executables settings panel 366 Windowing preference panel 291
debug column in Project window 413 x86 Settings preference panel 304
Debug command 380, 414, 507 debugger 36
Debug Info attribute basic debugging 450–493
in Project Inspector 102 contextual menu 431
Debug Info marker 105 crashing 509
for groups 106 defined 409
debug info marker editing source code 493
black 106 error messages 517
gray 106 expressions 493–506
none 106 font selection 467
general problems 507
Debug menu 279, 644
guided tour 415–450
Break command 644
launch problems 507
Break On C++ Exception command 645, 647
launching 451
Break On Java Exceptions command 646, 647
problems while running 509
Change Program Counter command 645, 647
running code 454, 455
Clear All Breakpoints command 645, 646
starting up 451
Clear All Watchpoints command 645, 647
stepping into routines 457
Clear Breakpoint command 645, 646
stepping out of routines 458
Clear Watchpoint command 645, 646
stepping through code 454, 457
Connect command 646
stopping code 454
Disable Breakpoint command 645, 646
symbol hint 431
Disable Watchpoint command 645, 647
toolbar 417
Enable Breakpoint command 645, 646
troubleshooting 506–521
Enable Watchpoint command 645, 647
using 414–415
Hide Breakpoints command 645, 646
viewing and changing data 480
Kill command 644, 646
Restart command 644, 646 Debugger Commands checkbox
Run To Cursor command 645, 647 of Editor Settings preference panel 279
Set Breakpoint command 645, 646 debugger configurations, in Target Settings
Set Watchpoint command 645, 646 window 366
Set/Clear Breakpoint command 645, 646 Debugger pop-up menu
Show Breakpoints command 645, 646 of New Connection dialog box 297
Step Into command 645, 646 Debugger Preferences
Step Out command 645, 646 of IDE Preferences window 288
Step Over command 644, 646 Debugger Settings panel 369
Stop command 646 Auto-target Libraries checkbox 370
Switch To Monitor command 647 Cache Symbolics Between Runs checkbox 371
Debug menu command 348, 381, 383, 451, 664 Choose button 369
Data Update Interval 371
IDE User Guide IDE–735
Index
Default radio button 370 of New Event dialog box 615
Location Of Relocated Libraries And Code of New Method dialog box 605
Resources field 369 declarations
Log System Messages checkbox 371 seeing in browser 248
Stop At Temp Breakpoint On Application Default applet parameter, of Java Applet
Launch checkbox 370 wizard 535
Stop At Watchpoints checkbox 371 Default File Format pop-up menu
User Specified radio button 370 DOS option 281
debugger toolbar 417 Macintosh option 281
Kill command 417 of Editor Settings preference panel 280
Step Out command 417 Unix option 281
Step Over command 417 default file name extensions 352–354
Debugger Trap Settings Default radio button
of MetroNub Settings preference panel in Debugger Settings panel 370
(Mac OS) 303 Default Size For Unbounded Arrays field
Debugger window. See Thread window. 416 of Display Settings preference panel 290
Debugger() 303 Default Targets option, in Target pop-up
debugging menu 174
activating for source code 105 Default Targets option, of Target pop-up
and refining code 36 menu 185
DLLs automatically 295, 370 defaults
embedded start-up process 454 for toolbars 330
enabling 381
defining
enabling debug info 104
actions for custom commands 312, 313
general start-up process 451
Defining Symbols for C/C++ 390
generating debugging information 104–106
Defining Symbols for Pascal 392
generating symbolics information 413
how to 382 definition
on multiple monitors 293 of bookmarks 159
other executable files with the build target 367 of build target 20, 90
preparation 411–414 of debugging nub 297, 302
preparing a build target 411 of design 92
preparing a file 412 of dirty file 144
projects 39, 382 of file set 189
static constructors 295 of host 19
of key binding 314
debugging for files 105
of non-debugging windows 291
debugging information file 37
of nub 297, 302
debugging nub, definition of 297, 302 of platform target 20
debugging source code 409 of plug-in 19
DebugStr() 303 of project 19
decimal of regular expression 195
entering data as 487 of subproject 90
Declaration field of tick 323
of New Data Member wizard 243 Definition field
of New Member Function wizard 238 of New Data Member wizard 243
Declaration File field of New Member Function wizard 239
of New Class wizard 230 definition of
Declaration section shielded folders 266
IDE–736 IDE User Guide
Index
Delete button 313 Direction section, of Find dialog box 171
Delete command 52, 582 Directory field
Delete menu command 85, 436, 440, 478, 557, 664 of Customize IDE Commands window
deleting (Windows) 312
command groups 313 Dirty File marker 143
custom keywords 286 dirty file, defined 144
environment variables 350 Disable Breakpoint command 469
expressions 436 Disable Breakpoint menu command 665
key bindings 318 Disable Debugger command 411
keyboard shortcuts 318 Disable Debugger menu command 381, 665
menu commands 313 Disable Third Party Plugins checkbox
shielded folders 269 of Plugin Settings preference panel 266
text in editor 150
Disable Watchpoint menu command 479, 665
dependencies
Disassemble command 394
how to specify between build targets 97
Disassemble menu command 257, 665
dereferencing handles 420
disassembling source code 394
Description applet parameter, of Java Applet
discarding
wizard 535
changes in Customize IDE Commands
Description field
window 306
of Java Applet wizard 537
changes in IDE Preferences window 255
of Java Application wizard 542
changes in Target Settings window 333
design
Disconnect (VCS operation) 624
defined 92
display
Design Name text field, of Project panel 546
of added files 76
Design pop-up menu, of New window 554
Display Grid command 560
Design tab, in Project window 548
Display Grid menu command 665
Design view 44, 548
Display Settings preference panel 288, 305
of Project window 53
Attempt To Use Dynamic Type Of C++, Object
designs Pascal And SOM Objects checkbox 290
adding to projects 546 Default Size For Unbounded Arrays field 290
in Targets view 549 Show All Locals checkbox 289
limitations of 547 Show Tasks In Separate Windows
working with 545–549 checkbox 290
Destination File section, of File Comparison Show Values As Decimal Instead Of Hex
window 129 checkbox 289
Details field Show Variable Types checkbox 288
of Global Optimizations settings panel 363 Show Variable Values In Source Code
Diagnostic Settings option for makefiles 67 checkbox 290
dialog boxes Sort Functions By Method Name In Browser
Custom Keywords 284, 285, 287 checkbox 289
Debug Additional Executable 367 Variable Change Hilite option 288
Edit Key Binding 316, 318 Watchpoint Hilite option 288
Find 168 displaying
Find And Replace 168 a tab view in the browser 596
New Connection 297 DLL 295, 370
Set/Clear Breakpoint 468 automatically debugging 295, 370
dialog boxes, for RAD browser 600–616
Difference list, of File Comparison window 130
IDE User Guide IDE–737
Index
Do Nothing To Non-Debugging Windows radio Edit button
button of Custom Keywords settings panel 366
of Windowing preference panel 291 of Text Colors preference panel 285, 287
Do Nothing To Project Windows checkbox Edit Commands checkbox
of Windowing preference panel 293 of Editor Settings preference panel 278
Document Settings pop-up menu 142 Edit Item Properties button 568
DOS option 143 Edit Key Binding dialog box 316, 318
Macintosh option 143 Edit menu 278, 637
Syntax Coloring option 143 Balance command 637, 638
UNIX option 143 Clear command 638
Document Tab Settings section Commands & Key Bindings command 637,
of Font & Tabs preference panel 282 638
documentation Copy command 637, 638
online help 162 Cut command 637, 638
platform targets 29 Delete command 637
QuickStart and tutorials 29 Insert Reference Template command 638
viewers 29 Paste command 637, 638
dollar sign in variable names 513 Preferences command 637, 638
Don’t Save button 255, 306, 333 Redo command 637, 638
Don’t Step Into Runtime Support Code checkbox Select All command 637, 638
of Global Settings preference panel 295 Shift Left command 637, 638
Done button Shift Right command 637, 638
of Custom Keywords dialog box 286 Target Settings command 637, 638
Undo command 637, 638
DOS option
Version Control Settings command 637, 638
in Default File Format pop-up menu 281
in Document Settings pop-up menu 143 EditEdit button
of Text Colors preference panel 287
DOS text files 122
editing
Down radio button, in Find dialog box 171
in browser 249
Download File During Remote Debugging
source code 38
checkbox 367
source code in debugger 493
drag and drop
editing symbols automatically 247
adding files to projects 80
editing, redoing 154
text 152
to remove files and groups 86 editing, undoing 154
Dump Internal Browse Information After Compile Editor
checkbox browser contextual menu preferences 278
of Build Extras settings panel 347 debugger contextual menu preferences 279
dump memory 448, 695 edit contextual menu preferences 278
project contextual menu preferences 279
Dvorak KCHR Support checkbox
remembering font preferences 277
of Customize IDE Commands window 317,
VCS contextual menu preferences 279
318, 323
editor 137–162
DWARF 410
adding text 150
dynamic library 35
balancing punctuation 153
dynamically linked library. See DLL. 295, 370 color syntax 155
configuration 145–149
E creating panes in window 148
Easter egg 209, 219 deleting text 150
IDE–738 IDE User Guide
Index
finding a routine in 156 Window Position And Size checkbox 278
font 146 Editor window
go to line number 161 setting the font 281
going back and Forward 161 setting the font size 282
guided tour 137–145 setting the script system 282
markers 156–159 editor window 193, 194
moving text 152 bookmarks 159
navigating text 155–162 editors
opening related file 160 creating menus with Menu editor 590
panes 147–148 for RAD components 588–593
removing panes in window 148 for RAD menu bars 589
resizing panes in window 148 for RAD pop-up menus 593
saving window settings 148 modifying menus with Menu editor 591
selecting text 151 removing menus with Menu editor 592
showing and hiding window toolbars 146 third-party 88
text editing 149–155 Electric Fish
text size 146 CVS plug-in 618
third-party support 262 Projector plug-in 618
undoing changes 154–155
elements
user interface elements 137
in toolbars 325
editor configurations, in Target Settings
Emacs text editor 262
window 365
empty project 55
(Editor Extensions) folder 654
Empty Project option, of New window 57
Editor Extensions Menu 654
Enable Automatic Toolbar Help checkbox
Editor Extensions menu
of IDE Extras preference panel 264
icon 654
Enable Breakpoint command 469
Editor Preferences
Enable Breakpoint menu command 666
of IDE Preferences window 277
Enable Debugger menu command 104, 381, 411,
Editor Settings preference panel
414, 451, 507, 508, 666
Balance Flash Delay field 280
Balance While Typing checkbox 279 Enable Debugging command 507
Browser Commands checkbox 278 Enable Remote Debugging checkbox
Contextual Menus section 278 in Remote Debugging settings panel 372
Debugger Commands checkbox 279 Enable Virtual Space checkbox
Default File Format pop-up menu 280 of Editor Settings preference panel 280
Edit Commands checkbox 278 Enable Watchpoint menu command 479, 666
Enable Virtual Space checkbox 280 enabling
Font Preferences checkbox 277 debugging 381
Insert Template Commands checkbox 278 End key 45
Left Margin Click Selects Line checkbox 280 Ends With field, of Find In Files window 173
of IDE Preferences window 277 Enter Find String menu command 194, 667
Other Settings 279 Enter Replace String menu command 667
Project Commands checkbox 279 entering data
Relaxed C Popup Parsing checkbox 279 formats 487
Remember section 277
entering symbols automatically 247
Selection Position checkbox 277
enumeration
Sort Function Pop-Up checkbox 280
viewing data as 485
Use Multiple Undo checkbox 279
VCS Commands checkbox 279 enumerations
IDE User Guide IDE–739
Index
auto-completion of names 247 of Customize IDE Commands window
Environment Settings section (Windows) 312
of Runtime Settings panel (Windows) 349 execution
Environment Variable option killing 462
of Source Trees preference panel 271, 274 of a single statement 457
of Source Trees settings panel 356 restarting 462
Environment Variable option, in Type pop-up stopping 461
menu 271, 274, 356 Existing button
environment variables of New Class wizard 232
creating 349 of New Member Function wizard 239
deleting 350 Existing Custom Set option, in New Event Set
modifying 350 dialog box 606
Error Button 395 Exit menu command 667
error messages 398 Expand Window menu command 668
compiler 400 expanding
debugger 517 groups 72
Errors And Warnings menu command 667 variables 419, 447, 481
Errors And Warnings Window menu Export button 319
command 667 Export Panel button
Errors Only option buttons
of Plugin Diagnostics 265 Export Panel 256, 334
event sets Export Project menu command 104, 668
assigning to build targets 612 Export To File button, of Custom Keywords dialog
setting base class and interfaces of 611 box 287
setting name and location of 608 exporting
Events tab commands 319
in Object Inspector 581 custom keyword sets 287
Events tab view, in browser (RAD) 599 key bindings 319
examining preference-panel settings 256, 334
commands 309 preferences in XML 256
project information 100–102 projects 103–104
RAD objects 557 target settings in XML 334
examples Expression Simplification 363
of expressions 499 expressions 493–506
Exceptions In Targeted Classes command in Java and decimal values 499
Exceptions submenu 696 and registers 497
.EXE 427 and structure members 500
executable files and variable values 499
how to debug with build target 367 as source addresses 496
how to modify debugging with build attaching to breakpoints 496
target 369 changing conditions by dragging 496
removing from debugging 369 creating 494
creating by dragging 495
Executable Files list 369
defined 493
in Other Executables settings panel 366
deleting 436
Executables pane
examples 499
in Symbolics window 428
formal syntax 501
Execute field in Breakpoints window 495
IDE–740 IDE User Guide
Index
in Expressions window 494 toolbar 131
in Memory window 496 File Control pop-up menu
interpretation of 494 Check Syntax command 52
limitations of 498 Clear command 52
logical 500 Compile command 52
pointers in 500 Delete command 52
reordering 436 File field
special features 497 of Java Bean wizard 543
use of regular expressions with shielded of New Event Set wizard 608
folders 266 File Location field
using 497 of Debug Additional Executable dialog
using vector variables in 505 box 367
Expressions menu command 436, 489, 494, 668 File Locations section, of New Member Function
Expressions window 436 wizard 238, 242
adding caller variables 489 File Mappings List 351
adding items 489 File Mappings list
and variables 488 of File Mappings settings panel 351
changing order of items 489 File Mappings settings panel 350
Expressions Window menu command 436, 489, Add button 351
495, 668 Compiler column 351
Extension column Compiler pop-up menu 354
in File Mappings settings panel 351 Extension column 351
Extension field Extension field 352
of File Mappings settings panel 352 File Mappings list 351
extension, file name 351 File Type column 351
external development tools 41 File Type field 352
external editor support 262 Flags pop-up menu 354
Extra Information Button 397 Mapping Info section 351
File menu 635
F Close All command 636
Close Catalog command 636
Factory Settings button 255, 307, 333 Close command 635, 636
Failure pop-up menu Exit command (Windows) 636
of Build Settings preference panel 258 Export Project command 636
Faster Execution Speed radio button Find And Open File command 635, 636
of Global Optimizations settings panel 362 Import Components command 636
fat libraries 408 Import Project command 636
FDI See Floating Document Interface. 263 New command 635, 636
figure conventions 25 New Text File command 636
File column 46, 113 Open command 635, 636
in Other Executables settings panel 366 Open Recent command 636
%file command-line string 262 Page Setup command 636, 637
file comparison Print command 636, 637
overview 128 Quit command 637
File Comparison window 129 Revert command 635, 636
Comparison column 130 Save A Copy As command 635, 636
Destination File section 129 Save All command 635, 636
Difference list 130 Save As command 635, 636
Save command 635, 636
IDE User Guide IDE–741
Index
file name extensions 351 choosing a default project 71–72
adding 351 closing 124–125
default settings 352–354 comparing 128
file name suffix 351 compiling 378
File Name text field, of File panel 575 compiling one file 379
File pane 437 compiling selected files 379
File panel creating 109
File Name text field 575 debugging information file 37
Location text field 576 display of added files 76
drag and drop adding to projects 80
File Path caption 143
dynamic library 35
File Path command 47
empty project 55
File Set pop-up menu finding and replacing text in 182
New File Set option 176 finding and replacing text in one file 177
Open Editor Files option 176 header file 35
File Set pop-up menu, of Find In Files window 176 include file 35
file set, defined 189 input file creation 34
File Systems… 668 interface file 35
File tab, of New window 575 items saved with projects 70
File Type column library file 35
in File Mappings settings panel 351 managing project files 72–89
File Type field merging 128
of File Mappings settings panel 352 modifying projects 60
File view moving 83
Checkout Status column 52 moving in Project window 83
Code column 47 naming projects 57
contextual menu 51 opening existing 110–117
Data column 48 opening project files from other hosts 69
Debug column 49 opening projects prior to IDE 1.7 (Mac OS) 717
File column 46 output file 36, 43
Interface pop-up menu 51 permissions
Project Checkout Status icon 52 Checked out 626
Target column 48 Locked 627
Touch column 49 Modify Read-Only 626
Files Read-Only 626
opening 160 Unlocked 627
saving in default text format 280 preparing for debugging 412
files 109–128 printing 125–127
activating debugging for 105 printing options 126
adding to projects 75 project file 35
adding to projects (Macintosh) 78 project stationery 55, 56
adding to projects (Solaris) 79 recompiling 379
adding to projects (Windows) 77 removing 85
assigning to build targets 98 removing in Files view 85
assigning with the Project Inspector 98 removing with drag and drop 86
assigning with the Target column 98 removing with menu commands 85
automatic stationery setup 59 resource file 34
backing up 70 reverting 155
building projects 60 reverting to saved 127
IDE–742 IDE User Guide
Index
saving 117–122 Find field 170
saving a copy of a project 70 Match Whole Word checkbox 171
selecting 73 Regular Expression checkbox 171
setting extensions 376 Search Selection Only checkbox 171
source-code file 34 Stop At End Of File checkbox 171
static library 35 Up radio button 171
symbolics file 37 Find field 170
symbolics files 410–411 Find In Files menu command 169, 670
touching and untouching 87 Find In Files window 169
types of project files 55 Browse button of In Folders tab 173
Files pane By Type pop-up menu 173
and breakpoints 428 Case Sensitive checkbox 171
in Symbolics window 428 Choose button of In Folders tab 173
navigating code with 465 Ends With field 173
Files tab 663 File Set pop-up menu 176
Files view 44 Find And Replace dialog box 171
of Project window 46 Find field 170
removing files and groups 85 In Files tab 172, 189
sorting items 49 In Folders tab 172, 182
Final option, of Specifier pop-up menu 544, 605, In Folders tab, how to 183
611 In Projects tab 172, 184
find In Projects tab, how to 185
and buttons 176 In Symbolics tab 172, 187
Find All button 177 In Symbolics tab, how to 188, 189
Find And Compare Operations checkbox Match Whole Word checkbox 171
of Shielded Folders preference panel 268 Project Headers checkbox 174
Project pop-up menu 174
Find And Open ‘Filename’ menu command 669
Project Sources checkbox 174
Find And Open File menu command 669
Replace field 170
find and replace Search Cached Sub-targets checkbox 175
text selectively, how to 180 Search In field 173
Find And Replace dialog box 168, 178, 179 Search Sub-folders checkbox 173
Case Sensitive checkbox 171 Symbolics pop-up menu 175
Find field 170 System Headers checkbox 175
Match Whole Word checkbox 171 Target pop-up menu 174
Regular Expression checkbox 171 Find In Next File menu command 184, 187, 189,
Replace field 170 191, 670
Stop At End Of File checkbox 171
Find In Previous File menu command 184, 187,
Find And Replace menu command 168, 179, 669 189, 191, 671
Find button 177 Find menu command 168, 178, 180, 668
Find Definition & Reference command 163 Find Next menu command 178, 194, 195, 671
Find Definition & Reference menu command 670 find options 169
Find Definition command 163 Find Previous menu command 179, 194, 195, 671
Find Definition menu command 669 Find Previous Selection menu command 671
Find dialog box 168 Find Reference command 163
Cancel button 177
Find Reference menu command 672
Case Sensitive checkbox 171
Find Reference Using pop-up menu
Direction section 171
of IDE Extras preference panel 264
Down radio button 171
IDE User Guide IDE–743
Index
Find Selection menu command 193, 195, 672 comparing 128
Find symbols with prefix 246 merging 128
Find symbols with substring 246 Font & Tabs preference panel 281, 282
Find Window Auto Indent checkbox 282
guided tour 167–169 Document Tab Settings section 282
Find-and-Compare Operations column, of Font pop-up menu 281
Shielded Folders preference panel 267 Global Tab Settings section 282
finding Sample field 282
all occurrences of specific text Script pop-up menu 282
find all occurrences of specific text 179 Size pop-up menu 282
function overrides in browser 249 Tab Indents Selection checkbox 282
individual occurrences of text 178 Tab Size field 282
selected text 193 Font pop-up menu
text in an inactive editor window, how to 194 of Font & Tabs preference panel 281
text in the active editor window, how to 193 Font Preferences checkbox
text with the Find And Replace dialog box, of Editor Settings preference panel 277
how to 178, 179 font selection in debugger 467
finding all implementations of function 225 font size
finding and replacing 181 setting 282
individual occurrences of text 180 fonts
text in a single file 177 setting 281
text in multiple file 182 Foreground color setting 283
finding and replacing text 195 formats
using regular expressions 197 entering data in 487
finding symbol definitions 163 of data views 485
finding text 193 FPU Registers command 442
finding text in multiple 194 FPU Registers window 420, 422, 442
Finish button FPU Registers Window command 442
of Browser wizards 229 Fract
of Makefile Importer wizard 65 viewing data as 486
of RAD wizards 529, 561, 607 Frame Class section, of Java Application
Fixed wizard 539
viewing data as 486 Frame Class section, of Java Frame wizard 561
Flags pop-up menu Full Path attribute
Ignored By Make flag 354 in Project Inspector 101
Launchable flag 354 function overrides
of File Mappings settings panel 354 finding in browser 249
Precompiled flag 354 Function pop-up menu 141, 424, 427
Resource File flag 354 sorting alphabetically 424
flexibility of IDE 18 functions
Floating Document Interface 263 auto-completion of names 247
floating point describing name and location of 237
entering data as 487 specifying file locations for 238, 242
viewing data as 485 Functions pane
floating toolbar in Symbolics window 429
anchoring 330 functions, finding all 225
focused pane 417
folders
IDE–744 IDE User Guide
Index
G Don’t Step Into Runtime Support Code
checkbox 295
General Preferences
Maintain Files In Cache For field 294
of IDE Preferences window 257
Purge Cache button 294
General Registers command 440, 492
Global Tab Settings section
General Registers window 420, 422, 440 of Font & Tabs preference panel 282
General Settings section global variables 437
of Runtime Settings panel (Windows) 349 in Variables pane 419
Generate button placing in separate windows 438
of Makefile Importer wizard 65 viewing in debugger 481
Generate button, of Browser wizards 230 Global Variables window 437
Generate button, of RAD wizards 530, 561 Global Variables Window menu command 481,
Generate Constructors and Destructors checkbox, 672
of New Class wizard 234 globals
Generate HTML Page checkbox auto-completion of names 247
of Java Applet wizard 532 Glossary menu command 672
Generate Standard Methods checkbox glue code 515
of Java Applet wizard 532 GNU, converting make files to projects 55
generating Go Back command 161
a link map 383 limitations of 246
symbolics information 413
Go Back menu command 673
generating software 36
Go Forward command 161
Get 622 limitations of 246
Get (VCS operation) 623 Go Forward menu command 673
Get next symbol 247 Go To Line menu command 673
Get previous symbol 247 Go To Next Bookmark command 159
Getting Started for CodeWarrior 29, 33 Go To Previous Bookmark command 159
getting started with IDE 31
going
Global Optimizations settings panel 361 back and forward 161
Details field 363
going to a line number 161
Faster Execution Speed radio button 362
gray debug info marker, meaning of 106
Optimization Level Slider 362
Optimize For section 362 grep 195
Smaller Code Size radio button 362 Grid Size X field 305
Global Register Allocation 363 of Layout Editor preference panel 305
Global Register Allocation Only For Temporary Grid Size Y field 306
Values 363 of Layout Editor preference panel 306
Global Settings preference panel 293 Group command 560
Auto Target Libraries checkbox 295 Group menu command 673
Automatically Launch Applications When Group pop-up menu 114
SYM File Opened checkbox 294 groups
Cache Edited Files Between Debug Sessions and Debug Info marker 106
checkbox 294 creating 84
Confirm “Kill Process” When Closing Or expanding and collapsing 72
Quitting checkbox 295 how to rename 86
Confirm Invalid File Modification Dates When moving 83
Debugging checkbox 294 moving in Project window 83
naming 86
IDE User Guide IDE–745
Index
removing 85 Hide Main Toolbar command in Toolbar
removing in Files view 85 submenu 699
removing with drag and drop 86 Hide Non-Debugging Windows radio button
removing with menu commands 85 of Windowing preference panel 292
selecting 73 Hide Window Toolbar command 327
guided tour Hide Window Toolbar command in Toolbar
of build target settings 331–334 submenu 698
of IDE preferences 253–256 Hide Window Toolbar menu command 418
hiding
H editor window toolbars 146
Has Data Member section, of New Property dialog toolbars 325
box 602 Hierarchical Menu action type 310
header file 35 hierarchy expansion triangle 223
header files Hierarchy view, browser 209
opening 117 History (VCS operation) 624
precompiling 387–393 Home key 45
headers Horizontal Center command in Align
caching precompiled headers 259 submenu 697
Height field, of Java Applet wizard 534 host
help defined 19
online 162 Host Application For Libraries And Code
Help menu 655 Resources field
About Metrowerks CodeWarrior of Runtime Settings panel 348
command 655 Host Flags pop-up menu
CodeWarrior Help command 655 All option 342
Glossary command 655 in Access Paths settings panel 342
How To command 655 None option 342
Index command 655 host terminology conventions 24
Metrowerks Website command 655 hosts
Online Manuals command 655 opening project files 69
Search command 655 how to
help viewers add general remote connections 297
QuickHelp (Mac OS) 164 add other executable files for debugging 367
QuickView (Mac OS) 165 change executable files for debugging 369
THINK Reference (Mac OS) 165 change general remote connections 299
WinHelp (Windows) 164 create a new build target in a project 93
(Helper Apps) folder 262 debug a project 382
hexadecimal find text in an inactive editor window 194
entering data as 487 find text in the active editor window 193
viewing data as 485 find text with the Find And Replace dialog
Hide Breakpoints command 469 box 178, 179
Hide Breakpoints menu command 673 link build targets 97
Hide Floating Toolbar command 326 mark a project for re-compilation 386
Hide Floating Toolbar command in Toolbar move files and groups in the Project
submenu 699 window 83
Hide Main Toolbar command (Windows) 325 remove all object code from a project 384
remove executable files from debugging with
build target 369
IDE–746 IDE User Guide
Index
remove files and groups in the Files view 85 defined 17
remove general remote connections 299 Edit menu 637
rename groups 86 File menu 635
selectively find and replace text 180 finding text 167–203
specify build-target dependencies 97 getting started 31
use the In Folders tab of the Find In Files Help menu 655
window 183 Info menu 635
use the In Projects tab of the Find In Files installation 33
window 185 introduction 17, 37–41
use the In Symbolics tab of the Find In Files Layout menu 650
window 188, 189 Linux system requirements 33
how to find text 178, 179, 193, 194 Mac system requirements 32
How To menu command 673 menu reference 633–701
HSpace field, of Java Applet wizard 534 online documentation 162
HTML overview 17–20
specifying page in Java Applet wizard 532 preference panel buttons 254
preference panels 254
HTML Page section, of Java Applet wizard 532
programming concepts 33–37
Hypertext Markup Language. See HTML. 532
Project menu 642
hypertext navigation 24 RAD components 585
RAD designs and layouts 523
I RAD Layout editor 553
icon RAD tools defined 40
for Editor Extensions menu 654 removing menu commands 313
for Tools menu 653 replacing text 167–203
for VCS menu 653 scripting 40
icons Scripts menu 654
Project File Proxy 52 Search menu 639
IDE 33 settings panel window buttons 332
about 17 settings panels 332
adding menu commands 310 software generation 36
and flexibility 18 Solaris system requirements 33
and VCS 40 system requirements 31–33
available tools 18 Tools menu 653
browser 205, 595 VCS menu 653
Browser menu 649 View menu 638
choosing preferences 256–306 Window menu 651
configuring options 253 Windows system requirements 32
configuring preferences 253 working with projects 43
configuring target options 331 IDE Extras 653, 654
configuring target settings 331 IDE Extras preference panel 259
converting multiple IDE 1.7 projects to latest Context Popup Delay field 260
version 716 Enable Automatic Toolbar Help checkbox 264
converting single IDE 1.7 project to latest Find Reference Using pop-up menu 264
version 715 Launch Editor field 262
customizing 40, 306–330 Launch Editor W/ Line # field 262
Data menu 647 Menu Bar Layout pop-up menu 259
Debug menu 644 Recent Projects field 259, 260
debugging source code 409
IDE User Guide IDE–747
Index
Use BBEdit™ Extensions checkbox importing
(Mac OS) 264 commands 320
Use External Editor checkbox 261 custom keyword sets 286
Use Multiple Document Interface key bindings 320
checkbox 263 preference-panel settings 256, 334
Use Script Menu checkbox 261 preferences in XML 256
Use Third Party Editor checkbox 262 projects 103–104
Use ToolServer Menu checkbox 263 target settings in XML 334
Zoom Windows To Full Screeen checkbox 261 > in documentation 24
IDE preferences In Files tab
guided tour 253–256 Add Files button 190
IDE Preferences window 256 Clear List button 190
Build Settings panel 257 File Set pop-up menu 176
buttons 254 Remove A Set button 191
Debugger Preferences 288 Save This Set button 190
discarding changes 255 In Files tab, of Find In Files window 172, 189
Editor Preferences 277 In Folders tab
Editor Settings panel 277 By Type pop-up menu 173
Font & Tabs panel 281, 282 Ends With field 173
General Preferences 257 how to use 183
IDE Extras panel 259 Search In field 173
Plugin Settings panel 264 Search Sub-folders checkbox 173
preference panels 254 In Folders tab, of Find In Files window 172, 182
RAD Tools Preferences 305 In Projects tab
Shielded Folders panel 266 how to use 185
Source Trees panel 269 Project Headers checkbox 174
IDE User Guide Project pop-up menu 174
overview 21–22 Project Sources checkbox 174
identifier icon, in browser 220 Search Cached Sub-targets checkbox 175
identifying System Headers checkbox 175
symbols in browser database 244 Target pop-up menu 174
Ignore Traps option In Projects tab, of Find In Files window 172, 184
of MetroNub Settings preference panel In Symbolics tab
(Mac OS) 303 how to use 188, 189
Ignored By Make flag Symbolics pop-up menu 175
of Flags pop-up menu 354 In Symbolics tab, of Find In Files window 172, 187
Implements List section inactive
of Java Bean wizard 545 breakpoints 438
of New Event Set wizard 612 include file 35
Import button 320 Include File Automatically Added For Member
Import Components button 568 Type field
Import Components menu command 674 of New Data Member wizard 243
Import From File button, of Custom Keywords Include File Cache field
dialog box 287 of Build Settings preference panel 259
Import Panel button 256, 334 #include files 234
Import Project menu command 104, 674 caching 259
Import Weak command 408 Include Files Automatically Added For Return
Importable XML option (Mac OS) 104 Type And Parameters field
IDE–748 IDE User Guide
Index
of New Member Function wizard 239 in Access Paths settings panel (Mac OS) 341
Include Files section, of New Class wizard 234 interpretation
Include Files That Will Automatically Be Added of expressions 494
For Base Classes field Intersolv
of New Class wizard 234 PVCS plug-in 618
indenting introduction to IDE 17
lines of text automatically 282 IP 301, 304
Index menu command 674 .iSYM 427
infinite loops
escaping from (Mac OS) 461 J
Info menu 635 Java
About Metrowerks CodeWarrior AWT RAD components 585–586
command 635 Swing RAD components 586–588
Copy Files command 635
Java Applet wizard 530
File Systems command 635
absbottom option 534
Keyboard Preferences command 635
absmiddle option 534
information Add button 536
examining in a project 100–102
Align pop-up menu 534
Information section, of Java Applet wizard 536, Applet Class section 530
541 Applet Name field 533
inheritance Applet Parameters section 534
analyzing in browser 249 Applet Title field 537
Inherited access icon 220 Base Class pop-up menu 532
Initialize Before command 408 baseline option 534
Initializer field bottom option 534
of New Data Member wizard 241 Can Run As A Standalone Application
Initializer field, in New Property dialog box 602 checkbox 532
Inline checkbox Class Name field 531
of New Member Function wizard 238 Codebase/Archive field 533
input files Default applet parameter 535
creation of 34 Description applet parameter 535
Insert Information In Every File checkbox Description field 537
of Java Applet wizard 537 Generate HTML Page checkbox 532
of Java Application wizard 542 Generate Standard Methods checkbox 532
Height field 534
Insert Reference Template menu command 674
HSpace field 534
Insert Template Commands checkbox
HTML Page section 532
of Editor Settings preference panel 278
Information section 536, 541
Insert Template contextual menu command 278 Insert Information in Every File checkbox 537
Inside option, of New Event Set wizard 610 left option 534
installation Location field 531
of CodeWarrior IDE 33 middle option 534
Instruction Scheduling 365 Name applet parameter 535
Integrated Development Environment 17 Package Name field 531
interface file 35 Remove button 536
Interface pop-up menu 51, 88, 114, 140 right option 534
Internet Protocol. See IP. texttop option 534
Interpret DOS And Unix paths checkbox Title field 533
IDE User Guide IDE–749
Index
top option 534 Java Exceptions submenu 696
Type applet parameter 535 All Exceptions command 696
Use Archive (JAR) field 533 Exceptions In Targeted Classes command 696
Variable applet parameter 535 Uncaught Exceptions Only command 696
VSpace field 534 Java Frame wizard 561
Width field 534 Base Class pop-up menu 562
Java Applet Wizard, of New window 526 Class Name field 561
Java applets Frame Class section 561
describing class of 530 Location field 562
Java Application wizard 537 Package Name field 562
Application Class section 538 Java frames
Application Title field 541 describing class of 561
Base Class pop-up menu 541 Java Settings preference panel 300
Class Name field 539, 540 Class For Debugging field (Windows) 300
Create A Frame On Startup checkbox 539 JView Arguments field (Windows) 300
Description field 542 Program Arguments field (Windows) 300
Frame Class section 539 JButton component 587
Insert Information in Every File checkbox 542 JCheckBox component 587
Location field 539, 540 JComboBox component 587
Package Name field 539, 540 JDK Version pop-up menu
Java Application Wizard, of New window 526 of Java Debugging preference panel 302
Java applications JEditorPane component 587
describing class of 538 JLabel component 587
Java Bean wizard 542 JList component 587
Access pop-up menu 544 JMenuBar component 587
Base Class and Interfaces section 544
JOptionPane component 587
Base Class section 544
JPanel component 587
Choose button 544
Class Is A Bean checkbox 543 JPasswordField component 587
Class Name field 543 JPopupMenu component 587
File field 543 JProgressBar component 587
Implements List section 545 JRadioButton component 587
Modifiers section 544 JScrollBar component 588
Name and Location section 542 JScrollPane component 588
New File option 543 JSlider component 588
Non-Visual Bean/Custom option 544 JSplitPane component 588
Package field 544 JTabbedPane component 588
Specifier pop-up menu 544 JTable component 588
Visual Bean option 544
JTextArea component 588
Java Bean Wizard, of New window 526
JTextField component 588
Java Debugging preference panel 300
JTextPane component 588
1.1.X Wire Protocol option 302
JToggleButton component 588
JDK Version pop-up menu 302
Port ID field 301 JToolBar component 588
Protocol pop-up menu 301 JTree component 588
Remote Debugging checkbox 301 jumping to
Remote IP Address field 301 markers 159
Timeout field 300 JView Arguments field
IDE–750 IDE User Guide
Index
of Java Settings preference panel L
(Windows) 300
Label (VCS operation) 624
Label component
K components
K&R coding Label 586
relaxing C popup parsing 279 Launch Editor field
Keep Program In Background While Stepping of IDE Extras preference panel 262
checkbox Launch Editor W/ Line # field
of MetroNub Settings preference panel 303 of IDE Extras preference panel 262
key binding, defined 314 Launch Remote Host Application checkbox
key bindings 150, 152 of Remote Debugging settings panel 373
adding 317 Launchable flag
customizing 314 of Flags pop-up menu 354
deleting 318 launching debugger 451
exporting 319 problems 507
importing 320 layout
modifying 316 of Macintosh menu commands 634
removing 318 of menu commands 259
restrictions in choosing 315 of Windows menu commands 634
Key Bindings section Layout editor 525, 553, 553–560
of Customize IDE Commands window 310
Layout editor contextual menu 559
keyboard conventions 25
Layout Editor preference panel 305, 306
keyboard navigation 150
Layout menu 650
Keyboard Preferences menu command 675 Align command 650
keyboard shortcuts Customize command 651
adding 317 Display Grid command 650
deleting 318 Group command 650
modifying 316 Properties command 651
removing 318 Resize command 650
restrictions 315 Snap To Grid command 650
keys Ungroup command 650
prefix key timeout 323 layout wizards 560–562
prefix keys 320 Java Frame Wizard 554
Quote Key prefix 321 layouts
keywords and use with Live view 571
coloring 284 creating 553
Kill command 462 creating objects 556
in debugger toolbar 417 limitations of 554
Kill command (debugger) 456 manipulating RAD objects 556
Kill menu command 675 modifying 554
killing removing objects 557
execution of code 462 working with 549–551
killing execution 462 Left Edges command in Align submenu 697
compared to stopping 462 left margin
Kind attribute clicking to select a line 280
in Project Inspector 101 Left Margin Click Selects Line checkbox
of Editor Settings preference panel 280
IDE User Guide IDE–751
Index
left option, of Java Applet wizard 534 of Java Applet wizard 531
Level pop-up menu of Java Application wizard 539, 540
of Plugin Diagnostics section 265 of Java Frame wizard 562
libraries Location Of Relocated Libraries And Code
dynamic library 35 Resources field 369
static library 35 Location text field, of File panel 576
library file 35 Location text field, of Project panel 527, 546
Lifetime Based Register Allocation 365 Lock command 574
lifetime based register allocation 512 Lock item
limitations in Component Information Bar 572
on choosing key bindings 315 Log All Statements Bypassed checkbox 67
on number of build targets in projects 92 Log Build Rules Discarded checkbox 67
line Log DebugStr Messages checkbox
selection of 151 of MetroNub Settings preference panel
Line And Column indicator 144 (Mac OS) 303
Line button in hierarchy window 222 Log System Messages checkbox
%line command-line string 262 of Debugger Settings panel 371
line number, going to 161 Log Targets Bypassed checkbox 67
linear code navigation 463 Log window 445
linear navigation through code 463 logical expressions 500
Link Order view 45 Loop Transformations 364
of Project window 53 Loop Unrolling 365
link order, setting 379 Loop Unrolling (Opt For Speed Only) 365
linker 36 Loop-Invariant Code Motion 364
Linker pop-up menu loops and conditional breakpoints 473
in Target Settings panel 337 loops, infinite
linker, shared libraries 407 escaping from (Mac OS) 461
Linking 375–406 lvalue
linking defined 449
projects 377–387
linking code 39 M
Linux Mac OS 32
system requirements 33 system requirements 32
List button, in browser 218 Mac OS 8.5 53
List component 586 Macintosh menu command layout 634
List view Macintosh option
contrasted with Live view 570 in Default File Format pop-up menu 281
List View button 569 in Document Settings pop-up menu 143
Live Range Splitting 364 Macintosh Programmer’s Toolbox Assistant 264
Live view macros
and use with RAD layouts 571 auto-completion of names 247
contrasted with List view 570 MacsBug Handles Traps option
Live View button 570 of MetroNub Settings preference panel
Local Path (VCS option) 621 (Mac OS) 303
local variables 489 Mainsoft
viewing in debugger 481 SourceSafe plug-in 618
Location field
IDE–752 IDE User Guide
Index
Maintain Files In Cache For field changing 450
of Global Settings preference panel 294 viewing memory at an address 490
Make command 380, 386, 389 viewing raw memory 490
Make menu command 186, 257, 414, 675 memory dump 448, 482, 695
Makefile Importer 55, 64–67 Memory window 448
Makefile Importer wizard and memory dump 482
Cancel button 65 changing base address 449
Finish button 65 changing contents of 450
Generate button 65 memory window 448
options 65 Menu Bar Layout pop-up menu
Makefile Location option 65 of IDE Extras preference panel 259
makefiles menu comands
converting to projects 64–67 Find In Previous File 671
creating new projects from 64 menu command
managing Compile 662
files in a project 72–89 menu commands
manipulating About Metrowerks CodeWarrior 656
objects in RAD layouts 556 Add Files 76, 656
manual style 23 Add Window 82, 83, 656
manuals Align 656, 697
platform targets 29 Anchor Floating Toolbar 330
QuickStart and tutorials 29 Apply Difference 133, 657
.MAP extension 384 Balance 657
Break 657
Mapping Info section
Break On C++ Exception 657
of File Mappings settings panel 351
Break On Java Exceptions 657, 696
margins
Breakpoints 438, 471, 472, 496, 657
clicking to select a line 280
Breakpoints Window 438, 471, 496, 658
mark project for re-compilation, how to 386 Bring Up To Date 257, 658
Marker pop-up menu 142 Browser Contents 213, 658
marker, Debug Info 106 Build Progress Window 658
markers Cascade 658
adding 156 Change Program Counter 460, 658
Dirty File 143 Check Syntax 659
jumping to 159 Class Browser 659
removing 158 Class Hierarchy 659
Match Whole Word checkbox 171 Class Hierarchy Window 659
.mcp extension 58, 527 Clear 85, 437, 440, 478, 557, 660
MDI 291 Clear All Breakpoints 660
MDI. See Multiple Document Interface. 263 Clear All Watchpoints 479
meaning of > in documentation 24 Clear Breakpoint 660
Member Function Declaration section, of New Clear Floating Toolbar 329
Member Function wizard 237 Clear Main Toolbar 329
Clear Watchpoint 440, 478, 660
member functions
Clear Window Toolbar 329
specifying file locations for 238, 242
Close 71, 660
viewing in browser 216
Close All 661
Member Functions pane, in browser 220
Close All Editor Documents 661
memory Close All Variable Windows 438
IDE User Guide IDE–753
Index
Close Catalog 661 Find In Files 169, 670
CodeWarrior Help 661 Find In Next File 184, 187, 189, 191, 670
Collapse Window 661 Find In Previous File 184, 187, 189, 191
Commands & Key Bindings 306, 661 Find Next 178, 194, 195, 671
Compare Files 662 Find Previous 179, 194, 195, 671
Compile 257 Find Previous Selection 671
Component Catalog 662 Find Reference 672
Component Palette 662 Find Selection 193, 195, 672
Connect 662 Global Variables Window 481, 672
Copy 181, 446, 662 Glossary 672
Copy Files 663 Go Back 673
Copy To Expression 436, 489, 663 Go Forward 673
Create Group 84, 663 Go To Line 673
Create Overlay 663 Group 673
Create Segment 663 Hide Breakpoints 673
Create Segment/Overlay 663 Hide Window Toolbar 418
Create Target 93, 663 How To 673
creating 311 Import Components 674
creating groups for 311 Import Project 104, 674
Customize 664 Index 674
customizing 310, 313 Insert Reference Template 674
Cut 664 Keyboard Preferences 675
Debug 348, 381, 383, 451, 664 Kill 675
Delete 85, 436, 440, 478, 557, 664 layout of 259
deleting 313 Macintosh layout 634
Disable Breakpoint 665 Make 186, 257, 414, 675
Disable Debugger 381, 665 Metrowerks Website 675
Disable Watchpoint 479, 665 New 56, 57, 63, 64, 676
Disassemble 257, 665 New Class 676
Display Grid 665 New Class Browser 676
Enable Breakpoint 666 New Data Member 676
Enable Debugger 104, 381, 411, 414, 451, 507, New Event 676
508, 666 New Event Set 677
Enable Watchpoint 479, 666 New Expression 489, 495, 677
Enter Find String 194, 667 New Member Function 677
Enter Replace String 667 New Property 677
Errors And Warnings 667 New Text File 137, 677
Errors And Warnings Window 667 Object Inspector 678
Exit 667 Online Manuals 678
Expand Window 668 Open 68, 678
Export Project 104, 668 Open Recent 678
Expressions 436, 489, 494, 668 Open Scripts Folder 678
Expressions Window 436, 489, 495, 668 organization of 259
Find 168, 178, 180, 668 Page Setup 126, 680
Find and Open ‘Filename’ 669 Paste 679
Find and Open File 669 Precompile 257, 679
Find And Replace 168, 179, 669 Preferences 253, 679
Find Definition 669 Preprocess 257, 679
Find Definition & Reference 670 Print 679
IDE–754 IDE User Guide
Index
Processes 432, 680 Synchronize Modification Dates 88, 689
Processes Window 432, 680 Target Settings 95, 331, 415, 690
Project Inspector 99, 100 Tile Editor Windows 690
Properties 680 Tile Editor Windows Vertically 690
Quit 680 Tile Horizontally 690
Redo 681 Tile Vertically 690
Registers Windows 682 to remove files and groups 85
Remove Object Code 384, 386, 507, 682 Toolbar 691, 698
Replace 682, 683 Toolbars 691, 698
Replace All 181, 683 ToolServer Worksheet 691
Replace and Find Next 682 Unanchor Floating Toolbar 330
Replace And Find Previous 683 Unapply Difference 133, 691
Re-search For Files 681 Undo 691
Reset Floating Toolbar 330 Ungroup 692
Reset Main Toolbar 330 Version Control Settings 692
Reset Project Entry Paths 684 View Array 692
Reset Window Toolbar 330 View As 486, 692
Resize 684, 697 View As Binary 693
Restart 684 View As C String 693
Resume 684 View As Character 693
Revert 684 View As Default 693
Run 257, 349, 381, 382, 684 View As Enumeration 693
Run To Cursor 470, 685 View As Fixed 693
Save 685 View As Floating Point 694
Save A Copy As 62, 70, 685 View As Fract 694
Save All 685 View As Hexadecimal 694
Save As 446, 686 View As Pascal String 694
Save Default Window 251, 686 View As Signed Decimal 694
Search 686 View As Unicode String 694
Select All 686 View As Unsigned Decimal 695
Set Breakpoint 468, 686 View Memory 448, 490, 497, 695
Set Default Project 686 View Memory As 449, 490, 695
Set Default Target 96, 687 View Variable 482, 695
Set Watchpoint 477, 687 Watchpoints 439, 479, 695
Set/Clear Breakpoint 468, 687 Watchpoints Window 439, 479, 696
Shift Left 687 Windows layout 634
Shift Right 687 Zoom Window 696
Show Breakpoints 687 Menu editor 589
Show Types 483, 514, 688 creating menu items 590
Show Window Toolbar 418 modifying menu items 591
Snap To Grid 688 removing menu items 592
Stack Editor Windows 688 menu reference
Step Into 688 for IDE 633–701
Step Out 688 MenuBar component 586
Step Over 688 menus
Stop 462, 689 Browser 278
Stop Build 689 creating with Menu editor 590
Switch To Monitor 689 Debug 279
Symbolics Window 427, 689 Document Settings pop-up 142
IDE User Guide IDE–755
Index
Edit 278 SourceSafe plug-in 618
Function pop-up 141 Metrowerks Tool Set pop-up menu 66
Interface pop-up 140 Metrowerks Website menu command 675
layouts 259 MFC
Marker pop-up 142 seeing classes in browser 250
modifying with Menu editor 591 Microsoft
Project 279 SourceSafe plug-in 618
removing with Menu editor 592 Microsoft Windows 32
VCS 279
middle option, of Java Applet wizard 534
VCS pop-up 143
Minimize Non-Debugging Windows radio button
Window 194
of Windowing preference panel
Merge Into Output command 408
(Windows) 291
Merge shared libraries option 408
mixed, viewing code as 422
Message List Pane 397
.mkb extension 320
Message Window
modification dates
command 667
in debugger 294
correcting compiler errors 400
synchronizing 88, 384
error and warning messages 398
stepping through messages 400 Modification dates, synchronizing 88
using 398–406 Modified item
in Component Information Bar 572
messages
stepping through 400 Modifiers section
of Java Bean wizard 544
Method option 621
of New Data Member wizard 241
methods
of New Event dialog box 615
alphabetizing C++ and Object Pascal
of New Event Set wizard 611
methods 429
of New Member Function wizard 238
methods (C++) of New Method dialog box 604
alphabetizing 290
modifying
Methods tab view, in browser (RAD) 598 environment variables 350
MetroNub Settings panel existing commands 309
Remote IP/ key bindings 316
Port field (Mac OS) 304 keyboard shortcuts 316
MetroNub Settings preference panel 302 layouts 554
Always Use File Mapping For Symbolics menu items in Menu editor 591
checkbox (Mac OS) 303 projects 60
Debugger Trap Settings (Mac OS) 303 shielded folders 268
Ignore Traps option (Mac OS) 303 Monitor For Debugging pop-up menu
Keep Program In Background While Stepping of Windowing preference panel (Mac OS) 293
checkbox 303 monitors
Log DebugStr Messages checkbox debugging on multiple 293
(Mac OS) 303
Move Open Windows To Debugging Monitor
MacsBug Handles Traps option (Mac OS) 303
When Debugging Starts checkbox
PowerPC trap handling 303
of Windowing preference panel (Mac OS) 293
Remote Debugging checkbox (Mac OS) 303
moving
Stop For Traps option (Mac OS) 303
files and groups 83
Metrowerks
projects 103
CVS plug-in 618
MPTA. See Macintosh Programmer’s Toolbox
Projector plug-in 618
Assistant 264
IDE–756 IDE User Guide
Index
MPW 125 Namespaces Required For Base Classes And
multi-class hierarchy, browser 222–224 Constructor Parameters field, of New Class
multi-file search options 172 wizard 234
multiple data types 489 Namespaces Required For Parameters field
Multiple Document Interface 263 of New Member Function wizard 238
multiple IDE 1.7 projects Namespaces Required For Type field
converting to latest IDE version 716 of New Data Member wizard 240
multiple RAD objects, selecting 556 naming
multiple Redo 681 projects 57
multiple Undo 681 Native checkbox, of New Method dialog box 605
multiple-monitor debugging 293 navigating
bookmarks 160
Mutable option, of Specifier pop-up menu 241
code 462
MW Visual SourceSafe 653
Project window 45
through code in the browser 245
N navigating code
n/a in Code column 47 by call chain 463
n/a in Data column 48 in browser window 464
Name and Location section linear 463
of Java Bean wizard 542 using a contextual menu 245
of New Event Set wizard 608 using the Go Back and Go Forward
Name and Location section, of New Class commands 245
wizard 230 navigation
Name applet parameter, of Java Applet basic concepts 149
wizard 535 using hypertext 24
Name attribute via scrollbars 150
in Project Inspector 101 via the keyboard 150
Name column navigation through code
in Remote Connections preference panel 297 linear 463
in Source Trees preference panel 270 via routine call chain 463
in Source Trees settings panel 356 via Symbolics window 464
Name field with the Files pane 465
in Source Trees preference panel 271 Never option, in Build Before Running pop-up
in Source Trees settings panel 356 menu
of Customize IDE Commands window 310, Build Before Running pop-up menu
311, 312 Never option 257
of New Connection dialog box 297 New Binding button 322
of New Data Member wizard 240 New button
of New Event dialog box 615 of New Class wizard 232
of New Member Function wizard 238 of New Member Function wizard 239
of New Method dialog box 603, 605 New Catalog button 568
of New Property dialog box 600, 602 New Class Browser menu command 676
of Source Trees preference panel 271, 275 New Class command 228
of Source Trees settings panel 356 New Class menu command 676
Name item New Class wizard 230
in Component Information Bar 572 Access pop-up menu 234
Namespace field Add Files To Targets list 236
of New Class wizard 232 Additional Header Include Files 234
IDE User Guide IDE–757
Index
After option 232 Name field 240
Base Classes and Methods section 233 Namespaces Required For Type field 240
Base Classes field 233 Type field 240
Before option 232 Volatile checkbox 241
Class field 231 New Event command 613
Class Name field 230 New Event dialog box
Constructor Parameters field 234 Add button 615
Declaration File field 230 Cancel button 615
Existing button 232 Declaration section 615
Generate Constructors and Destructors dialog boxes
checkbox 234 New Event 613
Include Files section 234 Modifiers section 615
Include Files That Will Automatically Be Name field 615
Added For Base Classes field 234 Optional Throws field 615
Name and Location section 230 Package Required For Parameters field 615
Namespace field 232 Parameters field 615
Namespaces Required For Base Classes And Synchronized checkbox 615
Constructor Parameters field 234 New Event menu command 676
New button 232 New Event Set command 605
New File option 231 New Event Set dialog box
Project field 235 dialog boxes
Relative To Class option 231 New Event Set 605
Targets section 235 Existing Custom Set option 606
Use separate file for member definitions New Custom Event Set option 606
checkbox 232
New Event Set menu command 677
Virtual destructor checkbox 234
New Event Set wizard 607
New command 525, 546, 554, 575
Access pop-up menu 611
New Command button 311 Add File To Targets list 612
New Connection dialog box 297 After option 610
Browse In Process Window checkbox 297 Base Class and Interfaces section 611
Connection Type pop-up menu 298 Base Class section 612
Debugger pop-up menu 297 Before option 610
Name field 297 Class field 610
New Custom Event Set option, in New Event Set Class Is A Bean checkbox 608
dialog box 606 Class Name field 608
New Data Member command Custom option 612
commands File field 608
New Data Member 229 Implements List section 612
New Data Member menu command 676 Inside option 610
New Data Member wizard 240 Modifiers section 611
Additional Header Include Files 243 Name and Location section 608
Const checkbox 241 New File option 609
Data Member Declaration section 240 Package field 610
Declaration field 243 Relative To Class option 610
Definition field 243 Set button 231, 609, 610
Include File Automatically Added For Specifier pop-up menu 611
Member Type field 243 Targets section 612
Initializer field 241 Visual Component option 612
Modifiers section 241 New Expression menu command 489, 495, 677
IDE–758 IDE User Guide
Index
New File option Add button 602
of Java Bean wizard 543 dialog boxes
of New Class wizard 231 New Property 600
of New Event Set wizard 609 Has Data Member section 602
New File Set option, in File Set pop-up menu 176 Initializer field 602
New Folder button 568 Name field 600, 602
New Folder command 574 Package Required For Type field 602
New Group button 311 Summary section 602
Transient checkbox 602
New Member Function command 229
Type field 601, 602
New Member Function menu command 677
Volatile checkbox 602
New Member Function wizard 236
New Property menu command 677
Additional Header Include Files 240
New Text File command 388, 391, 392
Const checkbox 238
Declaration field 238 New Text File menu command 137, 677
Definition field 239 New window 56
Existing button 239 Add Design To Project checkbox of Project
File Locations section 238, 242 panel 546
Include Files Automatically Added For Return Component Catalog File option 575
Type And Parameters field 239 Design Name text field of Project panel 546
Inline checkbox 238 Design pop-up menu 554
Member Function Declaration section 237 Empty Project option 57
Modifiers section 238 File Name text field in File panel 575
Name field 238 File tab 575
Namespaces Required For Parameters Java Applet Wizard 526
field 238 Java Application Wizard 526
New button 239 Java Bean Wizard 526
Parameters field 238 Location text field of File panel 576
Return Type field 238 Location text field of Project panel 527, 546
New menu command 56, 57, 63, 64, 676 Object tab 554
Project Name text field in Project panel 526
New Method command 602
Project pop-up menu 554
New Method dialog box
Project Stationery options 56
Add button 605
Project tab 57, 525, 546
Cancel button 605
Set button 58, 527, 576
Declaration section 605
Next button
dialog boxes
of Browser wizards 229
New Method 602
of RAD wizards 529, 561, 607
Modifiers section 604
Name field 603, 605 no debug info marker, meaning of 106
Native checkbox 605 non-debugging windows, defined 291
Optional Throws field 603 None option
Package Required For Parameters field 603 in Host Flags pop-up menu 342
Parameters field 603 of Plugin Diagnostics 265
Return Type field 603 None option, of Specifier pop-up menu 238, 241,
Synchronized checkbox 605 544, 605, 611
New Project dialog box 58 Non-Visual Bean/Custom option, of Java Bean
New Property command 600 wizard 544
New Property dialog box note conventions 23
Accessors section 602 notes
IDE User Guide IDE–759
Index
for the latest release 22 Open Editor Files option, in File Set pop-up
notification of completed build 386 menu 176
nub Open Editor Files option, in Symbolics pop-up
defined 297, 302 menu 189
number, going to line 161 Open File icon, in browser 221
Numeric Keypad Bindings checkbox Open In Windows Explorer command 47
of Customize IDE Commands window 316, Open menu command 68, 678
317, 322 Open Recent command 68, 259, 260
Open Recent menu command 678
O Open Scripts Folder menu command 678
object code 36 Open Windows On Debugging Monitor During
how to remove 384 Debugging checkbox
removing 384 of Windowing preference panel (Mac OS) 293
Object Inspector 578–583 opening
contextual menu 582 existing projects 67–69
Events tab 581 project files from other hosts 69
navigating properties with the keyboard related files 160
(Windows) 580 source files with the browser 248
Object pop-up menu 578 Opening a Related File 117
Properties tab 579 Opening Files from the File Menu 110
Object Inspector command 578 Opening Files from the Project Window 113
Object Inspector menu command 678 Optimization Level Slider
Object Master 88 of Global Optimizations settings panel 362
Object Pascal optimizations
methods, alphabetizing 429 Arithmetic Optimizations 363
Object pop-up menu Branch Optimizations 363
and keyboard navigation (Windows) 578 Common Subexpression Elimination 363
in Object Inspector 578 Copy And Expression Propagation 363
Object tab, of New window 554 Copy Propagation 363
objects Dead Code Elimination 363
creating in RAD layouts 556 Dead Store Elimination 364
manipulating in RAD layouts 556 Expression Simplification 363
removing from RAD layouts 557 Global Register Allocation 363
Global Register Allocation Only For
odoc AppleEvent 262
Temporary Values 363
of IDE Extras preference panel 654
Instruction Scheduling 365
OK button 256, 334, 345 Lifetime Based Register Allocation 365
online documentation viewers 29 Live Range Splitting 364
online help and references 162 Loop Transformations 364
Online Manuals menu command 678 Loop Unrolling 365
online references Loop Unrolling (Opt For Speed Only) 365
QuickHelp (Mac OS) 164 Loop-Invariant Code Motion 364
QuickView (Mac OS) 165 Peephole Optimization 363
THINK Reference (Mac OS) 165 Repeated 365
WinHelp (Windows) 164 Strength Reduction 364
Open Catalog button 564, 568 Vectorization 365
Open command 68 Optimize For section
of Global Optimizations settings panel 362
IDE–760 IDE User Guide
Index
optimizing code System Paths 342
and impact on breakpoints 474 System paths 341
Optional Throws field Target settings 336
of New Event dialog box 615 target settings 335–373
Optional Throws field, of New Method dialog toolbars 323
box 603 User paths 341
options user paths 342
Access paths 339 using modification date caching 346
activating the browser 347 organization
Add default access path 342 of menu commands 259
adding access paths 343 Other Executables settings panel 366
advanced compile options 386 Add button 367
Auto-target libraries 370 Change button 369
Build Extras 346 Debug column 366
build settings 257 Executable Files list 366
caching subprojects 347 File column 366
Caching symbolics between runs 371 Remove button 369
changing access paths 345 Other Settings
choosing host application for non- of Editor Settings preference panel 279
executables 348 Output Directory field
commands 307 in Target Settings panel 338
Custom keywords 365 output file 36, 43
Debugger settings 369 Overlays tab 663
editor settings 277 Overlays view 44
file mappings 350, 351
finding and replacing text 169
fonts and tabs 281, 282
P
general runtime settings (Windows) 349 Package field
Global optimizations 361 of Java Bean wizard 544
global source trees 269 of New Event Set wizard 610
Host flags for access paths 342 Package Name field
IDE extras 259 of Java Applet wizard 531
importing and exporting custom keyword of Java Application wizard 539, 540
sets 286 of Java Frame wizard 562
key bindings 314 Package Required For Parameters field
Log system messages 371 of New Event dialog box 615
multi-file search 172 Package Required For Parameters field, of New
Other executables 366 Method dialog box 603
Plugin Settings 264 Package Required For Type field, of New Property
preferences 256–306 dialog box 602
project-specific source trees 355 Page Down key 45
removing access paths 346 Page Setup command 680
replacing and finding text 169 Page Setup menu command 126
runtime environment settings (Windows) 349
Page Up key 45
Runtime settings 348
search across multiple files 172 PalmQuest reference 264
search, general 170 pane
setting in browser 244 active 417
shielded folders 266 focused 417
IDE User Guide IDE–761
Index
selecting items in 417, 427 Plugin Diagnostics
Pane Resize Bar 397 All Info option 265
Pane Resize boxes 148 Errors Only option 265
Pane Splitter controls 144, 148 Level pop-up menu 265
pane zoom box, of Browser window 217 None option 265
of Plugin Settings preference panel 265
Panel component 586
Plugin Settings preference panel 264
panels
Disable Third Party Plugins 266
for IDE preferences 254
Plugin Diagnostics 265
for target settings 332
pointer types
panes
viewing 486
creating 148
removing 148 Pop-up Menu editor 593
resizing 148, 417, 427 pop-up menus
Panes, in editor window 147–148 Current Target 96
Document Settings 142
Parameters field
Function 141, 427
of New Event dialog box 615
Interface 140
of New Member Function wizard 238
Marker 142
Parameters field, of New Method dialog box 603
Path (Mac OS) 145
parsing sorting functions in 280
K&R-styled C code 279 Source 422, 427
Pascal VCS 143
correcting circular references 404 PopupMenu component 586
Pascal string Port ID field
entering data as 487 of Java Debugging preference panel 301
viewing data as 485 of x86 Settings preference panel (Mac OS) 304
Pascal, spurious C code in 516 Post-Linker pop-up menu
Password field 621 in Target Settings panel 338
Paste command 152 PowerPC 32, 408
Paste menu command 679 PowerPC trap handling
menu commands in MetroNub Settings preference panel 303
Paste 181 PowerPlant
Path column seeing classes in browser 250
in Source Trees preference panel 270 #pragma, adding markers by using 157
Path pop-up menu (Mac OS) 145 Precompile command 387, 389, 390, 392, 393
Peephole Optimization 363 Precompile menu command 257, 679
PEF container 408 precompile_target 389
Perforce Precompiled flag
Perforce plug-in 618 of Flags pop-up menu 354
Perforce VCS plugin 618 precompiled headers
platform target automatic updating of 389
defined 20 caching 259
platform targets 37 creating 388
documentation 29 precompiling 387–393
Play Sound After ‘Bring Up To Date’ & ‘Make’ preference panels 254
checkbox, of Build Settings preference panel 258 Build Settings 257
plug-in Display Settings 288, 305
defined 19
IDE–762 IDE User Guide
Index
Editor Settings in IDE Preferences Hide non-debugging windows 292
window 277 IDE extras 259
Font & Tabs 281, 282 importing and exporting custom keyword
Global Settings 293 sets 286
IDE Extras 259 importing and exporting in XML 256
Java Debugging 300 Include file cache 259
Java Settings 300 Inserting template commands in contextual
MetroNub Settings 302 menus 278
Plugin Settings 264 Java debugging 300
Remote Connections 296 Java settings for debugger 300
Shielded Folders in IDE Preferences key bindings 314
window 266 Left margin click selects line 280
Source Trees in IDE Preferences window 269 Menu Bar Layout 259
Windowing 291 MetroNub settings 302
x86 Settings 304 MetroNub symbolics settings (Mac OS) 303
preferences 253–256 Minimize non-debugging windows 291
Auto indent 282 Monitor for debugging (Mac OS) 293
Auto target libraries 295 plugin diagnostics 265
Balance Flash Delay 280 project commands in contextual menus 279
Balance while typing 279 Recent Documents 260
browser commands in contextual menus 278 Recent Projects 259
Build before running 257 remembering for fonts 277
Cache edited files between debug sessions 294 Remote connections for debugger 296
changing syntax highlighting colors 283, 288 Save open files before build 257
choosing 256–306 Select stack crawl window when task is
Close non-debugging windows 292 stopped 295
Collapse non-debugging windows 292 selection position 277
commands 307 setting Java class for debugging
Compiler thread stack 258 (Windows) 300
Context popup delay 260 setting Java program arguments
controlling syntax highlighting within a (Windows) 300
window 284 setting JDK version for remote Java
debugger commands in contextual menus 279 debugging 302
Default Size For Unbounded Arrays 290 setting JView arguments (Windows) 300
Disable third-party COM plugins 266 setting port ID for remote debugging
Display Settings 288, 305 (Mac OS) 304
Do nothing to non-debugging windows 291 setting port ID for remote Java debugging 301
Do nothing to project windows 293 setting protocol for remote Java
Don’t step into runtime support code 295 debugging 301
edit commands in contextual menus 278 setting remote IP address for debugging
Editor Settings 277 (Mac OS) 304
Enable automatic toolbar help 264 setting remote IP address for Java
Enable virtual space 280 debugging 301
enabling remote Java debugging 301 setting timeout for Java debugging 300
Find Reference Using 264 setting up remote debugging (Mac OS) 304
fonts and tabs 281, 282 Shielded Folders 266
for background color 283 Show all locals 289
for foreground color 283 Show message after building up-to-date
global settings for debugger 293 project 257
IDE User Guide IDE–763
Index
Show tasks in separate windows 290 window 126
Show values as decimal instead of hex 289 with syntax coloring 127
Show variable types 288 Private option, of Access pop-up menu 238, 241,
show variable types by default 484 604, 611
Show variable values in source code 290 problems
Sort function popup 280 viewing routine names 280
Sort functions by method name in Process pane 434
browser 289, 429 Processes menu command 432, 680
Source Trees 269 Processes window 432
Tab indents selection 282
Processes Window menu command 432, 680
Tab inserts spaces 282
Processes window toolbar 433
Tab size 282
toolbars 323 processor registers
Use BBEdit™ Extensions (Mac OS) 264 viewing 492
Use External Editor 261 Program Arguments field
Use Multiple Document Interface 263 of Java Settings preference panel
Use Script Menu 261 (Windows) 300
Use ToolServer Menu 263 of Runtime Settings panel (Windows) 349
using color for custom keywords 284 program counter. See current-statement arrow.
Variable Change Hilite 288 Program window. See Thread window. 416
VCS commands in contextual menus 279 programming concepts 33–37
Watchpoint Hilite 288 project
Windowing 291 defined 19
windows marking for re-compilation 386
remembering position and size 278 Project (VCS operation) 623
x86 settings 304 Project attribute
Zoom windows to full screen 261 in Project Inspector 101
Preferences menu command 253, 679 Project Checkout Status icon 52
Prefix Key Timeout field Project Commands checkbox
of Customize IDE Commands window 323 of Editor Settings preference panel 279
prefix keys 320 project data folder 63, 257
Quote Key 321 Project field
timeout of 323 of New Class wizard 235
Pre-Linker pop-up menu project file 35
in Target Settings panel 338 Project File Proxy icon 52
Preparing 411 Project Headers checkbox, of Find In Files
preparing window 174
for debugging 411–414 project headers, defined 174
Preprocess command 394 Project Information Caption 396
Preprocess menu command 257, 679 Project Inspector 98, 407
preprocessing code 394 Access Path attribute 101
preprocessor 394 Code Size attribute 101
preprocessor symbols Data Size attribute 101
adding to projects 107 Debug Info attribute 102
Print command 679 Full Path attribute 101
Print Selection Only 126 Kind attribute 101
Print using Syntax Highlighting option 127 Name attribute 101
printing Project attribute 101
IDE–764 IDE User Guide
Index
Project Inspector menu command 99, 100 folder 61
Project menu 279, 642 project stationery file 61
Add Files command 642, 643 Project Stationery options, of New window 56
Add Window command 642, 643 Project tab, in New window 57, 525, 546
Bring Up To Date command 642, 643 Project window 628
Check Syntax command 642, 643 Checkout Status column 52
Compile command 642, 643 Code column 47
Create Group command 642, 643 contextual menu 51
Create Segment/Overlay command 642, 643 Current Target pop-up menu 96
Create Target command 642, 643 Data column 48
Debug command 643, 644 Debug column 49
Disable Debugger command 643, 644 debug column 413
Disassemble command 642, 643 Design tab 548
Enable Debugger command 643, 644 Design view 44, 53
Make command 642, 643 File column 46
Precompile command 642, 643 Files tab 663
Preprocess command 642, 643 Files view 44, 46
Remove Object Code command 642, 644 guided tour 44–54
Re-search For Files command 642, 644 how to move files and groups 83
Reset Project Entry Paths command 642, 644 Interface pop-up menu 51
Resume command 643, 644 Link Order view 45, 53
Run command 643, 644 navigating 45
Set Default Project command 643, 644 Overlays tab 663
Set Default Target command 643, 644 Project Checkout Status icon 52
Stop Build command 642, 643 Segments tab 663
Synchronize Modification Dates sorting items in Files view 49
command 642, 644 Target column 48
Project Name text field, of Project panel 526 Targets tab 663
Project Operations checkbox Targets view 45, 54
of Shielded Folders preference panel 268 toolbar 45
Project Operations column, of Shielded Folders Touch column 49
preference panel 267 Projector VCS plugin 618
Project panel project-related terms
Design Name text field 546 terms related to projects 19
Location text field 527, 546 projects
Project Name text field 526 about 19
Project Panel about project stationery 61
Add Design To Project checkbox 546 activating debugging for 104
Project pop-up menu adding designs 546
All Projects option 174, 185 adding files 75
Project pop-up menu, in New window 554 adding files (Macintosh) 78
Project pop-up menu, of Find In Files window 174 adding files (Solaris) 79
Project Relative Path 344 adding files (Windows) 77
Project Sources checkbox, of Find In Files adding files with drag and drop 80
window 174 adding preprocessor symbols to 107
project stationery 55, 61 backing up 70
automatic setup of 59 building 60, 377–387
creating 62 build-target limitation 92
choosing a default project 71–72
IDE User Guide IDE–765
Index
choosing stationery 56 selecting files 73
closing 71 selecting groups 73
compiling 377–387 setting link order 379
complex project strategy 92 settings 335–373
controlling debugging in 104–106 stationery 38, 55, 60–64
converting from 1.7 IDE 715, 716 stationery folder 61
converting makefiles 64–67 switching between 67
creating 55–60 synchronizing modification dates 88
creating from stationery 57 targets 37
creating groups 84 touching and untouching files 87
creating stationery 62 types 55
creating subprojects within 99 updating 380
debug enabling 381 version control 52
debugging 39, 382 working with complex projects 89–100
debugging setup 104–106 Properties (VCS operation) 624
definition of subproject 90 Properties command 560
embedded debugging start-up process 454 commands
empty project 55 Properties 574
examining information 100–102 Properties menu command 680
expanding and collapsing groups 72 Properties tab
frequently used terms 19 in Object Inspector 579
general debugging start-up process 451
Properties tab view, in browser (RAD) 597
how to create a new build target in 93
Protected option, of Access pop-up menu 238, 241,
how to debug 382
604, 611
how to mark for re-compilation 386
Protocol pop-up menu
how to remove all object code 384
1.1.X Wire Protocol option 302
importing and exporting 103–104
of Java Debugging preference panel 301
items saved with 70
linking 377–387 proxies
making 380 for project files 52
managing files 72–89 Public option, of Access pop-up menu 238, 241,
modifying 60 544, 604, 611
moving 103 punctuation balancing 153
moving files and groups 83 automatic 153
naming 57 Pure Virtual option, of Specifier pop-up menu 238
navigation 45 Purge Cache button
new 56 of Global Settings preference panel 294
New Project dialog box 58 PVCS VCS plugin 618
opening existing 67–69
opening files prior to IDE 1.7 (Mac OS) 717 Q
opening project files from other hosts 69
question mark in variable names 513
opening subprojects 69
project file 35 QuickDraw 293
RAD wizards 55 QuickHelp 264
removing files and groups 85 QuickHelp (Mac OS) 164
renaming groups 86 QuickStart 29
running 382 QuickStart and tutorials 29
saving 70–71 QuickStart resources 29
saving a copy 70 QuickView 264
IDE–766 IDE User Guide
Index
QuickView (Mac OS) 165 modifying object properties 579
Quit menu command 680 Object Inspector 578–583
Quote Key prefix 321 Properties tab view 597
assigning 321 removing layout objects 557
setting base class and interfaces of beans 544
R setting base class and interfaces of custom
event sets 611
RAD setting name and location of beans 542
about 523–524 setting name and location of custom event
adding designs to projects 546 sets 608
additional browser features 595–599 sort order of components 573
additional information for applets 536, 541 sorting components 573
and CodeWarrior architecture 523 specifying an HTML page for applets 532
assigning build targets to custom event wizards 526
sets 612 Java Applet Wizard 546
benefits of 523 Java Application Wizard 546
browser tab control 595 Java Bean Wizard 546
Catalog pane 569 working with designs 545–549
Catalog pop-up menu 564 working with layouts 549–551
catalogs 525
RAD components
class authoring 524
Java AWT 585–586
Component Catalog toolbar 568
Java Swing 586–588
Component Catalog window 567–578
RAD objects
component editors 588–593
examining 557
Component Information Bar 571
selecting multiple 556
component model 524
RAD projects
Component Palette 563–567
creating 525–529
Component Palette toolbar 563
Component pane 569 RAD tools
component tools 564 defined 40
components 524, 585 in CodeWarrior 524–525
Content View buttons 569 RAD Tools Preferences
creating component catalogs 574 of IDE Preferences window 305
creating layout objects 556 RAD wizards 55, 529–545
creating layouts 553 Back button 529, 560, 607
creating parameters for applets 534 Cancel button 529, 561, 607
describing an application’s frame class 539 Finish button 529, 561, 607
describing class of Java applets 530 Generate button 530, 561
describing class of Java applications 538 Java Applet Wizard 526
describing class of Java frames 561 Java Application Wizard 526
design defined 92 Java Bean Wizard 526
Design view 548 Java Frame Wizard 554
dialog boxes for RAD browser 600–616 Next button 529, 561, 607
Events tab view 599 RAM Doubler 477
Layout editor 525, 553, 553–560 Ram Doubler 508
layout wizards 560–562 range of text
manipulating layout objects 556 selection of 151
Methods tab view 598 Rapid Application Development. See RAD.
modifying layouts 554 Rational
modifying object events 581
IDE User Guide IDE–767
Index
ClearCase plug-in 618 CVS 266
raw memory grouping expressions 200
viewing 490 matching any character 199
Recent Projects field matching the beginning or end of a line 202
of IDE Extras preference panel 259, 260 references 203
recompiling 379 remembering sub-expressions 202
recompiling files 379 repeating expressions 199
re-compiling projects 386 simple matching 198
special operators 196
re-compiling projects, how to 386
using the Find string in the Replace string 202
rectangular selection
using to find and replace text 197
of text 151
related files
Recursion (VCS operation) 623
opening 160
recursive search of access paths 339
Relative To Class option, of New Class wizard 231
enabling and disabling 339
Relative To Class option, of New Event Set
re-defined functions
wizard 610
setting breakpoints 473
Relaxed C Popup Parsing checkbox
redo and undo
of Editor Settings preference panel 279
series of actions 279
release notes 22
Redo menu command 681
Remember Password (VCS option) 621
reference information
Remember Password option 621
for IDE menus 633–701
Remember section
refining code 36
of Editor Settings preference panel 277
Register Coloring. See also Lifetime Based Register
remembering
Allocation. 365
insertion point location 277
register coloring. Seelifetime based register
selection position 277
allocation. 512
remote connections
Register Window command 441
adding general 297
register windows 420, 422 changing general 299
registers removing general 299
changing values 440, 441, 443 Remote Connections list 299
in expressions 497 in Remote Connections preference panel 297
viewing 420, 422, 440, 441, 443
Remote Connections preference panel 296
viewing memory pointed to by an address 490
Add button 297
Registers Windows menu command 682 Change button 299
Registry Key option Name column 297
of Source Trees preference panel 271, 274 Remote Connections list 297
of Source Trees settings panel 356 Remove button 299
Registry Key option, in Type pop-up menu 271, Type column 297
274, 356 Remote Debugging checkbox
regular expression of Java Debugging preference panel 301
defined 195 of MetroNub Settings preference panel
Regular Expression checkbox 171 (Mac OS) 303
regular expressions 195 of x86 Settings preference panel (Mac OS) 304
.*[_]Data 266 Remote Debugging settings panel 372
\(.*\) 266 Connection pop-up menu 372
and their use with shielded folders 266 Enable Remote Debugging checkbox 372
choosing one character from many 201
IDE–768 IDE User Guide
Index
Launch Remote Host Application Rename commands 574
checkbox 373 Renaming and saving a file 118
Remote Download Path field 372 reordering
Remote Download Path field expressions 436
in Remote Debugging settings panel 372 Repeated optimizations 365
of Debug Additional Executable dialog replace
box 367 and buttons 176
Remote IP Address field Replace All button 177
of Java Debugging preference panel 301 Replace All menu command 181, 683
of x86 Settings preference panel (Mac OS) 304 replace and find
Remote IP/ text selectively, how to 180
Port field Replace and Find Next menu command 682
of MetroNub Settings preference panel
Replace And Find Previous menu command 683
(Mac OS) 304
Replace button 177
Remove A Set button
Replace field 170
of In Files tab 191
Replace menu command 682, 683
remove all object code, how to 384
replacing
Remove button
all occurrences of specific text
in Access Paths settings panel 346
replacing all occurrences of specific
in Other Executables settings panel 369
text 181
in Remote Connections preference panel 299
of Shielded Folders preference panel 269 replacing and finding
of Source Trees preference panel 276 special characters 181
of Source Trees settings panel 360 text in a single file 177
text in multiple files 182
Remove button, of Java Applet wizard 536
Re-search For Files menu command 681
Remove Object Code dialog box
Compact Targets checkbox 384, 386 Reset Floating Toolbar command in Toolbar
submenu 700
Remove Object Code menu command 384, 386,
507, 682 Reset Floating Toolbar menu command 330
Remove Toolbar Item command 329 Reset Main Toolbar command in Toolbar
submenu 700
removing
all elements from toolbars 329 Reset Main Toolbar menu command 330
binaries 384 Reset Project Entry Paths menu command 684
bookmarks 159 Reset Toolbar command 330
custom keywords 286 Reset Window Toolbar command in Toolbar
elements from toolbars 329 submenu 698
environment variables 350 Reset Window Toolbar menu command 330
files and groups 85 resize bar, in browser 217
key bindings 318 Resize command 560
keyboard shortcuts 318 Resize menu command 684, 697
markers 158 Resize submenu 697
menu items in Menu editor 592 To Largest Height command 698
object code 384 To Largest Width command 698
panes in editor window 148 To Smallest Height command 698
RAD objects in layouts 557 To Smallest Width command 698
shielded folders 269
resizing
rename columns in Component Information Bar 573
groups, how to 86 panes 427
IDE User Guide IDE–769
Index
panes in editor window 148 running debugger
resizing panes 417 problems 509
resource file 34 running debugger. See launching debugger.
Resource File flag Runtime Settings panel 348
in Flags pop-up menu 354 Clear button 349
resources Environment Settings section (Windows) 349
QuickStart and tutorials 29 General Settings section (Windows) 349
Restart menu command 684 Host Application For Libraries And Code
restarting Resources field 348
execution of code 462 Program Arguments field (Windows) 349
restoring Working Directory field (Windows) 349
default toolbars 330
restrictions S
on choosing key bindings 315 Sample field
Resume menu command 684 of Font & Tabs preference panel 282
Return Type field Save A Copy As command 120
of New Member Function wizard 238 Save A Copy As menu command 62, 70, 685
Return Type field, of New Method dialog box 603 Save All menu command 685
revert Save As command 118
to last saved version 155 Save As menu command 446, 686
Revert command 155 Save button 255, 256, 306, 307, 311, 312, 314, 333
Revert menu command 684 Save buttons 334
Revert Panel button 255, 307, 333 Save command 392, 393
revision control 653 Save Default Window menu command 251, 686
revision control systems Save menu command 685
see Version Control System (VCS) 617 Save Open Files Before Build checkbox
Right Edges command in Align submenu 697 of Build Settings preference panel 257
right option, of Java Applet wizard 534 Save Project Entries Using Relative Paths checkbox
Routine Pop-up Menu 156 in Target Settings panel 338
routine pop-Up menu 141 Save This Set button
Routine pop-up menu. See Function pop-up of In Files tab 190
menu 141 saving
Routine pop-up menu. See Function pop-up menu. a copy of a project 70
routines files in various text formats 280
problems viewing names of 280 items saved with projects 70
seeing definitions in browser 248 projects 70–71
stepping into 457 window position and size 278
stepping out of 458 Saving all files 118
Run App/Script field Saving files automatically 118
of Customize IDE Commands window 313 Saving one file 117
Run command 380, 414, 417, 455, 456, 461, 476, 507 Script pop-up menu
in debugger toolbar 417 of Font & Tabs preference panel 282
Run menu command 257, 349, 381, 382, 684 script system
Run To Cursor menu command 470, 685 setting 282
running scripting
code in debugger 455 IDE 40
running code 454 scripts
IDE–770 IDE User Guide
Index
IDE scripting 40 Search Sub-folders checkbox, of Find In Files
(Scripts) folder 654, 678 window 173
Scripts menu 654 searching 193
Scrollbar component 586 for selected text 193
scrollbar navigation 150 for selection 194
ScrollPane component 586 text in multiple editor windows 194
search and replace text in the active editor window 193
text selectively, how to 180 Segments tab 663
search buttons 176 Segments view 44
Search Cached Sub-targets checkbox, of Find In Select All command 582
Files window 175 Select All menu command 686
Search In field, of Find In Files window 173 Select Stack Crawl Window When Task Is Stopped
Search menu 639 checkbox 295
Apply Difference command 640, 641 of Global Settings preference panel 295
Compare Files command 640, 641 selected text search 193
Enter Find String command 640, 641 selecting
Enter Replace String command 641 items in a pane 427
Find And Replace command 640 lines by clicking in left margin 280
Find command 640 multiple RAD objects 556
Find Definition & Reference command 641 selecting items in a pane 417
Find Definition command 640, 641 selection
Find In Files command 640 by keyboard 75
Find In Next File command 640, 641 by mouse-clicking 74
Find In Previous File command 641 finding 194
Find Next command 640 of a line of text 151
Find Previous command 640 of a range of text 151
Find Previous Selection command 641 of a rectangular portion of text 151
Find Reference command 641 of a word of text 151
Find Selection command 640, 641 printing 126
Go Back command 640, 641 Selection Position checkbox
Go Forward command 640, 641 of Editor Settings preference panel 277
Go To Line command 640, 641 selectively finding and replacing text 180
Replace All command 640, 641 selectively finding text 178
Replace And Find Next command 641 Send To Back command 560
Replace and Find Next command 640
Set Breakpoint menu command 468, 686
Replace And Find Previous command 641
Set button
Replace command 640
of New Event Set wizard 231, 609, 610
Replace Selection command 641
of New window 58, 527, 576
Unapply Difference command 640, 641
Set Default Project menu command 686
Search menu command 686
Set Default Target menu command 96, 687
search of access paths
set up
enabling and disabling 340
for debugging 411–414
search options
Set Watchpoint menu command 477, 687
across multiple files 172
search options, general 170 Set/Clear Breakpoint dialog box 468
Search Results window 191 Set/Clear Breakpoint menu command 468, 687
Stop button 192 setting
a temporary breakpoint 459
Search Selection Only checkbox 171
IDE User Guide IDE–771
Index
background color 283 Change button 269
breakpoints 468 Find And Compare Operations checkbox 268
breakpoints for redefined functions 473 Find-and-Compare Operations column 267
breakpoints for templated functions 473 of IDE Preferences window 266
font 281 Project Operations checkbox 268
font size 282 Project Operations column 267
foreground color 283 Remove button 269
options in browser 244 Shielded Folders list 266
tab size 282 shielded folders, defined 266
the current build target 95 Shift Left command 154
watchpoints 477 Shift Left menu command 687
setting breakpoints 468 Shift Right command 154
setting link order 379 Shift Right menu command 687
Setting print options 126 shifting text 154
setting up shortcut conventions 25
build target for debugging 411 shortcuts
files for debugging 412 entering values in Type field of Java Applet
settings wizard 536
for build targets 331–334 keyboard shortcut restrictions 315
Remote debugging 372 Show All Locals checkbox
Source Trees 355 of Display Settings preference panel 289
Settings option for makefiles 66 Show Breakpoints command 469
settings panels 332 Show Breakpoints menu command 687
Access Paths 339
Show Floating Toolbar command 326
Build Extras 346
Show Floating Toolbar command in Toolbar
Custom Keywords 365
submenu 699
Debugger Settings 369
File Mappings 350 Show Inherited checkbox 220, 249
Global Optimizations 361 Show Main Toolbar command (Windows) 325
Other Executables 366 Show Main Toolbar command in Toolbar
Remote Debugging 372 submenu 699
Runtime Settings 348 Show Message After Building Up-To-Date Project
Source Trees in Target Settings window 355 checkbox
Target Settings 336 of Build Settings preference panel 257
setup Show Private command 217
project debugging 104–106 Show Processes command (debugger) 432
shared libraries 408 Show Protected command 217
linker options 407 Show Public command 217
sharing files between projects 516 Show Tasks In Separate Windows checkbox
shielded folders of Display Settings preference panel 290
adding 268 Show The Component Palette When Opening A
deleting 269 Form checkbox 305
modifying 268 of Layout Editor preference panel 305
use of regular expressions 266 Show The Object Inspector When Opening A Form
Shielded Folders list checkbox 305
of Shielded Folders preference panel 266 of Layout Editor preference panel 305
Shielded Folders preference panel Show Types command 513
Add button 268 Show Types menu command 483, 514, 688
IDE–772 IDE User Guide
Index
Show Values As Decimal Instead Of Hex checkbox functions in pop-up menus 280
of Display Settings preference panel 289 RAD components 573
show variable types by default 484 sorting items in Files view of Project window 49
Show Variable Types checkbox source code
of Display Settings preference panel 288 activating debugging for 105
Show Variable Values In Source Code checkbox disassembling 394
of Display Settings preference panel 290 editing and browsing 38
Show Window Toolbar command 327 editing in debugger 493
Show Window Toolbar command in Toolbar font and color 467
submenu 698 viewing 422, 515
Show Window Toolbar menu command 418 viewing as assembly 422
viewing as mixed 422
showing
editor window toolbars 146 Source Code Disclosure Triangle 397
toolbars 325 Source Code Pane 397
signed decimal Source File section 129
viewing data as 485 Source File section, of File Comparison
single IDE 1.7 projects window 129
converting to latest IDE version 715 source files
single-class hierarchy, in browser 224 compiling 379
size opening with the browser 248
setting default for unbounded arrays 290 precompiling 387–393
Size pop-up menu Source pane
of Font & Tabs preference panel 282 disclosure triangle 421
in Symbolics window 429
skipping
of Thread window 421
statements 458
Source pane, in browser 221
skipping statements 458
avoiding run-time corruption 459 source paths 269, 355
consequences of 458 Source pop-up menu 422, 427
Smaller Code Size radio button Source Tree Relative 345
of Global Optimizations settings panel 362 Source Trees
Snap To Grid command 560 difference between panels in IDE Preferences
Snap To Grid menu command 688 window and Target Settings window 269,
355
software
generation of 36 source trees 269, 355
Solaris Source Trees list 275, 276
File Systems… 668 in Source Trees preference panel 270
system requirements 33 in Source Trees settings panel 356
Sort Function Pop-Up checkbox Source Trees preference panel
of Editor Settings preference panel 280 Absolute Path option 271
Add button 271
Sort Functions By Method Name In Browser 429
Change button 275
Sort Functions By Method Name In Browser
Choose button 271
checkbox
Environment Variable option 271, 274
of Display Settings preference panel 289
Name column 270
sort order Name field 271, 275
RAD components 573 of IDE Preferences window 269
Sort Order button 50 Path column 270
sorting Registry Key option 271, 274
IDE User Guide IDE–773
Index
Remove button 276 static constructors
Source Trees list 270 debugging 295
Type pop-up menu 271, 275 static library 35
Source Trees settings panel Static option, of Specifier pop-up menu 238, 241,
Absolute Path option 357 605, 611
Add button 356 static variables 437
Change button 359 stationery 61
Choose button 356 about project stationery 61
Environment Variable option 356 and creating projects 57
Name column 356 automatic setup of 59
Name field 356 creating 62
of Target Settings window 355 folder 61
Registry Key option 356 project 60–64
Remove button 360 project stationery 56
Source Trees list 356 projects 55
Type field 356 stationery projects 38
source, viewing code as 422 Status (VCS operation) 624
source-code file 34 status area
SourceSafe VCS plugin 618 of browser 222
special characters 181 Step Into command 417, 457
finding and replacing 181 in debugger toolbar 417
special features Step Into menu command 688
of expressions 497 Step Out command 458
special operators in debugger toolbar 417
in regular expressions 196 Step Out menu command 688
Specifier pop-up menu Step Over command 457
Abstract option 544, 605, 611 in debugger toolbar 417
Final option 544, 605, 611 Step Over menu command 688
Mutable option 241
stepping
None option 238, 241, 544, 605, 611
into routines 457
of Java Bean wizard 544
out of routines 458
of New Event Set wizard 611
through a single line of code 457
Pure Virtual option 238
through code 457
Static option 238, 241, 605, 611
Stepping Buttons 397
Virtual option 238
stepping through code 454
Speed Doubler 477
Stop At End Of File checkbox 171
stack
viewing routine calls 418 Stop At Temp Breakpoint On Application Launch
checkbox
stack contents
of Debugger Settings panel 370
viewing 491
Stop At Watchpoints checkbox
Stack Crawl pane 416, 418, 463
of Debugger Settings panel 371
Stack Crawl window. See Thread window. 416
Stop Build menu command 689
Stack Editor Windows menu command 688
Stop button
starting up
in Search Results window 192
debugging for most projects 451
Stop command 417, 456, 461
debugging for some embedded projects 454
in debugger toolbar 417
statements
Stop For Traps option
skipping 458
IDE–774 IDE User Guide
Index
of MetroNub Settings preference panel symbolics files 410–411
(Mac OS) 303 and location in which saved 411
Stop menu command 462, 689 CodeView format 410
stopping DWARF format 410
execution of code 461 SYM format 410
stopping code 454 symbolics information
stopping execution 461 generating 413
compared to killing 462 Symbolics pop-up menu
strategy All Symbolics option 175, 188, 189
for creating complex projects 92 Symbolics pop-up menu, of Find In Files
Strength Reduction 364 window 175
strings Symbolics window 425, 464
coloring 284 compared to Thread window 425
style conventions Executables pane 428
for beginners 23 Files pane 428
hypertext 24 Functions pane 429
notes 23 setting breakpoints in 430
tips 23 Source pane 429
typefaces 24 Symbolics Window menu command 427, 689
use of > 24 symbols
warnings 23 completing 246
submenus defining for C/C++ 390
Align 697 defining for Pascal 392
Java Exceptions 696 identifying in the browser database 244
Resize 697 Symbols pane, in Contents window 214
Toolbar 698 Synchronize Modification Dates command 384
subprojects Synchronize Modification Dates menu
browsing across 246 command 88, 689
creating within projects 99 Synchronize Status (VCS operation) 623
defined 90 Synchronized checkbox
opening 69 of New Event dialog box 615
Success pop-up menu of New Method dialog box 605
of Build Settings preference panel 258 synchronizing
Summary section, of New Property dialog box 602 modification dates 88, 384
Swing Synchronizing modification dates 88
RAD components 586–588 Synergex
Switch To Monitor menu command 689 PVCS plug-in 618
SYM 410 syntax
Symantec THINK Reference 264 of expressions 501
symbol definitions, finding 163 Syntax Coloring
symbol documentation and printing 127
looking up 162 in Document Settings pop-up menu 143
Symbol hint 431 syntax coloring
Symbol window, in browser 225 changing 283, 288
symbolics file 37 Syntax coloring, table of 284
and debugging 411 syntax highlighting
multiple open files 416, 427 controlling within a window 284
IDE User Guide IDE–775
Index
System Headers checkbox, of Find In Files Choose button 338
window 175 Clear button 338
system headers, defined 175 Linker pop-up menu 337
System Paths pane Output Directory field 338
in Access Paths settings panel 342 Post-Linker pop-up menu 338
System Paths radio button Pre-Linker pop-up menu 338
in Access Paths settings panel (Windows) 341 Save Project Entries Using Relative Paths
System Relative Path 273, 345, 358 checkbox 338
System Requirements 31 Target Name field 337
system requirements 31–33 Target Settings window
for Linux IDE 33 build target configurations 336
for Mac IDE 32 choosing settings 335–373
code generation configurations 361
for Solaris IDE 33
debugger configurations 366
for Windows IDE 32
discarding changes 333
editor configurations 365
T settings panels 332
tab control Source Trees panel 355
displaying a tab view 596 window buttons 332
tab control, in browser (RAD) 595 targets
Tab Indents Selection checkbox assigning files to 98
of Font & Tabs preference panel 282 creating build target dependencies 96
Tab Inserts Spaces checkbox creating build targets 92
of Font & Tabs preference panel how to create in a project 93
Font & Tabs preference panel how to link 97
Tab Inserts Spaces checkbox 282 how to specify dependencies 97
Tab Size field platform target documentation 29
of Font & Tabs preference panel 282 setting the build target 95
tab view Targets section
displaying 596 of New Class wizard 235
limitations of 596 Targets section, of New Event Set wizard 612
tabs Targets tab 663
inserting spaces instead of 282 Targets tab, in Project window
setting size of 282 Project window
target Targets tab 549
build target defined 90 Targets view 45
changing the build target name 94 and designs 549
changing the build target settings 95 of Project window 54
Target column 48, 98 Task pane 435
Target Name field tasks
in Target Settings panel 337 viewing 432
Target pop-up menu .tdt files 384, 386
All Targets option 174, 185 templated functions
Default Targets option 174, 185 setting breakpoints 473
Target pop-up menu, of Find In Files window 174 templates
Target Settings command 391, 392, 393 auto-completion of names 247
Target Settings menu command 95, 331, 415, 690 temporary breakpoints 459, 470
Target Settings panel 336 effect on regular breakpoints 470
IDE–776 IDE User Guide
Index
setting 470 Thread window 416
temporary variables 513 compared to Symbolics window 425
Text debugger toolbar 417
drag and drop of 152 defined 417
text Source pane 421
adding in editor 150 Stack Crawl pane 418
deleting in editor 150 Variables pane 419
finding all occurrences of specific text 179 threading in CodeWarrior 259
finding and replacing individual occurrences threads
of 180 viewing 432
finding in multiple windows 194 __throw() 657
finding in the active editor window 193 tick, defined 323
finding individual occurrences of 178 definition of
finding selected 193 tick 260
indenting automatically 282 ticks
replacing all occurrences of specific text 181 and Balance Flash Delay 280
selecting a line 151 Tile Editor Windows menu command 690
selecting a range 151 Tile Editor Windows Vertically menu
selecting a rectangular portion of 151 command 690
selecting a word 151 Tile Horizontally menu command 690
shifting left and right 154
Tile Vertically menu command 690
Text Colors preference panel
Timeout field
Edit button 285, 287
of Java Debugging preference panel 300
Text Colors section 282
tip conventions 23
Text Colors section, of Text Colors preference
panel 282 Title field, of Java Applet wizard 533
Text Editing Area 138 To Grid command in Align submenu 697
Text File List option (Mac OS) 104 To Largest Height command in Resize
submenu 698
text formats
saving files in 280 To Largest Width command in Resize
submenu 698
text search
finding selection 194 To Smallest Height command in Resize
finding text 178, 179 submenu 698
for selection 194 To Smallest Width command in Resize
selected text search 193 submenu 698
using regular expressions 195 Toggle Index View button 568, 569
TextArea component 586 Tool Set Used In Makefile pop-up menu 66
TextField component 586 toolbar
texttop option, of Java Applet wizard 534 in browser 216
of Component Catalog window 568
THINK Reference 165, 264
of Component Palette 563
THINK Reference (Mac OS) 165
of debugger 417
third-party
Toolbar Disclosure Button 144
disabling and enabling plugins 266
Toolbar menu command 691, 698
third-party editor support 262
Toolbar submenu 698
third-party editors 88
Anchor Floating Toolbar command 700
third-party text editors Clear Floating Toolbar command 701
Emacs 262 Clear Main Toolbar command 700
third-party tools 41
IDE User Guide IDE–777
Index
Clear Window Toolbar command 699 Treat #include /<…/> as #include "…"
Hide Floating Toolbar command 699 option 341
Hide Main Toolbar command 699 troubleshooting
Hide Window Toolbar command 698 breakpoints 509, 510
Reset Floating Toolbar command 700 bus error 510
Reset Main Toolbar command 700 changing variable values 511
Reset Window Toolbar command 698 Debug command 508
Show Floating Toolbar command 699 debugger 506–521
Show Main Toolbar command 699 Enable Debugging 507
Show Window Toolbar command 698 error on launch 508
Unanchor Floating Toolbar command 700 launching debugger 507
Toolbars no source code 515
in File Comparison window 131 outdated source files 516
toolbars strange data types 513
adding elements 328 strange variable names 513
anchoring floating toolbar 330 undefined indentifier 514
customizing 323 unrecognized data types 514
elements 325 variable does not change 511
floating toolbar (Mac OS) 326 variables 511
main toolbar (Windows) 325 tutorial resources 29
modifying 327 Type applet parameter, of Java Applet wizard 535
Project window toolbar 45 Type column
removing all elements 329 in Remote Connections preference panel 297
removing elements 329 Type field
restoring default settings 330 in Source Trees settings panel 356
showing and hiding 325 of New Data Member wizard 240
showing and hiding in editor windows 146 Type field shortcut, in Java Applet wizard 536
types 324
Type field, in New Property dialog box 602
window toolbar 327
Type field, of New Property dialog box 601
Toolbars menu command 691, 698
Type pop-up menu
Toolbox Assistant, Macintosh Programmer’s 165
Absolute Path option 271, 356
tools Environment Variable option 271, 274, 356
third-party 41 in Source Trees preference panel 271
tools for RAD 524–525 of Source Trees preference panel 271, 275
Tools menu 653 Registry Key option 271, 274, 356
icon 653 type. See data types.
ToolServer Worksheet menu command 691 typedefs
ToolServer™ 690 auto-completion of names 247
ToolTip 324 typeface conventions 24
Top Edges command in Align submenu 697 types
top option, of Java Applet wizard 534 of project files 55
Touch column 49, 87 typing
Touch command 88 balancing parentheses, brackets, and
touching braces 279
files 87 typographical conventions 23
Transient checkbox, in New Property dialog
box 602
IDE–778 IDE User Guide
Index
U Use Local Project Data Storage checkbox 258
Use Local Project Data Storage checkbox, of Build
Unanchor Floating Toolbar command in Toolbar
Settings preference panel 257
submenu 700
Use Modification Date Caching checkbox
Unanchor Floating Toolbar menu command 330
of Build Extras settings panel 346
Unapply Difference menu command 133, 691
Use Multiple Document Interface checkbox
unbounded arrays
of IDE Extras preference panel 263
setting default size for viewing 290
Use Multiple Undo checkbox
Uncaught Exceptions Only command in Java
of Editor Settings preference panel 279
Exceptions submenu 696
Use Script Menu checkbox
undefined identifier 514
of IDE Extras preference panel 261
understanding
Use Scripts Menu checkbox
plugin compilers 376
of IDE Extras preference panel 654
undo and redo
Use separate file for member definitions checkbox
series of actions 279
of New Class wizard 232
Undo Checkout (VCS operation) 624
Use Third Party Debugger checkbox
Undo menu command 691 of Build Extras settings panel (Windows) 347
undoing Use Third Party Editor 262
multiple actions 154
Use Third Party Editor checkbox
the previous action 154
of IDE Extras preference panel 262
Ungroup command 560
Use ToolServer Menu checkbox
Ungroup menu command 692 of IDE Extras preference panel 263, 653
UNI Software Use Version Control option 620
Voodoo plug-in 618
User Paths pane
unicode string in Access Paths settings panel 342
viewing data as 485
User Paths radio button
UNIX option in Access Paths settings panel (Windows) 341
in Document Settings pop-up menu 143
User Specified radio button
Unix option in Debugger Settings panel 370
in Default File Format pop-up menu 281
user-defined roots 269, 355
UNIX text files 122
Username field 621
Unlock command 574
using
Unselect tool 564 Browser menu 228
unsigned decimal expressions 497
viewing data as 485 the debugger 414–415
Untouch command 88 using regular expressions 195
untouching using vector variables in expressions 505
files 87
Up radio button, in Find dialog box 171
V
updating projects 379, 380
Use Archive (JAR) field, of Java Applet wizard 533 values
changing variable value 487
Use BBEdit™ Extensions checkbox 654
of IDE Extras preference panel (Mac OS) 264 Variable applet parameter, of Java Applet
wizard 535
Use Debugging Monitor checkbox
of Windowing preference panel (Mac OS) 293 Variable Change Hilite option
of Display Settings preference panel 288
Use External Editor checkbox
of IDE Extras preference panel 261 Variable window 438, 446
automatic closing of 446
IDE User Guide IDE–779
Index
variables Read-Only 626
changing values 487 Unlocked 627
creating environment 349 IDE plugins
data formats 487 ClearCase 618
deleting environment 350 CVS 618
expanding 419, 447, 481 Perforce 618
global 437, 481 Projector 618
in Expressions window 488 PVCS 618
in separate windows 482 SourceSafe 618
local 481, 489 VOODOO 618
meaning of $ 513 installation 619
modifying environment 350 menus
opening a window for 438 VCS menu 622
static 437 VCS Pop-up menu 625
strange names 513 operations
temporary 513 About 624
troubleshooting 511 Add 624, 627
viewing information while debugging 431 Checkin 624, 628
Variables (VCS operation) 624 Checkout 624, 627
Variables pane 481 Comment 624
Variables:All listing 419 Connect 624
Variables:Auto listing 419 Disconnect 624
Variables:None listing 419 Get 623, 627
Variables:All 289, 419 History 624
Variables:Auto 289, 419 Label 624
Make Writable 628
Variables:None 289, 419
Project 623
VCS 40
Properties 624
VCS Commands checkbox Recursion 623
of Editor Settings preference panel 279 Status 624
VCS menu 279, 622, 653 Synchronize Status 623
icon 653 Undo Checkout 624, 627
VCS Message window 629 Unlock 627
VCS Pop-up menu 625, 627 Variables 624
VCS pop-up menu 143, 221 windows
VCS Setup panel 619, 620 Project window 628
vector variables VCS Message Window 629
using in expressions 505 Version Control Login 625
Vectorization 365 Version Control System menu. SeeVCS menu. 653
version control 653 Version Control System pop-up menu. See VCS
Version Control Login window 625 pop-up menu. 143
Version Control Settings (VCS option) 620 version control systems 52
Version Control Settings menu command 692 Vertical Center command in Align submenu 697
Version Control System (VCS) view
activation 619 variables while debugging 431
file permissions View Alphabetical command 582
Checked out 626 View Array command 438, 447
Locked 627 View Array menu command 692
Modify Read-Only 626
IDE–780 IDE User Guide
Index
View As Binary menu command 693 code as assembly language 410
View As C String menu command 693 code as mixed 422
View As Character menu command 693 code as source 422
View As Default menu command 693 data as different types 486
View As Enumeration menu command 693 data as multiple types 489
View As Fixed menu command 693 data in debugger 480
data in different formats 485
View As Floating Point menu command 694
data types 483
View As Fract menu command 694
debugger toolbar 417
View As Hexadecimal menu command 694 expressions 436
View As Implementor command 217 global variables 437, 481
View As menu command 486, 692 local variables 481
View As Pascal String menu command 694 member functions and data members in
View As Signed Decimal menu command 694 browser 216
View As Subclass command 217 memory
View As Unicode String menu command 694 viewing memory dump 482
View As Unsigned Decimal menu command 695 memory at an address 490
View As User command 217 pointer types 486
View command 574 processor registers 492
raw memory 490
View In Groups command 582
registers 420, 422, 441, 443
View Memory As command 447, 490
routine names, problems with 280
View Memory As menu command 449, 490, 695 stack contents 491
View Memory command 490 threads and tasks 432
View Memory menu command 448, 490, 497, 695 watchpoints 479
View menu 638 Virtual destructor checkbox
Breakpoints command 639 of New Class wizard 234
Browser Contents command 639 Virtual option, of Specifier pop-up menu 238
Class Browser command 639 Visual Bean option, of Java Bean wizard 544
Class Hierarchy command 639 Visual C, converting nmake files to projects 55
Component Catalog command 638
Visual Component option, of New Event Set
Component Palette command 639
wizard 612
Errors & Warnings command 639
Expressions command 639 Visual Sourcesafe, see SourceSafe 618
Global Variables Window command 639 Volatile checkbox
Object Inspector command 639 of New Data Member wizard 241
Processes command 639 Volatile checkbox, in New Property dialog box 602
Project Inspector command 639 VOODOO VCS plugin 618
Registers Windows command 639 VSpace field, of Java Applet wizard 534
Symbolics Window command 639
Toolbars command 638 W
Watchpoints command 639 Warning Button 395
View Variable command 438 warning conventions 23
View Variable menu command 482, 695 Warning Messages 398
viewers, documentation 29 Watchpoint Hilite option
viewing of Display Settings preference panel 288
breakpoints 470 watchpoints
call chain 418 clearing 440
code as assembly 422 defined 476
IDE User Guide IDE–781
Index
limitations (Mac OS) 477 Zoom Window command 652
on 68K machines 476 Window Position And Size checkbox
restrictions on 478 of Editor Settings preference panel 278
setting 477 Windowing preference panel 291
setting and clearing 477 Close Non-Debugging Windows radio
viewing 479 button 292
Watchpoints window 439 Collapse Non-Debugging Windows radio
Watchpoints menu command 439, 479, 695 button 292
Watchpoints window 439 Do Nothing To Non-Debugging Windows
Watchpoints Window menu command 439, 479, radio button 291
696 Do Nothing To Project Windows checkbox 293
“Weak” link 408 Hide Non-Debugging Windows radio
whole word 171 button 292
Width field, of Java Applet wizard 534 Minimize Non-Debugging Windows radio
wildcard searching 195 button (Windows) 291
Monitor For Debugging pop-up menu
window buttons
(Mac OS) 293
for settings panels 332
Move Open Windows To Debugging Monitor
in Target Settings window 332
When Debugging Starts checkbox
Window menu 194, 651
(Mac OS) 293
Breakpoints Window command 653
Open Windows On Debugging Monitor
Browser Contents command 652
During Debugging checkbox (Mac OS) 293
Build Progress Window command 652
Use Debugging Monitor checkbox
Cascade command 651
(Mac OS) 293
Class Hierarchy Window command 652
Windows
Close All command 651
system requirements 32
Close command 651
Collapse Window command 652 windows
Component Catalog command 653 Build Progress window 378
Component Palette command 653 class browser 214–222
Errors & Warnings Window command 652 controlling syntax highlighting within 284
Expand Window command 652 creating panes 148
Expressions Window command 653 Expressions window 436
Global Variables Window command 653 Find In Files 169
Global Variables window 437
New Class Browser command 652
IDE Preferences 256
Object Inspector command 653
Project window Design view 44, 53
Processes Window command 652
Project window Files view 44, 46
Project Inspector command 652
Project window Link Order view 45, 53
Registers Windows command 653
Project window navigation 45
Save Default Window command 651, 652
Project window Targets view 45, 54
Stack Editor Windows command 652
Project window toolbar 45
Symbolics Window command 652
removing panes 148
Tile Editor Windows command 652
resizing panes 148, 417
Tile Editor Windows Vertically command 652
Search Results 191
Tile Horizontally command 651
Symbolics 425
Tile Vertically command 651
Thread window 416
Toolbar command 652
ToolServer Worksheet command 652 Windows menu command layout 634
Watchpoints Window command 653 WinHelp (Windows) 164
wizards
IDE–782 IDE User Guide
Index
for Browser 229–243
for RAD 529–545
for RAD layouts 560–562
for RAD projects 526
Java Applet 530
Java Applet Wizard 526, 546
Java Application 537
Java Application Wizard 526, 546
Java Bean 542
Java Bean Wizard 526, 546
Java Frame 561
Java Frame Wizard 554
New Class 230
New Data Member 240
New Event Set 607
New Member Function 236
wizards, for RAD projects 55
word
selection of 151
working
with complex projects 89–100
Working Directory field
in Runtime Settings panel (Windows) 349
working with projects 43
X
x86 Settings preference panel 304
Port ID field (Mac OS) 304
Remote Debugging checkbox (Mac OS) 304
Remote IP Address field (Mac OS) 304
XML
exporting and importing preferences in 256
exporting and importing target settings in 334
importing and exporting preferences 256
preferences
importing and exporting in
XML 334
.xSYM 427
Z
Zoom Window menu command 696
Zoom Windows To Full Screen checkbox
of IDE Extras preference panel 261
IDE User Guide IDE–783
Index
IDE–784 IDE User Guide
CodeWarrior
IDE User Guide
Credits
writing lead: Derek Saldaña
other writers: Caresse Bennett, David Blache,
Alisa Dean, Chris Magnuson,
Roopa Malavally, Marc Paquette,
Jim Trudeau, L. Frank Turovich
engineering: Lubo Antonov, Kevin Bell, Greg Bolsinga,
Kenny Drycksback, David Dubrow,
Matt Henderson, Michael Marks,
Glenn Meter, Mathavi Paramasivam,
Dan Podwall, Max Requenes,
Rob Vaterlaus
quality assurance Joe Hayden, Patrick Sullivan,
Isaac Wankerl
frontline warriors: Richard Atwell, John Cortell,
Joe Hayden, Ron Liechty,
Todd McDaniel, Glenn Meter,
Max Requenes, Jim Trudeau,
Isaac Wankerl, Josef Wankerl,
Roger Wong, Anakin Skywalker,
and CodeWarrior users everywhere