uifw/AvKon/src/Aknpopupform.cpp
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 0 2f259fa3e83a
child 55 aecbbf00d063
--- a/uifw/AvKon/src/Aknpopupform.cpp	Wed Apr 14 16:14:00 2010 +0300
+++ b/uifw/AvKon/src/Aknpopupform.cpp	Tue Apr 27 16:55:05 2010 +0300
@@ -596,6 +596,17 @@
                 {
                 ClearArea( Rect() );
                 UpdateScrollIndicatorL();
+                // if iNoOfEditorLines becomes small, firstly calculate the New PopupForm layout.
+				// Because position of PopupForm is related to last PoppupForm layout.
+				if ( iNoOfEditorLines < oldNoOfLines )
+					{
+					TSize size;
+				    if ( !AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, size ) )
+				    	{
+						size = iCoeEnv->ScreenDevice()->SizeInPixels() ;
+				    	}
+					SetSizeAndPosition( PreferredSize( size ) );
+					}
                 LayoutAndDraw();
                 }
             else if ( IsActivated() )
@@ -2336,6 +2347,15 @@
     UpdateFlags( ctrlType, ETrue );
 
     CalculateNumberOfScreens();
+    // because of insert a control, iNoOfEditorLines of editor become small, 
+    // but position is calculated by previous size of editor,
+    // So firstly calculate editor layout.
+    TSize size;
+    if ( !AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, size ) )
+    	{
+		size = iCoeEnv->ScreenDevice()->SizeInPixels() ;
+    	}
+	SetSizeAndPosition( PreferredSize( size ) );
     LayoutAndDraw();
     UpdateScrollIndicatorL();