ecere/i18n: Completed dates i18n, Fixed compiler i18n $(EAR) build issues, Moved...
authorJerome St-Louis <jerome@ecere.com>
Sun, 19 Feb 2012 17:59:27 +0000 (02:59 +0900)
committerJerome St-Louis <jerome@ecere.com>
Sun, 19 Feb 2012 17:59:27 +0000 (02:59 +0900)
22 files changed:
compiler/bootstrap/ecere/bootstrap/String.c
compiler/bootstrap/ecere/bootstrap/i18n.c
compiler/bootstrap/libec/bootstrap/pass2.c
compiler/ecc/Makefile
compiler/ecp/Makefile
compiler/ecs/Makefile
compiler/libec/Makefile
ecere/Makefile
ecere/Makefile.ecereCOM
ecere/Makefile.vanilla
ecere/ecere.epj
ecere/ecereCOM.epj
ecere/locale/zh_CN/LC_MESSAGES/ecere.mo
ecere/locale/zh_CN/LC_MESSAGES/ecere.po
ecere/src/com/String.ec
ecere/src/gui/controls/CalendarControl.ec
ecere/src/sys/Date.ec
ecere/src/sys/Time.ec
ecere/src/sys/i18n.ec
ecere/src/sys/unicode.ec
samples/guiAndGfx/dataBoxes/dataBoxes.ec [new file with mode: 0644]
samples/guiAndGfx/dataBoxes/dataBoxes.epj [new file with mode: 0644]

index 5a36584..f042fe5 100644 (file)
@@ -1352,48 +1352,6 @@ break;
 return (float)neg * res;
 }
 
-unsigned int __ecereNameSpace__ecere__sys__GetAlNum(char ** buffer, char * string, int max)
-{
-int c;
-char ch;
-unsigned int result = 0x1;
-
-if(!* *buffer)
-{
-string[0] = (char)0;
-return 0x0;
-}
-for(; ; )
-{
-if(!(ch = *((*buffer)++)))
-result = 0x0;
-if(isalnum(ch))
-break;
-if(!*(*buffer))
-break;
-}
-if(result)
-{
-for(c = 0; c < max - 1; c++)
-{
-if(!isalnum(ch))
-{
-result = 0x1;
-break;
-}
-string[c] = ch;
-if(!(ch = *(*buffer)))
-{
-c++;
-break;
-}
-(*buffer)++;
-}
-string[c] = (char)0;
-}
-return result;
-}
-
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
 
 struct __ecereNameSpace__ecere__com__DefinedExpression;
@@ -1443,7 +1401,6 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::GetValue", "
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::GetHexValue", "uint ecere::sys::GetHexValue(char * * buffer)", __ecereNameSpace__ecere__sys__GetHexValue, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::StripQuotes", "char * ecere::sys::StripQuotes(char * string, char * output)", __ecereNameSpace__ecere__sys__StripQuotes, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FloatFromString", "double ecere::sys::FloatFromString(char * string)", __ecereNameSpace__ecere__sys__FloatFromString, module, 4);
-__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::GetAlNum", "bool ecere::sys::GetAlNum(char * * buffer, char * string, int max)", __ecereNameSpace__ecere__sys__GetAlNum, module, 4);
 }
 
 void __ecereUnregisterModule_String(struct __ecereNameSpace__ecere__com__Instance * module)
index 7250484..aad4b41 100644 (file)
@@ -531,9 +531,9 @@ void __ecereRegisterModule_i18n(struct __ecereNameSpace__ecere__com__Instance *
 {
 struct __ecereNameSpace__ecere__com__Class * class;
 
-__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::LoadTranslatedStrings", "void ecere::LoadTranslatedStrings(ecere::com::Module module, char * name)", __ecereNameSpace__ecere__LoadTranslatedStrings, module, 1);
-__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::UnloadTranslatedStrings", "void ecere::UnloadTranslatedStrings(ecere::com::Module module)", __ecereNameSpace__ecere__UnloadTranslatedStrings, module, 1);
-__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::GetTranslatedString", "char * ecere::GetTranslatedString(ecere::com::Module module, char * string, char * stringAndContext)", __ecereNameSpace__ecere__GetTranslatedString, module, 1);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::LoadTranslatedStrings", "void ecere::LoadTranslatedStrings(ecere::com::Module module, char * name)", __ecereNameSpace__ecere__LoadTranslatedStrings, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::UnloadTranslatedStrings", "void ecere::UnloadTranslatedStrings(ecere::com::Module module)", __ecereNameSpace__ecere__UnloadTranslatedStrings, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::GetTranslatedString", "char * ecere::GetTranslatedString(ecere::com::Module module, char * string, char * stringAndContext)", __ecereNameSpace__ecere__GetTranslatedString, module, 4);
 }
 
 void __ecereUnregisterModule_i18n(struct __ecereNameSpace__ecere__com__Instance * module)
