Objective Grid User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
Objective Grid User’s Guide Stingray® Studio Version 11.2.0 OBJECTIVE GRID USER’S GUIDE THIS MANUAL © Copyright 1997-2014 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 typo- graphical 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 OTHER- WISE, 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 SPE- CIAL, 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: (303) 473-9118 (800) 487-3217 Fax: (303) 473-9137 Web: http://www.roguewave.com CONTENTS 1Chapter 1 Introduction to Objective Grid 1.1 Welcome to Objective Grid 1 1.2 Product Features 1 1.3 Supported Platforms 3 1.4 Location of Samples 4 1.5 Licensing Restrictions 4 1.5.1 Stingray Naming Conventions 4 1.5.2 File Redistribution 5 1.6 Getting Help 5 1.6.1 Documentation 5 PART I User’s Guide 2Chapter 2 Design Overview 2.1 Design Introduction 11 2.1.1 The Style Object 11 2.1.2 The Range Object 13 2.1.3 The Parameter Object 14 2.1.4 Conclusion 14 2.2 Styles Architecture 15 2.2.1 Style Implementation 15 2.2.2 CGXGridCore - Styles Interface 17 2.2.3 CGXStyle - Class Interface 18 2.3 Drawing and Updating 20 2.3.1 CGXGridCore - Commands Interface 22 Contents iii 2.3.2 Accessor Methods 23 2.3.3 CGXGridCore - Drawing Overridables 25 2.4 Control Architecture 26 2.4.1 Current Cell Interface 26 2.4.2 Current Cell Notifications 26 2.4.3 Predefined Controls 29 2.5 Browser Architecture 31 2.5.1 CGXBrowserGrid - Interface 31 2.5.2 ODBC Browser 33 2.5.3 ADO Browser 34 2.6 Formula Engine 35 2.6.1 Adding Formula Support to Your Application 35 2.6.2 Initializing the Grid With Data and Formulas 36 2.6.3 Changing Cell Data and Formulas at Run Time 36 2.7 Run-Time Initialization 39 2.8 Choosing Between Grid Types 42 3Chapter 3 Technical Overview 3.1 Introduction 45 3.2 Class Summary 46 3.3 Drawing Classes 47 3.3.1 CGXGridCore 47 3.3.2 CGXView 48 3.3.3 CGXGridView 48 3.3.4 CGXGridWnd 48 3.3.5 CGXGridHandleView 48 3.3.6 CGXGridHandleWnd 48 3.3.7 CGXGridHint 48 3.4 Control Classes 49 3.4.1 CGXControl 51 3.4.2 CGXBitmapButton 51 3.4.3 CGXCheckBox 51 3.4.4 CGXCheckBoxEx 51 3.4.5 CGXCheckListComboBox 52 3.4.6 CGXComboBox 52 3.4.7 CGXComboBoxWnd 52 3.4.8 CGXCurrencyEdit 53 3.4.9 CGXDateTimeCtrl 53 3.4.10 CGXEditControl 54 3.4.11 CGXHeader 54 iv 3.4.12 CGXHotSpotEdit 54 3.4.13 CGXListBox 55 3.4.14 CGXMaskControl 55 3.4.15 CGXPasswordControl 55 3.4.16 CGXProgressCtrl 55 3.4.17 CGXPushbutton 55 3.4.18 CGXRadioButton 56 3.4.19 CGXRadioButtonEx 56 3.4.20 CGXRichEditCtrl 57 3.4.21 CGXSpinEdit 57 3.4.22 CGXStatic 57 3.4.23 CGXTabbedComboBox 57 3.4.24 CGXTabbedComboBoxWnd 58 3.4.25 CGXVScrollEdit 58 3.4.26 CGXWndWrapper 58 3.4.27 CGXChild 59 3.4.28 CGXButton 59 3.4.29 CGXBitmapButtonChild 59 3.5 Style Classes 60 3.5.1 CGXStyle 60 3.5.2 CGXStylesMap 61 3.5.3 CGXStylesDialog 61 3.5.4 CGXStyleSheet 61 3.5.5 CGXFont, CGXBrush, CGXPen 61 3.5.6 CGXAbstractUserAttribute 61 3.5.7 CGXUserAttribute 61 3.6 Data Structures 62 3.6.1 CGXGridParam 63 3.6.2 CGXData 63 3.6.3 CGXProperties 63 3.6.4 CGXCommand 63 3.6.5 CGXAbstractControlFactory 63 3.6.6 CGXControlFactory 63 3.6.7 CGXGridDropTarget 64 3.6.8 CGXNoOleDataObjectProxy 64 3.6.9 CGXNoOleDataSourceProxy 64 3.6.10 CGXDisplayPropertiesDialog, CGXHeaderFooterDialog, CGXPrintPropertiesDialog 64 3.6.11 CGXRange 64 3.6.12 CGXRangeList 65 3.6.13 CGXPrintDevice 65 3.7 Browser Classes 66 3.7.1 CGXBrowserGrid 67 3.7.2 CGXBrowserView 67 3.7.3 CGXBrowserWnd 67 3.7.4 CGXBrowseParam 67 v 3.7.5 CGXDbParam 67 3.7.6 CGXDynamicRecordset 67 3.7.7 CGXODBCGrid 67 3.7.8 CGXRecordInfoBeam 68 3.7.9 CGXRecordInfoWnd 68 3.7.10 CGXRecordInfoSplitterWnd 68 3.7.11 CGXRecordView 68 3.7.12 CGXRecordWnd 68 3.7.13 CGXRecSetInfo 68 3.7.14 CGXAdoGrid 68 3.7.15 CGXAdoParam 69 3.7.16 CGXAdoRecordView 69 3.7.17 CGXAdoRecordWnd 69 3.8 Utility Classes 70 3.8.1 CGXDrawingAndFormatting 70 3.8.2 CGXLongOperation 70 3.8.3 CGXScrollTip 71 3.8.4 CGXSplitterWnd 71 3.8.5 CGXTabBeam 71 3.8.6 CGXTabInfo 71 3.8.7 CGXTabWnd 71 3.9 Formula Engine Classes 72 3.9.1 CGXFormulaSheet 72 3.9.2 CGXWorksheetFunctions 72 3.9.3 CGXDefaultWorksheetFunctions 72 3.9.4 CGXFormula 73 3.10 Plug-in Component Classes 74 3.10.1 CGXPluginComponent 74 3.10.2 CGXMouseWheelPlugin 74 3.10.3 CGXIntelliMousePlugin 74 3.10.4 CGXGridMouseWheelPlugin 75 3.10.5 CGXGridIntelliMousePlugin 75 3.10.6 CGXScrollTipPlugin 75 3.10.7 CGXCellTipPlugin 75 4Chapter 4 Getting Started 4.1 Creating a Starter Application 77 4.1.1 Using the Objective Grid Static Libraries 77 4.1.2 Using the Objective Grid Extension DLLs 78 4.1.3 Converting an Application to Use the Objective Grid Extension DLL 78 4.2 Using Objective Grid in a Dialog Box 79 4.2.1 Objective Grid vs. ActiveX Controls 79 4.2.2 Using Objective Grid in a Dialog Template 79 vi 4.2.3 Troubleshooting 81 4.3 Miscellaneous Tips 82 4.3.1 Checklist for Build Configurations 82 4.3.2 Objective Grid and VC++ 83 4.3.3 Objective Grid and Windows Look and Feel 84 4.4 Using Objective Grid in a WinForm 86 4.4.1 Direct Use of Objective Grid in a WinForm 86 4.4.2 Use of Objective Grid in a .NET Control 87 5Chapter 5 Using Objective Grid 5.1 Cell Value 91 5.1.1 Filling the Grid with Values 91 5.1.2 Getting Values from the Grid 92 5.1.3 Clearing Cell Values 93 5.2 Cell Attributes 94 5.2.1 Reusing Style Objects 94 5.2.2 Disabled and Read-Only Cells 94 5.2.3 Covered Cells 96 5.2.4 Floating Cells 96 5.2.5 Merged Cells 97 5.2.6 Registration and Usage of Base Styles 99 5.2.7 Registration and Usage of User Attributes 101 5.3 Controls 104 5.3.1 Registration and Usage of Controls 104 5.4 Columns and Rows 105 5.4.1 Column and Row Count 105 5.4.2 Column and Row Sizing 106 5.4.3 Hidden Columns and Rows 107 5.4.4 Frozen Columns and Rows 108 5.5 Cell and Window Coordinates 110 5.5.1 Cell Coordinates 110 5.5.2 Window Coordinates 111 5.5.3 Hit-Testing 113 5.6 Grid Lines 114 5.6.1 Grid Line Drawing 114 5.7 Events 115 5.7.1 Keyboard Events 115 5.7.2 Keyboard Shortcuts 116 vii 5.8 Deriving a Grid 117 5.9 Virtual Grids 118 5.9.1 Supplying Data 118 5.9.2 Storing Data 120 5.10 Formula Support 121 5.11 Undo and Redo 121 5.11.1 CGXGridCore - Undo/Redo interface 121 5.11.2 Transaction-Like Blocks of Commands 122 5.11.3 Long Operations 122 5.12 Sorting 125 5.12.1 Basic Sorting 125 5.12.2 Natural Sorting 125 5.12.3 Sorting Example 126 5.13 Pre-Built Dialogs for Accessing Objective Grid Objects 126 5.13.1 Display Settings Dialog 126 5.13.2 Header / Footer Dialog 129 5.13.3 Page Setup Dialog 131 5.14 Number Formatting 133 5.14.1 Value Types 133 5.14.2 Formatting Number Values for Static Cells 133 5.14.3 Recognizing Locale Settings in Static Formatting 136 5.15 Miscellaneous 138 5.15.1 Using CGXDrawingAndFormatting 138 5.15.2 IntelliMouse Support 139 5.15.3 Rotated Text in Cells 140 5.15.4 Character Sets 140 5.15.5 Direct Copying and Moving of Cells 141 5.15.6 AutoScrolling 141 5.15.7 OLE Drag and Drop Integration 142 5.15.8 Scroll Tip Support 143 5.15.9 CellTip Support 143 5.16 Tools 143 5.16.1 Objective Grid Designer 143 5.16.2 Stingray AppWizard 150 6Chapter 6 Reducing the Size of Your Application 6.1 How Objective Grid Affects the Size of Your Application 155 6.1.1 Using Objective Grid As a Shared DLL 155 6.1.2 Linking Objective Grid Statically 156 viii 6.2 The Control Factory Class 157 6.2.1 Registration of Cell Types 157 6.2.2 Registration of Concrete Implementations for Grid Features 158 6.2.3 Registration of Window Classes 159 6.3 The Build Wizard 161 6.3.1 DLL Naming 162 6.3.2 Building the Libraries 162 6.4 Component Reference 163 6.4.1 Control Factory Class 163 6.4.2 Library Linking 176 6.4.3 Resources 180 6.4.4 A Note On the Implementation 180 7Chapter 7 1stGrid Tutorial 7.1 Introduction 183 7.2 1stGrid - Step 1 185 7.2.1 Create a New 1stGrid Project 185 7.2.2 1stGrid AppWizard Options 186 7.2.3 1stGrid Project Settings 186 7.2.4 Modify 1stGrid's stdafx.h 187 7.2.5 Include Objective Grid Resources in 1stGrid 188 7.2.6 Modify the 1stGrid Application Implementation File 190 7.2.7 Modify 1stGrid View's Header File 190 7.2.8 Modify 1stGrid View's Implementation File