Abstract: VCL Features in Delphi 2009
The Visual Component Library, or VCL, is the bedrock of Delphi and C++Builder development. It is a vast and powerful component-based framework that enables developers to rapidly and easily create Windows applications with rich, full-featured user interfaces. Combined with a huge set of third-party components, the VCL is clearly the premier application development framework in the development world.
New in Delphi 2009
New Classes and Components
All VCL controls now support displaying Unicode characters.
Delphi 2009 includes a complete set of VCL components that implement the Office 2007 Office User Interface. Commonly known as “ribbon controls”, these components allow developers to build rich, powerful user interfaces.
The TCategoryPanelGroup is a new VCL control that contains any number of collapsible panels, much like the “outlook bar” control included in Microsoft’s Outlook email client. Any type or number of controls can be placed on the panels, and the panels themselves can be configured.
TButtonedEdit is an edit box with configurable glyphs within it, one each on the right and left side. Each glyph has click events associated with them, so that code can be attached to them that will execute when clicked.
All components now have a CustomHint property which can reference any component that descends from TCustomHint. The VCL now provides TBalloonHint, which descends from TCustomHint and displays a balloon hint with an optional title and graphic.
The VCL now contains support for the PNG image format via the TPNGImage class TImage and TImageList both contain support for TPNGImage.
Enhanced Classes and Components
TImageList now supports containing images of all types registered with TImage. In addition, TImageList now supports alpha blending.
TButton now contains support for TImageList, and allows the display of an image on the button. The image can be aligned and positioned as desired. TButton also includes new styles to support the command link and split button features of Vista.
TListView now support putting items in groups.
TTreeView now supports displaying different glyphs for a node depending whether the node is expanded or collapsed.
TProgressBar has been enhanced to support new Vista styles, including Paused and Error. It also supports the Vista feature of Marquee scrolling.
TEdit now provides a “TextTip”, that is, text that appears in the control when there is no user entered text and the control does not have focus. This is normally used to provide “hint text”. For example, a TEdit might contain “Enter your password here” when first shown. TEdit also now has a NumbersOnly property that limits the keyboard input to number-associated characters.
The basic container for the VCL is TForm. TForm is a VCL class that encapsulates the concept of a Window. It is able to contain other components. TForm can be a sizable form, a non-sizable form, a dialog, or a tool window. It supports scrolling alpha blending, drag-n-drop, transparency, docking of other forms and controls, the displaying of hints for other controls, screen snapping, and the Vista Aero interface, as well as all the other standard behaviors of a Window in Microsoft's Windows operating system.
VCL applications can be automatically themed by simply selecting an option in the Project Options dialog.
By selecting this option, the IDE will automatically insert the proper theming manifest into the resources of the given project, causing Windows to view the application as themed.
Vista Aero support
The VCL provides automatic support for the Vista Aero user interface.
Forms now have the "GlassFrame" property, which causes VCL applications to display the glassing feature of the Aero interface, as shown in the screen shot below:
Vista Dialog Support
Margins and Padding
When the AlignWithMargins property of a component is set to TrueAlign property is set to something other than alNone, then the control, when doing the alignment, will take into account it's own Margin property values and the Padding property values of its container.
For instance, below is a TPanel in a form. The Panel has its AlignWithMargins property set to True, and all of its Margin values set to 20. In addition, the form itself has its Padding.Bottom property set to 30.
The VCL now supports IntelliMouse scrolling in any container class that supports mouse scrolling.
The image below shows the IntelliMouse support working in a TMemo control
The VCL includes a number of components that helps developers in laying out visual components on forms.
The TPanel component is a simple container component that can be used to partition an area of a form as a container for other components.
The TSplitter component is used to divide a given client area into two resizable areas.
The image below demonstrates the splitter control being used to create three resizable areas on a form.
TGridPanel implements a grid panel control in which each component is placed within a cell on a grid. With a grid panel, a developer can specify the number of rows and columns on the panel; then each component is placed into the next available cell in the grid, regardless of where it is placed with the mouse. If each grid contains a control and more controls are added, the location for the new controls is determined by the ExpandStyle property. For example, using the default ExpandStyle property of AddRows, a new row is added to the grid and each cell in the row can contain a new control.
TFlowPanel is a TPanel descendent that allows controls placed within it to "flow" together depending on the FlowStyle property. The default value is fsLeftRightTopBottom, meaning controls in the TFlowPanel flow from the upper left to the lower right. The functionality of a TFlowPanel is similar to that of text and other elements in a web browser.
The TTrayIcon enables developers to create applications that display an icon in the System Tray area. The component supports balloon hints (shown below) as well as icon animation.
An action is a non-visual component that represents a user-generated command. Actions enable developers to set up all the user interface properties related to a given command in one central place, including code required to execute the command, as well as the images and shortcuts associated with a command.
Actions, when used in conjunction with the ActionManager, can be used to create powerful, flexible user interfaces. The ActionManager also enables developers to produce toolbars that are user-customizable.
The ActionList component can contain a list of standard or user-generated commands.
The ActionManager can be used to manage commands and easily add them into ActionMenuBars and ActionToolBars. The ActionManager also comes with a complete set of standard actions for entire menu structures such as "File", "Edit", and "Search"
The image below shows a demo application at design-time using the ActionManager component in conjunction with an ImageList component.
Windows Common Control Support
The VCL provides components that wrap all of the standard Windows Common Control set:
Standard Windows Control Components
The VCL provides components that wrap all of the Standard Windows controls:
Windows Dialog Components
The VCL provides a powerful set of components that make using the standard Windows dialogs very easy. Components that provide dialogs for choosing colors and printers, as well as standard search/replace/find dialogs are also included.
In addition, the VCL supports the new Vista-based Windows dialogs, including the TTaskDialog.
The VCL also includes a large number of components on the additional tab that dramatically augment the developer’s ability to create rich user interfaces. The include, among many others, components that enable users to display images, put images on buttons, choose colors, check items in a list box, filter and limit input into Edit boxes, add control bars to windows, Group buttons in categories, and alter the color schemes of toolbars.
The VCL includes a complete set of data-bound components that enable developers to display data as part of their user interfaces.
RAD Studio contains a large, broad set of controls called Internet Direct (Indy) that provides component- based access to the entire range of socket-based communication, including all the major Internet protocols like HTTP, NNTP, TCP, UDP, FTP, and more.
Internet Direct is an open source project managed by the Delphi community.