index 4587221..17aac21 100644 (file)
@@ -2405,7 +2405,7 @@ struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecer
 
 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
 isArray = 0x1;
-if(isArray)
+if(isArray && _class->templateArgs)
 {
 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, (((void *)0)));
index f6ddcf5..81976c5 100644 (file)
@@ -45,6 +45,7 @@ export DYLD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
 ECP := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecp)
 ECC := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecc)
 ECS := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecs)
+EAR := $(call psep,../../obj/$(PLATFORM)/bin/ear)
 
 # FLAGS
 
index f6ea9ca..a1dcc26 100644 (file)
@@ -45,6 +45,7 @@ export DYLD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
 ECP := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecp)
 ECC := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecc)
 ECS := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecs)
+EAR := $(call psep,../../obj/$(PLATFORM)/bin/ear)
 
 # FLAGS
 
index b228a34..f9ddaf9 100644 (file)
@@ -45,6 +45,7 @@ export DYLD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
 ECP := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecp)
 ECC := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecc)
 ECS := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecs)
+EAR := $(call psep,../../obj/$(PLATFORM)/bin/ear)
 
 # FLAGS
 
index 3c15aee..179cb22 100644 (file)
@@ -146,6 +146,7 @@ endif
 ECP := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecp)
 ECC := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecc)
 ECS := $(call psep,../bootstrap/obj/bin.$(PLATFORM)/ecs)
+EAR := $(call psep,../../obj/$(PLATFORM)/bin/ear)
 
 # FLAGS
 
index c72173d..fe7d663 100644 (file)
@@ -1036,7 +1036,7 @@ $(OBJ)units.sym: src/sys/units.ec
        $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/sys/units.ec -o $(OBJ)units.sym
 
 $(OBJ)i18n.sym: src/sys/i18n.ec
-       $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/sys/i18n.ec -o $(OBJ)i18n.sym
+       $(ECP) -DECERE_COM_MODULE $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/sys/i18n.ec -o $(OBJ)i18n.sym
 
 $(OBJ)Cube.sym: src/gfx/3D/meshes/Cube.ec
        $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/gfx/3D/meshes/Cube.ec -o $(OBJ)Cube.sym
@@ -1410,7 +1410,7 @@ $(OBJ)units.c: src/sys/units.ec $(OBJ)units.sym | $(SYMBOLS)
        $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/sys/units.ec -o $(OBJ)units.c -symbols $(OBJ)
 
 $(OBJ)i18n.c: src/sys/i18n.ec $(OBJ)i18n.sym | $(SYMBOLS)
-       $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/sys/i18n.ec -o $(OBJ)i18n.c -symbols $(OBJ)
+       $(ECC) -DECERE_COM_MODULE $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/sys/i18n.ec -o $(OBJ)i18n.c -symbols $(OBJ)
 
 $(OBJ)Cube.c: src/gfx/3D/meshes/Cube.ec $(OBJ)Cube.sym | $(SYMBOLS)
        $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/gfx/3D/meshes/Cube.ec -o $(OBJ)Cube.c -symbols $(OBJ)
@@ -1793,7 +1793,7 @@ $(OBJ)System.c.o: src/sys/System.c
        $(CC) $(CFLAGS) -c src/sys/System.c -o $(OBJ)System.c.o
 
 $(OBJ)i18n.o: $(OBJ)i18n.c
-       $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)i18n.c -o $(OBJ)i18n.o
+       $(CC) -DECERE_COM_MODULE $(CFLAGS) $(FVISIBILITY) -c $(OBJ)i18n.c -o $(OBJ)i18n.o
 
 $(OBJ)Cube.o: $(OBJ)Cube.c
        $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)Cube.c -o $(OBJ)Cube.o
