Symbian3/SDK/Source/GUID-F64B88E0-49DA-5563-896E-29BAB8A244C9.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
child 13 48780e181b38
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE reference
  PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="GUID-F64B88E0-49DA-5563-896E-29BAB8A244C9" xml:lang="en"><title>HelloWorld:
A simple GUI application with a single view</title><shortdesc>This example demonstrates a simple application using a GUI with
a single view. </shortdesc><prolog><metadata><keywords/></metadata></prolog><refbody>
<section><title>Download</title> <p>Click on the following link to download
the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a2004cb9-da88-4ec7-a85e-dd648022f4f9.zip" scope="external">HelloWorldGUI.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a2004cb9-da88-4ec7-a85e-dd648022f4f9.html" scope="peer">browse</xref> to view the example code. </p> </section>
<section><title>Class Summary</title><p><xref href="GUID-E36E2F07-09E7-32BC-BB83-14DF9232E7D9.dita"><apiname>CEikApplication</apiname></xref></p><p><xref href="GUID-B33A8A56-D1BE-3E3D-B5AC-F644A5C764DB.dita"><apiname>CEikDocument</apiname></xref></p><p><xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita"><apiname>CEikAppUi</apiname></xref></p><p><xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></xref></p></section>
<section><title>Design and implementation</title> <p>This application consists
of 4 classes: </p> <ul>
<li id="GUID-28A83A4A-D743-556B-88EB-D65AAFD29D19"><p>Application class derived
from <xref href="GUID-E36E2F07-09E7-32BC-BB83-14DF9232E7D9.dita"><apiname>CEikApplication</apiname></xref>. </p> </li>
<li id="GUID-EF3F2195-1D04-56A4-B439-C2B50F543F74"><p>Document class derived
from <xref href="GUID-B33A8A56-D1BE-3E3D-B5AC-F644A5C764DB.dita"><apiname>CEikDocument</apiname></xref>. </p> </li>
<li id="GUID-65ABFCB1-BC5A-5BCA-9F45-D5FF82AB1AE4"><p>AppUi class derived
from <xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita"><apiname>CEikAppUi</apiname></xref>. </p> </li>
<li id="GUID-12BE51BC-0F68-5C5E-A279-4AE00E96FC7D"><p>AppView class derived
from <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></xref>. </p> </li>
</ul> <p> <codeph>E32Main()</codeph> marks the entry point to the example.
It calls <codeph>EikStart::RunApplication()</codeph> to create a new application
instance. The UI framework then calls <codeph>CExampleApplication::AppDllUid()</codeph> to
obtain the application's UID. The UID returned must match the second value
defined in the project definition file. </p> <p>Once the application is created,
the UI framework calls <codeph>CExampleApplication::CreateDocumentL()</codeph> to
create an instance of the document class. <codeph>CreateDocumentL()</codeph> internally
calls the constructor of the document class and passes the supplied reference
to the constructor initialisation list. The document has no real work to do
in this simple GUI application. </p> <p>As soon as the document has been created
the UI framework creates an instance of the application UI (appUI). The appUI
class is an instance of a <xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita"><apiname>CEikAppUi</apiname></xref> -derived class and
this class takes care of user interaction. </p> <p>AppUI creation uses two
phase construction where first <codeph>CExampleDocument::CreateAppUiL()</codeph> is
called and then the framework calls the second phase constructor of the appUI
class. <codeph>CExampleAppUi::ConstructL()</codeph> creates and owns the view.
User commands are handled by the <codeph>CExampleAppUi::HandleCommandL()</codeph> method. </p> <p>The
app view class is used to draw the view. The view in this example consists
of a simple outline rectangle with text drawn in the middle. </p> <p>The example
contains a resource file <filepath>HelloWorld.rss</filepath> which defines
resource information. This includes a menubar with four menu items, an icon
and caption. </p> <p> <filepath>HelloWorld.hrh</filepath> defines the menu
command IDs and <filepath>HelloWorld.pkg</filepath> file is the source file
used for installation file (SIS file) generation. </p> </section>
<section><title>Building and configuring</title> <p>Steps to build the example: </p> <ul>
<li id="GUID-81019373-E4C4-545E-85B9-1C4810203D5D"><p>You can build the example
from your IDE or the command line. </p> <p>If you use an IDE, import the <filepath>bld.inf</filepath> file
of the example into your IDE, and use the build command of the IDE. </p> <p>If
you use the command line, open a command prompt, and set the current directory
to the source code directory of the example. You can then build the example
with the SBSv1 build tools with the following commands: </p> <p><userinput>bldmake
bldfiles</userinput> </p> <p><userinput>abld build</userinput> </p> <p><xref href="GUID-793A5EF9-CC16-5EEB-9011-6431EA76EB15.dita">How to use bldmake</xref> and <xref href="GUID-B6B54E07-3B34-5D5C-8815-93383FA8FB4B.dita">How to use abld</xref> describe
how to use the SBSv1 build tools. </p> </li>
<li id="GUID-83E08D73-33DB-520B-8606-6547796EDE28"><p>For the emulator, the
example builds an executable called <filepath>helloworld.exe</filepath> in
the <filepath>epoc32\release\winscw\&lt;udeb or urel&gt;\</filepath> folder. </p> </li>
</ul> </section>
</refbody></reference>