Stingray Foundation Library User’s Guide

Stingray? Foundation Library User's Guide

Stingray? Studio

Version 6.0.1

STINGRAY STUDIO FOUNDATION USER'S GUIDE

PRODUCT TEAM

Development: Terry Crook, Clayton Dean, Boris Meltreger, David Noi Documentation: Marc Betz, Shelley Hoose Development Manager: Clayton Dean Product Manager: Ben Gomez Support: Terry Crook, Boris Meltreger

THIS MANUAL

? Copyright 1997-2012 Rogue Wave Software, Inc. All Rights Reserved. Rogue Wave and Stingray are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.

ACKNOWLEDGMENTS

This documentation, and the information contained herein (the "Documentation"), contains proprietary information of Rogue Wave Software, Inc. Any reproduction, disclosure, modification, creation of derivative works from, license, sale, or other transfer of the Documentation without the express written consent of Rogue Wave Software, Inc., is strictly prohibited. The Documentation may contain technical inaccuracies or typographical errors. Use of the Documentation and implementation of any of its processes or techniques are the sole responsibility of the client, and Rogue Wave Software, Inc., assumes no responsibility and will not be liable for any errors, omissions, damage, or loss that might result from any use or misuse of the Documentation

ROGUE WAVE SOFTWARE, INC., MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THE DOCUMENTATION. THE DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ROGUE WAVE SOFTWARE, INC., HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS WITH REGARD TO THE DOCUMENTATION, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL ROGUE WAVE SOFTWARE, INC., BE LIABLE, WHETHER IN CONTRACT, TORT, OR OTHERWISE, FOR ANY SPECIAL, CONSEQUENTIAL, INDIRECT, PUNITIVE, OR EXEMPLARY DAMAGES IN CONNECTION WITH THE USE OF THE DOCUMENTATION.

The Documentation is subject to change at any time without notice.

ROGUE WAVE SOFTWARE, INC.

Address: 5500 Flatiron Parkway, Boulder, CO 80301 USA

Product Information: Fax: Web:

(303) 473-9118 (800) 487-3217 (303) 473-9137

CONTENTS

1Chapter 1 Introduction to Stingray Foundation Library

1.1 Welcome to Stingray Foundation Library 1 1.2 Product Features 2 1.3 Location of Samples 3 1.4 Supported Platforms 3 1.5 Getting Help 4

1.5.1 Documentation 4 1.5.2 Knowledge Base 4 1.5.3 Professional Services 4 1.5.4 Technical Support 5

1.6 Licensing Restrictions 5

2Chapter 2 Getting Started

2.1 Building the SFL Libraries 7

2.1.1 SFL Library Naming Conventions 7

2.2 SFL Build Configurations 9 2.3 Visual Studio Environment Setup for SFL 10 2.4 Building SFL Libraries with the Visual Studio Solution 10

2.4.1 Make Files and Building Directly with nmake 12 2.4.2 Cleaning SFL Build Targets 12

2.5 SFL Build Wizard 12

3Chapter 3 Interface-Based Programming

3.1 Introduction 13 3.2 IQueryGuid and guid_cast 14

Contents iii

3.3 GUID Maps 16

3.4 Reference Counting 17

4Chapter 4 Design Patterns

4.1 Introduction 19

4.2 The Subject-Observer Pattern 20

4.3 The Composite Pattern 22

4.4 The Object Factory Pattern 25

4.4.1 Example 26

4.5 Polymorphic Iteration 27

4.5.1 The Polymorphic Iterator Templates 28 4.5.2 The Traversable Interfaces 29 4.5.3 The Traversable Mix-in Templates 30

4.5.3.1 Lifetime Management 31 4.5.3.2 MFC and COM Collections 31

5Chapter 5 Properties Package

5.1 Introduction to SFL Properties 33

5.1.1 Property Objects 33

5.2 Property Containers 34

5.2.1 A Property Container Implementation 35

5.2.1.1 The Property Map 35 5.2.1.2 Property Accessors 35

5.2.2 Property Container Example 37

5.3 ActiveX Controls 39

5.3.1 ActiveX Property Containers 39 5.3.2 Using ActiveX Property Containers 40

6Chapter 6 Events Package

6.1 Introduction to SFL Events 43

6.2 Event Objects 44

6.2.1 Windows Messages 44 6.2.2 The Event Factory 45 6.2.3 Windows Message Cracking 46

6.3 Event Routers 47

iv Contents

6.3.1 Default Event Router Implementation 47 6.3.2 ATL Integration 48 6.3.3 MFC Integration 49

6.4 Event Listeners 52

6.4.1 Dispatching Events 52 6.4.2 Adapter Classes 53 6.4.3 Using Event Listeners 55 6.4.4 Efficiency of Event Listeners vs. Message Maps 56

6.5 Chaining Event Routers 57

6.6 Custom Event Types 58

7Chapter 7 Layout Manager

7.1 Layout Manager Framework 59

7.2 Issues with Resizable Windows 60

7.3 Layout Manager Architecture 61

7.3.1 Layout Nodes 61 7.3.2 Layout Recalculation Process 62

7.3.2.1 Recalculation 62 7.3.2.2 Realization 62

7.3.3 Node Creation 63 7.3.4 Node Initialization 63

7.4 Integration with ATL 65

7.4.1 Adding Layout Management to Your Applications 67

7.5 Layout Algorithms 68

7.5.1 Scale Layout 68 7.5.2 Relative Layout 68 7.5.3 Border-Client Layout 70 7.5.4 DC Layout Nodes 70 7.5.5 Splitter Layout 71 7.5.6 Borders and Edges 73

7.6 Examples 74

8Chapter 8 Model View Controller

8.1 What is MVC? 77

8.2 The MVC Design Pattern 78

8.2.1 Model-View-Controller Relationship 78 8.2.2 The Subject-Observer Pattern in MVC 79

Contents v

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download