欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

popupform不能显示出来

更新时间: 2014-01-05 02:46:17 责任编辑: Author_N1

 

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);
先看看效果,一步一步调吧!
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:46:17
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/14226/
本文WWW.DOC100.NET DOC100.NET版权所有。