uifw/AvKon/src/akntabgrp.cpp
branchRCL_3
changeset 64 85902f042028
parent 56 d48ab3b357f1
child 72 a5e7a4f63858
equal deleted inserted replaced
59:978afdc0236f 64:85902f042028
    36 #include <aknlayoutscalable_avkon.cdl.h>
    36 #include <aknlayoutscalable_avkon.cdl.h>
    37 #include <akniconconfig.h>
    37 #include <akniconconfig.h>
    38 
    38 
    39 #include <AknTasHook.h>
    39 #include <AknTasHook.h>
    40 #include <touchfeedback.h>
    40 #include <touchfeedback.h>
       
    41 #include <AknPriv.hrh>
    41 
    42 
    42 // USER INCLUDE FILES
    43 // USER INCLUDE FILES
    43 #include "aknappui.h"
    44 #include "aknappui.h"
    44 #include "avkon.hrh"
    45 #include "avkon.hrh"
    45 #include "AknNaviObserver.h"
    46 #include "AknNaviObserver.h"
  2914                 {
  2915                 {
  2915                 // In one tab layout handle the navigation always by
  2916                 // In one tab layout handle the navigation always by
  2916                 // pointer position.
  2917                 // pointer position.
  2917                 newTab = iActiveTab;
  2918                 newTab = iActiveTab;
  2918                 }
  2919                 }
  2919             iExtension->iPointerDownTab       = newTab;
       
  2920             iExtension->iPointerDownXPosition = aPointerEvent.iPosition.iX;
       
  2921             
  2920             
  2922             //Activates highlight drawing for pressed tab.
  2921             //Activates highlight drawing for pressed tab.
  2923             if (!iExtension->iHighlight)
  2922             EnableHighlight( ETrue, newTab, aPointerEvent.iPosition.iX );
  2924                 {
       
  2925                 iExtension->iHighlight = ETrue;
       
  2926                 
       
  2927                 // Set the pressed tab to highlight
       
  2928                 if ( iExtension->iPointerDownTab >= 0 )
       
  2929                     {
       
  2930                     iTabArray->At( iExtension->iPointerDownTab )->SetHighlight( ETrue );
       
  2931                     }
       
  2932                 DrawDeferred();
       
  2933                 }
       
  2934             
  2923             
  2935             return;
  2924             return;
  2936             }
  2925             }
  2937         else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
  2926         else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
  2938             {
  2927             {
  2959                 }
  2948                 }
  2960 
  2949 
  2961             // if the button up event occurs ouside tabgroup, ignore it.
  2950             // if the button up event occurs ouside tabgroup, ignore it.
  2962             if ( !Rect().Contains( aPointerEvent.iPosition ) || iExtension->iPointerDownTab != newTab )
  2951             if ( !Rect().Contains( aPointerEvent.iPosition ) || iExtension->iPointerDownTab != newTab )
  2963                 {
  2952                 {
  2964                 iExtension->iPointerDownTab = -1;
  2953                 EnableHighlight( EFalse );
  2965                 iExtension->iPointerDownXPosition = -1;
       
  2966                 if (iExtension->iHighlight)
       
  2967                     {
       
  2968                     iExtension->iHighlight = EFalse;
       
  2969                     ResetHighlightStatus();
       
  2970                     DrawDeferred();
       
  2971                     }
       
  2972                 return;
  2954                 return;
  2973                 }
  2955                 }
  2974 
  2956 
  2975             if ( newTab != iActiveTab &&
  2957             if ( newTab != iActiveTab &&
  2976                  newTab > -1 &&
  2958                  newTab > -1 &&
  3073                             }
  3055                             }
  3074                         }
  3056                         }
  3075                     }
  3057                     }
  3076                 }
  3058                 }
  3077 
  3059 
  3078             iExtension->iPointerDownTab       = -1;
  3060             EnableHighlight( EFalse );
  3079             iExtension->iPointerDownXPosition = -1;
       
  3080             if( iExtension->iHighlight )
       
  3081                 {
       
  3082                 iExtension->iHighlight = EFalse;
       
  3083                 ResetHighlightStatus();
       
  3084                 DrawDeferred();
       
  3085                 }
       
  3086             }
  3061             }
  3087         }
  3062         }
  3088     }
  3063     }
  3089 
  3064 
  3090 
  3065 
  3433         {
  3408         {
  3434         // If this fails, svg tab graphics are not available.
  3409         // If this fails, svg tab graphics are not available.
  3435         // Then defaults to bitmaps if possible.
  3410         // Then defaults to bitmaps if possible.
  3436         TRAP_IGNORE( InitTabGroupGraphicsL() );
  3411         TRAP_IGNORE( InitTabGroupGraphicsL() );
  3437         TRAP_IGNORE( LoadTabBitmapsL( iNumberOfTabsShown, iLongTabs ) );
  3412         TRAP_IGNORE( LoadTabBitmapsL( iNumberOfTabsShown, iLongTabs ) );
       
  3413         }
       
  3414     
       
  3415     // Stop highlighting the pressed tab when receives KAknMessageFocusLost event.
       
  3416     if( aType == KAknMessageFocusLost )
       
  3417         {
       
  3418         EnableHighlight(EFalse);
  3438         }
  3419         }
  3439 
  3420 
  3440     if ( aType == KEikDynamicLayoutVariantSwitch )
  3421     if ( aType == KEikDynamicLayoutVariantSwitch )
  3441         {
  3422         {
  3442         // If double buffers are used in this layout,
  3423         // If double buffers are used in this layout,
  3464                 }
  3445                 }
  3465 
  3446 
  3466         if ( iExtension )
  3447         if ( iExtension )
  3467             {
  3448             {
  3468             iExtension->iNarrowTabLayout = EFalse;
  3449             iExtension->iNarrowTabLayout = EFalse;
  3469             if( iExtension->iHighlight )
  3450             EnableHighlight(EFalse);
  3470                 {
       
  3471                 iExtension->iHighlight = EFalse;
       
  3472                 ResetHighlightStatus();
       
  3473                 }
       
  3474             }
  3451             }
  3475 
  3452 
  3476         if ( !COMPARE_BOOLS( iMirrored, AknLayoutUtils::LayoutMirrored() ) )
  3453         if ( !COMPARE_BOOLS( iMirrored, AknLayoutUtils::LayoutMirrored() ) )
  3477             {
  3454             {
  3478             TInt active = ActiveTabIndex();
  3455             TInt active = ActiveTabIndex();
  4518     for( TInt i = 0; i < iTabArray->Count(); i++ )
  4495     for( TInt i = 0; i < iTabArray->Count(); i++ )
  4519         {
  4496         {
  4520         iTabArray->At(i)->SetHighlight( EFalse );
  4497         iTabArray->At(i)->SetHighlight( EFalse );
  4521         }
  4498         }
  4522     }
  4499     }
       
  4500 
       
  4501 void CAknTabGroup::EnableHighlight( TBool aEnable, TInt aNewTab , TInt aPointX )
       
  4502     {
       
  4503     iExtension->iPointerDownTab = aNewTab;
       
  4504     iExtension->iPointerDownXPosition = aPointX;
       
  4505     if( aEnable )
       
  4506         {
       
  4507         //Activates highlight drawing for pressed tab.
       
  4508         if (!iExtension->iHighlight)
       
  4509             {
       
  4510             iExtension->iHighlight = ETrue;
       
  4511             
       
  4512             // Set the pressed tab to highlight
       
  4513             if ( iExtension->iPointerDownTab >= 0 )
       
  4514                 {
       
  4515                 iTabArray->At( iExtension->iPointerDownTab )->SetHighlight( ETrue );
       
  4516                 }
       
  4517             DrawDeferred();
       
  4518             }
       
  4519         }
       
  4520     else
       
  4521         {
       
  4522         if (iExtension->iHighlight)
       
  4523             {
       
  4524             iExtension->iHighlight = EFalse;
       
  4525             ResetHighlightStatus();
       
  4526             DrawDeferred();
       
  4527             }
       
  4528         }
       
  4529     }
  4523  //  End of File
  4530  //  End of File