592 // Data needs the cell size to create/reconfigure highlight animations |
592 // Data needs the cell size to create/reconfigure highlight animations |
593 CColumnListBoxData* data = ColumnData(); |
593 CColumnListBoxData* data = ColumnData(); |
594 data->SetItemCellSize( iItemCellSize ); |
594 data->SetItemCellSize( iItemCellSize ); |
595 } |
595 } |
596 |
596 |
597 void CColumnListBoxItemDrawer::DrawCurrentItemRect(const TRect& aRect) const |
|
598 // |
|
599 // Draw the item background |
|
600 // |
|
601 { |
|
602 iGc->SetClippingRect(iViewRect); |
|
603 iGc->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
604 iGc->SetPenColor(iHighlightedBackColor); // KDefaultLbxHighlightRectColor |
|
605 iGc->DrawRect(aRect); |
|
606 iGc->CancelClippingRect(); |
|
607 } |
|
608 |
597 |
609 /** |
598 /** |
610 * Returns a pointer to the column data. Does not imply transfer of ownership. |
599 * Returns a pointer to the column data. Does not imply transfer of ownership. |
611 * |
600 * |
612 * @since ER5U |
601 * @since ER5U |
654 // SERIES60 ITEM MARKS! SAPLAF (the same code is in eikfrlb.cpp and eikclb.cpp) |
643 // SERIES60 ITEM MARKS! SAPLAF (the same code is in eikfrlb.cpp and eikclb.cpp) |
655 TPtrC repl; |
644 TPtrC repl; |
656 TInt pos = -1; |
645 TInt pos = -1; |
657 |
646 |
658 TBool removeicon = (!aItemIsSelected && !ItemMarkReverse()) || (aItemIsSelected && ItemMarkReverse()); |
647 TBool removeicon = (!aItemIsSelected && !ItemMarkReverse()) || (aItemIsSelected && ItemMarkReverse()); |
|
648 |
|
649 if ( Flags() & CListItemDrawer::EMarkingModeEnabled ) |
|
650 { |
|
651 removeicon = EFalse; |
|
652 } |
|
653 |
659 if ( Flags() & EDrawMarkSelection && ItemMarkPosition() != -1 && removeicon) |
654 if ( Flags() & EDrawMarkSelection && ItemMarkPosition() != -1 && removeicon) |
660 { |
655 { |
661 repl.Set( ItemMarkReplacement() ); |
656 repl.Set( ItemMarkReplacement() ); |
662 pos = ItemMarkPosition(); |
657 pos = ItemMarkPosition(); |
663 } |
658 } |
808 #define ITEM_EXISTS(x) (((x) > -1) && ((x) < no_of_items__)) |
803 #define ITEM_EXISTS(x) (((x) > -1) && ((x) < no_of_items__)) |
809 |
804 |
810 #define ITEM_EXISTS_ONCE(x) (((x) > -1) && ((x) < iModel->NumberOfItems())) |
805 #define ITEM_EXISTS_ONCE(x) (((x) > -1) && ((x) < iModel->NumberOfItems())) |
811 |
806 |
812 EXPORT_C void |
807 EXPORT_C void |
813 CColumnListBoxView::Draw( const TRect* aRect ) const |
808 CColumnListBoxView::Draw( const TRect* /*aRect*/ ) const |
814 { |
809 { |
|
810 // If we get here background is drawn via avkon implementation -> raise the |
|
811 // corresponding flag in item drawer. |
|
812 if ( iItemDrawer ) |
|
813 { |
|
814 iItemDrawer->SetFlags( CListItemDrawer::ENativeImplementation ); |
|
815 } |
|
816 |
815 if ( RedrawDisabled() || !IsVisible() ) |
817 if ( RedrawDisabled() || !IsVisible() ) |
816 { |
818 { |
817 return; |
819 return; |
818 } |
820 } |
819 |
821 |
829 if ( !cc ) |
831 if ( !cc ) |
830 { |
832 { |
831 cc = lbi->ColumnData()->SkinBackgroundContext(); |
833 cc = lbi->ColumnData()->SkinBackgroundContext(); |
832 } |
834 } |
833 |
835 |
834 // Draw the whole background at once, this is faster than drawing |
836 if ( !listbox ) |
835 // it in separate items. |
|
836 if ( listbox && listbox->BackgroundDrawingSuppressed() ) |
|
837 { |
|
838 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
839 MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc ); |
|
840 if ( transApi ) |
|
841 { |
|
842 transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); |
|
843 } |
|
844 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
845 |
|
846 AknsDrawUtils::Background( skin, cc, listbox, *iGc, *aRect ); |
|
847 |
|
848 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
849 if ( transApi ) |
|
850 { |
|
851 transApi->StopDrawing(); |
|
852 } |
|
853 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
854 } |
|
855 else if ( !listbox ) |
|
856 { |
837 { |
857 iGc->Clear(); |
838 iGc->Clear(); |
858 } |
839 } |
859 |
840 |
860 TInt firstPotentialItemIndex = iTopItemIndex; |
841 TInt firstPotentialItemIndex = iTopItemIndex; |
861 TInt lastPotentialItemIndex = |
842 TInt lastPotentialItemIndex = |
862 iTopItemIndex + NumberOfItemsThatFitInRect( iViewRect ) - 1; |
843 iTopItemIndex + NumberOfItemsThatFitInRect( iViewRect ) - 1; |
|
844 TBool backgroundDrawingSuppressed = ( listbox && listbox->BackgroundDrawingSuppressed() ); |
863 |
845 |
864 if ( iModel->NumberOfItems() == 0 ) |
846 if ( iModel->NumberOfItems() == 0 ) |
865 { |
847 { |
866 // Empty |
848 // Empty |
867 } |
849 } |
868 else |
850 else |
869 { |
851 { |
870 if ( lastPotentialItemIndex > iBottomItemIndex ) |
852 if ( lastPotentialItemIndex > iBottomItemIndex ) |
871 { |
853 { |
872 lastPotentialItemIndex = iBottomItemIndex; |
854 lastPotentialItemIndex = iBottomItemIndex; |
|
855 } |
|
856 |
|
857 if ( backgroundDrawingSuppressed ) |
|
858 { |
|
859 iGc->SetClippingRect( iViewRect ); |
873 } |
860 } |
874 |
861 |
875 ITEM_EXISTS_BEGIN; |
862 ITEM_EXISTS_BEGIN; |
876 for ( i = firstPotentialItemIndex; i <= lastPotentialItemIndex; i++ ) |
863 for ( i = firstPotentialItemIndex; i <= lastPotentialItemIndex; i++ ) |
877 { |
864 { |
882 else |
869 else |
883 { |
870 { |
884 break; |
871 break; |
885 } |
872 } |
886 } |
873 } |
887 } |
874 |
888 |
875 if ( backgroundDrawingSuppressed ) |
889 if ( listbox && !listbox->BackgroundDrawingSuppressed() ) |
876 { |
|
877 iGc->CancelClippingRect(); |
|
878 } |
|
879 } |
|
880 |
|
881 if ( !backgroundDrawingSuppressed ) |
890 { |
882 { |
891 // Clear the unused portion of the viewing area |
883 // Clear the unused portion of the viewing area |
892 // (this handles drawing the vertical line too :) |
884 // (this handles drawing the vertical line too :) |
893 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
885 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
894 MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc ); |
886 MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc ); |