symbian复合控件的重绘问题 (compound controls redraw)

来源:互联网 发布:js添加按钮点击事件 编辑:程序博客网 时间:2024/06/05 19:32

在一个container中有多个复合控件的情况下,实现切换横竖屏幕的时候,发现在SizeChanged()里定义的操作执行了,但是container里的控件却没有被重绘。

后发现,复合控件的container里必须要实现两个方法
TInt CmydlgAppView::CountComponentControls() const
    {
    return 1; // return nbr of controls inside this container
    }


CCoeControl* CmydlgAppView::ComponentControl(TInt aIndex) const
    {
    switch ( aIndex )
        {
        case 0:
            if ( iColListBox )
                {
                return iColListBox;
                }

        default:
            return NULL;
        }
    }

有了这两个方法以后,重绘的时候container 才能找到里面复合控件,进行重绘。

原创粉丝点击