03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

There are a number of other ways in which a Symbian OS GUI deals with the difference<br />

between a mouse and a pen:<br />

� You can't hover with a pen. That rules out tooltips, so Symbian OS buttons are big<br />

enough to include either text or a carefully designed image to indicate their action. Also,<br />

there's no pointer to change to a hand, an hourglass, or a crosshair, based on its<br />

position and the state of the program. That has a more subtle effect on the GUI and<br />

your application design.<br />

� You can't right click with a pen. We could have invented some odd combination – such<br />

as Alt + tap – to simulate a right click, but we didn't. Symbian OS simply doesn't use the<br />

metaphor.<br />

� A pen isn't as accurate as a mouse, so pen-selectable items have to be bigger than<br />

mouse-selectable items, and it's useful to provide some reassurance about what has<br />

been selected: check out the behavior of buttons in dialogs (or menu items) that briefly<br />

animate as you select them, confirming which item was selected.<br />

So: a pen-based GUI is not a mouse-based GUI. A Symbian OS GUI is not a desktop GUI –<br />

it is different in ways that really matter. On the other hand, a Symbian OS GUI isn't different<br />

merely for the sake of it. Desktop GUIs are familiar to many people, and Symbian OS<br />

includes many familiar concepts.<br />

1.2 Hello World – Text Version<br />

Now that you've started to get to grips with the emulator, it's time to get your first Symbian<br />

OS C++ program running. Even though Symbian OS is primarily a system for developing<br />

GUI applications, the simplest kind of programs use a text interface, so for our first task we'll<br />

learn how to build a program that writes 'Hello world!' to a text console. That will introduce<br />

you to the tools required for building applications for both the emulator and a real machine,<br />

so that later on you'll be ready for a program with a GUI.<br />

If you want to follow this chapter through at your desktop with the UIQ SDK, make sure that<br />

you've installed all the tools you need, and the example source for the book. See the<br />

appendices for more information.<br />

1.2.1 The Program: hellotext<br />

Here's the program we're going to build. It's your first example of Symbian OS C++ source<br />

code:<br />

// hellotext.cpp<br />

#include <br />

#include <br />

LOCAL_D CConsoleBase* gConsole;<br />

// Real main function<br />

void MainL()<br />

{

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!