quick_recipes (Symbian Books), страница 5

PDF-файл quick_recipes (Symbian Books), страница 5 Основы автоматизированного проектирования (ОАП) (17703): Книга - 3 семестрquick_recipes (Symbian Books) - PDF, страница 5 (17703) - СтудИзба2018-01-10СтудИзба

Описание файла

Файл "quick_recipes" внутри архива находится в папке "Symbian Books". PDF-файл из архива "Symbian Books", который расположен в категории "". Всё это находится в предмете "основы автоматизированного проектирования (оап)" из 3 семестр, которые можно найти в файловом архиве МГТУ им. Н.Э.Баумана. Не смотря на прямую связь этого архива с МГТУ им. Н.Э.Баумана, его также можно найти и в других разделах. Архив можно найти в разделе "книги и методические указания", в предмете "основы автоматизированного производства (оап)" в общих файлах.

Просмотр PDF-файла онлайн

Текст 5 страницы из PDF

The modification will include source code changes on bothplatforms, S60 and UIQ.2.7.1 Adding a New Menu Item1.Open \data\s60_3rd\HelloWorld.rss, which is the resourcedefinition that contains the menu definition for S60. Add the lineswritten in bold below to the menu definition r_helloworld_menupane.RESOURCE MENU_PANE r_helloworld_menupane{items ={MENU_ITEM{command = EHelloWorldSelectMe;txt = string_r_helloworld_selectme;},MENU_ITEM{command = EHelloWorldCommand1;txt = string_r_helloworld_command1;},MENU_ITEM{command = EEikCmdExit;txt = string_r_helloworld_exit;}};}These additional lines add a new menu item with the commandidentifier EHelloWorldSelectMe and the text string_r_helloworld_selectme. We will be defining the identifier andthe string later.2.Open \data\uiq3\HelloWorld.rss and do the same thing forthe resource definition for UIQ.RESOURCE QIK_COMMAND_LIST r_helloworld_commands{items ={QIK_COMMAND{id = EEikCmdExit;type = EQikCommandTypeScreen;MODIFYING THE HELLO WORLD PROJECT19stateFlags = EQikCmdFlagDebugOnly;text = string_r_helloworld_close_debug;},QIK_COMMAND{id = EHelloWorldSelectMe;type = EQikCommandTypeScreen;text = string_r_helloworld_selectme;},QIK_COMMAND{id = EHelloWorldCommand1;type = EQikCommandTypeScreen;text = string_r_helloworld_command1;}};}3.

Open \inc\HelloWorld.hrh. It is the header file for the resourcefile. Add a new command identifier, EHelloWorldSelectMe.enum THelloWorldCommand{EHelloWorldCommand1 = 0x1000,EHelloWorldSelectMe};4. Open \data\HelloWorld_01.rls, which contains the definitionof localized strings. The suffix _01 in the filename indicates that it isthe localization file for UK English language. Add a new line belowto HelloWorld_01.rls.rls_string string_r_helloworld_selectme "Select me"At this point, if you build and run the application, you should see anew item (see Figure 2.13).

This menu item does not do anything yet. Thenext section discusses how to handle the menu event from this new item.(a) S60 3rd Edition device(b) UIQ 3 deviceFigure 2.13 Hello World Application With a New Menu Item20QUICK START2.7.2 Handling a Menu Event1.Open \data\HelloWorld_01.rls to add the string that is goingto be displayed when the menu item is selected.rls_string string_r_helloworld_title"Title"rls_string string_r_helloworld_description "Congratulations on yourfirst Symbian OS application."The two lines above added two strings to the localization file for UKEnglish language. The first string is used as the title for the notificationdialog and the second one is used as the content.2.Open \data\HelloWorld_string.rss to add resources thatpoint to the two strings above.RESOURCE TBUF256 r_helloworld_title{ buf = string_r_helloworld_title; }RESOURCE TBUF256 r_helloworld_description{ buf = string_r_helloworld_description; }The lines above added two string resources with the maximum lengthof 256 characters.3.Open \src\HelloWorldAppUi.cpp.

