|
| 1 | +Custom Containers Pack (CCPack) |
| 2 | +for |
| 3 | +Delphi 5 |
| 4 | + |
| 5 | +Sergey Orlik |
| 6 | +product manager |
| 7 | +Inprise Representative Office (Moscow) |
| 8 | +Russia, C.I.S. and Baltic States |
| 9 | + |
| 10 | + |
| 11 | +WWW: http://www.inprise.ru |
| 12 | +Personal Home Page: http://www.geocities.com/SiliconValley/Way/9006/index.html |
| 13 | + |
| 14 | +Custom Containers Pack (CCPack) : Copyright (c) 1997-99 Sergey Orlik. |
| 15 | +Introduction |
| 16 | + |
| 17 | + |
| 18 | +The next logical step in evolution of VCL IDEs (Delphi and C++Builder) is a real Visual Composite Component and Container Creation. Custom Containers Pack (CCPack) |
| 19 | + |
| 20 | + is created to initiate the new wave of the next generation 3rd party VCL libraries with a lot of new components. |
| 21 | + |
| 22 | +CCPack is the next generation of two well-known Delphi add-ins: Custom Forms Pack and Composite Components Pack. |
| 23 | +1. Purposes |
| 24 | +To provide an easy mechanism for compound existent VCL into the new native VCL components. |
| 25 | +To provide an easy mechanism for creating new base form and data module classes with new published properties and events. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +With CCPack developers have an answer to discussion “Inheritance vs. Composition in CBD (Component Based Development)”. Delphi support both of them. |
| 30 | +2. Details |
| 31 | +The technology of Custom Modules allows to produce real Composite Components (aka compound components and super-components) and Container (Form/Data Module/Frame) Inheritance. |
| 32 | + |
| 33 | +In defference with well-known form’s .dfm-resource conversation technology, the using of Custom Modules with predefined composite containers allows to produce rich composites with abilities of redesign them in design-time without code loss. |
| 34 | +3. Solution |
| 35 | +Custom Containers Pack (CCPack) |
| 36 | + |
| 37 | + is an integrated tool and component mini-library to produce and maintain composite controls (or simply “composites”) and other containers (forms, data modules and frames). The process of building composite components looks like ActiveForm and Frame creating, but the result is the native VCL component. You can create new composites just as usual forms. |
| 38 | + |
| 39 | +CCPack is an expert tool which allows to easy inherit TForm and TDataModule with custom published properties and events and use them in Delphi and C++Builder visual form's designer. |
| 40 | + |
| 41 | + |
| 42 | +CCPack provides an ingenious and easy way to effectively create a native VCL compound component. Now Delphi and C++Builder developers can visually create Composite Components by simply dragging and dropping existing components onto a one of 3 predefined containers and frames: |
| 43 | + |
| 44 | + |
| 45 | +Container Class Types of Custom Controls |
| 46 | + TBox This class descends from TCustomPanel. It is the base class for most compound components. |
| 47 | + TControlGroupBox Use this class (descendant of TcustomGroupBox) when you want to have to create a compound component with Caption on the border line (looks like the RadioGroup). |
| 48 | + TControlScrollBox This class descends from TScrollBox. It is the base scrolling container for compound controls. |
| 49 | +ToolBarBox introduced in previous versions of CCPack is not supported in CCPack for Delphi 5. This is related with changes in behaviour in the latest versions of common controls and VCL library. |
| 50 | + |
| 51 | +CCPack for Delphi 5 provides single design-time package ccpack50. It contains 6 units. The most important units for container components developer are: |
| 52 | +Boxes.pas - implements 3 base composite containers |
| 53 | +CCReg provides a special registration routines for custom container classes |
| 54 | +4. Using |
| 55 | +Install ccpack50 design-time package to the Delphi 5 IDE. The Custom Container Wizard is then available using File | New command, wich opens the New Items dialog box: |
| 56 | + |
| 57 | + |
| 58 | +When you open new container instance, Delphi displays a graphical representation of the container. You can add new properties and event-handlers to containers in code manually. Published properties for composite containers will be visible in Object Inspector after registering composite container in IDE as an original VCL component (use standard RegisterComponents routine). Now you can use your own composite from the Delphi Palette. If you want to publish properties/events for your form or data module to show them in the Object Inspector you need register class (not instance!) via using RegisterCustomContainer routine. |
| 59 | +5. Notes |
| 60 | +You can create your own non-visual composites based on TDataModule.Custom data-modules may be registered in IDE’s Component Palette with RegisterComponent routine without any problems because TDataModule is a descendant of TComponent. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +Change default IDE-generated names for sub-components placed on composite container to avoid any possible naming conflicts. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +You can manually delegate any properties and methods of sub-components by creating new properties and methods for composite itself. |
0 commit comments