summaryrefslogtreecommitdiff
path: root/inputmethods/dasher/CustomAlphabet.cpp
Unidiff
Diffstat (limited to 'inputmethods/dasher/CustomAlphabet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/CustomAlphabet.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/inputmethods/dasher/CustomAlphabet.cpp b/inputmethods/dasher/CustomAlphabet.cpp
new file mode 100644
index 0000000..deb0f6d
--- a/dev/null
+++ b/inputmethods/dasher/CustomAlphabet.cpp
@@ -0,0 +1,40 @@
1// CustomAlphabet.cpp
2//
3/////////////////////////////////////////////////////////////////////////////
4//
5// Copyright (c) 2002 Iain Murray
6//
7/////////////////////////////////////////////////////////////////////////////
8
9
10#include "CustomAlphabet.h"
11
12using namespace Dasher;
13using namespace std;
14
15
16CCustomAlphabet::CCustomAlphabet(const CAlphIO::AlphInfo& AlphInfo)
17{
18 // Set miscellaneous options
19 SetOrientation(AlphInfo.Orientation);
20 SetLanguage(AlphInfo.Type);
21 SetTrainingFile(AlphInfo.TrainingFile);
22
23 // Add all the characters.
24 for (unsigned int i=0; i<AlphInfo.Groups.size(); i++) { // loop groups
25 for (unsigned int j=0; j<AlphInfo.Groups[i].Characters.size(); j++) { // loop characters
26 AddChar(AlphInfo.Groups[i].Characters[j].Text, AlphInfo.Groups[i].Characters[j].Display, AlphInfo.Groups[i].Characters[j].Colour, AlphInfo.Groups[i].Characters[j].Foreground);
27 }
28 StartNewGroup();
29 }
30
31 // Set Space character if requested
32
33 // This line makes it a bit easier for our WindowsCE compiler
34 std::string empty="";
35
36 if (AlphInfo.SpaceCharacter.Text != empty ) {
37 AddChar(AlphInfo.SpaceCharacter.Text, AlphInfo.SpaceCharacter.Display, AlphInfo.SpaceCharacter.Colour, AlphInfo.SpaceCharacter.Foreground);
38 SetSpaceSymbol();
39 }
40}