S60 Platform: Rich Text Editor Example v2.0

-------------------------------------------------

 

This C++ code example demonstrates the usage of Rich Text Editor. Most of the features

are handled automatically when the dialog framework creates the editor. However, some

steps, such as inserting an image, setting the text input type, or showing the scroller require

the use of methods or classes.

 

--------------------------------------------------------------------------------

 

PREREQUISITES

 

Symbian C++ basics

 

--------------------------------------------------------------------------------

 

IMPORTANT FILES/CLASSES

 

src\RichTextEditorContainer.cpp

   Shows, for example, how to insert an image, scroller, and text input type for RichTextEditor.

 

Important classes: CEikRichTextEditor, CFbsBitmap, TPictureHeader, CPicture

 

--------------------------------------------------------------------------------

 

KNOWN ISSUES

 

No known issues.

   

--------------------------------------------------------------------------------

 

RUNNING THE EXAMPLE

 

Start the application. An editor opens.

 

Select any part of the text: press and hold the Edit key while moving the scroller key to left

or right. The selected text is highlighted.

 

You can select various formatting options from the Options menu (character format, color, alignment, and font).

 

 

--------------------------------------------------------------------------------

 

BUILD & INSTALLATION INSTRUCTIONS

 

Steps for building and installing the application to a device depend on the S60 platform version:

 

--Mobile device (S60 3rd Edition)

    cd to /RichTextEditor/group

    bldmake bldfiles

    abld build gcce urel

    cd to /RichTextEditor/sis

    Edit the RichTextEditor_S60_3rd_ed.pkg's paths to match those on your system.

    makesis RichTextEditor_S60_3rd_ed.pkg

   

    Sign the SIS package

      - See the SDK Help for information about self-signed .sis packages, or

        www.symbiansigned.com for information about Developer Certificates.

 

    Install the signed .sis file to an S60 3rd Edition device.

      - If you get a "Certificate error" during installation of a self-signed package, check that

App.Manager -> Settings -> Software Installation is set to "All".

   

--Mobile device (S60 1st and 2nd Edition)

    cd to /RichTextEditor/group

    bldmake bldfiles

    abld build armi urel

    cd to /RichTextEditor/sis

    Edit the RichTextEditor_S60_2nd_ed.pkg's (or RichTextEditor_S60_1st_ed.pkg's) paths to match those on your system.

    makesis RichTextEditor_S60_2nd_ed.pkg (or RichTextEditor_S60_1st_ed.pkg)

    Install the SIS file to the device.

 

--Emulator (WINSCW)

    cd to /RichTextEditor/group

    bldmake bldfiles

    abld build winscw udeb

    Start the emulator.

 

--Carbide.c++ IDE

 

You can also import the example into Carbide.c++ IDE. Note that the source

code of this code example itself supports building to both S60 2nd and 3rd Edition.

However, when importing it to Carbide, you need to import to separate S60 2nd Edition

and 3rd Edition projects. This is because Carbide only supports multiple project

configurations between S60 2nd Edition releases and S60 3rd Edition releases,

but it is not possible to build from the same source to both S60 2nd and

3rd Edition. So for further development in Carbide, you need to implement the

changes twice.

 

Note also that Carbide does not deal with MMP files when creating and building

applications but it is still possible to import existing applications to Carbide

from an MMP file. In this code example, the MMP provides some additional definitions

that allow seamless importing of all required application directories and files to

Carbide.

 

Steps for importing to Carbide.c++:

 

    1. Make sure that the path for the current Carbide workspace does not contain any

       whitespace characters.

       If necessary, select a new workspace folder in Carbide (File -> Switch workspace…).

    2. Extract the example package to a temporary folder.

    3. To ensure that the files are exported to the correct location under emulator environment,

       open command prompt and run the following commands:

 

        cd to /RichTextEditor/group

        bldmake bldfiles

        abld export

 

            Check that the desired SDK has been set as default (run devices.exe) before trying to

            export. Export needs to be done for each SDK for which you are about to compile the

            application.

 

 

    4. Select File -> Import… -> Symbian MMP File, click Browse, and find the .mmp file

       you want to import (for S60 2nd Edition or for S60 3rd Edition and later).

       Select the appropriate SDK/configurations.

       Check that 'Copy source files into workspace' is selected, and then click Finish.

     

The project is now ready to be built:

 

    --Mobile device (S60 3rd Edition)

        Select Project -> Properties -> C/C++ Build

        Set Configuration: "S60 3.0 Phone (GCCE) Release" and press OK.

        Select Project -> Build project

        Install the SIS file to the device.

 

        Install the signed .sis file to an S60 3rd Edition device.

        - If you get a "Certificate error" during installation of a self-signed

          package, check that App.Manager -> Settings -> Software Installation is

          set to "All".

 

    --Mobile device (S60 2nd Edition)

        Select Project -> Properties -> C/C++ Build

        Set Configuration: "S60 2.8 Phone (ARMI) Release" or "S60 2.8 Phone (Thumb) Release"

                        and press OK.

        Select Project -> Build project

        Install the SIS file to the device.

 

    --Emulator (WINSCW) (S60 3rd or 2nd Edition)

        Select Project -> Properties -> C/C++ Build

        Set Configuration: "S60 3.0 Emulator Debug" or "S60 2.8 Emulator Debug" and press OK.

        Select Project -> Build project

        Select Run -> Run As -> Run Symbian OS Application

       

       

   

--------------------------------------------------------------------------------

 

COMPATIBILITY

 

S60 3rd Edition

S60 2nd Edition

S60 1st Edition

 

Tested with Nokia 3650, Nokia 6670, Nokia E60, and Nokia E61.

 

Created / tested with Series 60 1st Edition SDK for Symbian OS, for C++, Supporting Metrowerks CodeWarrior

and with Series 60 2nd Edition SDK for Symbian OS, for C++, Supporting Metrowerks CodeWarrior

and with S60 3rd Edition SDK for Symbian OS, for C++, Supporting Metrowerks CodeWarrior.

Imported and tested with Carbide.c++ IDE.

 

--------------------------------------------------------------------------------

 

VERSION HISTORY                              

 

2.0                 Support added for S60 3rd Edition and scalable UI.

Replaces the Series 60 Developer Platform 1.0: Rich-Text Editor Example

but also parts from the Series 60 Developer Platform 1.0: Type Example are added.

1.0                 First release (separately published Rich-Text Editor and Type examples).

 

--------------------------------------------------------------------------------

EVALUATE THIS RESOURCE

 

Please spare a moment to help us improve documentation quality and recognize the examples

you find most valuable, by rating this resource.