Top Banner

Click here to load reader

Guide v Guide

Oct 24, 2014

ReportDownload

Documents

Cincom Smalltalk

GUI Developer's GuideP46-0136-07

S I M P L I F I C AT I O N T H R O U G H I N N O VAT I O N

Copyright 19932009 by Cincom Systems, Inc. All rights reserved. This product contains copyrighted third-party software.

Part Number: P46-0136-07 Software Release 7.7 This document is subject to change without notice. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013.Trademark acknowledgments: CINCOM, CINCOM SYSTEMS, and the Cincom logo are registered trademarks of Cincom Systems, Inc. ParcPlace and VisualWorks are trademarks of Cincom Systems, Inc., its subsidiaries, or successors and are registered in the United States and other countries. ObjectLens, ObjectSupport, ParcPlace Smalltalk, Database Connect, DLL & C Connect, and COM Connect are trademarks of Cincom Systems, Inc., its subsidiaries, or successors. ENVY is a registered trademark of Object Technology International, Inc. All other products or services mentioned herein are trademarks of their respective companies. Specifications subject to change without notice. The following copyright notices apply to software that accompanies this documentation: VisualWorks is furnished under a license and may not be used, copied, disclosed, and/or distributed except in accordance with the terms of said license. No class names, hierarchies, or protocols may be copied for implementation in other systems. This manual set and online system documentation copyright 19932009 by Cincom Systems, Inc. All rights reserved. No part of it may be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form without prior written consent from Cincom.

Cincom Systems, Inc. 55 Merchant Street Cincinnati, Ohio 45246

Phone: (513) 612-2300 Fax: (513) 612-2000 World Wide Web: http://www.cincom.com

Contents

About This Book

xv

Audience ................................................................................................................... xv Conventions .............................................................................................................. xv Typographic Conventions ............................................................................. xv Special Symbols ...........................................................................................xvi Mouse Buttons and Menus ..........................................................................xvi Getting Help .............................................................................................................xvii Commercial Licensees ................................................................................xvii Before Contacting Technical Support .............................................xvii Contacting Technical Support ........................................................xvii Non-Commercial Licensees ....................................................................... xviii Additional Sources of Information .............................................................................xix Online Help ..................................................................................................xix VisualWorks FAQ .........................................................................................xix News Groups ...............................................................................................xix Commercial Publications .............................................................................. xx Examples ..................................................................................................... xx

Chapter 1

Building an Applications GUI

1-1

Separating Domain and Application Models ............................................................1-1 GUI Development .....................................................................................................1-2 Loading the UI Painter ..............................................................................................1-2 Creating a Graphical User Interface .........................................................................1-2 Painting a Window ....................................................................................1-3 Setting Properties .......................................................................................1-4 Installing the Canvas ...................................................................................1-6 Reopening a Canvas ...................................................................................1-7 Defining Value Models ................................................................................1-8 Testing the User Interface ...........................................................................1-9

GUI Developers Guide

iii

Formatting a Canvas ............................................................................................... 1-9 Setting the Window Size ........................................................................... 1-10 Setting the Window Opening Position ....................................................... 1-10 Adding Scrollbars to a Window ................................................................. 1-11 Adding a Menu Bar ................................................................................... 1-11 Adding Fly-by Help ................................................................................... 1-12 Setting the UI Colors ................................................................................. 1-12 Sizing a Widget ......................................................................................... 1-14 Making a Widgets Size Fixed ................................................................... 1-15 Making a Widgets Size Relative ............................................................... 1-15 Applying Explicit Boundaries to an Unbounded Widget ............................ 1-16 Positioning a Widget .............................................................................................. 1-16 Making a Widgets Origin Fixed ................................................................ 1-17 Giving an Unbounded Widget a Fixed Position ............................ 1-17 Making a Widgets Origin Relative ............................................................ 1-18 Giving an Unbounded Widget a Relative Position ....................... 1-18 Grouping Widgets .................................................................................................. 1-19 Making a Group of Widgets ...................................................................... 1-19 Editing Widgets in Groups ........................................................................ 1-20 Aligning Widgets .................................................................................................... 1-20 Distributing Widgets ............................................................................................... 1-21 Changing a Widgets Font ...................................................................................... 1-21 Named Fonts ............................................................................................ 1-22 Changing the Tabbing Order .................................................................................. 1-23 Opening and Closing Windows .............................................................................. 1-24 Opening the Main Window ........................................................................ 1-24 Opening a Secondary Window ................................................................. 1-25 Setting the Window Size at Opening ........................................................ 1-26 Setting the Startup Location of a Window ................................................ 1-26 Closing Application Windows ....................................................... 1-26 Hiding a Window ....................................................................................... 1-27 Performing Final Actions .......................................................................... 1-27

Chapter 2

The VisualWorks GUI Environment

2-1

UI Painter ................................................................................................................ 2-2 The Canvas ............................................................................................................. 2-3 The Palette .............................................................................................................. 2-3 GUI Painter Tool ...................................................................................................... 2-4

Chapter 3

Controlling the GUI Programmatically

3-1

Application Startup and Shutdown .......................................................................... 3-1 Launching an Application ........................................................................... 3-2iv VisualWorks

Prebuild Intervention ...................................................................................3-2 Postbuild Intervention ..................................................................................3-3 Postopen Intervention .................................................................................3-3 Application Cleanup ....................................................................................3-3 Windows ...................................................................................................................3-4 Creating a Window ......................................................................................3-4 Class Hierarch