mpxplugins/viewplugins/views/addtracksdialog/src/mpxaddtracksdialog.cpp
changeset 2 b70d77332e66
parent 0 ff3acec5bc43
child 5 2a40e88564c8
equal deleted inserted replaced
1:8118492f1bdf 2:b70d77332e66
   588     TInt offset =
   588     TInt offset =
   589         lbxView->NumberOfItemsThatFitInRect( lbxView->ViewRect() ) - 1;
   589         lbxView->NumberOfItemsThatFitInRect( lbxView->ViewRect() ) - 1;
   590 
   590 
   591     CAknFilteredTextListBoxModel* lbxModel =
   591     CAknFilteredTextListBoxModel* lbxModel =
   592         static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() );
   592         static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() );
   593     CAknSearchField* tempSearchField =
   593     CAknSearchField* findBox = FindBox();
   594         static_cast<CAknSearchField*>( lbxModel->Filter()->FindBox() );
       
   595     lbxModel->Filter()->SetSearchField( NULL );//for find the items
   594     lbxModel->Filter()->SetSearchField( NULL );//for find the items
   596     // Update item array
   595     // Update item array
   597     iLbxFilterItems->HandleItemArrayChangeL();
   596     iLbxFilterItems->HandleItemArrayChangeL();
   598     lbxModel->Filter()->SetSearchField( tempSearchField );// for laylout of list
   597     lbxModel->Filter()->SetSearchField( findBox );// for laylout of list
   599 
   598 
   600     TInt itemCount = CurrentListItemCount();
   599     TInt itemCount = CurrentListItemCount();
   601     if ( itemCount )
   600     if ( itemCount )
   602         {
   601         {
   603         TInt lastItemIdx = itemCount - 1;
   602         TInt lastItemIdx = itemCount - 1;
  1506             findBox->MakeVisible( EFalse );
  1505             findBox->MakeVisible( EFalse );
  1507             findBox->SetFocus( EFalse );
  1506             findBox->SetFocus( EFalse );
  1508             TRAP_IGNORE( findBox->ResetL() );
  1507             TRAP_IGNORE( findBox->ResetL() );
  1509             iListBox->SetFocus( ETrue );
  1508             iListBox->SetFocus( ETrue );
  1510             
  1509             
       
  1510             CAknFilteredTextListBoxModel* lbxModel =
       
  1511                 static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() );
       
  1512             lbxModel->Filter()->SetSearchField( findBox );// for laylout of list
  1511             TRect mainPane;
  1513             TRect mainPane;
  1512             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
  1514             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
  1513             SetSizeAndPosition( mainPane.Size() );
  1515             SetSizeAndPosition( mainPane.Size() );
       
  1516             DrawDeferred();
  1514             break;
  1517             break;
  1515             }
  1518             }
  1516         default:
  1519         default:
  1517             {
  1520             {
  1518             retVal = CAknSelectionListDialog::OkToExitL( aButtonId );
  1521             retVal = CAknSelectionListDialog::OkToExitL( aButtonId );
  1535     {
  1538     {
  1536     MPX_FUNC( "CMPXAddTracksDialog::OfferKeyEventL" );
  1539     MPX_FUNC( "CMPXAddTracksDialog::OfferKeyEventL" );
  1537     TKeyResponse res = EKeyWasNotConsumed;
  1540     TKeyResponse res = EKeyWasNotConsumed;
  1538     TBool updateCBA = EFalse;
  1541     TBool updateCBA = EFalse;
  1539     CAknSearchField* findbox = FindBox();
  1542     CAknSearchField* findbox = FindBox();
       
  1543     
       
  1544     CAknFilteredTextListBoxModel* lbxModel =
       
  1545         static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() );
       
  1546     lbxModel->Filter()->SetSearchField( NULL );//for find the items
  1540 
  1547 
  1541     if ( aType == EEventKey )
  1548     if ( aType == EEventKey )
  1542         {
  1549         {
  1543         StopAnimL();
  1550         StopAnimL();
  1544 
  1551 
  1645                     findBox->MakeVisible( EFalse );
  1652                     findBox->MakeVisible( EFalse );
  1646                     findBox->SetFocus( EFalse );
  1653                     findBox->SetFocus( EFalse );
  1647                     TRAP_IGNORE( findBox->ResetL() );
  1654                     TRAP_IGNORE( findBox->ResetL() );
  1648                     iListBox->SetFocus( ETrue );
  1655                     iListBox->SetFocus( ETrue );
  1649                     
  1656                     
       
  1657                     lbxModel->Filter()->SetSearchField( findBox );// for laylout of list
       
  1658                     
  1650                     TRect mainPane;
  1659                     TRect mainPane;
  1651                     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
  1660                     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
  1652                     SetSizeAndPosition( mainPane.Size() );
  1661                     SetSizeAndPosition( mainPane.Size() );
       
  1662                     iListBox->DrawDeferred();
  1653                     res = EKeyWasConsumed;
  1663                     res = EKeyWasConsumed;
  1654                     }
  1664                     }
  1655                 else
  1665                 else
  1656                     {
  1666                     {
  1657                     offerEventToBaseClass = ETrue;
  1667                     offerEventToBaseClass = ETrue;
  1685     MPX_FUNC( "CMPXAddTracksDialog::HandleResourceChange" );
  1695     MPX_FUNC( "CMPXAddTracksDialog::HandleResourceChange" );
  1686     CAknSelectionListDialog::HandleResourceChange( aType );
  1696     CAknSelectionListDialog::HandleResourceChange( aType );
  1687 
  1697 
  1688     if ( aType == KEikDynamicLayoutVariantSwitch )
  1698     if ( aType == KEikDynamicLayoutVariantSwitch )
  1689         {
  1699         {
  1690         TRect rect;
  1700         CAknSearchField* findBox = FindBox();    
  1691         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
  1701         CAknFilteredTextListBoxModel* lbxModel =
  1692         SetRect( rect );
  1702             static_cast<CAknFilteredTextListBoxModel*>( iListBox->Model() );
       
  1703         lbxModel->Filter()->SetSearchField( findBox );// for laylout of list
       
  1704 
       
  1705         TRect mainPane;
       
  1706         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
       
  1707         SetSizeAndPosition( mainPane.Size() );
  1693         }
  1708         }
  1694 
  1709 
  1695     if ( aType == KAknsMessageSkinChange )
  1710     if ( aType == KAknsMessageSkinChange )
  1696         {
  1711         {
  1697         // Create and set icon array. Ownership transferred.
  1712         // Create and set icon array. Ownership transferred.