phonebookui/Speeddial/ControlSrc/SpdiaGridDlg.cpp
branchRCL_3
changeset 32 2828b4d142c0
parent 23 5586b4d2ec3e
child 64 c1e8ba0c2b16
equal deleted inserted replaced
26:0d28c1c5b6dd 32:2828b4d142c0
    81 //
    81 //
    82 CSpdiaGridDlg::CSpdiaGridDlg(TInt& aDial, const CSpdiaControl& aControl): iDial(aDial)
    82 CSpdiaGridDlg::CSpdiaGridDlg(TInt& aDial, const CSpdiaControl& aControl): iDial(aDial)
    83     {
    83     {
    84     iControl = CONST_CAST(CSpdiaControl*, &aControl);
    84     iControl = CONST_CAST(CSpdiaControl*, &aControl);
    85     iCbaID = R_AVKON_SOFTKEYS_BACK;
    85     iCbaID = R_AVKON_SOFTKEYS_BACK;
       
    86     iButton1DownIndex = 0;
    86     }
    87     }
    87 
    88 
    88 // ----------------------------------------------------
    89 // ----------------------------------------------------
    89 // CSpdiaGridDlg::PreLayoutDynInitL
    90 // CSpdiaGridDlg::PreLayoutDynInitL
    90 //
    91 //
   367         CEikStatusPane* StatusPane = 
   368         CEikStatusPane* StatusPane = 
   368         ( ( CAknAppUi* ) CEikonEnv::Static()->EikAppUi() )->StatusPane();
   369         ( ( CAknAppUi* ) CEikonEnv::Static()->EikAppUi() )->StatusPane();
   369 
   370 
   370         if ( Layout_Meta_Data::IsLandscapeOrientation() )
   371         if ( Layout_Meta_Data::IsLandscapeOrientation() )
   371             {
   372             {
   372             StatusPane->MakeVisible( ETrue );
       
   373             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,mainPaneRect );
   373             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,mainPaneRect );
   374             StatusPane->DrawNow();
   374             StatusPane->DrawNow();
   375             }
   375             }
   376         else
   376         else
   377             {
   377             {
   378             StatusPane->MakeVisible( EFalse );
       
   379             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   378             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   380             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, statusPaneRect );
   379             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, statusPaneRect );
   381             mainPaneRect.iTl = statusPaneRect.iTl;
   380             mainPaneRect.iTl = statusPaneRect.iTl;
   382             }	
   381             }	
   383         SetRect( mainPaneRect );
   382         SetRect( mainPaneRect );
   393         CAknDialog::HandleResourceChange( aType );
   392         CAknDialog::HandleResourceChange( aType );
   394         }
   393         }
   395     }
   394     }
   396 
   395 
   397 // ---------------------------------------------------------
   396 // ---------------------------------------------------------
   398 // CSpdiaGridDlg::HandleDialogPageEventL()
   397 // CSpdiaGridDlg::HandlePointerEventL()
   399 // Handles the events on the dialog page (for Touch)
   398 // Handle the pointer events on the dialog page, instead of HandleDialogPageEventL.
   400 // ---------------------------------------------------------
   399 // Because HandleDialogPageEventL() can not handle the different pointer events.
   401 //	
   400 // Only when the index button down is the same with the index button up, assign is right action.
   402 void CSpdiaGridDlg::HandleDialogPageEventL(TInt /*aEventId*/)
   401 // ---------------------------------------------------------
   403     {
   402 //
   404     // When clicking on grid, the function will simulate the event 
   403 void CSpdiaGridDlg::HandlePointerEventL( const TPointerEvent& aPointerEvent )
   405     // just like clicking on LSK
   404 	{
   406     TryExitL( EAknSoftkeyOk );
   405 	iGrid->HandlePointerEventL( aPointerEvent );
   407     }
   406 	if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   407         {
       
   408         iGrid->View()->XYPosToItemIndex( aPointerEvent.iPosition, iButton1DownIndex );
       
   409 	    }
       
   410 	else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
       
   411 		{
       
   412 		TInt button1UpIndex = -1;
       
   413 		iGrid->View()->XYPosToItemIndex( aPointerEvent.iPosition, button1UpIndex );
       
   414 		if( iButton1DownIndex == button1UpIndex )
       
   415 			{
       
   416 			TryExitL( EAknSoftkeyOk );
       
   417 			}
       
   418 		}
       
   419 	}
   408 // End of File
   420 // End of File