--- a/emailuis/emailui/src/ncsaddressinputfield.cpp Wed Mar 31 21:08:33 2010 +0300
+++ b/emailuis/emailui/src/ncsaddressinputfield.cpp Wed Apr 14 15:42:15 2010 +0300
@@ -32,6 +32,8 @@
#include <sysutil.h>
#include <AknUtils.h>
#include <FreestyleEmailUi.rsg>
+#include <AknPhysics.h>
+
#include "FreestyleEmailUiAppui.h"
#include "FreestyleEmailUiLayoutData.h"
#include "FreestyleEmailUiLayoutHandler.h"
@@ -53,10 +55,8 @@
MNcsAddressPopupList* aAddressPopupList,
CNcsHeaderContainer* aParentControl ):
MNcsControl( aSizeObserver ),
- // <cmail>
iParentControl( aParentControl ),
iAddressPopupList( aAddressPopupList ),
- // </cmail>
iFieldType( aFieldType )
{
FUNC_LOG;
@@ -352,7 +352,32 @@
{
iButton->HandlePointerEventL( aPointerEvent );
}
- iTextEditor->HandleTextChangedL();
+ iTextEditor->HandleTextChangedL();
+
+ switch( aPointerEvent.iType )
+ {
+ case TPointerEvent::EButton1Down:
+ {
+ // Save start position so that it can be used in
+ // drag/scrolling calculations
+ iStartPosition = aPointerEvent.iPosition;
+ iIsDraggingStarted = EFalse;
+ break;
+ }
+
+ case TPointerEvent::EDrag:
+ {
+ if ( !iIsDraggingStarted && iPhysics )
+ {
+ TInt drag( iStartPosition.iY - aPointerEvent.iPosition.iY );
+ if ( Abs( drag ) > iPhysics->DragThreshold() )
+ {
+ iIsDraggingStarted = ETrue;
+ }
+ }
+ break;
+ }
+ }
}
// -----------------------------------------------------------------------------
@@ -364,7 +389,7 @@
{
if( aEventType == EEventStateChanged )
{
- if( aControl == iButton )
+ if( aControl == iButton && !iIsDraggingStarted )
{
iParentControl->OpenPhonebookL();
}
@@ -832,3 +857,9 @@
}
}
}
+
+void CNcsAddressInputField::EnableKineticScrollingL( CAknPhysics* aPhysics )
+ {
+ iPhysics = aPhysics;
+ iTextEditor->EnableKineticScrollingL( aPhysics );
+ }