index 6614bda..bd5b3d8 100644 (file)
@@ -128,7 +128,7 @@ EAR := $(call psep,../obj/$(PLATFORM)/bin/ear)
 # FLAGS
 
 CFLAGS = -fmessage-length=0 -O2 -ffast-math -m32 $(FPIC) -w \
-        -DECERE_COM_MODULE -DBUILDING_ECERE_COM
+        -DECERE_COM_MODULE -DBUILDING_ECERE_COM -DECERE_NOFILE
 
 CECFLAGS =
 
index 822b922..94a1f3e 100644 (file)
@@ -640,7 +640,8 @@ RESOURCES3 = \
        $(RES)places/brokenFolder.png \
        $(RES)status/audioVolumeHigh.png \
        $(RES)status/folderOpen.png \
-       $(RES)unicode/derivedGeneralCategoryStripped.txt
+       $(RES)unicode/derivedGeneralCategoryStripped.txt \
+       locale/zh_CN/LC_MESSAGES/ecere.mo
 
 # CROSS-PLATFORM MAGIC
 
@@ -791,7 +792,7 @@ $(OBJ)units.sym: src/sys/units.ec
        $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/sys/units.ec -o $(OBJ)units.sym
 
 $(OBJ)i18n.sym: src/sys/i18n.ec
-       $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/sys/i18n.ec -o $(OBJ)i18n.sym
+       $(ECP) -DECERE_COM_MODULE $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/sys/i18n.ec -o $(OBJ)i18n.sym
 
 $(OBJ)BMPFormat.sym: src/gfx/bitmaps/BMPFormat.ec
        $(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) -c src/gfx/bitmaps/BMPFormat.ec -o $(OBJ)BMPFormat.sym
@@ -1063,7 +1064,7 @@ $(OBJ)units.c: src/sys/units.ec $(OBJ)units.sym | $(SYMBOLS)
        $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/sys/units.ec -o $(OBJ)units.c -symbols $(OBJ)
 
 $(OBJ)i18n.c: src/sys/i18n.ec $(OBJ)i18n.sym | $(SYMBOLS)
-       $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/sys/i18n.ec -o $(OBJ)i18n.c -symbols $(OBJ)
+       $(ECC) -DECERE_COM_MODULE $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/sys/i18n.ec -o $(OBJ)i18n.c -symbols $(OBJ)
 
 $(OBJ)BMPFormat.c: src/gfx/bitmaps/BMPFormat.ec $(OBJ)BMPFormat.sym | $(SYMBOLS)
        $(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY) -c src/gfx/bitmaps/BMPFormat.ec -o $(OBJ)BMPFormat.c -symbols $(OBJ)
@@ -1344,7 +1345,7 @@ $(OBJ)System.c.o: src/sys/System.c
        $(CC) $(CFLAGS) -c src/sys/System.c -o $(OBJ)System.c.o
 
 $(OBJ)i18n.o: $(OBJ)i18n.c
-       $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)i18n.c -o $(OBJ)i18n.o
+       $(CC) -DECERE_COM_MODULE $(CFLAGS) $(FVISIBILITY) -c $(OBJ)i18n.c -o $(OBJ)i18n.o
 
 $(OBJ)BMPFormat.o: $(OBJ)BMPFormat.c
        $(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)BMPFormat.c -o $(OBJ)BMPFormat.o
