Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi,

I want to implement tab in my application, but i am not getting how can i start for it.
can any body please direct me desire steps to create it . Actualy in each tab i want to show
diffrent group of widgets.

Widget questions are best answered in C Forum. Moved.

Widget questions are best answered in C Forum. Moved.

A tab is actually a decorator (AEECLSID_TabWidget) and you should follow the following steps:
- To create an instance of a decorator an application would call the following.
ISHELL_CreateInstance() with a class ID of the decorator.
- To associate a child widget with the decorator applications should use
the api: IDECORATOR_SetWidget()
- Insert the decorator in a container that up the hierarchy leads to the root container,
to make sure that the container is displayed on the screen.
Please see API reference guide for details on IDecorator and IWidget_SetTabXXX.
-Tony

A tab is actually a decorator (AEECLSID_TabWidget) and you should follow the following steps:
- To create an instance of a decorator an application would call the following.
ISHELL_CreateInstance() with a class ID of the decorator.
- To associate a child widget with the decorator applications should use
the api: IDECORATOR_SetWidget()
- Insert the decorator in a container that up the hierarchy leads to the root container,
to make sure that the container is displayed on the screen.
Please see API reference guide for details on IDecorator and IWidget_SetTabXXX.
-Tony

Hi Friend,
Here's a snippet that will give you an idea of how it is setup. Hope this helps:
ERR_TRY( ISHELL_CreateInstance(me->piShell, AEECLSID_TabWidget, (void**)&me->piwTab) );
ERR_TRY( ISHELL_CreateInstance(me->piShell, AEECLSID_CardContainer, (void**)&picCard) );
ERR_TRY( ICardContainer_QueryInterface(picCard, AEEIID_IWidget, (void**)&piwc) );
// SetWidget also connects the child's ViewModel to the decorator's ViewModel
// Tab widget will wrap the card container.
IDECORATOR_SetWidget((IDecorator*)(void*) me->piwTab, piwc);
// set up the tab data
ERR_TRY( IWidget_GetModel(me->piwTab, AEEIID_IVectorModel, (IModel**)(void**) &pimVector) );
(void) IVectorModel_SetPfnFree(pimVector, (PFNNOTIFY)ImageStaticInfo_Delete);
// Create the first tab.
ERR_TRY( ISHELL_LoadResStringEx(me->piShell,EMAILAPP_RES_FILE, IDS_STRING_SETTINGS, &pSettingsStr) );
ERR_TRY( ISHELL_LoadResImageEx(me->piShell, EMAILAPP_RES_FILE, IDI_IMAGE_SETTINGS_SMALL, &pii) );
ERR_TRY( ImageStaticInfo_New(&pisi, pii, pSettingsStr) );
RELEASEIF(pii);
(void) IVectorModel_Add(pimVector, pisi);
// Create the second tab.
ERR_TRY( ISHELL_LoadResStringEx(me->piShell,EMAILAPP_RES_FILE, IDS_STRING_MISC, &pMiscStr) );
ERR_TRY( ISHELL_LoadResImageEx(me->piShell, EMAILAPP_RES_FILE, IDI_IMAGE_MISC_SMALL, &pii) );
ERR_TRY( ImageStaticInfo_New(&pisi, pii, pMiscStr) );
RELEASEIF(pii);
(void) IVectorModel_Add(pimVector, pisi);
// Creates a widget and insert it in the card container
ERR_TRY( AddSettings(me, picCard, MAKE_RGB(240,233,170)) );
// Creates a widget and insert it in the card container
ERR_TRY( MiscellaneousSettings(me, picCard, MAKE_RGB(240,233,170)) );
(void) IWidget_SetFlags(me->piwTab, 0 | TABWF_WRAP | TABWF_SHOWBORDER);
(void) IWidget_SetPadding(me->piwTab, 0);
(void) IWidget_SetActiveBorderWidth(me->piwTab, 2);
(void) IWidget_SetInactiveBorderWidth(me->piwTab, 1);
(void) IWidget_SetInactiveBorderColor(me->piwTab, MAKE_RGBA(0x7B,0x7D,0xA5,255));
(void) IWidget_SetActiveBorderColor(me->piwTab, MAKE_RGBA(0x7B,0x7D,0xA5,255));
(void) IWidget_SetInactiveBGColor(me->piwTab, MAKE_RGBA(0xEF,0xEF,0xFF,255));
(void) IWidget_SetActiveBGColor(me->piwTab, MAKE_RGBA(0xc0,0xff,0xe0,255));
(void) IWidget_SetBorderWidth(piwc, 0);
(void) IWidget_SetBGColor(piwc, RGBA_WHITE);
Note: the ERR_TRY macro is just some error handler I use.

