316 // |
316 // |
317 // ----------------------------------------------------------------------------- |
317 // ----------------------------------------------------------------------------- |
318 // |
318 // |
319 void CMmGrid::HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent ) |
319 void CMmGrid::HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent ) |
320 { |
320 { |
321 CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() ); |
321 CAknGrid::HandlePointerEventL(aPointerEvent); |
322 if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
|
323 { |
|
324 const TInt KIgnoreRectSize = 40; |
|
325 TRect ignoreDragRect(aPointerEvent.iPosition, |
|
326 TSize(KIgnoreRectSize, KIgnoreRectSize)); |
|
327 ignoreDragRect.Move( - KIgnoreRectSize / 2, - KIgnoreRectSize / 2 ); |
|
328 Window().RequestPointerRepeatEvent( 50000, ignoreDragRect ); |
|
329 } |
|
330 else if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat ) |
|
331 { |
|
332 HandleButtonRepeatEventInNormalModeL( aPointerEvent ); |
|
333 } |
|
334 CAknGrid::HandlePointerEventL(aPointerEvent); |
|
335 } |
|
336 |
|
337 // ----------------------------------------------------------------------------- |
|
338 // |
|
339 // ----------------------------------------------------------------------------- |
|
340 // |
|
341 void CMmGrid::HandleButtonRepeatEventInNormalModeL( |
|
342 const TPointerEvent& aPointerEvent ) |
|
343 { |
|
344 TInt itemUnderPointerIndex = KErrNotFound; |
|
345 TBool itemFound = View()->XYPosToItemIndex( |
|
346 aPointerEvent.iPosition, itemUnderPointerIndex ); |
|
347 if ( !itemFound ) |
|
348 { |
|
349 return; |
|
350 } |
|
351 |
|
352 View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState ); |
|
353 CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() ); |
|
354 TBool highlightWasVisible = parent->IsHighlightVisible(); |
|
355 |
|
356 if( itemUnderPointerIndex == View()->CurrentItemIndex() ) |
|
357 { |
|
358 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
359 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( |
|
360 iMmDrawer->Gc() ); |
|
361 if ( transApi ) |
|
362 { |
|
363 transApi->Remove( MAknListBoxTfxInternal::EListHighlight ); |
|
364 View()->DrawItem( itemUnderPointerIndex ); |
|
365 TRect itemUnderPointerIndexRect ( |
|
366 View()->ItemPos(itemUnderPointerIndex), |
|
367 View()->ItemSize(itemUnderPointerIndex)); |
|
368 transApi->Draw( itemUnderPointerIndexRect ); |
|
369 } |
|
370 else |
|
371 { |
|
372 View()->DrawItem( itemUnderPointerIndex ); |
|
373 } |
|
374 #else |
|
375 View()->DrawItem( itemUnderPointerIndex ); |
|
376 #endif |
|
377 } |
|
378 else |
|
379 { |
|
380 TInt previouslyHighlightedItemIndex = View()->CurrentItemIndex(); |
|
381 parent->SetManualHighlightL( itemUnderPointerIndex , EFalse ); |
|
382 if ( highlightWasVisible ) |
|
383 { |
|
384 View()->DrawItem( previouslyHighlightedItemIndex ); |
|
385 } |
|
386 } |
|
387 } |
322 } |
388 |
323 |
389 // ----------------------------------------------------------------------------- |
324 // ----------------------------------------------------------------------------- |
390 // |
325 // |
391 // ----------------------------------------------------------------------------- |
326 // ----------------------------------------------------------------------------- |