diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-542550FA-F9F1-46D6-8182-6E7FAA013572.dita --- a/Symbian3/PDK/Source/GUID-542550FA-F9F1-46D6-8182-6E7FAA013572.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-542550FA-F9F1-46D6-8182-6E7FAA013572.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,70 +1,70 @@ - - - - - -Receiving -key event data in your application -

The UI controller is -the default handler for key events. In order for other controls to -receive events, you must register them with the control stack with CCoeAppUi::AddToStackL(). Controls are -usually added to the control stack in the second phase constructor.

-

The options are as follows:

- + + + + + +Receiving +key event data in your application +

The UI controller is +the default handler for key events. In order for other controls to +receive events, you must register them with the control stack with CCoeAppUi::AddToStackL(). +Controls are usually added to the control stack in the second phase constructor.

+

The options are as follows:

+
    +
  • In a traditional +Symbian UI application architecture, this is done in the UI controller +construction phase. An example of an implementation is as follows:

    + +void CAddressBookAppUi::ConstructL() + { + BaseConstructL(); + iCurrentView = CMyAppMainView::NewL( ClientRect() ); + AddToStackL( iCurrentView ); + } + +

    This places iCurrentView on top of the control +stack, which means the UI controller is underneath it in the stack. When the +application framework passes an event to the application, the framework first +requests that iCurrentView handle it. If this control +does not consume the event, then the framework calls the method for the UI +controller to handle the event.

    +

    CCoeAppUi::AddToStackL() offers a parameter to set +the stack priority of a UI control.

    +

    You should use CCoeAppUi::RemoveFromStackL() to remove +a control from the control stack when it should no longer receive events.

    +
    +
  • +
  • In an Symbian +view architecture, this is typically done with CAknView::DoActivateL() when +the UI controls are constructed. An example of an implementation for this +approach is as follows:

    + +void CMyView::DoActivateL(const TVwsViewId&, TUid , const TDesC8&) + { + if (!iUIControl) + { + iUIControl = CMyUiControl::NewL( this, ClientRect() ); + AppUi()->AddToStackL( *this, iUiControl ); + } + } + +

    This places iUiControl on top of the control stack, +which means the UI controller is underneath it in the stack. When the application +framework passes an event to the application, the framework first requests +that iUIControl handle it. If this control does not consume +the event, then the framework calls the method for the UI controller to handle +the event.

    +

    CCoeAppUi::AddToStackL() offers a parameter to set +the stack priority for a UI control.

    +

    You should use CCoeAppUi::RemoveFromStackL() to remove +a control from the control stack when it should no longer receive events.

    +
    +
  • +
\ No newline at end of file