← Elements Of C++ Macintosh Programming 1990

Elements Of C++ Macintosh Programming 1990

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

Elements of C++ Macintosh Programming

SERIES EDITOR SCOTT KNASTER Macintosh Inside Out Elements OF C++ Macintosh® Programming DAN WESTON

A book cover with a cream background, a black top band reading SERIES EDITOR and SCOTT KNASTER, a purple downward triangle labeled Macintosh Inside Out, large black and yellow stylized 'Elements' with a purple 'OF', and pink-and-black title text 'C++ Macintosh Programming' above author name DAN WESTON in spaced capitals.

Reading notes: The top-right of the black band text 'SCOTT KNASTER' and 'SERIES EDITOR' reading order relative to the triangle is approximate. The word 'OF' is set in small letters on a purple arc and may be read in different order. The ® symbol after Macintosh is small and placed at upper right of the word.

Languages
English
PDF page 1

Elements of C++ Macintosh Programming

SERIES EDITOR SCOTT KNASTER Macintosh Inside Out Elements OF C++ Macintosh® Programming DAN WESTON

Book cover with a yellow-highlighted large letter E in black, a purple inverted triangle labeled Macintosh Inside Out at top, a black banner reading SERIES EDITOR SCOTT KNASTER, and magenta title text on a beige background with author name DAN WESTON at bottom.

Reading notes: The word 'Elements' is stylized with the large E separate from 'lements' and the 'OF' printed in a curved purple shape; reading order is inferred from layout. The series title 'Macintosh Inside Out' appears inside the purple triangle and is partly rotated visually at the top.

Languages
English
PDF page 2

From the Library of Jerry Clark B213 © APCo

A bookplate with calligraphic script reading "from the Library of" decorated with a sprig, a leafy flourish, three owls perched on the flourish, and an open book at the bottom, with a handwritten name in blue ink.

Reading notes: The name "Jerry Clark" is handwritten in blue ink rather than printed, and is transcribed as seen. The vertical small print "B213 © APCo" along the right edge is small and may be imperfectly read.

Languages
English
PDF page 3

The image is a entirely blank white page with no visible artwork, layout, or text.

PDF page 4

Elements of C++ Macintosh® Programming

Elements of C++ Macintosh® Programming Dan Weston A 'YT Addison-Wesley Publishing Company, Inc. Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan

Printed product names
Macintosh®
Languages
English
PDF page 5

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book and Addison-Wesley was aware of a trademark claim, the designations have been printed in initial capital letters (e.g., Apple is a registered trademark of Apple Computer, Inc.) Library of Congress Cataloging-in-Publication Data Weston, Dan. Elements of C++ Macintosh programming/Dan Weston p. cm. - {Macintosh inside out) ISBN 0-201-55025-3 1. Macintosh {Computer)-Programming. 2. C++ (Computer program language) I. Title II. Series. QA76.8.M3W48 1990 005.26'5-dc20 Copyright© 1990 by Dan Weston 90-35408 CIP All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. Sponsoring Editor: Carole McClendon Technical Reviewer: John Dance Cover Design: Ronn Campisi Text Design: Copenhaver Cumpston Set in 10.5 point Palatino by Don Huntington ISBN 0-201-55025-3 ABCDEFGHIJ-MW-943210 First printing, June 1990

Reading notes: Library of Congress catalog-line OCR text uses brace characters where parentheses likely appear, e.g. '{Macintosh inside out)' and '{Computer)'

Printed product names
Macintosh · Apple · Apple Computer, Inc.
Printed dates
1990 · June 1990 · 90-35408
Languages
English
PDF page 6

The image is a entirely blank white page with no visible artwork, layout elements, or markings.

PDF page 7

Contents Preface xvii Acknowledgments xix IJJl> PART ONE Getting Your Feet Wet 1 An introduction to C++ and the concepts of object-oriented program- ming, plus some mechanical aspects of making C++ programs in the MPW environment. 1. WhyC++? 3 Reasons to Learn C ++ 3 Reasons Not to Learn C++ 4 How to Learn C ++ 4 2. C++: A Better C 7 Comments 7 Declarations and Definitions 8 Variables 9 Functions 9 When to Declare and When to Define 10 Variable Definitions Anywhere in Code 12 Type Checking 12 vii

Reading notes: Source text is a table of contents; no advertised products, prices, or dates are present. Some characters in the page numbers and heading markers appear damaged (e.g., 'IJJl>' and 'ClassDefinitions').

Languages
English
PDF page 8