This file contains the definition of CHelloWorldAppUi class, which handles various aspectsof the application’s user interface, including the menu bar.Every GUI application should have its own AppUi class derivedfrom CEikAppUi or one of its derivative classes. For example, S60applications usually use CAknAppUi and UIQ applications usuallyuse CQikAppUi.One of the main roles of the AppUi class is to handle commands fromthe UI in its HandleCommandL() method. Add the code writtenin bold below in CHelloWorldAppUi::HandleCommandL() tohandle the menu event from our new menu item.void CHelloWorldAppUi::HandleCommandL(TInt aCommand){switch (aCommand){#ifdef __SERIES60_3X__// For S60, we need to handle this event, which is normally// an event from the right soft key.case EAknSoftkeyExit:#endifcase EEikCmdExit:ADVANCED TOPICS ON CARBIDE.c++21{Exit();break;}case EHelloWorldCommand1:{iEikonEnv->InfoWinL(R_HELLOWORLD_CAPTION,R_HELLOWORLD_CAPTION);break;}case EHelloWorldSelectMe:{iEikonEnv->InfoWinL(R_HELLOWORLD_TITLE,R_HELLOWORLD_DESCRIPTION);break;}default:// Do nothingbreak;}}Figure 2.14 shows the notification dialog that is shown when the userselects our new item on S60 and UIQ devices.(a) S60 3rd Edition device(b) UIQ 3 deviceFigure 2.14 Displaying the Notification Dialog on the Hello World ApplicationTip: This example uses a generic dialog, CEikonEnv::InfoWinL(),to make it compatible with S60 and UIQ.

Each platform also hasmore types of dialog that can be used for different purposes. Forexample, S60 has CAknInformationNote to display informationand CAknErrorNote to display error messages.2.8 Advanced Topics on Carbide.c++This section describes some more advanced topics when using Carbide.c++:22QUICK START• Modifying the project files.• Importing project files.• Changing the certificate/key pair.You may prefer not to read this section now, but to continue to thenext chapter and come back later as needed.2.8.1 Modifying the Project FilesA Symbian OS project is represented by a build configuration file (knownas a bld.inf file) and one (or several) project (MMP) files.

Most examplesin this book have only one MMP file.Both bld.inf and MMP files are ASCII text files. Carbide.c++ providesa user interface to edit them visually (see Figure 2.15a). They can also beedited using the standard text editor (see Figure 2.15b).(a) An MMP file in the GUI editor(b) An MMP file in the text editorFigure 2.15 Editing an MMP File using Carbide.c++A bld.inf file is made up of a number of sections, such as a list ofMMP files to build and a list of files to be exported.

The following codeshows the content of bld.inf for our Hello World project:PRJ_MMPFILESHelloWorld.mmp#ifndef UIQ_UMTS_AVAILABLEgnumakefile icons_scalable_dc.mk#endifAs you can see, the bld.inf above contains one MMP file, which isHelloWorld.mmp. It also includes a GNU makefile, icons_scalable_dc.mk, which is invoked if the macro UIQ_UMTS_AVAILABLE is notdefined. This macro is defined on the UIQ SDK only. In other words, theADVANCED TOPICS ON CARBIDE.c++23GNU makefile will be used if the project is compiled using S60 SDK.

Thisparticular makefile will build a scalable icon to be used to represent theapplication in the main menu of the smartphone.An MMP file specifies the properties of a project in a platform- andcompiler-independent way. During the build process, Symbian OS buildtools convert the MMP file into makefiles for particular platforms.The following code shows the first couple of lines of HelloWorld.mmp:TARGETTARGETTYPEUIDHelloWorld.exeEXE0x100039CE 0xEF1D5F42CAPABILITYNoneLANGSC...When do you need to modify the project files? One case that you willfind very often in the following chapters is adding libraries.

The HelloWorld project includes some general libraries (see Figure 2.16). In orderto use some specific APIs, such as multimedia or telephony, you wouldneed to add additional libraries. To add libraries, click Add and selectthe libraries you want to add.Figure 2.16Adding Libraries to the Project FileAnother case that you will also find quite often is adding platformsecurity capabilities (they are described in Chapter 3). The Hello Worldproject does not include any capabilities, as you can see in Figure 2.17.Many APIs discussed in this book require additional capabilities. Forexample, the telephony API requires NetworkServices. Click Chooseto add more capabilities to the project file, as shown in Figure 2.17.24QUICK STARTFigure 2.17 Adding Capabilities to the Project Files2.8.2 Importing Project FilesAll sample codes from this book are available for download fromdeveloper.symbian.com/quickrecipesbook.

In order to compile themin Carbide.c++, you need to import their project files (bld.inf files).Follow the steps below to import a project file:1.Select File | Import menu from Carbide.c++ IDE.2.In the Import dialog, select Symbian OS | Symbian OS Bld.inf file(see Figure 2.18).3.Click Next and select the bld.inf file you want to import (seeFigure 2.19).Figure 2.18Import a Project File into Carbide.c++ADVANCED TOPICS ON CARBIDE.c++25Figure 2.19 Browse to the bld.inf of the Project to be Imported4. Click Next and select the SDK. The dialog is similar to the one whencreating a new project (shown in Figure 2.5).5. Click Next to select the MMP files to be imported (see Figure 2.20).Since most examples contain only one MMP file, you can just pressNext again.6.

The next dialog asks for project name and location (see Figure 2.21).You can usually just use the default values and click Finish.Figure 2.20 Select the MMP Files to be Imported26QUICK STARTFigure 2.21 Enter the Project Name and Location2.8.3 Changing the Certificate/Key PairBy default, Carbide.c++ creates a self-signed certificate/key pair whencreating a SIS file. A self-signed certificate is sufficient for many applications. However, there are cases when you need to apply for a developercerificate at Symbian Signed (www.symbiansigned.com), for examplewhen using the Location API (see Section 4.10). The developer certificateallows your application to use restricted APIs that cannot be accessedusing a self-signed certificate.Follow the instructions below to change the certificate/key pair of yourproject:1.Right click the project name and select Properties.2.In the Properties dialog, select Carbide.c++ | Carbide Build Configuration.

On the SIS Builder box, select the name of the SIS file andclick Edit (see Figure 2.22).3.In the SIS Properties dialog, enter the certificate/key pair files (seeFigure 2.23). If your key requires a password, you can enter it hereas well.2.9 Links• Code samples for Symbian Press books, including this one:developer.symbian.com/quickrecipesbook.• Forum Nokia wiki – Moving to Windows Vista: wiki.forum.nokia.com/index.php/Moving to Windows Vista.LINKSFigure 2.2227SIS Builder in Carbide.c++ IDEFigure 2.23 Change the Certificate/Key Pair in the SIS Builder• Information about errors that occur when installing self-signed, orunsigned, SIS files: www.antonypranata.com/articles/interpreting-signing-error-messages-s60-3rd-edition.3Symbian OS Development BasicsThis chapter explains some of the essential topics needed to write C++on Symbian OS.

To discuss every Symbian C++ concept would take anentire book, so we only discuss the concepts that you need to understandthe examples and discussion in the following chapters of this book.3.1 Fundamental Data Types on Symbian OSSymbian OS defines a set of fundamental types which, for compilerindependence, are used instead of the native built-in C++ types. Theseare provided as a set of typedefs as shown in Table 3.1, and can befound in the Symbian header file e32def.h.The fundamental Symbian OS types should always be used instead ofthe native types (that is, use TInt instead of int and so on).

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
5232
Авторов
на СтудИзбе
424
Средний доход
с одного платного файла
Обучение Подробнее