Currently, the available C ++ compiler implementations are rich, and there are several implementations on the Windows platform, commonly used are the C ++ compiler implementation that comes with Visual C ++ 6.0, and the C ++ compiler implementation that comes with Borland C ++ Builder.
In Windows, Dockable toolbar is widely used in many software and programs. Dockable, that is, the dock function. The so-called dock function allows you to combine some toolbar and windows with other toolbar or windows in the same toolbar or window. The tool bar and window contained in the IDE of C ++ Builder have the dock function. As shown in.
The dock function of the toolbar not only makes the toolbar more flexible, but also allows you to combine and place the toolbar as you like and as you like, and makes the operation interface more beautiful. It is easy to develop such a toolbar and window with the dock function in C ++ Builder. Now we can start to develop the Dockable toolbar and window by ourselves. Let's go!
We can use C ++ Builder to develop applications with the dock function. In C ++ Builder, visualized VCL components support the dock function. The Visualized VCL component here refers to all VCL components inherited from TControl and TwinControl.
Basically, the dock action requires at least two components, one of which is the dock site component, and the other is the component attached to the dock site, the visual components provided by C ++ Builder have the dock site function only when the VCL Component inherited from TwinControl is provided, as long as it is inherited from the Visual C ++ 6.0 component, it has the function of attaching to the dock site.
- C ++ Programming
- C ++ programming examples
- Several important elements of C ++ programming tools
- In-depth analysis of various problems with C ++ development tools
- On the programming skills and skills of C ++ Programming
If you want a component inherited from TwinControl to have the dock site function, set the DockSite attribute to true. If you want a component inherited from TControl to be attached to the dock site, set the property DragSite to dkDock and the property DragMode to dmAutomatic. But when the program runs, you can drag the latter component to the former component, and the latter will automatically attach to the former to complete the dock action.
The following two examples show how to easily develop a Dockable window and toolbar in C ++ Builder.
1. Develop windows that support Visual C ++ 6.0
Step 1: Create a project;
Step 2: drag a Tpanel component on the Standard page of the component panel to Form1, set the Align attribute of Tpanel1 to alTop, and set the DockSite attribute to true;
Step 3: On the Additonal page of the component panel, drag three Tshape components to Form1, set the property DragKind of the three Tshape components to dkDock, and set the property DragMode to dmAutomatic;
Step 4: run the program and you can use the mouse to dock the Tshape component on the Tpanel component. 2. Develop a tool bar for Dockable