viii ~ Contents Arguments by Reference 13 Default Argument Values 14 Inline Functions 15 Const Definitions 16 Overloaded Functions 17 Streams 17 Summary 19 3. C++ Objects 21 Class Declarations 21 Public, Protected, and Private 22 Friends 24 Accessing Members and Member Functions 24 Derived Classes 25 Members 27 Static Members 27 Member Functions 28 "this" as a Function Argument 28 Virtual Functions 30 Static Member Functions 31 Constructors and Destructors 31 Virtual Destructors 33 Creating Objects 34 A Generic List Class 35 Iterating on a List 42 Summary 44 4. Writing MPW Tools in C++ 45 Helloworld 46 Creating a Makefile 47 1/0 Redirection in MPW 49 Command Line Arguments 55 The TTool Class 56 Initializing and Running the Tool 58 Parsing Command Line Arguments 59 Making Streams for Input and Output 61

Reading notes: Page numbers and section labels appear in the table of contents with uncertain spacing around 'Static Members' and similar entries.

Languages
English
PDF page 9

1/0 Redirection with TTool 62 Deriving a New Class from TTool 62 The Filter Member Function 63 The Main Function 64 Makefile for Fixcom2 65 Compiler Warnings 65 ~ Contents ix Reading the Command Line with TTool 66 Overriding the Initialization Member Function 67 Processing the Command Line 68 Calling the Do Work Member Function 69 Summary 70 Ill; PART TWO Total Immersion 71 Dig in and use object-oriented concepts to design nontrivial classes specifically for the Macintosh environment. Emphasis on discussion of how object-oriented design decisions are made. 5 . TDoc: The Generic Document Class 73 TDoc Members 74 Constructor and Destructor 74 Initializing Documents 77 Maintaining Windows 78 Handling Events 79 Update Events 79 Activation 81 Growing, Zooming, Dragging 83 Mouse Clicks and Key Presses 85 Idle Events 86 Handling Menus 86 Adjusting Menus 87 Handling Menu Commands 89 Cut, Copy, and Paste 91 Handling Files 92 Opening and Closing Document Files 92 Reading and Writing Document Files 94

Reading notes: Some OCR fragments in the table of contents are garbled, such as 'Ill;' and '~' markers. Reading order of chapter and section titles may be uncertain due to extraction.

Languages
English
PDF page 10

x ~ Contents Saving Document Files 94 Closing Documents 96 Specifying Document File Type 98 Printing 98 Utilities 99 Compiling TDoc 100 Resources 101 Summary 102 6. TApp: The Generic Application Class 103 Extending TList to Handle Documents 104 How to Use TApp 105 TApp Members 106 Clipboard Support 107 Private Clipboard and System Clipboard 108 The Clipboard without MultiFinder 109 The Clipboard with MultiFinder 111 TApp Constructor and Destructor 112 Initializing the Application 115 Cleaning Up After the Application 116 Making Documents 116 Opening New Documents 118 Opening Old Documents 119 Opening Documents from the Finder 121 Deleting Documents 123 Handling Events 124 Idle Events 127 Mouse Down Events 128 Key Down Events 129 Activate Events 130 Update Events 131 MultiFinder Support 131 Suspend and Resume 133 Handling Menus 134 Adjusting Menus 134

Languages
English
PDF page 11

Handling Menu Commands 136 File Menu Commands 139 Edit Menu Commands 140 TApp Resources 141 Compiling TApp 142 Summary 143 7. Helloworld, Revisited 145 Subclassing TApp and TDoc 146 THelloDoc 146 THelloApp 148 Making New THelloDoc Objects 148 The Draw Member Function 149 The Helloworld2 Main Program 149 The Helloworld2 Resources 151 ~ Contents xi Helloworld2 Makefile: Putting It All Together 152 Debugging Helloworld2 with SADE 158 Summary 159 l)i> PART THREE Swimming 161 How to use the T App and TDoc classes developed in Part II. The true benefits of object-oriented programming become obviouS' while design flaws in the original TApp and TDoc classes are revealed. The chapter on MacApp shows how to use another, more fully developed class system. 8. Scribble 163 Making a TScribbleDoc 164 TScribbleDoc's Constructor 164 Scribbling Functions 166 File Type and Creator 168 Opening Files from the Finder 170 Reading and Writing Scribble Files 170 Handling Menus 172 Handling Menu Commands 172 Adjusting Menus 174

Reading notes: Source appears to be a book table of contents and chapter excerpt rather than an advertisement; no headline or products identified. Some words may be OCR-broken, e.g. 'Helloworld2' and 'TApp' spacing, and 'obviouS'' with a stray capital.

Languages
English