7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-1944C350-900E-5621-BF43-6A366844E9DD" xml:lang="en"><title>MenuApp: |
12 <concept id="GUID-1944C350-900E-5621-BF43-6A366844E9DD" xml:lang="en"><title>MenuApp: An Application with a Menu</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 An Application with a Menu</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 <section id="GUID-4DA645E1-7FBA-4777-BF59-87B54A04E539"><title>Download</title> <p>Click on the following link to |
14 <section><title>Download</title> <p>Click on the following link to download |
14 download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a13df6fa-ad69-40b4-8923-11dbd4775915.zip" scope="external">MenuApp.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a13df6fa-ad69-40b4-8923-11dbd4775915.html" scope="peer">browse</xref> to view the example code. </p> </section> |
15 the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a13df6fa-ad69-40b4-8923-11dbd4775915.zip" scope="external">MenuApp.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a13df6fa-ad69-40b4-8923-11dbd4775915.html" scope="peer">browse</xref> to view the example code. </p> </section> |
15 <section id="GUID-B412BBB6-7A38-451F-8501-4BB4B017B790"><title>Description</title> <p>This example builds on the <xref href="GUID-1D7BD70F-40A3-53FF-8150-A9CAFA4D01D8.dita">minimal</xref> UI |
16 <section><title>Description</title> <p>This example builds on the <xref href="GUID-1D7BD70F-40A3-53FF-8150-A9CAFA4D01D8.dita">minimal</xref> UI |
16 application by adding a menu bar and menu pane. The menu bar is defined |
17 application by adding a menu bar and menu pane. The menu bar is defined in |
17 in a resource file, and the menu pane is populated dynamically in |
18 a resource file, and the menu pane is populated dynamically in the app UI's <codeph>DynInitMenuPaneL()</codeph> function. |
18 the app UI's <codeph>DynInitMenuPaneL()</codeph> function. The menu |
19 The menu pane contains a list of all applications present on the device. If |
19 pane contains a list of all applications present on the device. If |
20 a menu item is selected by the user, the corresponding application is launched. </p> <p>The |
20 a menu item is selected by the user, the corresponding application |
21 menu application displays a list of applications on the menu pane: </p> <fig id="GUID-B2DD173E-A5FE-5DF3-9750-491E0A18A2B6"> |
21 is launched. </p> <p>The menu application displays a list of applications |
22 <image href="GUID-2183F898-48C2-53A3-ADA0-1132EF7D4380_d0e170520_href.png" placement="inline"/> |
22 on the menu pane: </p> <fig id="GUID-B2DD173E-A5FE-5DF3-9750-491E0A18A2B6"> |
|
23 <image href="GUID-2183F898-48C2-53A3-ADA0-1132EF7D4380_d0e176594_href.png" placement="inline"/> |
23 </fig> </section> |
24 </fig> </section> |
24 <section><title>Class Summary</title><p><xref href="GUID-5EEE8745-F483-33C0-A5B1-AEB5544DE2BA.dita"><apiname>RApaLsSession</apiname></xref></p><p><xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita"><apiname>CEikAppUi</apiname></xref></p><p><xref href="GUID-F6168582-DFF1-31DF-87F9-FF2AEC5EE0FF.dita"><apiname>CEikMenuPane</apiname></xref></p></section> |
25 <section id="GUID-FE3F5411-B575-4284-A841-158A65F5A9C0"><title>Class Summary</title><p><xref href="GUID-5EEE8745-F483-33C0-A5B1-AEB5544DE2BA.dita"><apiname>RApaLsSession</apiname></xref></p><p><xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita"><apiname>CEikAppUi</apiname></xref></p><p><xref href="GUID-F6168582-DFF1-31DF-87F9-FF2AEC5EE0FF.dita"><apiname>CEikMenuPane</apiname></xref></p></section> |
25 <section><title>Application list</title> <p>To create the application list, |
26 <section id="GUID-8B7554ED-99FA-41A0-94A5-529FD719A40B"><title>Application list</title> <p>To create the application |
26 the app UI first makes a connection to the application architecture server, |
27 list, the app UI first makes a connection to the application architecture |
27 using <xref href="GUID-5EEE8745-F483-33C0-A5B1-AEB5544DE2BA.dita#GUID-5EEE8745-F483-33C0-A5B1-AEB5544DE2BA/GUID-A92887D0-694C-3792-B3C9-46B155FE83B9"><apiname>RApaLsSession::Connect()</apiname></xref>. Then, it requests notification |
28 server, using <xref href="GUID-5EEE8745-F483-33C0-A5B1-AEB5544DE2BA.dita#GUID-5EEE8745-F483-33C0-A5B1-AEB5544DE2BA/GUID-A92887D0-694C-3792-B3C9-46B155FE83B9"><apiname>RApaLsSession::Connect()</apiname></xref>. Then, it |
28 from the server that the application list is fully populated, using <codeph>RApaLsSession::RegisterListPopulationCompleteObserver()</codeph>. |
29 requests notification from the server that the application list is |
29 When the request completes, <codeph>RApaLsSession::GetNextApp()</codeph> is |
30 fully populated, using <codeph>RApaLsSession::RegisterListPopulationCompleteObserver()</codeph>. When the request completes, <codeph>RApaLsSession::GetNextApp()</codeph> is called in a loop to get a list of application names and UIDs. |
30 called in a loop to get a list of application names and UIDs. This list is |
31 This list is used to populate the menu pane. </p> </section> |
31 used to populate the menu pane. </p> </section> |
32 <section id="GUID-BA8A16BE-F0A3-429A-9D78-1E4AD833A095"><title>Launching an application</title> <p> <codeph>CEikAppUi::HandleCommandL()</codeph> handles commands based on a command ID. The <codeph>EEikCmdExit</codeph> command ID is generated by the <systemoutput>Close</systemoutput> menu option, and <codeph>HandleCommandL()</codeph> responds to it |
32 <section><title>Launching an application</title> <p> <codeph>CEikAppUi::HandleCommandL()</codeph> handles |
33 by exiting the application. The other possible command IDs are the |
33 commands based on a command ID. The <codeph>EEikCmdExit</codeph> command ID |
34 UIDs of the applications in the list. This allows <codeph>CEikAppUi::HandleCommandL()</codeph> to launch applications based on the command ID. </p> <p>An application |
34 is generated by the <systemoutput>Close</systemoutput> menu option, and <codeph>HandleCommandL()</codeph> responds |
35 is launched by getting the executable name (using <codeph>RApaLsSession::GetAppInfo()</codeph>), creating a command line (<codeph>CApaCommandLine</codeph>) containing |
35 to it by exiting the application. The other possible command IDs are the UIDs |
36 the executable name, and passing this to <codeph>RApaLsSession::StartApp()</codeph>. </p> </section> |
36 of the applications in the list. This allows <codeph>CEikAppUi::HandleCommandL()</codeph> to |
37 <section id="GUID-6BD34EA5-E1B4-47C1-8D64-CFDB0E26B786"><title>Build</title> <p>The Symbian build process describes |
37 launch applications based on the command ID. </p> <p>An application is launched |
38 how to build an application. </p> <p>The <filepath>MenuApp</filepath> example builds an executable called <filepath>MenuApp.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for CodeWarrior). Either launch the executable |
38 by getting the executable name (using <codeph>RApaLsSession::GetAppInfo()</codeph>), |
39 itself, or launch the emulator and then select the <filepath>MenuApp</filepath> application from the Emulator's extras bar. </p> </section> |
39 creating a command line (<codeph>CApaCommandLine</codeph>) containing the |
|
40 executable name, and passing this to <codeph>RApaLsSession::StartApp()</codeph>. </p> </section> |
|
41 <section><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian |
|
42 build process</xref> describes how to build an application. </p> <p>The <filepath>MenuApp</filepath> example |
|
43 builds an executable called <filepath>MenuApp.exe</filepath> in the standard |
|
44 location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for |
|
45 CodeWarrior). Either launch the executable itself, or launch the emulator |
|
46 and then select the <filepath>MenuApp</filepath> application from the Emulator's |
|
47 extras bar. </p> </section> |
|
48 </conbody></concept> |
40 </conbody></concept> |