uifw/EikStd/dlgsrc/EIKDPAGE.CPP
branchRCL_3
changeset 51 fcdfafb36fe7
parent 50 a1caeb42b3a3
child 55 aecbbf00d063
equal deleted inserted replaced
50:a1caeb42b3a3 51:fcdfafb36fe7
  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  
  1387     SetDataPosition( topYPosOfControlWhichMustBeViewable, bottomYPosOfControlWhichMustBeViewable, aForceResize ); 
  1419     SetDataPosition( topYPosOfControlWhichMustBeViewable, bottomYPosOfControlWhichMustBeViewable, aForceResize ); 
  1388   
  1420   
  1389     if ( aLine != iLastExposedLine )
  1421     if ( aLine != iLastExposedLine )
  1390         {
  1422         {
  1391         iLastExposedLine = aLine;
  1423         iLastExposedLine = aLine;
  1935         // Using form layout, since this is used by AknForm only
  1967         // Using form layout, since this is used by AknForm only
  1936         TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( 
  1968         TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( 
  1937             AknLayoutScalable_Avkon::listscroll_form_pane(),  
  1969             AknLayoutScalable_Avkon::listscroll_form_pane(),  
  1938             AknLayoutScalable_Avkon::scroll_pane_cp8());
  1970             AknLayoutScalable_Avkon::scroll_pane_cp8());
  1939             
  1971             
  1940         TRect scrollBarParent( MainPane().Size() );
  1972 		//Using Rect() instead of main pane rect for supporting partial input mode.
  1941     
  1973         //TRect scrollBarParent( MainPane().Size() );   
  1942         AknLayoutUtils::LayoutVerticalScrollBar(iPageContainer->ScrollBar(), scrollBarParent, layout.LayoutLine());
  1974         AknLayoutUtils::LayoutVerticalScrollBar(iPageContainer->ScrollBar(), Rect(), layout.LayoutLine());
       
  1975         
  1943         if(!ScbState() &&  iCurrentLine!=-1 && iCurrentLine < iLines->Count() )
  1976         if(!ScbState() &&  iCurrentLine!=-1 && iCurrentLine < iLines->Count() )
  1944         	{
  1977         	{
  1945     		CEikCaptionedControl *ctrl = (*iLines)[iCurrentLine];
  1978     		CEikCaptionedControl *ctrl = (*iLines)[iCurrentLine];
  1946         	if(ctrl->ControlIsAPopfield(ctrl->iControlType))
  1979         	if(ctrl->ControlIsAPopfield(ctrl->iControlType))
  1947 				{
  1980 				{
  4407 void CEikDialogPageContainer::SetPageSelector(const CEikDialogPageSelector* aPageSelector)
  4440 void CEikDialogPageContainer::SetPageSelector(const CEikDialogPageSelector* aPageSelector)
  4408     {
  4441     {
  4409     iPageSelector = aPageSelector;
  4442     iPageSelector = aPageSelector;
  4410     }
  4443     }
  4411 
  4444 
  4412 void CEikDialogPageContainer::SetPageFormSized()
  4445 void CEikDialogPageContainer::SetPageFormSized(const TRect& aRect)
  4413     {
  4446     {
  4414     iForm = ETrue;
  4447     iForm = ETrue;
  4415 
  4448 
  4416     //
  4449     //
  4417     // Form layout
  4450     // Form layout
  4418     //
  4451     //    
  4419     
  4452     
  4420     /** Dialog page container and page have the same size */
  4453     SetRect(aRect);
  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         }
       
  4438 
  4454 
  4439     /** Only forms have line highlight animations. Animation creation is delayed
  4455     /** Only forms have line highlight animations. Animation creation is delayed
  4440       * here.
  4456       * here.
  4441       */
  4457       */
  4442     if ( !iAnimation )
  4458     if ( !iAnimation )