symbian複合控件的重繪問題 (compound controls redraw)

在一個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 才能找到裏面複合控件,進行重繪。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章