emailuis/emailui/src/ncssubjectfield.cpp
branchRCL_3
changeset 8 e1b6206813b4
parent 1 12c456ceeff2
child 12 f5907b1a1053
equal deleted inserted replaced
4:e7aa27f58ae1 8:e1b6206813b4
    87     // S60 Skin support
    87     // S60 Skin support
    88 	iLabel->SetBrushStyle(CWindowGc::ENullBrush);
    88 	iLabel->SetBrushStyle(CWindowGc::ENullBrush);
    89 
    89 
    90     iTextEditor = new ( ELeave ) CNcsEditor( iSizeObserver, ETrue, ENcsEditorSubject, captionText );
    90     iTextEditor = new ( ELeave ) CNcsEditor( iSizeObserver, ETrue, ENcsEditorSubject, captionText );
    91     CleanupStack::PopAndDestroy( aTextBuf );
    91     CleanupStack::PopAndDestroy( aTextBuf );
    92 
       
    93     // iTextEditor is not completely constructed until in SetContainerWindowL()
       
    94     iFocusChangeHandler = new (ELeave) CAsyncCallBack( CActive::EPriorityStandard );
       
    95     }
    92     }
    96 
    93 
    97 // ---------------------------------------------------------------------------
    94 // ---------------------------------------------------------------------------
    98 // Destructor
    95 // Destructor
    99 // ---------------------------------------------------------------------------
    96 // ---------------------------------------------------------------------------
   107     /*if ( iFont )
   104     /*if ( iFont )
   108         {
   105         {
   109         ControlEnv()->ScreenDevice()->ReleaseFont( iFont );
   106         ControlEnv()->ScreenDevice()->ReleaseFont( iFont );
   110         iFont = NULL;
   107         iFont = NULL;
   111         }*/
   108         }*/
   112 
       
   113     delete iFocusChangeHandler;
       
   114     }
   109     }
   115 
   110 
   116 // -----------------------------------------------------------------------------
   111 // -----------------------------------------------------------------------------
   117 // CNcsSubjectField::SetContainerWindowL() const
   112 // CNcsSubjectField::SetContainerWindowL() const
   118 // -----------------------------------------------------------------------------
   113 // -----------------------------------------------------------------------------
   243 //
   238 //
   244 void CNcsSubjectField::HandlePointerEventL( const TPointerEvent& aPointerEvent )
   239 void CNcsSubjectField::HandlePointerEventL( const TPointerEvent& aPointerEvent )
   245     {
   240     {
   246 	FUNC_LOG;
   241 	FUNC_LOG;
   247     iTextEditor->HandlePointerEventL( aPointerEvent );
   242     iTextEditor->HandlePointerEventL( aPointerEvent );
       
   243     iTextEditor->HandleTextChangedL();
   248     }
   244     }
   249 
   245 
   250 // -----------------------------------------------------------------------------
   246 // -----------------------------------------------------------------------------
   251 // CNcsSubjectField::FocusChanged()
   247 // CNcsSubjectField::FocusChanged()
   252 // -----------------------------------------------------------------------------
   248 // -----------------------------------------------------------------------------
   253 //
   249 //
   254 void CNcsSubjectField::FocusChanged( TDrawNow aDrawNow )
   250 void CNcsSubjectField::FocusChanged( TDrawNow aDrawNow )
   255 	{
   251 	{
   256     FUNC_LOG;
   252     FUNC_LOG;
   257 	// The focus change gaining handling needs to be deferred until AknFep is fully
       
   258 	// initialised. Otherwise there will be problems when moving focus from
       
   259 	// body to subject. Focus losing can be handled immediately
       
   260 	iDrawAfterFocusChange = aDrawNow;
   253 	iDrawAfterFocusChange = aDrawNow;
   261 	if ( IsFocused() )
   254 	DoHandleFocusChanged( this );
   262 	    {
       
   263 	TCallBack callback( DoHandleFocusChanged, this );
       
   264 	iFocusChangeHandler->Cancel();
       
   265 	iFocusChangeHandler->Set( callback );
       
   266 	iFocusChangeHandler->CallBack();
       
   267 	}
       
   268 	else
       
   269 	    {
       
   270 	    DoHandleFocusChanged( this );
       
   271 	    }
       
   272 	}
   255 	}
   273 
   256 
   274 // -----------------------------------------------------------------------------
   257 // -----------------------------------------------------------------------------
   275 // CNcsSubjectField::HandleFocusChangedL()
   258 // CNcsSubjectField::HandleFocusChangedL()
   276 // -----------------------------------------------------------------------------
   259 // -----------------------------------------------------------------------------