Characteristics of a Category Panel Group
The category panel group is primarily a container, like
a panel, but it adds some valuable aesthetic and functional features. Still,
because it is a Windows control (it descends from TWinControl),
it has some normal characteristics such as a name, background color, and a
size. After visually adding the control to a form, you can change these
properties in the Object Inspector.
By default, after adding a category panel group to a
form, it is glued to the left. Although this characteristics is inherited
from the TWinControl class, it has a valuable importance
from this control because you should make sure it is visible at all times.
In fact, depending the requirements of your application, you can use as many
category panel groups as you want. You can position one to the left, another
to the right, etc. To visually specify the alignment of a category panel
group, use the Align field in the Object Inspector.
Probably the most important characteristic of a category
panel group is the section(s) it contains. Each section is referred to as a
panel. To visually create a panel, right-click the panel and click New
In the same way, you can add as many panels as you want.
Each panel is based on the TCategoryPanel class, which is derived
from TCustomPanel. In other words, the TCategoryPanel and the
TPanel classes have the same ancestor.
After adding a panel, it gets equipped with a buttoned
header that is made of three sections: a left, a middle, and a right sides.
Learning: Creating the Panels
- On the form, right-click the category panel group and click New
- Right-click the category panel group again and click New Panel
By default, the left section shows a semi-button named a
chevron. The chevron displays two Vs, one on top of the other, as its
caption. By default, the chevron is positioned in the left section of the
header. You can position it to the center or the right section. To support
this, the TCustomCategoryPanelGroup class is equipped with the
ChevronAligngnment property that is of type
__property Classes::TAlignment ChevronAlignment =
To visually specify the alignment of a chevron, access
the Object Inspector for the category panel group and accept or change the
value of the ChevronAlignment field.
By default, the chevron appears in a gray color. If you
want to make it appear in a different color, access the ChevronColor field
in the Object Inspector and select a color of your choice. The
ChevronHotColor is the color by which the chevron would appear when the user
positions the mouse on top of it.
Learning: Confoguring a Category Panel Group
- In the Structure window, click cpgRealEstate
- In the Object Inspector, click ChevronColor, then click the arrow of
its combo box and select clMaroon
- Click ChevronHotColor, then click the arrow of its combo box and
- On the form, click the top panel of the category panel group
- In the Object Inspector, click Caption and type Condominiums
- On the form, click the other panel of the category panel group
- In the Object Inspector, click Caption and type Houses
- Press F9 to preview the form
- Close the form and return to your programming environment
- On the main menu of Embarcadero C++Builder, click File -> Close All
- When asked whether you want to save, click No