uifw/EikStd/dlgsrc/EIKDPAGE.CPP
branchRCL_3
changeset 72 a5e7a4f63858
parent 59 978afdc0236f
equal deleted inserted replaced
64:85902f042028 72:a5e7a4f63858
  1382             topYPosOfControlWhichMustBeViewable = iLastExposedLineViewWinYPosition;
  1382             topYPosOfControlWhichMustBeViewable = iLastExposedLineViewWinYPosition;
  1383             bottomYPosOfControlWhichMustBeViewable = topYPosOfControlWhichMustBeViewable + controlHeight;
  1383             bottomYPosOfControlWhichMustBeViewable = topYPosOfControlWhichMustBeViewable + controlHeight;
  1384             }
  1384             }
  1385         }
  1385         }
  1386 
  1386 
  1387     // If control height is greater then screen. Make sure that edwin's cursor is visible
       
  1388     if (controlType == EEikCtEdwin && controlHeight > Rect().Height())
       
  1389         {
       
  1390         CEikEdwin* edwin = dynamic_cast<CEikEdwin*>(capCtrl->iControl); 
       
  1391         if (edwin)
       
  1392             {
       
  1393             TInt pos = edwin->CursorPos();
       
  1394             TRect linerect;
       
  1395             TRAP_IGNORE( linerect = edwin->TextLayout()->GetLineRectL(pos, pos) );
       
  1396             
       
  1397             TPoint capctrlpos = capCtrl->Position();
       
  1398             TPoint edwinpos = edwin->Position();
       
  1399             if (edwinpos.iY - capctrlpos.iY + (linerect.iTl.iY + linerect.iBr.iY)/2 > Rect().Height()/2) // cursor not fully visible
       
  1400                 {
       
  1401                 TInt offset = edwinpos.iY - capctrlpos.iY + (linerect.iTl.iY + linerect.iBr.iY)/2 - Rect().Height()/2;
       
  1402                 if (topYPosOfControlWhichMustBeViewable + offset + Rect().Height() <= bottomYPosOfControlWhichMustBeViewable)
       
  1403                     {
       
  1404                     topYPosOfControlWhichMustBeViewable += offset;
       
  1405                     bottomYPosOfControlWhichMustBeViewable = topYPosOfControlWhichMustBeViewable + Rect().Height();
       
  1406                     }
       
  1407                 else
       
  1408                     {
       
  1409                     topYPosOfControlWhichMustBeViewable = bottomYPosOfControlWhichMustBeViewable - Rect().Height();
       
  1410                     }
       
  1411                 }
       
  1412             else
       
  1413                 {
       
  1414                 bottomYPosOfControlWhichMustBeViewable = topYPosOfControlWhichMustBeViewable + Rect().Height();
       
  1415                 }
       
  1416             }
       
  1417         }
       
  1418  
       
  1419     SetDataPosition( topYPosOfControlWhichMustBeViewable, bottomYPosOfControlWhichMustBeViewable, aForceResize ); 
  1387     SetDataPosition( topYPosOfControlWhichMustBeViewable, bottomYPosOfControlWhichMustBeViewable, aForceResize ); 
  1420   
  1388   
  1421     if ( aLine != iLastExposedLine )
  1389     if ( aLine != iLastExposedLine )
  1422         {
  1390         {
  1423         iLastExposedLine = aLine;
  1391         iLastExposedLine = aLine;
  1967         // Using form layout, since this is used by AknForm only
  1935         // Using form layout, since this is used by AknForm only
  1968         TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( 
  1936         TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( 
  1969             AknLayoutScalable_Avkon::listscroll_form_pane(),  
  1937             AknLayoutScalable_Avkon::listscroll_form_pane(),  
  1970             AknLayoutScalable_Avkon::scroll_pane_cp8());
  1938             AknLayoutScalable_Avkon::scroll_pane_cp8());
  1971             
  1939             
  1972 		//Using Rect() instead of main pane rect for supporting partial input mode.
  1940         TRect scrollBarParent( MainPane().Size() );
  1973         //TRect scrollBarParent( MainPane().Size() );   
  1941     
  1974         AknLayoutUtils::LayoutVerticalScrollBar(iPageContainer->ScrollBar(), Rect(), layout.LayoutLine());
  1942         AknLayoutUtils::LayoutVerticalScrollBar(iPageContainer->ScrollBar(), scrollBarParent, layout.LayoutLine());
  1975         
       
  1976         if(!ScbState() &&  iCurrentLine!=-1 && iCurrentLine < iLines->Count() )
  1943         if(!ScbState() &&  iCurrentLine!=-1 && iCurrentLine < iLines->Count() )
  1977         	{
  1944         	{
  1978     		CEikCaptionedControl *ctrl = (*iLines)[iCurrentLine];
  1945     		CEikCaptionedControl *ctrl = (*iLines)[iCurrentLine];
  1979         	if(ctrl->ControlIsAPopfield(ctrl->iControlType))
  1946         	if(ctrl->ControlIsAPopfield(ctrl->iControlType))
  1980 				{
  1947 				{
  2243 
  2210 
  2244                 if ( iCurrentLine != KErrNotFound )
  2211                 if ( iCurrentLine != KErrNotFound )
  2245                     {
  2212                     {
  2246                     ExposeLine( iCurrentLine, ETrue );
  2213                     ExposeLine( iCurrentLine, ETrue );
  2247                     }
  2214                     }
  2248                 TRAP_IGNORE( RecordLinesL() );
       
  2249                 DrawDeferred();
       
  2250                 break;
  2215                 break;
  2251                 
  2216                 
  2252             case KAknMessageFocusLost:
  2217             case KAknMessageFocusLost:
  2253                 if ( !IsEditable() && iExtension && 
  2218                 if ( !IsEditable() && iExtension && 
  2254                     iExtension->iUsesSingleClick && HighlightVisible() )
  2219                     iExtension->iUsesSingleClick && HighlightVisible() )
  2259             
  2224             
  2260                     if ( line )
  2225                     if ( line )
  2261                         {
  2226                         {
  2262                         ShowFocus( EFalse, ETrue );
  2227                         ShowFocus( EFalse, ETrue );
  2263                         }
  2228                         }
  2264                     }
       
  2265                 //Stop physics and synchronize the page to reset KS
       
  2266                 //when page losing foreground.
       
  2267                 if ( IsEditable() && iExtension->iScrolling 
       
  2268                 	              && iPhysics->OngoingPhysicsAction() == 
       
  2269                                   CAknPhysics::EAknPhysicsActionDragging ) 
       
  2270                 	{
       
  2271                 	iPhysics->Stop();
       
  2272                     Synchronize();
       
  2273                     }
  2229                     }
  2274                 break;
  2230                 break;
  2275 
  2231 
  2276             default:
  2232             default:
  2277                 break;
  2233                 break;
  3211     
  3167     
  3212     TInt touchedLine = iExtension->iLastTouchedLine;
  3168     TInt touchedLine = iExtension->iLastTouchedLine;
  3213     
  3169     
  3214     if ( ( touchedLine < iLines->Count() ) && ( touchedLine != iCurrentLine ) )
  3170     if ( ( touchedLine < iLines->Count() ) && ( touchedLine != iCurrentLine ) )
  3215         {
  3171         {
  3216         TRAP_IGNORE( (*iLines)[touchedLine]->ActivateL() );
  3172         (*iLines)[touchedLine]->ActivateL();
  3217         
  3173         
  3218         if ( LineIsFocusable( touchedLine ) )
  3174         if ( LineIsFocusable( touchedLine ) )
  3219             {
  3175             {
  3220             TRAP_IGNORE( PrepareForFocusTransitionL();
  3176             TRAP_IGNORE( PrepareForFocusTransitionL();
  3221                          ChangeFocusToAndExposeL( touchedLine );
  3177                          ChangeFocusToAndExposeL( touchedLine );
  4451 void CEikDialogPageContainer::SetPageSelector(const CEikDialogPageSelector* aPageSelector)
  4407 void CEikDialogPageContainer::SetPageSelector(const CEikDialogPageSelector* aPageSelector)
  4452     {
  4408     {
  4453     iPageSelector = aPageSelector;
  4409     iPageSelector = aPageSelector;
  4454     }
  4410     }
  4455 
  4411 
  4456 void CEikDialogPageContainer::SetPageFormSized(const TRect& aRect)
  4412 void CEikDialogPageContainer::SetPageFormSized()
  4457     {
  4413     {
  4458     iForm = ETrue;
  4414     iForm = ETrue;
  4459 
  4415 
  4460     //
  4416     //
  4461     // Form layout
  4417     // Form layout
  4462     //    
  4418     //
  4463     
  4419     
  4464     SetRect(aRect);
  4420     /** Dialog page container and page have the same size */
       
  4421     TRect mainPaneRect;
       
  4422     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
       
  4423     mainPaneRect = TRect( mainPaneRect.Size() );    // Moving to point (0, 0)
       
  4424     TAknLayoutRect formPaneLt;
       
  4425     formPaneLt.LayoutRect( mainPaneRect, AknLayoutScalable_Avkon::listscroll_form_pane().LayoutLine() );
       
  4426     formPaneLt.LayoutRect( formPaneLt.Rect(), AknLayoutScalable_Avkon::list_form_gen_pane().LayoutLine() );
       
  4427     
       
  4428     //
       
  4429     // End of form layout
       
  4430     //
       
  4431 
       
  4432     if ( formPaneLt.Rect() != Rect() )
       
  4433         {
       
  4434         // TODO: use static method to do variation between traditional scrolling and panning when available
       
  4435         //SetRect( formPaneLt.Rect() );
       
  4436         SetRect( mainPaneRect );
       
  4437         }
  4465 
  4438 
  4466     /** Only forms have line highlight animations. Animation creation is delayed
  4439     /** Only forms have line highlight animations. Animation creation is delayed
  4467       * here.
  4440       * here.
  4468       */
  4441       */
  4469     if ( !iAnimation )
  4442     if ( !iAnimation )