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

Developer

Forums

Hi all,

I want the text in static widget align horizontal center (use IDF_ALIGN_CENTER) and vertical middle (use IDF_ALIGN_MIDDLE).
But only horzontal center has effect, vertical middle doesn't work. Does anyone know why ?

Thanks

Its working, here is the code snippet:
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget, (void**)&pMe->piwStatic);
IWIDGET_SetText(pMe->piwStatic, L"Favorite color:", FALSE);
IWidget_SetFGColor(pMe->piwStatic, MAKE_RGBA(0,255,0,0));
IWidget_SetFlags(pMe->piwStatic, SWF_WRAPTEXT | IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
pWExtent.height = pMe->deviceInfo.cyScreen - 10;
pWExtent.width = pMe->deviceInfo.cxScreen - 10;
IWidget_SetExtent(pMe->piwStatic, &pWExtent);
ppos.bVisible = TRUE;
ppos.x = (pMe->deviceInfo.cxScreen - pWExtent.width)/2;
ppos.y = (pMe->deviceInfo.cyScreen - pWExtent.height)/2;
IRootContainer_Insert(pMe->picRootText, pMe->piwStatic, WIDGET_ZNORMAL, &ppos);

Its working, here is the code snippet:
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget, (void**)&pMe->piwStatic);
IWIDGET_SetText(pMe->piwStatic, L"Favorite color:", FALSE);
IWidget_SetFGColor(pMe->piwStatic, MAKE_RGBA(0,255,0,0));
IWidget_SetFlags(pMe->piwStatic, SWF_WRAPTEXT | IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
pWExtent.height = pMe->deviceInfo.cyScreen - 10;
pWExtent.width = pMe->deviceInfo.cxScreen - 10;
IWidget_SetExtent(pMe->piwStatic, &pWExtent);
ppos.bVisible = TRUE;
ppos.x = (pMe->deviceInfo.cxScreen - pWExtent.width)/2;
ppos.y = (pMe->deviceInfo.cyScreen - pWExtent.height)/2;
IRootContainer_Insert(pMe->picRootText, pMe->piwStatic, WIDGET_ZNORMAL, &ppos);