Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Card container

The card container organizes widgets much like a deck of cards, one on top of another, managing which is visible at the top of the deck.

Only the widget that currently has the focus is displayed. The underlying widgets are hidden, regardless of the top widget's size, position, or opacity. Though only one widget may be visible at a time, that widget could be a container that contains multiple widgets.

Widgets in a card container are always sized to the full extent of the container. The container only keeps track of the z-order of the widgets, with one widget at each level of the display.

The figure below illustrates the relationships of the widgets managed by a card container.

The topmost widget is the one that occupies the entire extent of the container, and is the widget that has the current focus (if it can take focus). However, it is possible to activate a widget that cannot take focus, which causes the container to have no-focused widget, as focus usually goes to the activated widget. There are two ways to set the activated widget:

  • Move focus to a widget which can take focus.
  • Activate a non-focusable widget using ICardContainer_Activate(). In this case, the container will not have a focused widget if the newly activated widget is unable to take focus.

The card container is described in greater detail in AEEICardContainer.h in the http://developer.brewmp.com/reference/api-all.

Using a card container

The following example creates a card container, obtains its widget interface, then inserts a widget into the card container. The example below assumes that pWidget is a pointer to a widget that has already been created.

// Create Card Container
nErr = ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_CCardContainer, 
            (void**)&pCardCont);

// Obtain the Card Container’s widget interface
if (AEE_SUCCESS == nErr) {
   nErr = ICardContainer_QueryInterface(pCardCont, AEEIID_IWidget, 
               (void**)&pCardWgt);
}

// Insert widget into Card Container
if (AEE_SUCCESS == nErr) {
   nErr = ICardContainer_Insert(pCardCont, pWidget, WIDGET_ZBOTTOMMOST);
}