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

PopupForm不能显示出来

2012-02-05 
PopupForm不能显示出来,求救C/C++ codestatic boolean PopupForm_new(FmMgr *pMgr, int32 *pnId, IForm **

PopupForm不能显示出来,求救

C/C++ code
static boolean PopupForm_new(FmMgr *pMgr, int32 *pnId, IForm **ppiForm){    popupBase *pMe;    int32 nErr = 0;    IShell *piShell = NULL;    IWidget *staticWdg = NULL;    IXYContainer *p_xycontainer = NULL;    WidgetPos wp;    IWidget  *m_pWdg;    IWidget  *pImageWdg;    IWidget* pBackDrop;    WExtent we;    IImage *pimage;    if(NULL == pMgr)    {        return EBADPARM;    }    piShell = pMgr->piShell;    if( NULL == ( pMe = (popupBase*)MALLOC( sizeof(popupBase))))    {        return ENOMEMORY;    }   MEMSET( pMe, 0, sizeof(popupBase));    *pnId = BRW_FM_ID_POPUPFORM;    nErr= ISHELL_CreateInstance(piShell,AEECLSID_POPUPFORM,(void**)&pMe->piForm);    nErr += ISHELL_CreateInstance(piShell,AEECLSID_STATICWIDGET,(void**)&staticWdg);    nErr += ISHELL_CreateInstance(piShell,AEECLSID_BORDERWIDGET,(void**)&pBackDrop);    nErr += ISHELL_CreateInstance(piShell,AEECLSID_IMAGEWIDGET,(void**)&pImageWdg);    nErr += ISHELL_CreateInstance(piShell,AEECLSID_XYCONTAINER,(void**)&p_xycontainer);    if(nErr != 0)    {        return EFAILED;        }    we.height = 50;    we.width = 100;    IWIDGET_SetExtent(staticWdg,&we);    IWIDGET_SetText(staticWdg,L"test",FALSE);    pimage = ISHELL_LoadResImage(pMgr->piShell,IMAGE_RES_FILE,IDI_AUDIO);    IWIDGET_SetImage(pImageWdg,pimage);    wp.x = 0;    wp.y = 0;    wp.bVisible = TRUE;    IXYCONTAINER_Insert(p_xycontainer,pImageWdg,WIDGET_ZNORMAL,&wp);    IXYCONTAINER_Insert(p_xycontainer,staticWdg,WIDGET_ZNORMAL,&wp);    IWIDGET_SetBGColor(pBackDrop, MAKE_RGBA(125, 233, 10, 5));    IWIDGET_SetBorderWidth(pBackDrop, 0);    IFORM_SetWidget((IForm*)pMe->piForm, WID_BACKDROP, pBackDrop);    IXYCONTAINER_QueryInterface(pMe->piForm,AEEIID_WIDGET,(void**)&m_pWdg);    IFORM_SetWidget(pMe->piForm,WID_FORM,m_pWdg);        IFMBASE_Init( (FormBase*)pMe, pMe->piForm, *pnId, pMgr );    *ppiForm = pMe->piForm;    return TRUE;}

外层已经将该POPUPForm push到IROOTFORM中了


[解决办法]
IFMBASE_Init( (FormBase*)pMe, pMe->piForm, *pnId, pMgr );
你把这个先注释掉,然后再这个方法里直接
IROOTFORM_PushForm(……,pMe->piForm);
先看看效果,一步一步调吧!

热点排行