--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistbox.cpp Tue May 25 12:34:19 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistbox.cpp Wed Jun 09 09:34:07 2010 +0300
@@ -140,6 +140,8 @@
MSwtComposite& aParent,
TInt aStyle)
: ASwtScrollableBase(aDisplay, aPeer, &aParent, aStyle)
+ , iFlickScrollingOngoing(EFalse)
+
{
}
@@ -343,7 +345,32 @@
// Deliver event to scrollbar
if (iVScrollBarGrabsPointerEvents && vsb)
{
- vsb->HandlePointerEventL(aPointerEvent);
+ if (!iFlickScrollingOngoing
+ && aPointerEvent.iType == TPointerEvent::EButton1Down)
+ {
+ // Scrollbar was tapped after scrolling stopped
+ // by itself, so no need to redirect events
+ iScrollbarPointerEventToListbox = EFalse;
+ }
+
+ if (iScrollbarPointerEventToListbox)
+ {
+ // Stops kinetic scrolling when scrollbar is tapped
+ iList->HandlePointerEventL(aPointerEvent);
+ // Continue delivering events until button up appears to prevent
+ // some unexpected behavior in both scrollbar and listbox
+ switch (aPointerEvent.iType)
+ {
+ case TPointerEvent::EButton1Up:
+ iScrollbarPointerEventToListbox = EFalse;
+ break;
+ }
+ }
+ else
+ {
+ // Handles scrollbar behavior
+ vsb->HandlePointerEventL(aPointerEvent);
+ }
}
// Deliver event to list
@@ -415,6 +442,8 @@
{
iVScrollBarGrabsPointerEvents = EFalse;
}
+
+ PostMouseEventL(aPointerEvent);
}
#else //RD_SCALABLE_UI_V2
void CSwtListBox::HandlePointerEventL(
@@ -472,6 +501,9 @@
// This gets called before contained list is created.
if (iList)
{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ EnableFocusHighlight(isFocused);
+#endif //RD_JAVA_S60_RELEASE_9_2
iList->SetFocus(isFocused, aDrawNow);
}
HandleFocusChanged(aDrawNow);
@@ -645,6 +677,14 @@
//
void CSwtListBox::ProcessKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ if (aType == EEventKeyDown)
+ {
+ // After panning focus highlight was disabled, so enabling again
+ EnableFocusHighlight(ETrue);
+ }
+#endif //RD_JAVA_S60_RELEASE_9_2
+
// No items or not a normal key event
if (iList->Model()->NumberOfItems() == 0 || aType != EEventKey)
{
@@ -818,6 +858,22 @@
}
#endif
+#ifdef RD_JAVA_S60_RELEASE_9_2
+// ---------------------------------------------------------------------------
+// CSwtListBox::EnableFocusHighlight
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtListBox::EnableFocusHighlight(TBool aEnable)
+{
+ ASSERT(iList);
+ ASSERT(iList->View());
+
+ CSwtListBoxLists::EnableFocusHighlight(iList->View()->ItemDrawer(),
+ aEnable);
+}
+#endif //RD_JAVA_S60_RELEASE_9_2
+
// ---------------------------------------------------------------------------
// CSwtListBox::Scrollable
// From MSwtListBox
@@ -1330,6 +1386,8 @@
return;
}
+ UpdateFlickScrollingState(aEventType);
+
switch (aEventType)
{
// On 5.0, drawing trough Java gives simply a better fps.
@@ -2480,3 +2538,22 @@
}
}
#endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+
+// ---------------------------------------------------------------------------
+// CSwtTableListBox::UpdateFlickScrollingState
+// Updates flick scrolling status based on received listbox event.
+// ---------------------------------------------------------------------------
+//
+void CSwtListBox::UpdateFlickScrollingState(TListBoxEvent aEventType)
+{
+ switch (aEventType)
+ {
+ case EEventFlickStarted:
+ iFlickScrollingOngoing = ETrue;
+ iScrollbarPointerEventToListbox = ETrue;
+ break;
+ case EEventFlickStopped:
+ iFlickScrollingOngoing = EFalse;
+ break;
+ }
+}