void CBubbleCtrl::UnFreeze( TBool aUpdate )
    {
    iFreeze = EFalse;
    if( aUpdate )
        {
        if( !iInvalidRect.IsEmpty() )
            {
            RootControl()->ReDrawRect( iInvalidRect );
            }
        Draw();
        
        if(iInvalidRect.IsEmpty() )
            {
            iInvalidRect = Rect();
            }
        else
            {
            iInvalidRect.BoundingRect( Rect() );
            }      
                  
        UpdateArea(iInvalidRect); 
        }
    
    iInvalidRect = TRect();
    }
EXPORT_C void CBubbleCtrl::Close()
    {
    TRect rect = Rect();
    
    iShowing = EFalse;  
    
    if( iFreeze )
        {
        if(iInvalidRect.IsEmpty() )
            {
            iInvalidRect = rect;
            }
        else
            {
            iInvalidRect.BoundingRect( rect );
            }            
        }
    else
        {
        Clear();
        SetHidenFlag(ETrue);    
        BringToBack();

        RootControl()->ReDrawRect(rect);
        UpdateAreaImmed(rect); 
        }
    }
EXPORT_C void CBubbleCtrl::Popup(const TRect& aRect)
    {
    SetRect(aRect);

    if(iFreeze)
        {
        iShowing = ETrue;              
        SetHidenFlag(EFalse);        
        return;
        }
    if(!iShowing || aRect != Rect() || iNeedRedraw)
        {
        iShowing = ETrue;  
        TRect rect = Rect();
        SetRect(aRect);
        SetHidenFlag(EFalse);        
        BringToTop();
        //redraw the control under bubble control
        if(aRect != rect)        
            RootControl()->ReDrawRect(rect);    

        Draw();
        
        rect.BoundingRect(aRect);
        UpdateAreaImmed(rect,ETrue);     
        
        iNeedRedraw = EFalse;
        }
    }
Example #4
0
void MenuItem::Done() {
    RootControl()->Highlight(false);
}
Example #5
0
void MenuItem::Busy() {
    RootControl()->Highlight(true);
}
// ---------------------------------------------------------------------------
// CFepUiLayoutRootCtrl::InitControl
// Initialize the layout
// ---------------------------------------------------------------------------
//
TRect CFepUiLayoutRootCtrl::InitControl()
    {
    TInt i=0;
    TInt count = iCtrlList.Count();
    CFepUiBaseCtrl* ctrl;
    
    //check whether there is pop up window, move it to last
    //if pop up window is encapsulated by some control group, it can't be found here.
    for(i = 0; i < count; i++)
        {        
        if(iCtrlList[i]->IsKindOfControl(ECtrlPopupWindow))
            {
            ctrl = iCtrlList[i];
            iCtrlList.Remove(i);
            iCtrlList.Append(ctrl);
            i--;
            count--;//The last one is pop wnd, no need to check.            
            }
        }

    //check and calc the shadow rect
    TBool bHasShadow = EFalse;
    if(iShadowRect.IsEmpty())
        {
        
        for(i = 0; i < iCtrlList.Count(); i++)
            {
            //pop up window doesn't affect our layout rect, ignore it.
            if(!iCtrlList[i]->IsKindOfControl(ECtrlPopupWindow))
                {                
                iShadowRect = iCtrlList[i]->ShadowRect();            
                bHasShadow = ETrue;
                break;
                }
            }
        }
    
    bHasShadow = !iShadowRect.IsEmpty();
    
    TSize s(iRect.Size());
            
    if(bHasShadow)
        {
        for(i = 0; i < iCtrlList.Count(); i++)
            {
            if(!iCtrlList[i]->IsKindOfControl(ECtrlPopupWindow) &&
                !iCtrlList[i]->ShadowRect().IsEmpty())
                {
                iShadowRect.BoundingRect(iCtrlList[i]->ShadowRect());
                }
            }

        if(iRect.Width() < iShadowRect.Width())
            s.iWidth = iShadowRect.Width();
        
        if(iRect.Height() < iShadowRect.Height())
            s.iHeight = iShadowRect.Height();  
        iRect.SetRect(TPoint(0,0),s);

        iLayoutPos = iShadowRect.iTl;
        //move iShadowAreaRect if needed
        
        //iShadowRect need be kept as SetShadowAreaRect will change iShadowRect
        if(ShadowAreaRect(KShadowBmpTl).iTl != TPoint(0,0))
            {
            TPoint offset = -ShadowAreaRect(KShadowBmpTl).iTl;
            for (TInt i = 0; i < KShadowBitmapTotalNum; i ++)
                {
                iShadowAreaRect[i].Move(offset);
                }
            }
        //The layout shadow rect starts from TPoint(0,0);        
        iShadowRect.Move(-iLayoutPos);

        s = iShadowRect.Size();
        }
    else
        {
        iLayoutPos = iRect.iTl;
        iRect.Move(-iLayoutPos);              
        }
    
    iNonHwrStartPtRegion.Clear();
    /*
    iNonHwrStartPtRegion.AddRect(iRect);
    
    //find HWR window and remove it from the region
    CFepUiBaseCtrl* hwrWnd = ControlForKindOfType(ECtrlTransparentHwrWnd);
    TInt index = 0;
    while(hwrWnd)
        {
        iNonHwrStartPtRegion.SubRegion(hwrWnd->Region());
        //find next hwr window
        hwrWnd = ControlForKindOfType(ECtrlTransparentHwrWnd,++index);
        }
      */     
      
    CalculateNonHwrStartPtArea();
    const TRegion& t = RootControl()->NonHwrStartingPtRegion();
    TInt n = t.Count();
    const TRect* r =t.RectangleList();
    
    RegisterICFEditor();
    //check each control group, whether there is background control, 
    //adjust pos if necessary
    AdjustBkCtrlPos();
    //now it's ready to be drawn
    SetReady(ETrue);    

    UpdateValidRegion(NULL,EFalse);
    return TRect(iLayoutPos,s);    
    }