I | Quick StartFor most purposes WTextView will be part of a view hierarchy that is designed in Constructor. A custom CYTP resource is provided in the WasteDemo.ppob file that defines the fields for WTextView. Most of these are concerned with the feature flags of the WASTE view. Creating a WTextView for your application involves 4 steps, design your user interface in Constructor, add the WASTE and WTextView source code to your application, add required libraries, and register your classes. Design your user interfaceWTextViews can be added like any other view in constructor. Just make sure the custom CYTP resource is open. The resource is part of WasteDemo.ppob so if you want to use it in other PPob resources be sure to copy it or better yet add it to your custom types folder. Open up the catalog window (Window->Catalog). Click on the View tab at the top of the window. The WasteView should be at the bottom of the window. Drag WasteView from the Catalog window onto the window or dialog that you are constructing. Set the options for the waste view. The options include
Add the WASTE and WTextView SourceThe following WASTE code is added to the demo version project. I, Timothy Paustian, created the project using the document stationary for Power Plant. WEAccessors.c WEBirthDeath.c WEDebug.c WEDrawing.c WEFontTables.c WEHighLevelEditing.c WEICGlue.c WEInlineInput.c WELineLayout.c WELongCoords.c WELowLevelEditing.c WEMouse.c WEObjects.c WEScraps.c WESelecting.c WESelectors.c WEUndo.c WEUnicode.c WEUserSelectors.c WEUtilities.c waste.h InternetConfig.h NOTE: Waste 2.0 is distributed in library form, unless you buy a source license. You can just include the WASTE library, not all the WASTE source .c files, as above. The PPlant wrapper consists of two classes WText and WTextView. These are the only required for WASTE. To implement the Apple Script text model, the WTextModel classes have to be added. See Adding Apple Script support to WASTE for more details. Add the required librariesThe following libraries also have to be added to the project for WASTE UnicodeConverter - For Unicode support TextCommon - For Unicode support Register your classesDuring application startup, don't forget to register WTextView. Add this line of code during other class registration.
Take a look at the NThisAppRegistry is included that registers the applications views. Hit compile to make the project and you're set. Enjoy! |
Originally by Timothy Paustian. Last modified September 17, 2002. Contact David Phillip Oster <mailto:oster@ieee.org>.