menufw/menufwui/mmwidgets/src/mmgridview.cpp
changeset 4 4d54b72983ae
parent 0 f72a12da539e
child 5 c743ef5928ba
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
    73 // -----------------------------------------------------------------------------
    73 // -----------------------------------------------------------------------------
    74 //
    74 //
    75 void CMmGridView::ConstructL()
    75 void CMmGridView::ConstructL()
    76     {
    76     {
    77     }
    77     }
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 void CMmGridView::DrawItem(TInt aItemIndex) const
       
    84 	{
       
    85 	CMmListBoxItemDrawer* itemDrawer =
       
    86 	        STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
       
    87 	TSize size = itemDrawer->GetItemSize( 0, ETrue );
       
    88 	if ( itemDrawer->ItemCellSize() != size  )
       
    89 		{
       
    90 		const_cast<CMmGridView*>( this )->SetItemHeight(size.iHeight);
       
    91 		const_cast<CMmGridView*>( this )->SetColumnWidth(size.iWidth);
       
    92 		}
       
    93 
       
    94 	CAknGridView::DrawItem( aItemIndex );
       
    95 	}
       
    96 
    78 
    97 // -----------------------------------------------------------------------------
    79 // -----------------------------------------------------------------------------
    98 //
    80 //
    99 // -----------------------------------------------------------------------------
    81 // -----------------------------------------------------------------------------
   100 //
    82 //
   230 //
   212 //
   231 // -----------------------------------------------------------------------------
   213 // -----------------------------------------------------------------------------
   232 //
   214 //
   233 void CMmGridView::Draw(const TRect* aClipRect) const
   215 void CMmGridView::Draw(const TRect* aClipRect) const
   234     {
   216     {
       
   217     CMmListBoxItemDrawer* itemDrawer =
       
   218             STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
       
   219     TSize size = itemDrawer->GetItemSize( 0, EFalse );
       
   220     if ( itemDrawer->ItemCellSize() != size  )
       
   221         {
       
   222         const_cast<CMmGridView*>( this )->SetItemHeight( size.iHeight );
       
   223         const_cast<CMmGridView*>( this )->SetColumnWidth( size.iWidth );
       
   224         }
   235     DoDraw( aClipRect );
   225     DoDraw( aClipRect );
   236     }
   226     }
   237 
   227 
   238 // -----------------------------------------------------------------------------
   228 // -----------------------------------------------------------------------------
   239 //
   229 //