I am doing an app for 5800 and N97. One of the views has two editors (a CEikEdwin and a CEikSecretEditor) for letting the user input login and password. These two controls are contained in a CCoeControl created by the uidesigner.

I use the code below to handle touch screen events and switch focus from one editor to the other when needed:

Code:
void CMyContainerControl::HandlePointerEventL(const TPointerEvent& aPointerEvent)
    {
    CTextView* textview;
    
     // Validate pointer position.
    if( iLogin->Rect().Contains( aPointerEvent.iPosition ) )
       {
       if(iFocusControl == iPassword)
    	   {
		   iLogin->SetFocus(ETrue);
  		   textview = iLogin->TextView();
   		   textview->SetCursorVisibilityL(TCursor::EFCursorVisible, TCursor::EFCursorFlashing);
   		   iPassword->SetFocus(EFalse);
   		   iFocusControl = iLogin;
   		   DrawNow();
   		   }
       // click on edwin1 pass the pointer event. //
       iLogin->HandlePointerEventL( aPointerEvent );
       }
    else if( iPassword->Rect().Contains( aPointerEvent.iPosition ) )
       {
       if(iFocusControl == iLogin)
    	   {
    	   iPassword->SetFocus(ETrue);
    	   iLogin->SetFocus(EFalse);
    	   textview = iLogin->TextView();
    	   textview->SetCursorVisibilityL(TCursor::EFCursorInvisible, TCursor::EFCursorInvisible);
    	   iFocusControl = iPassword;
    	   DrawNow();
    	   }
       // click on edwin2 pass the pointer event. //
       iPassword->HandlePointerEventL( aPointerEvent );
       }
    else
       {
       // simply calling the base class implementation //
       CCoeControl::HandlePointerEventL(aPointerEvent);
       }
    }
The problem I am finding is that, independent of whether the interface is portrait or landscape, when the rectangle of one of the text boxes is touched the Qwerty always appears large in landscape. I want it to appear small and portrait if the app is showing in portrait. How should I do it?