首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Brew >

求解BUIW的FORM解决方案

2012-03-02 
求解BUIW的FORM请问BUIW中的Form里的title和shoftkey的大小能改变吗。我试了IWIDGET_SetExtent(),不行,不知

求解BUIW的FORM
请问BUIW中的Form里的title和shoftkey的大小能改变吗。我试了IWIDGET_SetExtent(),不行,不知是真不行还是代码不对,小弟急求解,谢谢~~另外,试了一下其他好多参数都可以改的。
部分代码:
{
IPropContainer *pPropContainer;
IWidget *pLeftSoftKey = NULL, *pRightSoftKey = NULL;
IWidget *pSoftKeyWidget;
WidgetExtent widgetextent;
widgetextent.height = 30;
widgetextent.width = 60;
IFORM_GetWidget((IForm *)pMe->pIRootForm, WID_SOFTKEYS, (IWidget **)&pSoftKeyWidget);
IWIDGET_QueryInterface(pSoftKeyWidget, AEEIID_PROPCONTAINER, (void **)&pPropContainer);
pRightSoftKey = IPROPCONTAINER_GetWidget(pPropContainer, pRightSoftKey, FALSE, FALSE);
pLeftSoftKey = IPROPCONTAINER_GetWidget(pPropContainer, pRightSoftKey, FALSE, FALSE);
IWIDGET_SetBorderWidth(pLeftSoftKey, 1);
IWIDGET_SetBorderWidth(pRightSoftKey, 1);

IWIDGET_SetBorderColor(pLeftSoftKey, MAKE_RGB(155,155,155));
IWIDGET_SetBorderColor(pRightSoftKey, MAKE_RGB(155,155,155));

IWIDGET_SetPadding(pSoftKeyWidget, 0);
IPROPCONTAINER_SetPaddingExact(pPropContainer, pLeftSoftKey, 0, 20);

IWIDGET_SetFlags(pLeftSoftKey, IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
IWIDGET_SetFlags(pRightSoftKey, IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);

IWIDGET_SetExtent(pLeftSoftKey,&widgetextent);
IWIDGET_SetExtent(pRightSoftKey,&widgetextent);

IWIDGET_SetBorderColor(pSoftKeyWidget, MAKE_RGB(255, 0, 0));

IFORM_SetWidget((IForm *)pMe->pIRootForm, WID_SOFTKEYS, pSoftKeyWidget);

IWIDGET_Release(pSoftKeyWidget);
IPROPCONTAINER_Release(pPropContainer);
}

[解决办法]
title是可以改的

softkey大小改变想必也行

风格属性
[解决办法]
{
IPropContainer *pPropContainer;
IWidget *pLeftSoftKey = NULL, *pRightSoftKey = NULL;
IWidget *pSoftKeyWidget;
WExtent widgetextent;
widgetextent.height = 100;
widgetextent.width = 240;
IFORM_GetWidget((IForm *)pMe->pIRootForm, WID_SOFTKEYS, (IWidget **)&pSoftKeyWidget);
IWIDGET_QueryInterface(pSoftKeyWidget, AEEIID_PROPCONTAINER, (void **)&pPropContainer);
pRightSoftKey = IPROPCONTAINER_GetWidget(pPropContainer, pRightSoftKey, FALSE, FALSE);
pLeftSoftKey = IPROPCONTAINER_GetWidget(pPropContainer, pRightSoftKey, FALSE, FALSE);
IWIDGET_SetBorderWidth(pLeftSoftKey, 1);
IWIDGET_SetBorderWidth(pRightSoftKey, 1);

IWIDGET_SetBorderColor(pLeftSoftKey, MAKE_RGB(155,155,155));
IWIDGET_SetBorderColor(pRightSoftKey, MAKE_RGB(155,155,155));

IWIDGET_SetPadding(pSoftKeyWidget, 0);
IPROPCONTAINER_SetPaddingExact(pPropContainer, pLeftSoftKey, 0, 20);

IWIDGET_SetFlags(pLeftSoftKey, IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
IWIDGET_SetFlags(pRightSoftKey, IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);

//IWIDGET_SetExtent(pLeftSoftKey,&widgetextent);
//IWIDGET_SetExtent(pRightSoftKey,&widgetextent);
IWIDGET_SetExtent(pSoftKeyWidget,&widgetextent);

IWIDGET_SetBorderColor(pSoftKeyWidget, MAKE_RGB(255, 0, 0));

IFORM_SetWidget((IForm *)pMe->pIRootForm, WID_SOFTKEYS, pSoftKeyWidget);

IWIDGET_Release(pSoftKeyWidget);
IPROPCONTAINER_Release(pPropContainer);

}

直接给IWIDGET_SetExtent(pSoftKeyWidget,&widgetextent);
可以的啊,大小改变了的!你试一下

热点排行