uifw/EikStd/coctlsrc/aknstyluspopupmenu.cpp
branchRCL_3
changeset 64 85902f042028
parent 56 d48ab3b357f1
child 72 a5e7a4f63858
--- a/uifw/EikStd/coctlsrc/aknstyluspopupmenu.cpp	Tue Sep 14 21:48:24 2010 +0300
+++ b/uifw/EikStd/coctlsrc/aknstyluspopupmenu.cpp	Wed Sep 15 12:29:17 2010 +0300
@@ -426,14 +426,7 @@
     {
     if ( aControl && aEventType == EEventStateChanged )
         {
-        if ( iPreviewPopup )
-            {
-            iPreviewPopup->HidePopUp();
-            }
-        if ( iController )
-            {
-            iController->HidePopUp();
-            }
+        HidePreviewPopup();
 
         if ( iMenuObserver )
             {
@@ -463,20 +456,14 @@
         }
     else if ( aControl && aEventType == EEventRequestExit )
         {
-        if ( iPreviewPopup )
-            {
-            iPreviewPopup->HidePopUp();
-            }
-
-        if ( iController )
-            {
-            iController->HidePopUp();
-            }      
+        HidePreviewPopup();
 
         StartControllerIdleL();
         }
     else if ( aControl && aEventType == EEventRequestCancel )
         {
+        HidePreviewPopup();
+
         if ( iMenuObserver )
             {
             TBool isAlreadySet = iFlags.IsSet( EIdleDisabled );
@@ -587,3 +574,20 @@
     {
     static_cast<CAknStylusPopUpMenu*>( aParam )->iIsDeleted = NULL;
     }
+
+// -----------------------------------------------------------------------------
+// Hide Preview Popups
+// -----------------------------------------------------------------------------
+//
+void CAknStylusPopUpMenu::HidePreviewPopup()
+    {
+    if ( iPreviewPopup )
+        {
+        iPreviewPopup->HidePopUp();
+        }
+
+    if ( iController )
+        {
+        iController->HidePopUp();
+        }
+    }