636 CCoeControl::HandlePointerEventL(aPointerEvent); |
636 CCoeControl::HandlePointerEventL(aPointerEvent); |
637 |
637 |
638 if ( aPointerEvent.iType == TPointerEvent::EButton1Down |
638 if ( aPointerEvent.iType == TPointerEvent::EButton1Down |
639 && itemExists ) |
639 && itemExists ) |
640 { |
640 { |
641 SetHighlightL( index ); |
641 SetHighlightL( index );///////////-- |
642 } |
642 } |
643 else if ( aPointerEvent.iType == TPointerEvent::EDrag |
643 else if ( aPointerEvent.iType == TPointerEvent::EDrag |
644 // the line below is needed to enable edit mode in the list widget |
644 // the line below is needed to enable edit mode in the list widget |
645 // because behaviour in the grid and list is different |
645 // because behaviour in the grid and list is different |
646 || (aPointerEvent.iType == TPointerEvent::EButtonRepeat && WidgetType() == EGridWidget )) |
646 || (aPointerEvent.iType == TPointerEvent::EButtonRepeat && WidgetType() == EGridWidget )) |
764 else |
765 else |
765 { |
766 { |
766 iWidget->View()->ItemDrawer()->ClearFlags( |
767 iWidget->View()->ItemDrawer()->ClearFlags( |
767 CListItemDrawer::ESingleClickDisabledHighlight ); |
768 CListItemDrawer::ESingleClickDisabledHighlight ); |
768 } |
769 } |
769 |
770 |
770 if ( IsVisible() ) |
771 if ( IsVisible() ) |
771 { |
772 { |
772 TInt highlight = GetHighlight(); |
773 TInt highlight = GetHighlight(); |
773 CListBoxView* view = Widget()->View(); |
774 CListBoxView* view = Widget()->View(); |
774 Widget()->DrawNow( TRect( view->ItemPos( highlight ), |
775 Widget()->DrawNow( TRect( view->ItemPos( highlight ), |
1188 |
1189 |
1189 TInt numberOfItemsBefore (0); |
1190 TInt numberOfItemsBefore (0); |
1190 numberOfItemsBefore = GetMmModel()->NumberOfItems(); |
1191 numberOfItemsBefore = GetMmModel()->NumberOfItems(); |
1191 |
1192 |
1192 GetMmModel()->SetSuiteModelL( aModel ); |
1193 GetMmModel()->SetSuiteModelL( aModel ); |
1193 |
1194 |
1194 TBool highlightVisibleBefore = iWidget->IsVisible() && IsHighlightVisible(); |
1195 TBool highlightVisibleBefore = iWidget->IsVisible() && IsHighlightVisible(); |
1195 |
1196 |
1196 // This needs to be in place (disabling redraw) |
1197 // This needs to be in place (disabling redraw) |
1197 // to udpate widget internal state, however to wait for |
1198 // to udpate widget internal state, however to wait for |
1198 // drawing until all highlight set matters are solved. |
1199 // drawing until all highlight set matters are solved. |
1893 { |
1894 { |
1894 // handle same behaviour in edit mode and normal mode |
1895 // handle same behaviour in edit mode and normal mode |
1895 switch ( aEventType ) |
1896 switch ( aEventType ) |
1896 { |
1897 { |
1897 case MEikListBoxObserver::EEventPenDownOnItem: |
1898 case MEikListBoxObserver::EEventPenDownOnItem: |
1898 { |
|
1899 iDragOccured = EFalse; |
|
1900 if ( !iLongTapInProgress ) |
|
1901 { |
|
1902 SetHighlightVisibilityL( ETrue ); |
|
1903 } |
|
1904 break; |
|
1905 } |
|
1906 case MEikListBoxObserver::EEventItemSingleClicked: |
1899 case MEikListBoxObserver::EEventItemSingleClicked: |
1907 { |
1900 { |
1908 if ( !iDragOccured && !iLongTapInProgress ) |
|
1909 { |
|
1910 SetHighlightL( Widget()->CurrentItemIndex() ); |
|
1911 SetHighlightVisibilityL( EFalse ); |
|
1912 } |
|
1913 iDragOccured = EFalse; |
1901 iDragOccured = EFalse; |
1914 break; |
1902 break; |
1915 } |
1903 } |
1916 case MEikListBoxObserver::EEventItemDraggingActioned: |
1904 case MEikListBoxObserver::EEventItemDraggingActioned: |
1917 { |
1905 { |
1918 SetHighlightVisibilityL( EFalse ); |
|
1919 iDragOccured = ETrue; |
1906 iDragOccured = ETrue; |
1920 break; |
1907 break; |
1921 } |
1908 } |
1922 case MEikListBoxObserver::EEventPanningStarted: |
|
1923 case MEikListBoxObserver::EEventPanningStopped: |
|
1924 case MEikListBoxObserver::EEventFlickStarted: |
|
1925 case MEikListBoxObserver::EEventFlickStopped: |
|
1926 { |
|
1927 SetHighlightVisibilityL( EFalse ); |
|
1928 break; |
|
1929 } |
|
1930 } |
1909 } |
1931 |
1910 |
1932 // handle different behaviour in edit mode and normal mode |
1911 // handle different behaviour in edit mode and normal mode |
1933 if ( !IsEditMode() ) |
1912 if ( !IsEditMode() ) |
1934 { |
1913 { |
1935 switch ( aEventType ) |
1914 switch ( aEventType ) |
1936 { |
1915 { |
1937 case MEikListBoxObserver::EEventFlickStarted: |
1916 case MEikListBoxObserver::EEventFlickStarted: |
|
1917 case MEikListBoxObserver::EEventPanningStarted: |
1938 { |
1918 { |
1939 static_cast<CMmListBoxItemDrawer*>( |
1919 static_cast<CMmListBoxItemDrawer*>( |
1940 Widget()->View()->ItemDrawer() )-> |
1920 Widget()->View()->ItemDrawer() )-> |
1941 EnableCachedDataUse( ETrue ); |
1921 EnableCachedDataUse( ETrue ); |
1942 break; |
1922 break; |