EasyManua.ls Logo

Casio ClassPad 300

Casio ClassPad 300
125 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Message Number Enumeration
The first step that you will need to do when designing your application is keep a running
enumeration of IDs for all of the strings that will appear in you application. These IDs
are called message numbers. In the Hello World add-in this is done in
HelloLangDatabase.h. Here is the code that creates the enumeration:
#define HELLO_MESSAGE_START LOCAL_LANG_START+1
enum HelloWorldMessage {
HELLO_HELLO= HELLO_MESSAGE_START,
HELLO_HELLO_WORLD,
HELLO_MESSAGE_END
};
In the enumeration we have the HELLO_HELLO message ID, which refers to the
“Hello” message on the button and the menu, and the HELLO_HELLO_WORLD
message ID that refers to the “Hello World” string in the Module Windows. The more
text messages you have, the more entries in the enumeration you must add. The
enumeration should always start from LOCAL_LANG_START + 1. This ensures that
there is no collision of message IDs. In HelloLangDatabase.h LOCAL_LANG_START
+ 1 is #defined as HELLO_MESSAGE_START. You should also add an ending entry
into your enumeration, like HELLO_MESSAGE_END, so you can check that a message
ID is within your enumeration range.
Language Arrays
Each one of the message IDs will become an index into an array. The array that is used
depends on what language is currently set. Using this index and the array that
corresponds to the current language, the correct text string will be returned. First, let’s
take a look at all of the arrays that HelloWorld defines in HelloLangDatabase.cpp:
CP_CHAR *HelloMessageData_Eng[]={
"Hello",
"Hello World",
};
CP_CHAR *HelloMessageData_Deu[]={
"Hallo",
"Hallo Welt",
};
CP_CHAR *HelloMessageData_Esp[]={
"Hola",
"Hola Mundo",
};
CP_CHAR *HelloMessageData_Fra[]={
"Bonjour",
"Bonjour Monde",
};
CP_CHAR *HelloMessageData_Por[]={
106

Table of Contents

Other manuals for Casio ClassPad 300

Related product manuals