index 7f14bcd..eac521d 100644 (file)
                   },
                   {
                      "FileName" : "i18n.ec",
+                     "Options" : {
+                        "PreprocessorDefinitions" : [
+                           "ECERE_COM_MODULE"
+                        ]
+                     },
                      "Configurations" : [
                         {
                            "Name" : "Bootstrap",
index 23787a7..348e458 100644 (file)
@@ -5,7 +5,8 @@
       "Warnings" : "All",
       "PreprocessorDefinitions" : [
          "ECERE_COM_MODULE",
-         "BUILDING_ECERE_COM"
+         "BUILDING_ECERE_COM",
+         "ECERE_NOFILE"
       ],
       "DefaultNameSpace" : "ecere",
       "TargetType" : "SharedLibrary",
index ae416d8..23dd221 100644 (file)
Binary files a/ecere/locale/zh_CN/LC_MESSAGES/ecere.mo and b/ecere/locale/zh_CN/LC_MESSAGES/ecere.mo differ
index 82c4908..6cf7715 100644 (file)
@@ -66,11 +66,11 @@ msgstr "Alt+"
 msgid "Appearance"
 msgstr "外观"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Apr"
 msgstr "四月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "April"
 msgstr "四月"
 
@@ -78,11 +78,11 @@ msgstr "四月"
 msgid "As Type:"
 msgstr "类型(T):"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Aug"
 msgstr "八月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "August"
 msgstr "八月"
 
@@ -232,11 +232,11 @@ msgstr "剪切(X)\tCtrl+X"
 msgid "Data"
 msgstr "数据"
 
-#: .\src\sys\Date.ec:25
+#: .\src\sys\Date.ec:43
 msgid "Dec"
 msgstr "十二月"
 
-#: .\src\sys\Date.ec:16
+#: .\src\sys\Date.ec:34
 msgid "December"
 msgstr "十二月"
 
@@ -321,11 +321,16 @@ msgstr "写入文件错误"
 msgid "Exp"
 msgstr "Exp"
 
-#: .\src\sys\Date.ec:24
+#: .\src\gui\controls\CalendarControl.ec:10
+msgctxt "Friday"
+msgid "F"
+msgstr "五"
+
+#: .\src\sys\Date.ec:42
 msgid "Feb"
 msgstr "二月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "February"
 msgstr "二月"
 
@@ -373,11 +378,11 @@ msgstr "查找内容(N):"
 msgid "Find...\tCtrl+F"
 msgstr "查找(F)...\tCtrl+F"
 
-#: .\src\sys\Date.ec:20
+#: .\src\sys\Date.ec:38
 msgid "Fri"
 msgstr "星期五"
 
-#: .\src\sys\Date.ec:11
+#: .\src\sys\Date.ec:29
 msgid "Friday"
 msgstr "星期五"
 
@@ -424,27 +429,27 @@ msgstr "不存在指定的字符串标识符"
 msgid "Insert Tabs"
 msgstr "插入制表符(I)"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Jan"
 msgstr "一月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "January"
 msgstr "一月"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Jul"
 msgstr "七月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "July"
 msgstr "七月"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Jun"
 msgstr "六月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "June"
 msgstr "六月"
 
@@ -469,11 +474,16 @@ msgstr "行号:"
 msgid "Look in:"
 msgstr "浏览(L):"
 
-#: .\src\sys\Date.ec:24
+#: .\src\gui\controls\CalendarControl.ec:9
+msgctxt "Monday"
+msgid "M"
+msgstr "一"
+
+#: .\src\sys\Date.ec:42
 msgid "Mar"
 msgstr "三月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "March"
 msgstr "三月"
 
@@ -486,12 +496,12 @@ msgstr "区分大小写(C)"
 msgid "Maximize"
 msgstr "最大化(X)"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgctxt "LongMonthNames"
 msgid "May"
 msgstr "五月"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgctxt "ShortMonthNames"
 msgid "May"
 msgstr "五月"
@@ -509,11 +519,11 @@ msgstr "Microsoft Windows Network"
 msgid "Minimize"
 msgstr "最小化(N)"
 
-#: .\src\sys\Date.ec:20
+#: .\src\sys\Date.ec:38
 msgid "Mon"
 msgstr "星期一"
 
-#: .\src\sys\Date.ec:11
+#: .\src\sys\Date.ec:29
 msgid "Monday"
 msgstr "星期一"
 
@@ -544,11 +554,11 @@ msgstr "没有错误"
 msgid "No such line."
 msgstr "没有这行."
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Nov"
 msgstr "十一月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "November"
 msgstr "十一月"
 
@@ -563,11 +573,11 @@ msgstr "十一月"
 msgid "OK"
 msgstr "OK"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Oct"
 msgstr "十月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "October"
 msgstr "十月"
 
@@ -623,11 +633,21 @@ msgstr "替换(R)...\tCtrl+R"
 msgid "Restore"
 msgstr "恢复(R)"
 
-#: .\src\sys\Date.ec:21
+#: .\src\gui\controls\CalendarControl.ec:11
+msgctxt "Saturday"
+msgid "S"
+msgstr "六"
+
+#: .\src\gui\controls\CalendarControl.ec:9
+msgctxt "Sunday"
+msgid "S"
+msgstr "日"
+
+#: .\src\sys\Date.ec:39
 msgid "Sat"
 msgstr "星期六"
 
-#: .\src\sys\Date.ec:12
+#: .\src\sys\Date.ec:30
 msgid "Saturday"
 msgstr "星期六"
 
@@ -721,11 +741,11 @@ msgstr "创建目录吗?"
 msgid "Selection"
 msgstr "已选中内容(S)"
 
-#: .\src\sys\Date.ec:24
+#: .\src\sys\Date.ec:42
 msgid "Sep"
 msgstr "九月"
 
-#: .\src\sys\Date.ec:15
+#: .\src\sys\Date.ec:33
 msgid "September"
 msgstr "九月"
 
@@ -747,11 +767,11 @@ msgstr "大小(S)"
 msgid "Stay On Top"
 msgstr "置顶(T)"
 
-#: .\src\sys\Date.ec:20
+#: .\src\sys\Date.ec:38
 msgid "Sun"
 msgstr "星期日"
 
-#: .\src\sys\Date.ec:11
+#: .\src\sys\Date.ec:29
 msgid "Sunday"
 msgstr "星期日"
 
@@ -760,6 +780,16 @@ msgstr "星期日"
 msgid "System"
 msgstr "System"
 
+#: .\src\gui\controls\CalendarControl.ec:10
+msgctxt "Thursday"
+msgid "T"
+msgstr "四"
+
+#: .\src\gui\controls\CalendarControl.ec:9
+msgctxt "Tuesday"
+msgid "T"
+msgstr "二"
+
 #: .\src\gui\skins\TVisionSkin.ec:37
 #: .\src\gui\skins\TVisionSkin.ec:43
 #: .\src\gui\skins\WindowsSkin.ec:125
@@ -768,19 +798,19 @@ msgstr "System"
 msgid "Tahoma"
 msgstr "Tahoma"
 
-#: .\src\sys\Date.ec:20
+#: .\src\sys\Date.ec:38
 msgid "Thu"
 msgstr "星期四"
 
-#: .\src\sys\Date.ec:11
+#: .\src\sys\Date.ec:29
 msgid "Thursday"
 msgstr "星期四"
 
-#: .\src\sys\Date.ec:20
+#: .\src\sys\Date.ec:38
 msgid "Tue"
 msgstr "星期二"
 
-#: .\src\sys\Date.ec:11
+#: .\src\sys\Date.ec:29
 msgid "Tuesday"
 msgstr "星期二"
 
@@ -796,19 +826,24 @@ msgstr "撤销(U)\tCtrl+Z"
 msgid "Up"
 msgstr "向上(U)"
 
-#: .\src\gui\controls\CalendarControl.ec:44
-#: .\src\gui\controls\CalendarControl.ec:69
-#: .\src\gui\controls\CalendarControl.ec:90
-#: .\src\gui\controls\CalendarControl.ec:111
+#: .\src\gui\controls\CalendarControl.ec:50
+#: .\src\gui\controls\CalendarControl.ec:75
+#: .\src\gui\controls\CalendarControl.ec:96
+#: .\src\gui\controls\CalendarControl.ec:117
 #, fuzzy
 msgid "Verdana"
 msgstr "Verdana"
 
-#: .\src\sys\Date.ec:20
+#: .\src\gui\controls\CalendarControl.ec:9
+msgctxt "Wednesday"
+msgid "W"
+msgstr "三"
+
+#: .\src\sys\Date.ec:38
 msgid "Wed"
 msgstr "星期三"
 
-#: .\src\sys\Date.ec:11
+#: .\src\sys\Date.ec:29
 msgid "Wednesday"
 msgstr "星期三"
 
@@ -863,25 +898,25 @@ msgstr ""
 "\n"
 "你想查看错误日志吗?"
 
-#: .\src\sys\Date.ec:64
-#: .\src\sys\Time.ec:779
+#: .\src\sys\Date.ec:121
+#: .\src\sys\Time.ec:781
 msgid "now"
 msgstr "现在"
 
-#: .\src\sys\Date.ec:63
-#: .\src\sys\Time.ec:778
+#: .\src\sys\Date.ec:120
+#: .\src\sys\Time.ec:780
 msgid "today"
 msgstr "今日"
 
-#: .\src\sys\Date.ec:65
-#: .\src\sys\Date.ec:69
-#: .\src\sys\Time.ec:781
+#: .\src\sys\Date.ec:122
+#: .\src\sys\Date.ec:126
+#: .\src\sys\Time.ec:783
 msgid "tomorrow"
 msgstr "明天"
 
-#: .\src\sys\Date.ec:66
-#: .\src\sys\Date.ec:74
-#: .\src\sys\Time.ec:788
+#: .\src\sys\Date.ec:123
+#: .\src\sys\Date.ec:131
+#: .\src\sys\Time.ec:790
 msgid "yesterday"
 msgstr "昨天"
 
index df057b4..a5efa25 100644 (file)
@@ -1100,40 +1100,3 @@ public double FloatFromString(char * string)
    }
    return neg * res;
 }
-
-public bool GetAlNum(char ** buffer, char * string, int max)
-{
-   int c;
-   char ch;
-   bool result = true;
-   if(!**buffer) { string[0]=0; return false; }
-
-   for(;;)
-   {
-      if(!(ch = *((*buffer)++)))
-         result = false;
-      if(isalnum(ch))
-         break;
-      if(!*(*buffer)) break;
-   }
-   if(result)
-   {
-      for(c=0; c<max-1; c++)
-      {
-         if(!isalnum(ch))
-         {
-            result = true;
-            break;
-         }
-         string[c]=ch;
-         if(!(ch = *(*buffer)))
-         {
-            c++;
-            break;            
-         }
-         (*buffer)++;
-      }
-      string[c]=0;
-   }
-   return result;
-}
index 3981d6c..0a656fc 100644 (file)
@@ -4,6 +4,12 @@ import "Window"
 
 #define ISLEAP(y) (!((y)%4) && (((y) % 100) || (!((y)% 400))))
 
+/*static */Array<String> veryShortDaysNames
+{ [
+   $"Sunday"."S", $"Monday"."M", $"Tuesday"."T", $"Wednesday"."W",
+   $"Thursday"."T", $"Friday"."F", $"Saturday"."S"
+] };
+
 public class CalendarControl : CommonControl
 {
    class_property(icon) = "<:ecere>controls/calendar.png";
@@ -240,8 +246,7 @@ private:
          surface.SetForeground(black);
          for(d = sunday; d <= saturday; d++)
          {
-            String s = shortDaysNames[d];
-            surface.CenterTextf(Width / 2 + d * Width, 0, "%c", toupper(s[0]));
+            surface.CenterTextf(Width / 2 + d * Width, 0, "%s", veryShortDaysNames[d]);
          }
 
          surface.SetBackground(Color { 238, 238, 238 } /*whiteSmoke*/);
index b007b89..109c6bf 100644 (file)
@@ -6,6 +6,24 @@ import "CalendarControl"
 
 #define ISLEAP(y) (!((y)%4) && (((y) % 100) || (!((y)% 400))))
 
+/*static */Array<String> enLongDaysNames
+{ [
+   "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+] };
+/*static */Array<String> enLongMonthsNames
+{ [
+   "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+] };
+
+/*static */Array<String> enShortDaysNames
+{ [
+   "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+] };
+/*static */Array<String> enShortMonthsNames
+{ [
+   "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+] };
+
 /*static */Array<String> longDaysNames
 { [
    $"Sunday", $"Monday", $"Tuesday", $"Wednesday", $"Thursday", $"Friday", $"Saturday"
@@ -23,7 +41,46 @@ import "CalendarControl"
 { [
    $"Jan", $"Feb", $"Mar", $"Apr", $"ShortMonthNames"."May", $"Jun", $"Jul", $"Aug", $"Sep", $"Oct", $"Nov", $"Dec"
 ] };
-public enum Month { january, february, march, april, may, june, july, august, september, october, november, december };
+
+default:
+extern int __ecereVMethodID_class_OnGetString;
+public:
+
+public enum Month
+{
+   january, february, march, april, may, june, july, august, september, october, november, december;
+
+   char * OnGetString(char * string, void * fieldData, bool * needClass)
+   {
+      Month m = this;
+      if(m >= january && m <= december)
+      {
+         if(!needClass || !*needClass)
+            return longMonthsNames[m];
+         else
+            return class::OnGetString(string, fieldData, needClass);
+      }
+      return null;
+   }
+
+   bool OnGetDataFromString(char * string)
+   {
+      if(string)
+      {
+         Month m;
+         for(m = 0; m<=december; m++)
+         {
+            if(!strcmpi(shortMonthsNames[m], string)  || !strcmpi(longMonthsNames[m], string) ||
+               !strcmpi(enShortMonthsNames[m], string) || !strcmpi(enLongMonthsNames[m], string))
+            {
+               this = m;
+               return true;
+            }
+         }
+      }
+      return false;
+   }
+};
 
 default:
 extern int __ecereVMethodID_class_OnGetString;
@@ -97,16 +154,22 @@ public struct Date
             bool resolved = false;
             int c;
             bool isAlpha = false;
-            for(c = 0; value[c] && !isAlpha; c++)
-               if(isalpha(value[c])) isAlpha = true;
+            unichar ch;
+            int nb;
+            for(c = 0; (ch = UTF8GetChar(value + c, &nb)) && !isAlpha; c += nb)
+            {
+               // if(isalpha(value[c])) isAlpha = true;
+               if(CharMatchCategories(ch, letters)) isAlpha = true;
+            }
 
             if(isAlpha)
             {            
-               Month c;
-               for(c = 0; c<Month::enumSize; c++)
-                  if(!strnicmp(shortMonthsNames[c], value, 3))
+               Month m;
+               for(m = 0; m<Month::enumSize; m++)
+                  if(!strcmpi(shortMonthsNames[m], value)  || !strcmpi(longMonthsNames[m], value) ||
+                     !strcmpi(enShortMonthsNames[m], value) || !strcmpi(enLongMonthsNames[m], value))
                   {
-                     month = c;
+                     month = m;
                      gotAlphaMonth = true;
                      break;
                   }
index b1c80ea..1b239ff 100644 (file)
@@ -695,12 +695,14 @@ public struct DateTime
       {
          int i;
          for(i = 0; i<7; i++) 
-            if(!strcmpi(tokens[c], shortDaysNames[i]) || !strcmpi(tokens[c], longDaysNames[i]))
+            if(!strcmpi(tokens[c], shortDaysNames[i]) || !strcmpi(tokens[c], longDaysNames[i]) ||
+               !strcmpi(tokens[c], enShortDaysNames[i]) || !strcmpi(tokens[c], enLongDaysNames[i]))
                break;               
          if(i < 7) { dayOfTheWeek = (DayOfTheWeek)i; foundDayOfTheWeek = true; continue; }
 
          for(i = 0; i<12; i++) 
-            if(!strcmpi(tokens[c], shortMonthsNames[i]) || !strcmpi(tokens[c], longMonthsNames[i]))
+            if(!strcmpi(tokens[c], shortMonthsNames[i]) || !strcmpi(tokens[c], longMonthsNames[i]) ||
+               !strcmpi(tokens[c], enShortMonthsNames[i]) || !strcmpi(tokens[c], enLongMonthsNames[i]))
                break;               
          if(i < 12) { month = (Month)i; continue; }
 
index 13d284b..e387574 100644 (file)
@@ -1,4 +1,4 @@
-#ifndef ECERE_COM_MODULE
+#ifndef ECERE_NOFILE
 import "File"
 #endif
 import "Map"
@@ -23,7 +23,7 @@ static Map<String, Map<String, String>> moduleMaps { };
 
 public dllexport void LoadTranslatedStrings(Module module, char * name)
 {
-#ifndef ECERE_COM_MODULE
+#ifndef ECERE_NOFILE
    File f;
    char fileName[MAX_LOCATION];
 
index c9d215f..505c9a1 100644 (file)
@@ -292,6 +292,63 @@ public enum PredefinedCharCategories : CharCategories
    connector = CharCategories { punctuationConnector = true },
 };
 
+public bool GetAlNum(char ** input, char * string, int max)
+{
+   int c = 0;
+   unichar ch;
+   int nb = 1;
+   bool result = true;
+   char * buffer = *input;
+   if(!buffer[0]) { string[0]=0; return false; }
+
+   // Eat all left spacing, leave last char in ch
+   for(;;)
+   {
+#if defined(ECERE_NOUNICODE) || defined(ECERE_BOOTSTRAP)
+      ch = *buffer;
+#else
+      ch = UTF8GetChar(buffer, &nb);
+#endif
+      if(!ch) { result = false; break; }
+
+#if defined(ECERE_NOUNICODE) || defined(ECERE_BOOTSTRAP)
+      if(isalnum(ch))
+#else
+      if(CharMatchCategories(ch, numbers|letters))
+#endif
+         break;
+      else
+         buffer += nb;
+   }
+   if(result)
+   {
+      while(c < max-1)
+      {
+         int i;
+         for(i = 0; i < nb && c < max-1; i++)
+            string[c++] = *(buffer++);
+
+#if defined(ECERE_NOUNICODE) || defined(ECERE_BOOTSTRAP)
+         ch = *buffer;
+#else
+         ch = UTF8GetChar(buffer, &nb);
+#endif
+         if(!ch) break; // End of input string
+
+#if defined(ECERE_NOUNICODE) || defined(ECERE_BOOTSTRAP)
+         if(!isalnum(ch))
+#else
+         if(!CharMatchCategories(ch, numbers|letters))
+#endif
+            // End of this alpha numeric word
+            break;
+      }
+      string[c]=0;
+   }
+   *input = buffer;
+   return result;
+}
+
 static struct Range
 {
    uint start, end;
diff --git a/samples/guiAndGfx/dataBoxes/dataBoxes.ec b/samples/guiAndGfx/dataBoxes/dataBoxes.ec
new file mode 100644 (file)
index 0000000..29d2f67
--- /dev/null
@@ -0,0 +1,51 @@
+import "ecere"
+class ColorFun : Window
+{
+   text = "Fun With Colors and Data Boxes";
+   background = activeBorder;
+   borderStyle = sizable;
+   hasMaximize = true;
+   hasMinimize = true;
+   hasClose = true;
+   nativeDecorations = true;
+   tabCycle = true;
+   size = { 640, 480 };
+   Color color;
+   color = activeBorder;
+   SavingDataBox colorBox
+   {      
+      this, size = { 116, 20 }, position = { 176, 104 }; data = &color; type = class(Color);
+      bool NotifyChanged(bool closingDropDown)
+      {
+         background = color;
+         return true;
+      }
+   };
+   Date date;
+   DateTime now;
+   date = (now.GetLocalTime(), Date { now.year, now.month, now.day });
+   SavingDataBox dateBox
+   {      
+      this, size = { 200, 20 }, position = { 376, 104 }; data = &date; type = class(Date);
+   };
+
+   DateTime dateTime;
+   dateTime = now;
+   SavingDataBox dateTimeBox
+   {      
+      this, size = { 200, 20 }, position = { 376, 304 }; data = &dateTime; type = class(DateTime);
+   };
+   double d;
+   d = Pi;
+   SavingDataBox doubleBox
+   {      
+      this, size = { 116, 20 }, position = { 176, 204 }; data = &d; type = class(double);
+   };
+}
+ColorFun form {};
diff --git a/samples/guiAndGfx/dataBoxes/dataBoxes.epj b/samples/guiAndGfx/dataBoxes/dataBoxes.epj
new file mode 100644 (file)
index 0000000..5375e0a
--- /dev/null
@@ -0,0 +1,38 @@
+{
+   "Version" : 0.2,
+   "ModuleName" : "dataBoxes",
+   "Options" : {
+      "Warnings" : "All",
+      "TargetType" : "Executable",
+      "TargetFileName" : "dataBoxes",
+      "Libraries" : [
+         "ecere"
+      ]
+   },
+   "Configurations" : [
+      {
+         "Name" : "Debug",
+         "Options" : {
+            "Debug" : true,
+            "Optimization" : "None",
+            "PreprocessorDefinitions" : [
+               "_DEBUG"
+            ]
+         }
+      },
+      {
+         "Name" : "Release",
+         "Options" : {
+            "Debug" : false,
+            "Optimization" : "Speed"
+         }
+      }
+   ],
+   "Files" : [
+      "dataBoxes.ec"
+   ],
+   "ResourcesPath" : "",
+   "Resources" : [
+
+   ]
+}
\ No newline at end of file