Copyright © 2002-2009 MultiMedia Soft 
Return to index  
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. 
    The cell text settings can be modified from their initial default using the abmCellsGetLogFont/abmCellsSetLogFont functions and the TextSetting property. You can also change its alignment using the TextHorzAlign and TextVertAlign properties. 
    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; 
    for (int i = 0; i < abmCellsGetCount(hWndBtn); i++) 
        nUniqueID = abmCellsGetCellUniqueID(hWndBtn, i); 
        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. 
    Each cell can also display a picture through the PictureNormal/PictureDisabled properties; you can change the picture alignment inside the cell using the PictureHorzAlign and PictureVertAlign properties. If you have a picture handle, for example obtained from the Picture.Handle property of a Visual Basic 6 PictureBox, you can use it in order to modify the cell's picture using the abmCellsSetPictureFromHandle function. 
    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. 
    Copyright © 2002-2009 MultiMedia Soft 
    Return to index