Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
authorteknolog
Thu, 25 Feb 2010 16:02:42 +0000
changeset 4 be243543a361
parent 3 3326ac3c89fa
child 5 ba42cd6670b8
Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
application/inc/PodcastQueueView.h
application/src/PodcastListView.cpp
application/src/PodcastQueueView.cpp
application/src/PodcastShowsView.cpp
--- a/application/inc/PodcastQueueView.h	Thu Feb 25 15:23:53 2010 +0000
+++ b/application/inc/PodcastQueueView.h	Thu Feb 25 16:02:42 2010 +0000
@@ -94,8 +94,6 @@
 	void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
 	void FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded = 0);
 
-	void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation);
-
 private:
 	void GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex);
 	void UpdateToolbar();
--- a/application/src/PodcastListView.cpp	Thu Feb 25 15:23:53 2010 +0000
+++ b/application/src/PodcastListView.cpp	Thu Feb 25 16:02:42 2010 +0000
@@ -355,7 +355,12 @@
 void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
 {
 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
-    if(iStylusPopupMenu)
+	
+	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
+	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
+			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
+
+    if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
     {
 		iStylusPopupMenu->ShowMenu();
 		iStylusPopupMenu->SetPosition(aPenEventLocation);
--- a/application/src/PodcastQueueView.cpp	Thu Feb 25 15:23:53 2010 +0000
+++ b/application/src/PodcastQueueView.cpp	Thu Feb 25 16:02:42 2010 +0000
@@ -575,18 +575,6 @@
 	toolbar->HideItem(EPodcastResumeDownloads,!iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue);	
 }
 
-void CPodcastQueueView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
-{
-	DP("CPodcastQueueView::HandleLongTapEventL BEGIN");
-	
-    if(iStylusPopupMenu)
-    {
-		iStylusPopupMenu->ShowMenu();
-		iStylusPopupMenu->SetPosition(aPenEventLocation);
-    }
-	DP("CPodcastQueueView::HandleLongTapEventL END");
-}
-
 void CPodcastQueueView::DownloadQueueUpdatedL(TInt /*aDownloadingShows*/, TInt /*aQueuedShows*/)
 	{
 	}
--- a/application/src/PodcastShowsView.cpp	Thu Feb 25 15:23:53 2010 +0000
+++ b/application/src/PodcastShowsView.cpp	Thu Feb 25 16:02:42 2010 +0000
@@ -796,7 +796,11 @@
 {
 	DP("CPodcastShowsView::HandleLongTapEventL BEGIN");
 	
-    if(iStylusPopupMenu)
+	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
+	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
+			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
+
+    if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
     {
 		TInt index = iListContainer->Listbox()->CurrentItemIndex();
 		if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())