11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-542550FA-F9F1-46D6-8182-6E7FAA013572" xml:lang="en"><title>Receiving |
12 <concept id="GUID-542550FA-F9F1-46D6-8182-6E7FAA013572" xml:lang="en"><title>Receiving |
13 key event data in your application</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 key event data in your application</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 <p>The <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI controller </xref>is |
14 <p>The <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI controller </xref>is |
15 the default handler for key events. In order for other <xref href="GUID-5944FFF1-79C6-4F5E-95C8-F4833AFC64AB.dita">controls</xref> to |
15 the default handler for key events. In order for other <xref href="GUID-5944FFF1-79C6-4F5E-95C8-F4833AFC64AB.dita">controls</xref> to |
16 receive events, you must register them with the control stack with <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeAppUiClass.html#%3a%3aCCoeAppUi%3a%3aAddToStackL%28const%20MCoeView%20%26amp%3b%2cCCoeControl%20%2a%2cTInt%2cTInt%29" format="application/java-archive"><parmname>CCoeAppUi::AddToStackL()</parmname></xref>. Controls are |
16 receive events, you must register them with the control stack with <xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita#GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90/GUID-3CB7F46F-FF5D-3F96-B478-1E83CC7CDE17"><apiname>CCoeAppUi::AddToStackL()</apiname></xref>. |
17 usually added to the control stack in the second phase constructor.</p> |
17 Controls are usually added to the control stack in the second phase constructor.</p> |
18 <p>The options are as follows:</p> |
18 <p>The options are as follows:</p> |
19 <ul> |
19 <ul> |
20 <li><p>In a <xref href="GUID-B5DE1C86-2B16-4B22-887F-7079E54A8ED6.dita">traditional |
20 <li><p>In a <xref href="GUID-B5DE1C86-2B16-4B22-887F-7079E54A8ED6.dita">traditional |
21 Symbian OS UI architecture</xref>, this is done in the UI controller construction |
21 Symbian UI application architecture</xref>, this is done in the UI controller |
22 phase. An example of an implementation is as follows:</p> |
22 construction phase. An example of an implementation is as follows:</p> |
23 <itemgroup> |
23 <itemgroup> |
24 <codeblock id="GUID-CC069DFD-545E-43BF-97A2-F76D2D0F903F" xml:space="preserve">void CAddressBookAppUi::ConstructL() |
24 <codeblock id="GUID-CC069DFD-545E-43BF-97A2-F76D2D0F903F" xml:space="preserve">void CAddressBookAppUi::ConstructL() |
25 { |
25 { |
26 BaseConstructL(); |
26 BaseConstructL(); |
27 iCurrentView = CMyAppMainView::NewL( ClientRect() ); |
27 iCurrentView = CMyAppMainView::NewL( ClientRect() ); |
32 stack, which means the UI controller is underneath it in the stack. When the |
32 stack, which means the UI controller is underneath it in the stack. When the |
33 application framework passes an event to the application, the framework first |
33 application framework passes an event to the application, the framework first |
34 requests that <parmname>iCurrentView</parmname> handle it. If this control |
34 requests that <parmname>iCurrentView</parmname> handle it. If this control |
35 does not consume the event, then the framework calls the method for the UI |
35 does not consume the event, then the framework calls the method for the UI |
36 controller to handle the event.</p> |
36 controller to handle the event.</p> |
37 <p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeAppUiClass.html#%3a%3aCCoeAppUi%3a%3aAddToStackL%28const%20MCoeView%20%26amp%3b%2cCCoeControl%20%2a%2cTInt%2cTInt%29" format="application/java-archive"><parmname>CCoeAppUi::AddToStackL()</parmname></xref> offers a parameter |
37 <p><xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita#GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90/GUID-3CB7F46F-FF5D-3F96-B478-1E83CC7CDE17"><apiname>CCoeAppUi::AddToStackL()</apiname></xref> offers a parameter to set |
38 to set the stack priority of a UI control.</p> |
38 the stack priority of a UI control.</p> |
39 <p>You should use <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeAppUiClass.html#%3a%3aCCoeAppUi%3a%3aRemoveFromStack%28CCoeControl%20%2a%29" format="application/java-archive"><parmname>CCoeAppUi::RemoveFromStackL</parmname></xref> to remove a control from |
39 <p>You should use <xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita#GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90/GUID-E036CC0E-D93E-36E4-BA5C-2A1B51CC37E3"><apiname>CCoeAppUi::RemoveFromStackL()</apiname></xref> to remove |
40 the control stack when it should no longer receive events.</p> |
40 a control from the control stack when it should no longer receive events.</p> |
41 </itemgroup> |
41 </itemgroup> |
42 </li> |
42 </li> |
43 <li><p>In an <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">Symbian |
43 <li><p>In an <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">Symbian |
44 view architecture</xref>, this is typically done with <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknView.html#486d490d911ce5e9495e0ee19b0442db" format="application/java-archive"><parmname>CAknView::DoActivateL()</parmname></xref> when |
44 view architecture</xref>, this is typically done with <xref href="GUID-11967EBB-7439-3775-B287-7560ECA0AF1F.dita#GUID-11967EBB-7439-3775-B287-7560ECA0AF1F/GUID-F6105D54-1C2A-36C0-8522-50DAB45FEF67"><apiname>CAknView::DoActivateL()</apiname></xref> when |
45 the UI controls are constructed. An example of an implementation for this |
45 the UI controls are constructed. An example of an implementation for this |
46 approach is as follows:</p> |
46 approach is as follows:</p> |
47 <itemgroup> |
47 <itemgroup> |
48 <codeblock id="GUID-4DEDAE29-C6D9-4004-9687-530398F84E4A" xml:space="preserve">void CMyView::DoActivateL(const TVwsViewId&, TUid , const TDesC8&) |
48 <codeblock id="GUID-4DEDAE29-C6D9-4004-9687-530398F84E4A" xml:space="preserve">void CMyView::DoActivateL(const TVwsViewId&, TUid , const TDesC8&) |
49 { |
49 { |
58 which means the UI controller is underneath it in the stack. When the application |
58 which means the UI controller is underneath it in the stack. When the application |
59 framework passes an event to the application, the framework first requests |
59 framework passes an event to the application, the framework first requests |
60 that <parmname>iUIControl</parmname> handle it. If this control does not consume |
60 that <parmname>iUIControl</parmname> handle it. If this control does not consume |
61 the event, then the framework calls the method for the UI controller to handle |
61 the event, then the framework calls the method for the UI controller to handle |
62 the event.</p> |
62 the event.</p> |
63 <p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeAppUiClass.html#%3a%3aCCoeAppUi%3a%3aAddToStackL%28const%20MCoeView%20%26amp%3b%2cCCoeControl%20%2a%2cTInt%2cTInt%29" format="application/java-archive"><parmname>CCoeAppUi::AddToStackL()</parmname></xref> offers a parameter |
63 <p><xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita#GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90/GUID-3CB7F46F-FF5D-3F96-B478-1E83CC7CDE17"><apiname>CCoeAppUi::AddToStackL()</apiname></xref> offers a parameter to set |
64 to set the stack priority for a UI control.</p> |
64 the stack priority for a UI control.</p> |
65 <p>You should use <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeAppUiClass.html#%3a%3aCCoeAppUi%3a%3aRemoveFromStack%28CCoeControl%20%2a%29" format="application/java-archive"><parmname>CCoeAppUi::RemoveFromStackL</parmname></xref> to remove a control from |
65 <p>You should use <xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita#GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90/GUID-E036CC0E-D93E-36E4-BA5C-2A1B51CC37E3"><apiname>CCoeAppUi::RemoveFromStackL()</apiname></xref> to remove |
66 the control stack when it should no longer receive events.</p> |
66 a control from the control stack when it should no longer receive events.</p> |
67 </itemgroup> |
67 </itemgroup> |
68 </li> |
68 </li> |
69 </ul> |
69 </ul> |
70 </conbody></concept> |
70 </conbody></concept> |