How to manage cells
Starting from version 3 of the SDK, you have the opportunity to add as many cells you want to the button surface.
Each single cell can have the following features:
Position and size
Visibility
Solid background with border and alpha channel transparency support
Fully configurable caption text
Picture for control's normal and disabled states with alignment and alpha channel transparency support
The scale unit, expressed in percentage or pixels, can be set for a specific button through the
ScaleUnit property and, using the value of the
ScaleUnit property itself, a new cell can be initially created through the
abmCellsAddCellEx function; this function requires receiving a
UniqueID, i.e. a
Unique IDentification number that will be used to identify a specific cell inside the list of available cells. After this function call, the new cells will already have an initial position, size and text. These initial settings can be retrieved/changed at any time using the
abmCellsGetCellPosEx/
abmCellsSetCellPosEx,
abmCellsGetCellSizeEx/
abmCellsSetCellSizeEx functions and the
Text property.
Each new cell you create will be added to a list: you can know how many cells are inside the list through the
abmCellsGetCount function and enumerate them with the help of the
abmCellsGetCellUniqueID function as in the sample below:
HWND hWndBtn = GetDlgItem (IDC_BUTTON)->GetSafeHwnd ();
short nUniqueID;
{
TRACE1 ("Found cell with ID: %d\n\r", nUniqueID);
}
Furthermore you can know if a cell with a specific
UniqueID exists using the
abmCellsFindCell function.
Each cell can be deleted and removed from the list of available cells through the
abmCellsDeleteCell function. Note that each cell can be hidden/shown using its
Visible property.
A cell is initially created with an invisible background: you can set the background as visible changing the
BackColor property value: note that each cell can also display a border line: you can set the border width (in pixels) and color through the
BorderWidth and
BorderColor properties.
As a final feature, you can control the alpha channel transparency for all of the cell's elements:
background through the
BackTranspFactor property,
picture through the
PictureTranspFactor property and
text through the
nTransparentFactor field of the
TEXT_DESC data structure associated to the cell's
TextSetting property.