Hi Friend,
Here's a snippet that will give you an idea of how it is setup. Hope this helps:
ERR_TRY( ISHELL_CreateInstance(me->piShell, AEECLSID_TabWidget, (void**)&me->piwTab) );
ERR_TRY( ISHELL_CreateInstance(me->piShell, AEECLSID_CardContainer, (void**)&picCard) );
ERR_TRY( ICardContainer_QueryInterface(picCard, AEEIID_IWidget, (void**)&piwc) );
// SetWidget also connects the child's ViewModel to the decorator's ViewModel
// Tab widget will wrap the card container.
IDECORATOR_SetWidget((IDecorator*)(void*) me->piwTab, piwc);
// set up the tab data
ERR_TRY( IWidget_GetModel(me->piwTab, AEEIID_IVectorModel, (IModel**)(void**) &pimVector) );
(void) IVectorModel_SetPfnFree(pimVector, (PFNNOTIFY)ImageStaticInfo_Delete);
// Create the first tab.
ERR_TRY( ISHELL_LoadResStringEx(me->piShell,EMAILAPP_RES_FILE, IDS_STRING_SETTINGS, &pSettingsStr) );
ERR_TRY( ISHELL_LoadResImageEx(me->piShell, EMAILAPP_RES_FILE, IDI_IMAGE_SETTINGS_SMALL, &pii) );
ERR_TRY( ImageStaticInfo_New(&pisi, pii, pSettingsStr) );
RELEASEIF(pii);
(void) IVectorModel_Add(pimVector, pisi);
// Create the second tab.
ERR_TRY( ISHELL_LoadResStringEx(me->piShell,EMAILAPP_RES_FILE, IDS_STRING_MISC, &pMiscStr) );
ERR_TRY( ISHELL_LoadResImageEx(me->piShell, EMAILAPP_RES_FILE, IDI_IMAGE_MISC_SMALL, &pii) );
ERR_TRY( ImageStaticInfo_New(&pisi, pii, pMiscStr) );
RELEASEIF(pii);
(void) IVectorModel_Add(pimVector, pisi);
// Creates a widget and insert it in the card container
ERR_TRY( AddSettings(me, picCard, MAKE_RGB(240,233,170)) );
// Creates a widget and insert it in the card container
ERR_TRY( MiscellaneousSettings(me, picCard, MAKE_RGB(240,233,170)) );
(void) IWidget_SetFlags(me->piwTab, 0 | TABWF_WRAP | TABWF_SHOWBORDER);
(void) IWidget_SetPadding(me->piwTab, 0);
(void) IWidget_SetActiveBorderWidth(me->piwTab, 2);
(void) IWidget_SetInactiveBorderWidth(me->piwTab, 1);
(void) IWidget_SetInactiveBorderColor(me->piwTab, MAKE_RGBA(0x7B,0x7D,0xA5,255));
(void) IWidget_SetActiveBorderColor(me->piwTab, MAKE_RGBA(0x7B,0x7D,0xA5,255));
(void) IWidget_SetInactiveBGColor(me->piwTab, MAKE_RGBA(0xEF,0xEF,0xFF,255));
(void) IWidget_SetActiveBGColor(me->piwTab, MAKE_RGBA(0xc0,0xff,0xe0,255));
(void) IWidget_SetBorderWidth(piwc, 0);
(void) IWidget_SetBGColor(piwc, RGBA_WHITE);
Note: the ERR_TRY macro is just some error handler I use.

How do you link the widgets on the Card Container with a specific tab?

How do you link the widgets on the Card Container with a specific tab?

its long time ... just checking wether am able to repl or not
 

its long time ... just checking wether am able to repl or not