uifw/EikStd/coctlsrc/EIKMENUP.CPP
branchRCL_3
changeset 9 0aa5fbdfbc30
parent 8 71dd06cfe933
child 10 3d340a0166ff
equal deleted inserted replaced
8:71dd06cfe933 9:0aa5fbdfbc30
  2285     if ( iItemArray )
  2285     if ( iItemArray )
  2286         {// Min size is for 1 item even if menu is empty
  2286         {// Min size is for 1 item even if menu is empty
  2287         numItemsInPane = iItemArray->Count();
  2287         numItemsInPane = iItemArray->Count();
  2288         }
  2288         }
  2289 
  2289 
  2290     if ( iExtension->iSct )
  2290     if ( iExtension && iExtension->iSct )
  2291         {
  2291         {
  2292         numItemsInPane++;
  2292         numItemsInPane++;
  2293         }
  2293         }
  2294 
  2294 
  2295     TInt maxItemsInView = NumberOfItemsThatFitInView();
  2295     TInt maxItemsInView = NumberOfItemsThatFitInView();
  3764     CEikMenuBar* menubar = static_cast<CEikMenuBar*>( Parent() );
  3764     CEikMenuBar* menubar = static_cast<CEikMenuBar*>( Parent() );
  3765     if( menubar->MenuPane() == this )
  3765     if( menubar->MenuPane() == this )
  3766         {
  3766         {
  3767         TPointerEvent ptrEvent;
  3767         TPointerEvent ptrEvent;
  3768         ptrEvent.iType = TPointerEvent::EButton1Up;
  3768         ptrEvent.iType = TPointerEvent::EButton1Up;
  3769         menubar->HandlePointerEventL( ptrEvent );
  3769         TRAP_IGNORE( menubar->HandlePointerEventL( ptrEvent ) );
  3770         }
  3770         }
  3771     else
  3771     else
  3772         {
  3772         {
  3773         MCoeControlObserver* observer = iOwner ? iOwner->Observer() : Observer();
  3773         MCoeControlObserver* observer = iOwner ? iOwner->Observer() : Observer();
  3774         if ( observer )
  3774         if ( observer )
  4282                     }
  4282                     }
  4283                 }
  4283                 }
  4284             else
  4284             else
  4285                 {
  4285                 {
  4286                 // Clicked out side submenu, parent handles this
  4286                 // Clicked out side submenu, parent handles this
       
  4287                 iExtension->iDownOnMenuArea = EFalse;
  4287                 if ( iOwner )
  4288                 if ( iOwner )
  4288                     {
  4289                     {
  4289                     iExtension->CalculateParentEvent(aPointerEvent, parentEvent);                                        
  4290                     iExtension->CalculateParentEvent(aPointerEvent, parentEvent);                                        
  4290                     _AKNTRACE( "[%s]", "HandlePointerEventL return 12" );
  4291                     _AKNTRACE( "[%s]", "HandlePointerEventL return 12" );
  4291                     _AKNTRACE_FUNC_EXIT;
  4292                     _AKNTRACE_FUNC_EXIT;
  4379                 iExtension->iNextHighlightItem = KErrNotFound;
  4380                 iExtension->iNextHighlightItem = KErrNotFound;
  4380                 iExtension->iPanningActive = ETrue;
  4381                 iExtension->iPanningActive = ETrue;
  4381                 iExtension->EnableHighlight( EFalse );
  4382                 iExtension->EnableHighlight( EFalse );
  4382                 }    
  4383                 }    
  4383                          
  4384                          
  4384             if ( iExtension->iPanningActive )
  4385             if ( iExtension->iPanningActive && iExtension->iDownOnMenuArea )
  4385                 {
  4386                 {
  4386                 TPoint delta( 
  4387                 TPoint delta( 
  4387                     0, iExtension->iPrevPoint.iY - aPointerEvent.iPosition.iY );
  4388                     0, iExtension->iPrevPoint.iY - aPointerEvent.iPosition.iY );
  4388                 iExtension->iPhysics->RegisterPanningPosition( delta );
  4389                 iExtension->iPhysics->RegisterPanningPosition( delta );
  4389                 } 
  4390                 } 
  4433                                     }
  4434                                     }
  4434                                 iExtension->iShowCascadeTransition = ETrue;
  4435                                 iExtension->iShowCascadeTransition = ETrue;
  4435                                 CloseCascadeMenu();
  4436                                 CloseCascadeMenu();
  4436                                 }
  4437                                 }
  4437                             }
  4438                             }
  4438                         else
       
  4439                             {
       
  4440                             TInt oldSelected = iSelectedItem;
       
  4441                             // update highlight to new item
       
  4442                             if ( oldSelected != ii )
       
  4443                                 {
       
  4444                                 iExtension->iPressedDown = EFalse;
       
  4445                                 }
       
  4446                             TRect screenRect( TPoint( KMinTInt, KMinTInt ),
       
  4447                                     TPoint( KMaxTInt, KMaxTInt ) );
       
  4448                             TRect repeatRect( screenRect.iTl.iX, item->iPos,
       
  4449                                     screenRect.iBr.iX, item->iPos
       
  4450                                             + iItemHeight );
       
  4451                             }
       
  4452                         // item found, break                      
  4439                         // item found, break                      
  4453                         break;
  4440                         break;
  4454                         }
  4441                         }
  4455                     }
  4442                     }
  4456 
  4443 
  5102             {
  5089             {
  5103             UpdateScrollBar();
  5090             UpdateScrollBar();
  5104             }
  5091             }
  5105         else
  5092         else
  5106             {
  5093             {
  5107             DoUpdateScrollBarL();
  5094             TRAP_IGNORE( DoUpdateScrollBarL() );
  5108             }        
  5095             }        
  5109         }
  5096         }
  5110     _AKNTRACE_FUNC_EXIT;
  5097     _AKNTRACE_FUNC_EXIT;
  5111     return;
  5098     return;
  5112     }
  5099     }
  5381                     {
  5368                     {
  5382                     TPointerEvent pointerEvent = iExtension->iLastPointerEvent;                    
  5369                     TPointerEvent pointerEvent = iExtension->iLastPointerEvent;                    
  5383                     pointerEvent.iType = TPointerEvent::EButton1Up;
  5370                     pointerEvent.iType = TPointerEvent::EButton1Up;
  5384                     // Sending a up event to scroll bar for dehighlighting 
  5371                     // Sending a up event to scroll bar for dehighlighting 
  5385                     // the scroll bar.
  5372                     // the scroll bar.
  5386                     verScrollBar->HandlePointerEventL(pointerEvent);   
  5373                     TRAP_IGNORE ( verScrollBar->HandlePointerEventL(pointerEvent) );   
  5387                     iSBFrame->DrawScrollBarsDeferred();
  5374                     iSBFrame->DrawScrollBarsDeferred();
  5388                     ClaimPointerGrab( EFalse );
  5375                     ClaimPointerGrab( EFalse );
  5389                     }
  5376                     }
  5390                 }
  5377                 }
  5391             // Fixed for TSW error ELLI-7UG89S
  5378             // Fixed for TSW error ELLI-7UG89S