Compare commits

..

177 Commits

Author SHA1 Message Date
Simon Rozman
593392782a Version set to 2.1-beta2 2017-06-01 20:04:39 +02:00
Simon Rozman
e19a98a249 Translation management extended and moved from settings dialog to Translate toolbar 2017-06-01 20:02:43 +02:00
Simon Rozman
a66128b8ca Incorrect data type fixed 2017-06-01 19:59:09 +02:00
Simon Rozman
6121f7ee12 Translation sequences loaded from database 2017-06-01 15:16:24 +02:00
Simon Rozman
d9527fe70f Predefined translation sequences added to ZRCola.zrcdb database 2017-06-01 13:28:18 +02:00
Simon Rozman
937c263d56 Sub-module update 2017-05-30 12:55:45 +02:00
Simon Rozman
6487507570 Adaptation to database changes 2017-05-10 09:45:21 +02:00
Simon Rozman
84fa35c9be Clean-up 2017-05-10 09:44:06 +02:00
Simon Rozman
b8be10390b Database update 2017-05-09 13:06:05 +02:00
Simon Rozman
de6d890ac1 Secondary translation permutations added to support normalization 2017-05-09 12:08:34 +02:00
Simon Rozman
31b6f1a3e8 Recursively inverse translated translations ranks updated 2017-05-08 14:52:30 +02:00
Simon Rozman
4c6839e9fe com_translation class extended to support normalization 2017-05-08 14:44:53 +02:00
Simon Rozman
397cfe71dd Duplicate transformations (differing by rank only) removed from database 2017-05-08 14:33:33 +02:00
Simon Rozman
1834543564 Rearranged transformation sort order in database 2017-05-08 13:39:19 +02:00
Simon Rozman
8f4f20f2b4 Internal classes upgraded to support future normalization 2017-05-08 13:33:40 +02:00
Simon Rozman
9bba0ca557 com_translation now stand-alone class for clearer code 2017-05-08 12:40:01 +02:00
Simon Rozman
435b5c4a10 Duplicate error number resolved 2017-05-03 13:30:06 +02:00
Simon Rozman
bc5058f168 Database update 2017-05-03 13:01:29 +02:00
Simon Rozman
5ba870158e Decomposition syntax validation temporary removed 2017-05-03 12:36:15 +02:00
Simon Rozman
a6693673a5 Preliminary decomposition syntax validation introduced 2017-04-28 19:37:14 +02:00
Simon Rozman
ba55173f28 Sub-module update 2017-04-28 19:34:56 +02:00
Simon Rozman
12a053a495 Database update 2017-04-28 19:34:47 +02:00
Simon Rozman
8da5f88e0d MSICA has its own copy of WinStd and MSICALib libraries to allow stand-alone configuration (i.e. static RTL) 2017-04-24 23:07:06 +02:00
Simon Rozman
5a4a20a873 Sub-module update 2017-04-24 22:07:15 +02:00
Simon Rozman
7e50ba5974 Sub-module update 2017-04-24 21:59:48 +02:00
Simon Rozman
91fd26a51d Sub-module update 2017-04-18 14:47:54 +02:00
Simon Rozman
1ea5e52208 Sub-module update 2017-04-18 14:44:13 +02:00
Simon Rozman
2a18117b17 Sub-module update 2017-04-18 14:05:58 +02:00
Simon Rozman
b7bef14746 Copyright extended to 2017 2017-04-18 14:05:45 +02:00
Simon Rozman
4aacc4abc5 Version set to 2.1-beta1 2017-04-03 12:38:54 +02:00
Simon Rozman
2f6c789fdf Support for multiple transformations 2017-04-03 12:36:14 +02:00
Simon Rozman
57ceeadbe7 Clean-up 2017-04-03 12:34:18 +02:00
Simon Rozman
3b297c8427 Missing translations added 2017-04-03 12:16:46 +02:00
Simon Rozman
92374e57a8 Loading of recent character list simplified by using wxStringTokenizer 2017-03-31 14:02:37 +02:00
Simon Rozman
ace7551281 Main frame no longer deletes child dialogues in destructor, causing after-death wxPersist saving of deleted dialogue states later. 2017-03-31 13:44:47 +02:00
Simon Rozman
15e5f2d9e2 Character select dialog saves history in legacy format too now 2017-03-31 13:17:25 +02:00
Simon Rozman
08397415c4 Clean-up 2017-03-30 14:54:15 +02:00
Simon Rozman
6dff6eed4f Translation set database and other translation sets added 2017-03-30 13:08:20 +02:00
Simon Rozman
acbae76737 Clean-up 2017-03-30 10:57:31 +02:00
Simon Rozman
cc4a150501 Translation set ID data-type introduced 2017-03-30 10:23:08 +02:00
Simon Rozman
186dbee443 Multiple translation sets support 2017-03-30 09:49:22 +02:00
Simon Rozman
716dde0a84 Clean-up 2017-03-29 09:46:33 +02:00
Simon Rozman
155642a3f9 "Composition" and "Decomposition" renamed to more general terms "Translation" and "Inverse translation" to extend its use for transliteration 2017-03-27 14:10:43 +02:00
Simon Rozman
7cb0317544 Translation update 2017-03-27 14:06:16 +02:00
Simon Rozman
87a2828ce0 Translation rank split to composed and decomposed character rank allowing asymmetric ranking 2017-03-27 12:39:36 +02:00
Simon Rozman
806aa550a5 Characters are represented as UTF-16 sequences instead of a single UTF-16 character 2017-03-21 09:09:07 +01:00
Simon Rozman
ca306345c2 Composed and decomposed strings of the ZRCola::translation_db::translation protected 2017-03-16 10:21:29 +01:00
Simon Rozman
03ff056898 ZRCola::translation_db::translation::com_start marked as const now 2017-03-16 09:44:43 +01:00
Simon Rozman
9f083bb521 Character-Language table extended to support multi-UTF-16 characters 2017-03-14 14:14:39 +01:00
Simon Rozman
a224454b3c ZRCola::translation::CompareString() >> ZRCola::CompareString() 2017-03-14 13:23:20 +01:00
Simon Rozman
bd0fdba435 Composed characters extended to support multiple UTF-16 character 2017-03-14 12:54:46 +01:00
Simon Rozman
87814981db ZRCola::translation_db::Compose fixed to honor inputMax==-1 correctly 2017-03-14 10:51:56 +01:00
Simon Rozman
acf86e2ce0 Reverted to SHA1 Authenticode signatures for Windows XP compatibility 2017-03-14 09:44:31 +01:00
Simon Rozman
1016d5f738 ZRCola tutorial is now displayed only if ZRCola feature was installed 2017-03-14 09:23:53 +01:00
Simon Rozman
4d53785af7 wxWidget RTL dependencies fixed 2017-03-14 09:00:16 +01:00
Simon Rozman
8e2a3860e3 Changed to RFC3161 time-stamping and forced SHA1 digest to support Vista 2017-03-10 13:49:07 +01:00
Simon Rozman
0c2e666d0f Russian translation update 2017-03-10 13:36:48 +01:00
Simon Rozman
d6075327ef Copy (de)composed and return feature introduced 2017-01-13 13:56:51 +01:00
Simon Rozman
14e665fdf2 Sub-module update 2017-01-13 13:55:18 +01:00
Simon Rozman
55e2ee8c4d Folder options added 2017-01-12 10:10:08 +01:00
Simon Rozman
f444355d6d 00ZRCOla fonts replaced with ZRCOla 2017-01-12 10:09:54 +01:00
Simon Rozman
feb3c7c150 Unicode apostrophe changed to ASCII version for simplicity 2017-01-03 11:52:36 +01:00
Simon Rozman
f65634e285 Sub-module update and version set to 2.0 2016-11-08 11:20:50 +01:00
Simon Rozman
62a67b6be7 German MSI building commented until translation is available 2016-11-08 11:05:08 +01:00
Simon Rozman
5304402ec5 Sub-module update 2016-10-18 14:26:57 +02:00
Simon Rozman
f14fa2911d Version set to 2.0-beta14 2016-10-18 13:50:13 +02:00
Simon Rozman
db391d7023 Incorrect frequent character information in Character Catalog fixed 2016-10-18 13:36:35 +02:00
Simon Rozman
0b5a6a7016 Required update package language determined correctly now 2016-10-18 12:56:34 +02:00
Simon Rozman
5cc72a6a96 wxAUI pane captions no longer persist to allow localization 2016-10-18 12:38:55 +02:00
Simon Rozman
4138f6a5a3 Language for product update matches UI language not OS Regional settings now 2016-10-18 11:14:55 +02:00
Simon Rozman
2b2b2656b3 Language of character tags in Character Search dialog resolved to match UI language 2016-10-18 11:00:40 +02:00
Simon Rozman
6253f2c267 About dialog text updated 2016-10-18 10:10:49 +02:00
Simon Rozman
c9779c3772 Version set to 2.0-beta13 2016-10-17 10:38:34 +02:00
Simon Rozman
f6019e361c Russian translation complete now 2016-10-17 10:35:22 +02:00
Simon Rozman
3fd0aef27d SRC SASA >> ZRC SAZU 2016-10-17 09:30:01 +02:00
Simon Rozman
49c9d33b97 Russian translations added 2016-10-17 09:21:16 +02:00
Simon Rozman
b01d1c5409 Sub-module update 2016-10-14 08:47:04 +02:00
Simon Rozman
b0b434fec2 Version set to 2.0-beta12 2016-10-13 12:56:08 +02:00
Simon Rozman
d46557a367 CompareString() flags simplified to work on Windows XP 2016-10-13 12:55:44 +02:00
Simon Rozman
0180cb6306 Updating task triggering adjusted to workaround Windows 10 Task Scheduler 0x800710e0 bug 2016-10-13 12:32:26 +02:00
Simon Rozman
4ce3213b1a Searching by character tags honors category selection now 2016-10-13 12:30:55 +02:00
Simon Rozman
75b2758797 Translation update 2016-10-13 11:55:46 +02:00
Simon Rozman
2e14bcf1ec Translation templates update 2016-10-13 11:53:04 +02:00
Simon Rozman
cf49e3e401 Merge branch 'master' of https://github.com/Amebis/ZRCola
# Conflicts:
#	ZRCola/zrcolacomppnl.cpp
2016-10-13 11:16:27 +02:00
Simon Rozman
0ed0cf8c49 Support for searchable character tags added 2016-10-13 11:13:46 +02:00
Simon Rozman
38a77ca51b Code clean-up 2016-10-13 10:34:45 +02:00
Simon Rozman
891bd624fc Code clean-up 2016-10-13 10:32:20 +02:00
Simon Rozman
affe7b06a2 Code clean-up 2016-10-13 09:01:23 +02:00
Simon Rozman
f51c4dbbec ZRCola::tagname_db::Search() added 2016-10-12 18:45:59 +02:00
Simon Rozman
650ad13a30 lang >> locale 2016-10-12 18:40:07 +02:00
Simon Rozman
f53779dbad Character tagging support added 2016-10-12 14:30:24 +02:00
Simon Rozman
a45115d5e7 Support for the [VRS_CharList].[klj_bes_en] has been discontinued 2016-10-12 14:28:15 +02:00
Simon Rozman
b5ba1290f9 Setup sub-folder abolished and final MSI output CAB embedding and signing re-established 2016-10-11 13:28:09 +02:00
Simon Rozman
52689653d0 Adaptation to Updater changes 2016-10-11 13:25:33 +02:00
Simon Rozman
8d9af61d5e ZRCOLA_ >> PRODUCT_ 2016-10-11 12:54:13 +02:00
Simon Rozman
5f339d0d51 Sub-module update 2016-10-11 12:49:35 +02:00
Simon Rozman
641d178248 include/zrcola.h >> include/version.h 2016-10-11 12:49:01 +02:00
Simon Rozman
67d3c6f3ac Output MSI file updated 2016-10-11 11:34:24 +02:00
Simon Rozman
060ed729b3 en_US localization fixed 2016-10-11 11:22:40 +02:00
Simon Rozman
f8eead6835 MSI building process revised
- Common cabinet file for all language variations
- Same practice applied as with GÉANTLink project
2016-10-11 11:08:36 +02:00
Simon Rozman
15693f643f MSI module Makefile simplified 2016-10-11 11:04:42 +02:00
Simon Rozman
916b466909 Revert "MSI files contain all localization files now"
This reverts commit a112a46755.
2016-10-11 10:06:59 +02:00
Simon Rozman
a112a46755 MSI files contain all localization files now 2016-10-11 10:03:18 +02:00
Simon Rozman
fba2181b32 REDIST_ variables removed for cleaner Makefile 2016-10-11 09:33:56 +02:00
Simon Rozman
d9bf31897e Sub-module update 2016-10-11 09:26:26 +02:00
Simon Rozman
65b92f017b Character tags updated 2016-10-07 12:19:16 +02:00
Simon Rozman
dddc2d5794 chrcatid_t_blank and langid_t_blank are static members of their respective structures now 2016-10-06 23:17:24 +02:00
Simon Rozman
e4e8609a00 Initial setup of character tags added 2016-10-06 23:15:30 +02:00
Simon Rozman
cee1ea7dbc Total decomposition of rule's decompositions added 2016-10-06 20:56:41 +02:00
Simon Rozman
87c41451ab ATL replaced by WinStd 2016-10-06 16:02:56 +02:00
Simon Rozman
ecefcecfd8 Event to detect secondary ZRCola launch implemented by winstd::win_handle now 2016-10-06 15:59:27 +02:00
Simon Rozman
ba8254c097 Auto C++ typing introduced where appropriate 2016-10-06 11:52:17 +02:00
Simon Rozman
dacca1409e Version set to 2.0-beta10 2016-10-05 19:39:28 +02:00
Simon Rozman
8a3a539d5b Texts and translations update 2016-10-05 14:00:42 +02:00
Simon Rozman
bb2e5e256b Stock "About" menu text replaced with custom one (the stock was missing ellipsis) 2016-10-05 13:39:33 +02:00
Simon Rozman
6828887308 Program title in About dialog box now limited in width to prevent excess dimensions when font is not installed 2016-10-05 13:33:22 +02:00
Simon Rozman
186bc61723 Locale is set using wxExtend's wxInitializeLocale() helper function now 2016-10-05 13:18:35 +02:00
Simon Rozman
19a9d9c26d Shortcuts in Russian translation revised 2016-10-05 13:18:26 +02:00
Simon Rozman
cca084be7d Missing shortcuts and ellipses added to Russian translation 2016-10-05 11:56:34 +02:00
Simon Rozman
6710e0a21c Font and database update 2016-10-05 11:43:25 +02:00
Simon Rozman
b5cc0b8f2c Slovenian translation update 2016-10-05 11:36:33 +02:00
Simon Rozman
ded987e4f8 Slovenian translations update 2016-10-05 11:07:54 +02:00
Simon Rozman
957d530801 Russian MSI files available now 2016-10-05 11:04:40 +02:00
Simon Rozman
4c716f2ba3 Translation update 2016-10-05 11:02:42 +02:00
Simon Rozman
7e3cf0bce7 HKLM\SOFTWARE\Amebis\ZRCola\Language is set using LANGUAGE property now to prevent accidental localization of registry key and/or value name 2016-10-05 11:02:23 +02:00
Simon Rozman
7f97a20ba0 MO files are dynamically generated as a part of build process now 2016-10-05 10:22:06 +02:00
Simon Rozman
4b4bc1b371 Revert "A system reboot is scheduled when "00 ZRCola" font substitute is registered"
This reverts commit 41aa04abad.
2016-10-04 13:19:48 +02:00
Simon Rozman
f0b573f1a8 Sub-module update 2016-10-04 13:15:52 +02:00
Simon Rozman
c2887f77b0 WinStd update 2016-09-19 10:52:04 +02:00
Simon Rozman
f056a4b0ec rcxgettext.exe dependency eliminated 2016-09-19 10:46:17 +02:00
Simon Rozman
181778c981 Adaptation to MSIBuild updates
- Source file English "en_US" instead of generic "En" now
- MSIBUILD_LANG_PO merged to LANG
- Language names in MSIBuild extended from two letter to ll_CC syntax
2016-09-19 10:04:42 +02:00
Simon Rozman
ffb887b306 Creation of localized folder added 2016-09-15 12:56:38 +02:00
Simon Rozman
515a994ece Switch to new version of MSIBuild 2016-09-14 00:20:07 +02:00
Simon Rozman
ab28678227 Generation of localized IDT files simplified 2016-09-06 16:40:56 +02:00
Simon Rozman
b90ff2977f Translations update 2016-08-12 13:42:58 +02:00
Simon Rozman
eab7bcb35f URL update 2016-08-03 08:38:16 +02:00
Simon Rozman
a7c6f2967f Version set to 2.0-beta9 2016-08-03 08:28:29 +02:00
Simon Rozman
2316e5906c Database update 2016-08-03 08:27:24 +02:00
Simon Rozman
1866ace76f Version tagging removed from POT file generation to make POT files version independent 2016-08-03 08:27:09 +02:00
Simon Rozman
48d97742b1 URL update 2016-08-02 17:47:52 +02:00
Simon Rozman
96bde4740f A reboot after "00 ZRCola" font substitute installation is explained now + Updater updated to version that should not reboot after an unattended update 2016-07-22 01:20:24 +02:00
Simon Rozman
333a415a66 Database and Slovenian translation update 2016-07-22 00:19:00 +02:00
Simon Rozman
26e81ac0a0 Sub-module update 2016-07-18 08:51:20 +02:00
Simon Rozman
2b610e2804 Version set to 2.0-beta8 2016-07-18 08:29:30 +02:00
Simon Rozman
ea4f85223c "ZRCola" font name mainstream now 2016-07-15 21:44:28 +02:00
Simon Rozman
aff96d1efe Russian MSI generation commented & some additional support for German added 2016-07-15 21:27:51 +02:00
Simon Rozman
f5eaf3c74b Internal and output folders now using $(MSBuildProjectName) instead of $(ProjectName), to distinguish project variations of essentially the same module 2016-07-15 12:48:07 +02:00
Simon Rozman
6e167b7344 Contact information updated 2016-07-15 10:32:26 +02:00
Simon Rozman
acaae141de ZRCola keyboard PDF updated 2016-07-15 10:28:29 +02:00
Simon Rozman
4a32a4b40c General package information moved from NMAKE macros to Property table, to allow translation to other scripts (than Windows-1252 and Windows-1250) 2016-07-15 09:52:22 +02:00
Simon Rozman
902fcf92a4 Support for Russian localization introduced 2016-07-14 18:08:15 +02:00
Simon Rozman
424a6762f7 Support for numeric keyboard with Ins+nnnn added 2016-07-14 13:59:50 +02:00
Simon Rozman
41aa04abad A system reboot is scheduled when "00 ZRCola" font substitute is registered 2016-07-14 13:44:32 +02:00
Simon Rozman
8ae98bfb12 The font components marked to use reference counter 2016-07-14 12:34:27 +02:00
Simon Rozman
41dfe0c892 Font update 2016-07-14 11:25:01 +02:00
Simon Rozman
5cd454a757 Version set to 2.0-beta7f 2016-07-14 10:56:38 +02:00
Simon Rozman
a75b649f8b Database and font update 2016-07-14 10:50:53 +02:00
Simon Rozman
174f117770 "00 ZRCola" font renamed to "ZRCola" 2016-07-14 10:25:54 +02:00
Simon Rozman
19d1daf099 Slovenian translations updated 2016-07-14 09:27:36 +02:00
Simon Rozman
c4fe7c4370 Some Russian translations added 2016-07-14 09:18:37 +02:00
Simon Rozman
7a7135ea81 Version set to 2.0-beta7 2016-06-17 13:04:29 +02:00
Simon Rozman
2d97afded3 Database update 2016-06-17 13:01:16 +02:00
Simon Rozman
01e8ca5338 Documentation update 2016-06-14 12:45:31 +02:00
Simon Rozman
02f69e332c Documentation update 2016-06-14 12:38:46 +02:00
Simon Rozman
5ce2d209d2 Update README.md 2016-06-14 12:29:38 +02:00
Simon Rozman
088abe062b Documentation update 2016-06-14 12:28:19 +02:00
Simon Rozman
f264fdb211 Version set to 2.0-beta6 2016-06-14 12:13:21 +02:00
Simon Rozman
0e9c6ab66e Support for more or less frequent characters in catalog added 2016-06-14 12:12:17 +02:00
Simon Rozman
040109c36f Version set to 2.0-beta5 2016-06-14 10:15:43 +02:00
Simon Rozman
d130888753 End-of-setup tutorial added 2016-06-14 10:14:45 +02:00
Simon Rozman
e81b0f772d Translation update 2016-06-14 10:02:21 +02:00
Simon Rozman
750cab5370 Add/Remove Programs icon reverted back to ZRCola's 2016-06-14 09:19:03 +02:00
Simon Rozman
213425fd11 Global hot-key registration moved as late as possible to avoid non-effective registration at auto start-up 2016-06-13 15:38:19 +02:00
Simon Rozman
689c72e7e7 Composing ə (and some other characters) combinations fixed 2016-06-13 15:35:52 +02:00
Simon Rozman
fbd60a53dc Categories are collapsible in Character Search dialog now 2016-06-13 13:25:05 +02:00
Simon Rozman
e3475ef48d Font and database update - fonts now OpenType 2016-06-13 11:02:55 +02:00
Simon Rozman
86d512e752 Empty character groups and categories are included in translation catalog too now 2016-06-13 10:57:00 +02:00
186 changed files with 28640 additions and 41685 deletions

18
.gitmodules vendored
View File

@@ -1,24 +1,18 @@
[submodule "lib/wxExtend"]
path = lib/wxExtend
url = https://github.com/Amebis/wxExtend.git
[submodule "lib/stdex"]
path = lib/stdex
url = https://github.com/Amebis/stdex.git
[submodule "lib/WinStd"]
path = lib/WinStd
url = https://github.com/Amebis/WinStd.git
[submodule "lib/wxExtend"]
path = lib/wxExtend
url = https://github.com/Amebis/wxExtend.git
[submodule "MSI/MSIBuild"]
path = MSI/MSIBuild
url = https://github.com/Amebis/MSIBuild.git
[submodule "MSI/MSICA"]
path = MSI/MSICA
url = https://github.com/Amebis/MSICA.git
[submodule "lib/atlex"]
path = lib/atlex
url = https://github.com/Amebis/atlex.git
[submodule "lib/MSICALib"]
path = lib/MSICALib
url = https://github.com/Amebis/MSICALib.git
[submodule "lib/WinStd"]
path = lib/WinStd
url = https://github.com/Amebis/WinStd.git
[submodule "Updater"]
path = Updater
url = https://github.com/Amebis/Updater.git

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featUpdCheck
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,6 @@
[splosno]
jezik=0
deli=featZRCola
deli=featZRCola featUpdCheck
[parametri]

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
MSILocal.mak Normal file

Binary file not shown.

442
Makefile
View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -36,16 +36,6 @@ Clean ::
cd "MSI\MSIBuild\Version"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean
cd "$(MAKEDIR)"
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=Win32 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=Win32 CFG=Debug
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=x64 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=En PLAT=x64 CFG=Debug
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=Win32 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=Win32 CFG=Debug
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=x64 CFG=Release
$(MAKE) /f "Makefile" /$(MAKEFLAGS) Clean LANG=Sl PLAT=x64 CFG=Debug
cd "$(MAKEDIR)"
devenv.com "ZRCola.sln" /clean "Release|Win32"
devenv.com "ZRCola.sln" /clean "Debug|Win32"
devenv.com "ZRCola.sln" /clean "Release|x64"
@@ -60,15 +50,29 @@ Clean ::
devenv.com "Updater\Updater.sln" /clean "Debug|Win32"
devenv.com "Updater\Updater.sln" /clean "Release|x64"
devenv.com "Updater\Updater.sln" /clean "Debug|x64"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn32.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn32.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn64.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn64.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl32.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl32.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl64.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl64.msi"
-if exist "$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi" del /f /q "$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi"
-if exist "$(OUTPUT_DIR)\catalog.xml" del /f /q "$(OUTPUT_DIR)\catalog.xml"
-if exist "$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\de_DE\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" del /f /q "$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo"
-if exist "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo" del /f /q "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo"
-if exist "$(OUTPUT_DIR)\ZRCola32.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola32.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola32D.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola32D.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola64.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola64.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola64D.ddf" del /f /q "$(OUTPUT_DIR)\ZRCola64D.ddf"
-if exist "$(OUTPUT_DIR)\ZRCola32.cab" del /f /q "$(OUTPUT_DIR)\ZRCola32.cab"
-if exist "$(OUTPUT_DIR)\ZRCola32.inf" del /f /q "$(OUTPUT_DIR)\ZRCola32.inf"
-if exist "$(OUTPUT_DIR)\ZRCola32.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola32.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola32D.cab" del /f /q "$(OUTPUT_DIR)\ZRCola32D.cab"
-if exist "$(OUTPUT_DIR)\ZRCola32D.inf" del /f /q "$(OUTPUT_DIR)\ZRCola32D.inf"
-if exist "$(OUTPUT_DIR)\ZRCola32D.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola32D.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola64.cab" del /f /q "$(OUTPUT_DIR)\ZRCola64.cab"
-if exist "$(OUTPUT_DIR)\ZRCola64.inf" del /f /q "$(OUTPUT_DIR)\ZRCola64.inf"
-if exist "$(OUTPUT_DIR)\ZRCola64.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola64.rpt"
-if exist "$(OUTPUT_DIR)\ZRCola64D.cab" del /f /q "$(OUTPUT_DIR)\ZRCola64D.cab"
-if exist "$(OUTPUT_DIR)\ZRCola64D.inf" del /f /q "$(OUTPUT_DIR)\ZRCola64D.inf"
-if exist "$(OUTPUT_DIR)\ZRCola64D.rpt" del /f /q "$(OUTPUT_DIR)\ZRCola64D.rpt"
-if exist "$(OUTPUT_DIR)\catalog.xml" del /f /q "$(OUTPUT_DIR)\catalog.xml"
!IFNDEF HAS_VERSION
@@ -82,6 +86,7 @@ Setup \
SetupDebug \
Register \
Unregister \
Localization \
PublishPre \
Publish :: "MSI\MSIBuild\Version\Version.mak"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) HAS_VERSION=1 $@
@@ -104,12 +109,6 @@ Publish :: "MSI\MSIBuild\Version\Version.mak"
PUBLISH_PACKAGE_DIR=$(PUBLISH_DIR)\$(MSIBUILD_VERSION_STR)
PUBLISH_PACKAGE_URL=http://www.amebis.si/prenos/ZRCola/$(MSIBUILD_VERSION_STR)
REDIST_EN_WIN32="$(PUBLISH_PACKAGE_DIR)\ZRColaEn32.msi"
REDIST_EN_X64="$(PUBLISH_PACKAGE_DIR)\ZRColaEn64.msi"
REDIST_SL_WIN32="$(PUBLISH_PACKAGE_DIR)\ZRColaSl32.msi"
REDIST_SL_X64="$(PUBLISH_PACKAGE_DIR)\ZRColaSl64.msi"
######################################################################
# Main targets
######################################################################
@@ -118,18 +117,54 @@ All :: \
Setup
Setup :: \
"$(OUTPUT_DIR)\Setup" \
"$(OUTPUT_DIR)\Setup\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl64.msi"
# "$(OUTPUT_DIR)\ZRColaDe32.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64.msi" \
"$(OUTPUT_DIR)\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\ZRColaRu32.msi" \
"$(OUTPUT_DIR)\ZRColaRu64.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.msi"
SetupDebug :: \
"$(OUTPUT_DIR)\Setup" \
"$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi" \
"$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi"
# "$(OUTPUT_DIR)\ZRColaDe32D.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64D.msi" \
"$(OUTPUT_DIR)\ZRColaEn32D.msi" \
"$(OUTPUT_DIR)\ZRColaEn64D.msi" \
"$(OUTPUT_DIR)\ZRColaRu32D.msi" \
"$(OUTPUT_DIR)\ZRColaRu64D.msi" \
"$(OUTPUT_DIR)\ZRColaSl32D.msi" \
"$(OUTPUT_DIR)\ZRColaSl64D.msi"
######################################################################
# Publishing
######################################################################
PublishPre :: \
"$(PUBLISH_PACKAGE_DIR)" \
# "$(PUBLISH_PACKAGE_DIR)\ZRColaDe32.msi" \
# "$(PUBLISH_PACKAGE_DIR)\ZRColaDe64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaEn32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaEn64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaRu32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaRu64.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaSl32.msi" \
"$(PUBLISH_PACKAGE_DIR)\ZRColaSl64.msi" \
"$(PUBLISH_DIR)" \
# "$(PUBLISH_DIR)\ZRColaInstallDe.exe" \
"$(PUBLISH_DIR)\ZRColaInstallEn.exe" \
"$(PUBLISH_DIR)\ZRColaInstallRu.exe" \
"$(PUBLISH_DIR)\ZRColaInstallSl.exe"
Publish :: \
PublishPre \
"$(PUBLISH_DIR)\catalog-0000.xml"
######################################################################
# Registration
######################################################################
Register :: \
RegisterSettings \
@@ -158,24 +193,26 @@ UnregisterSettings ::
!ENDIF
InstallFonts :: \
"$(WINDIR)\Fonts\00_ZRCola_Re.ttf" \
"$(WINDIR)\Fonts\00_ZRCola_It.ttf" \
"$(WINDIR)\Fonts\00_ZRCola_Bd.ttf" \
"$(WINDIR)\Fonts\00_ZRCola_BI.ttf"
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola (TrueType)" /t REG_SZ /d "00_ZRCola_Re.ttf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Italic (TrueType)" /t REG_SZ /d "00_ZRCola_It.ttf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold (TrueType)" /t REG_SZ /d "00_ZRCola_Bd.ttf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold Italic (TrueType)" /t REG_SZ /d "00_ZRCola_BI.ttf" $(REG_FLAGS) > NUL
"$(WINDIR)\Fonts\ZRCola_Re.otf" \
"$(WINDIR)\Fonts\ZRCola_It.otf" \
"$(WINDIR)\Fonts\ZRCola_Bd.otf" \
"$(WINDIR)\Fonts\ZRCola_BI.otf"
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola (TrueType)" /t REG_SZ /d "ZRCola_Re.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Italic (TrueType)" /t REG_SZ /d "ZRCola_It.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold (TrueType)" /t REG_SZ /d "ZRCola_Bd.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold Italic (TrueType)" /t REG_SZ /d "ZRCola_BI.otf" $(REG_FLAGS) > NUL
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" /v "00 ZRCola" /t REG_SZ /d "ZRCola" $(REG_FLAGS) > NUL
UninstallFonts::
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Italic (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "00 ZRCola Bold Italic (TrueType)" $(REG_FLAGS) > NUL
-if exist "$(WINDIR)\Fonts\00_ZRCola_Re.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_Re.ttf"
-if exist "$(WINDIR)\Fonts\00_ZRCola_It.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_It.ttf"
-if exist "$(WINDIR)\Fonts\00_ZRCola_Bd.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_Bd.ttf"
-if exist "$(WINDIR)\Fonts\00_ZRCola_BI.ttf" rd /s /q "$(WINDIR)\Fonts\00_ZRCola_BI.ttf"
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Italic (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "ZRCola Bold Italic (TrueType)" $(REG_FLAGS) > NUL
-reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" /v "00 ZRCola" $(REG_FLAGS) > NUL
-if exist "$(WINDIR)\Fonts\ZRCola_Re.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_Re.otf"
-if exist "$(WINDIR)\Fonts\ZRCola_It.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_It.otf"
-if exist "$(WINDIR)\Fonts\ZRCola_Bd.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_Bd.otf"
-if exist "$(WINDIR)\Fonts\ZRCola_BI.otf" rd /s /q "$(WINDIR)\Fonts\ZRCola_BI.otf"
RegisterShortcuts :: \
"$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" \
@@ -184,21 +221,20 @@ RegisterShortcuts :: \
UnregisterShortcuts ::
-if exist "$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" rd /s /q "$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola"
PublishPre :: \
"$(PUBLISH_PACKAGE_DIR)" \
$(REDIST_EN_WIN32) \
$(REDIST_EN_X64) \
$(REDIST_SL_WIN32) \
$(REDIST_SL_X64) \
"$(PUBLISH_DIR)" \
"$(PUBLISH_DIR)\ZRColaInstallDe.exe" \
"$(PUBLISH_DIR)\ZRColaInstallEn.exe" \
"$(PUBLISH_DIR)\ZRColaInstallRu.exe" \
"$(PUBLISH_DIR)\ZRColaInstallSl.exe"
######################################################################
# Localization
######################################################################
Publish :: \
PublishPre \
"$(PUBLISH_DIR)\catalog-0000.xml"
Localization :: \
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" \
"$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" \
"$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" \
"$(OUTPUT_DIR)\locale\sl_SI" \
"$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" \
"$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo"
######################################################################
@@ -207,14 +243,21 @@ Publish :: \
"$(OUTPUT_DIR)" \
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\Setup" \
"$(OUTPUT_DIR)\locale" \
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\sl_SI" \
"$(PUBLISH_DIR)" \
"$(PUBLISH_PACKAGE_DIR)" \
"$(PROGRAMDATA)\Microsoft\Windows\Start Menu\Programs\ZRCola" :
if not exist $@ md $@
"$(OUTPUT_DIR)\Keys" \
"$(OUTPUT_DIR)\Setup" : "$(OUTPUT_DIR)"
"$(OUTPUT_DIR)\locale" : "$(OUTPUT_DIR)"
"$(OUTPUT_DIR)\locale\de_DE" \
"$(OUTPUT_DIR)\locale\ru_RU" \
"$(OUTPUT_DIR)\locale\sl_SI" : "$(OUTPUT_DIR)\locale"
"$(PUBLISH_PACKAGE_DIR)" : "$(PUBLISH_DIR)"
@@ -223,56 +266,16 @@ Publish :: \
# File copy
######################################################################
"$(OUTPUT_DIR)\Setup\ZRColaEn32.msi" \
$(REDIST_EN_WIN32) : "$(OUTPUT_DIR)\ZRColaEn32.3.msi"
"$(WINDIR)\Fonts\ZRCola_Re.otf" : "$(OUTPUT_DIR)\ZRCola_Re.otf"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaEn32D.msi" : "$(OUTPUT_DIR)\ZRColaEn32D.3.msi"
"$(WINDIR)\Fonts\ZRCola_It.otf" : "$(OUTPUT_DIR)\ZRCola_It.otf"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaEn64.msi" \
$(REDIST_EN_X64) : "$(OUTPUT_DIR)\ZRColaEn64.3.msi"
"$(WINDIR)\Fonts\ZRCola_Bd.otf" : "$(OUTPUT_DIR)\ZRCola_Bd.otf"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaEn64D.msi" : "$(OUTPUT_DIR)\ZRColaEn64D.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl32.msi" \
$(REDIST_SL_WIN32) : "$(OUTPUT_DIR)\ZRColaSl32.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl32D.msi" : "$(OUTPUT_DIR)\ZRColaSl32D.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl64.msi" \
$(REDIST_SL_X64) : "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
copy /y $** $@ > NUL
"$(OUTPUT_DIR)\Setup\ZRColaSl64D.msi" : "$(OUTPUT_DIR)\ZRColaSl64D.3.msi"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_Re.ttf" : "$(OUTPUT_DIR)\00_ZRCola_Re.ttf"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_It.ttf" : "$(OUTPUT_DIR)\00_ZRCola_It.ttf"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_Bd.ttf" : "$(OUTPUT_DIR)\00_ZRCola_Bd.ttf"
copy /y $** $@ > NUL
"$(WINDIR)\Fonts\00_ZRCola_BI.ttf" : "$(OUTPUT_DIR)\00_ZRCola_BI.ttf"
copy /y $** $@ > NUL
"$(PUBLISH_DIR)\ZRColaInstallDe.exe" : "$(OUTPUT_DIR)\Win32.Release\ZRColaInstallDe.exe"
copy /y $** $@ > NUL
"$(PUBLISH_DIR)\ZRColaInstallEn.exe" : "$(OUTPUT_DIR)\Win32.Release\ZRColaInstallEn.exe"
copy /y $** $@ > NUL
"$(PUBLISH_DIR)\ZRColaInstallRu.exe" : "$(OUTPUT_DIR)\Win32.Release\ZRColaInstallRu.exe"
copy /y $** $@ > NUL
"$(PUBLISH_DIR)\ZRColaInstallSl.exe" : "$(OUTPUT_DIR)\Win32.Release\ZRColaInstallSl.exe"
"$(WINDIR)\Fonts\ZRCola_BI.otf" : "$(OUTPUT_DIR)\ZRCola_BI.otf"
copy /y $** $@ > NUL
@@ -288,130 +291,177 @@ $(REDIST_SL_X64) : "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
# Building
######################################################################
"$(OUTPUT_DIR)\locale\de_DE\wxstd.mo" : "$(WXWIN)\locale\de.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\ru_RU\wxstd.mo" : "$(WXWIN)\locale\ru.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\sl_SI\wxstd.mo" : "$(WXWIN)\locale\sl.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\de_DE\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\ru_RU\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.mo" : "$(OUTPUT_DIR)\locale\sl_SI\ZRCola-zrcdb.po"
msgfmt.exe --output-file=$@ --alignment=1 --endianness=little $**
"$(OUTPUT_DIR)\Win32.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" ::
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\Win32.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\x64.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\x64.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" :: Localization
"$(OUTPUT_DIR)\Win32.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Release\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Release|Win32"
"$(OUTPUT_DIR)\Win32.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn32D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32D.3.msi" ::
"$(OUTPUT_DIR)\Win32.Debug\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Debug|Win32"
"$(OUTPUT_DIR)\x64.Release\libZRCola10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\libZRColaUI10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\stdex10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\wxExtend10u_vc100.dll" \
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.3.msi" ::
"$(OUTPUT_DIR)\x64.Release\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Release|x64"
"$(OUTPUT_DIR)\x64.Debug\libZRCola10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\libZRColaUI10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\stdex10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\wxExtend10ud_vc100.dll" \
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" \
"$(OUTPUT_DIR)\ZRColaEn64D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64D.3.msi" ::
"$(OUTPUT_DIR)\x64.Debug\ZRCola.exe" ::
devenv.com "ZRCola.sln" /build "Debug|x64"
"$(OUTPUT_DIR)\Win32.Release\ZRColaInstallDe.exe" \
"$(OUTPUT_DIR)\Win32.Release\ZRColaInstallEn.exe" \
"$(OUTPUT_DIR)\Win32.Release\ZRColaInstallRu.exe" \
"$(OUTPUT_DIR)\Win32.Release\ZRColaInstallSl.exe" ::
devenv.com "ZRColaUtils.sln" /build "Release|Win32"
"$(OUTPUT_DIR)\ZRCola32.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.32.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.32.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola32" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\Win32.Debug\ZRColaInstallDe.exe" \
"$(OUTPUT_DIR)\Win32.Debug\ZRColaInstallEn.exe" \
"$(OUTPUT_DIR)\Win32.Debug\ZRColaInstallRu.exe" \
"$(OUTPUT_DIR)\Win32.Debug\ZRColaInstallSl.exe" ::
devenv.com "ZRColaUtils.sln" /build "Debug|Win32"
"$(OUTPUT_DIR)\ZRCola32D.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.32D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.32D.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola32D" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Release|Win32"
devenv.com "Updater\Updater.sln" /build "Release|Win32"
"$(OUTPUT_DIR)\ZRCola64.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.64.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.64.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola64" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRColaEn32D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32D.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Debug|Win32"
devenv.com "Updater\Updater.sln" /build "Debug|Win32"
"$(OUTPUT_DIR)\ZRCola64D.ddf" : \
# "$(OUTPUT_DIR)\ZRCola.de_DE.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.en_US.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.ru_RU.64D.2.msi" \
"$(OUTPUT_DIR)\ZRCola.sl_SI.64D.2.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
cscript.exe "MSI\MSIBuild\MSI.wsf" //Job:MakeDDF //Nologo "$(@:"=).tmp" $** /O:"$(OUTPUT_DIR)\ZRCola64D" /C:LZX
move /y "$(@:"=).tmp" $@ > NUL
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Release|x64"
devenv.com "Updater\Updater.sln" /build "Release|x64"
"$(OUTPUT_DIR)\ZRCola32.cab" \
"$(OUTPUT_DIR)\ZRCola32.inf" \
"$(OUTPUT_DIR)\ZRCola32.rpt" : "$(OUTPUT_DIR)\ZRCola32.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRColaEn64D.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64D.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Debug|x64"
devenv.com "Updater\Updater.sln" /build "Debug|x64"
"$(OUTPUT_DIR)\ZRCola32D.cab" \
"$(OUTPUT_DIR)\ZRCola32D.inf" \
"$(OUTPUT_DIR)\ZRCola32D.rpt" : "$(OUTPUT_DIR)\ZRCola32D.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=Win32 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRCola64.cab" \
"$(OUTPUT_DIR)\ZRCola64.inf" \
"$(OUTPUT_DIR)\ZRCola64.rpt" : "$(OUTPUT_DIR)\ZRCola64.ddf"
makecab.exe /F $**
"$(OUTPUT_DIR)\ZRColaEn32D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=Win32 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=x64 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaEn64D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=En PLAT=x64 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=Win32 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl32D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=Win32 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl64.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=x64 CFG=Release
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRColaSl64D.3.msi" ::
cd "MSI\ZRCola"
$(MAKE) /f "Makefile" /$(MAKEFLAGS) LANG=Sl PLAT=x64 CFG=Debug
cd "$(MAKEDIR)"
"$(OUTPUT_DIR)\ZRCola64D.cab" \
"$(OUTPUT_DIR)\ZRCola64D.inf" \
"$(OUTPUT_DIR)\ZRCola64D.rpt" : "$(OUTPUT_DIR)\ZRCola64D.ddf"
makecab.exe /F $**
"$(PUBLISH_DIR)\catalog-0000.xml" : "$(OUTPUT_DIR)\catalog.xml"
if exist $@ del /f /q $@
output\$(PLAT).Release\UpdSignXML.exe $** $@
"$(OUTPUT_DIR)\catalog.xml" : \
"$(OUTPUT_DIR)\ZRColaEn32.3.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.3.msi"
# "$(OUTPUT_DIR)\ZRColaDe32.msi" \
# "$(OUTPUT_DIR)\ZRColaDe64.msi" \
"$(OUTPUT_DIR)\ZRColaEn32.msi" \
"$(OUTPUT_DIR)\ZRColaEn64.msi" \
"$(OUTPUT_DIR)\ZRColaRu32.msi" \
"$(OUTPUT_DIR)\ZRColaRu64.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.msi" \
"$(OUTPUT_DIR)\ZRColaSl64.msi"
-if exist $@ del /f /q $@
-if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp"
copy /y "$(PUBLISH_DIR)\catalog-0000.xml" "$(@:"=).tmp" > NUL
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn32.msi" -f "$(OUTPUT_DIR)\ZRColaEn32.3.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn64.msi" -f "$(OUTPUT_DIR)\ZRColaEn64.3.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl32.msi" -f "$(OUTPUT_DIR)\ZRColaSl32.3.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl64.msi" -f "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
# output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 de_DE "$(PUBLISH_PACKAGE_URL)/ZRColaDe32.msi" -f "$(OUTPUT_DIR)\ZRColaDe32.msi"
# output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 de_DE "$(PUBLISH_PACKAGE_URL)/ZRColaDe64.msi" -f "$(OUTPUT_DIR)\ZRColaDe64.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn32.msi" -f "$(OUTPUT_DIR)\ZRColaEn32.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn64.msi" -f "$(OUTPUT_DIR)\ZRColaEn64.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu32.msi" -f "$(OUTPUT_DIR)\ZRColaRu32.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu64.msi" -f "$(OUTPUT_DIR)\ZRColaRu64.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl32.msi" -f "$(OUTPUT_DIR)\ZRColaSl32.msi"
output\$(PLAT).Release\UpdPublish.exe "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl64.msi" -f "$(OUTPUT_DIR)\ZRColaSl64.msi"
move /y "$(@:"=).tmp" $@ > NUL
!ENDIF
#LANG=de_DE
#LANG_OUT=De
#!INCLUDE "MSILocal.mak"
LANG=en_US
LANG_OUT=En
!INCLUDE "MSILocal.mak"
LANG=ru_RU
LANG_OUT=Ru
!INCLUDE "MSILocal.mak"
LANG=sl_SI
LANG_OUT=Sl
!INCLUDE "MSILocal.mak"

View File

@@ -1 +1,44 @@
# ZRCola
# ZRCola
A Microsoft Windows application for composing texts using a wide range of Slavic (and general) letters from or beyond Unicode.
## Project Website
http://zrcola.zrc-sazu.si/en/
## Binaries for Download
https://www.amebis.si/prenos/ZRCola/
## Building
### Building Environment Requirements
- Microsoft Windows Vista or later
- Microsoft Visual Studio 2010 SP1
- _sed.exe_ and _grep.exe_
- Command line utilities from Microsoft Windows SDK Bin folder: distributed with Visual Studio, add Bin folder to path manually.
- Additional command line utilities from project's bin folder: add bin folder to path. The source code is provided on request.
### Digital Signing of Build Outputs
In order to have the build process digitally sign output files, one should provide the following:
1. A signing certificate installed in the current user's certificate store.
2. The following variables in the environment:
- `ManifestCertificateThumbprint` - set the value to certificate's SHA1 thumbprint (hexadecimal, without spaces, i.e. `bc0d8da45f9eeefcbe4e334e1fc262804df88d7e`).
- `ManifestTimestampUrl` - set the value to URL used to perform timestamp signature (i.e. `http://timestamp.verisign.com/scripts/timstamp.dll`). In order to perform timestamp signing successfully, the computer running the build should be online and able to access this URL.
Please note that only Release builds are configured for timestamp signing. Debug configurations do not attempt to timestamp sign the resulting DLL and EXE files in order to speed up the building process and enable offline building.
### Building
Use Microsoft NMAKE to build the project. The resulting files can be found in output subfolder.
- `nmake Clean` Delete all intermediate and output files.
- `nmake Setup` Build a release version of project and release MSI setup files.
- `nmake SetupDebug` Build a debug version of project and debug MSI setup files.
- `nmake Register` Build a debug version of project, install fonts (reboot required), and Start Menu shortcuts. For development purposes only!
- `nmake Unregister` Remove Start Menu shortcuts, and fonts. For development purposes only!
The `/ls` flag can be appended to the commands above to reduce NMAKE's verbosity. You can combine multiple targets (i.e. nmake Unregister Clean). Please, see NMAKE reference for further reading.
## Contact Information
Please contact the following addressee for further information and help:
- ZRC SAZU, ZRCola@zrc-sazu.si
- Amebis, info@amebis.si

Submodule Updater updated: 55548e1059...c25cf09b9a

View File

@@ -5,11 +5,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZRCola", "ZRCola\ZRCola.vcx
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtend.vcxproj", "{A3A36689-AC35-4026-93DA-A3BA0C0E767C}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxExtend", "lib\wxExtend\build\wxExtendDll.vcxproj", "{A3A36689-AC35-4026-93DA-A3BA0C0E767C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CFEBC17E-C840-4507-BDE6-1EF5B52DDCC5}"
ProjectSection(SolutionItems) = preProject
include\zrcola.h = include\zrcola.h
include\version.h = include\version.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRCola", "lib\libZRCola\build\libZRCola.vcxproj", "{3C61929E-7289-4101-8D0A-DA22D6E1AEA8}"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,5 +1,5 @@
#
# Copyright 1991-2016 Amebis
# Copyright 1991-2017 Amebis
#
# This file is part of ZRCola.
#
@@ -19,6 +19,10 @@
!INCLUDE "..\..\include\MSIBuildCfg.mak"
!IFNDEF MSIBUILD_LANGID
!ERROR Parameter MSIBUILD_LANGID is undefined.
!ENDIF
MSIBUILD_IS_LOCALIZEABLE=1
@@ -37,6 +41,36 @@ OLDZRCOLADIR clZRCola.exe.$(PLAT)
<<NOKEEP
######################################################################
# Binary
All :: \
"$(LANG).$(PLAT).$(CFG).Binary-1.idt" \
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial1.bmp" \
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial2.bmp" \
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial3.bmp"
"$(LANG).$(PLAT).$(CFG).Binary-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak" "$(LANG).$(PLAT).$(CFG).Binary-1"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Name Data
s$(MSIBUILD_LENGTH_ID) v0
Binary Name
bintutorial1.bmp tutorial1.bmp
bintutorial2.bmp tutorial2.bmp
bintutorial3.bmp tutorial3.bmp
<<NOKEEP
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial1.bmp" : "Binary\tutorial1.bmp"
copy /y $** $@ > NUL
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial2.bmp" : "Binary\tutorial2.bmp"
copy /y $** $@ > NUL
"$(LANG).$(PLAT).$(CFG).Binary-1\tutorial3.bmp" : "Binary\tutorial3.bmp"
copy /y $** $@ > NUL
######################################################################
# CompLocator
@@ -74,18 +108,110 @@ compZRCola.exe.Win32 {F30B6545-6203-4B7D-8575-85245A0F90E5} ZRCOLABINDIR 0 file
!IF "$(PLAT)" == "x64"
compZRCola.exe.x64 {D45B105D-2303-459A-AF4B-52AC3AAD5510} ZRCOLABINDIR 256 fileZRCola.exe.x64
!ENDIF
!IF "$(LANG)" == "Sl"
!IF "$(LANG)" == "ru_RU"
compZRCola.mo.ru_RU {DEA5D11C-2B0E-4B85-ACE3-D76334866F50} ZRCOLALOCRURUDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) fileZRCola.mo.ru_RU
!ENDIF
!IF "$(LANG)" == "sl_SI"
compZRCola.mo.sl_SI {7FF95C71-D8DE-4D2B-A26D-FEB5A1F54D63} ZRCOLALOCSLSIDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) fileZRCola.mo.sl_SI
!ENDIF
<<NOKEEP
######################################################################
# Control
All :: "$(LANG).$(PLAT).$(CFG).Control-2.idt"
"en_US.$(PLAT).$(CFG).Control-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Dialog_ Control Type X Y Width Height Attributes Property Text Control_Next Help
s$(MSIBUILD_LENGTH_ID) s50 s20 i2 i2 i2 i2 I4 S50 L0 S50 L$(MSIBUILD_LENGTH_HELP)
1252 Control Dialog_ Control
dlgTutorial1 ctlBannerBitmap Bitmap 0 0 400 45 1 binUIHeader.bmp ctlTitle
dlgTutorial1 ctlTitle Text 15 15 320 15 196611 [DlgTitleFont][SimpleProductName] Tutorial : Starting ctlScreenshot
dlgTutorial1 ctlScreenshot Bitmap 154 60 92 54 5 bintutorial1.bmp ctlText1
dlgTutorial1 ctlText1 Text 15 119 370 24 196611 When configured, ZRCola starts at system startup and runs in the background. If needed, it can be brought up by pressing the combination Win+F5. ctlText2
dlgTutorial1 ctlText2 Text 15 148 370 36 196611 IMPORTANT: Upon pressing the combination Win+F5 the program memorises the location of the cursor in the text. If ZRCola is brought to the foreground without using the aforementioned combination of keys, the program won't know where to insert the special characters! ctlContinue
dlgTutorial1 ctlContinue PushButton 325 265 60 20 3 &Continue ctlBannerBitmap
dlgTutorial2 ctlBannerBitmap Bitmap 0 0 400 45 1 binUIHeader.bmp ctlTitle
dlgTutorial2 ctlTitle Text 15 15 320 15 196611 [DlgTitleFont][SimpleProductName] Tutorial : Composition ctlScreenshot
dlgTutorial2 ctlScreenshot Bitmap 81 60 238 137 5 bintutorial2.bmp ctlText1
dlgTutorial2 ctlText1 Text 15 202 370 36 196611 The string of basic and substitute characters is entered into the upper input window of the program. In the window below the resulted special characters are displayed. To insert them in the text, the F5 key is used. ctlContinue
dlgTutorial2 ctlContinue PushButton 325 265 60 20 3 &Continue ctlBannerBitmap
dlgTutorial3 ctlBannerBitmap Bitmap 0 0 400 45 1 binUIHeader.bmp ctlTitle
dlgTutorial3 ctlTitle Text 15 15 320 15 196611 [DlgTitleFont][SimpleProductName] Tutorial : Entering Characters ctlScreenshot
dlgTutorial3 ctlScreenshot Bitmap 147 60 106 112 5 bintutorial3.bmp ctlText1
dlgTutorial3 ctlText1 Text 15 177 370 24 196611 Characters can be entered using keyboard shortcuts, the character catalogue (F4) or the character finding tool (F8). ctlContinue
dlgTutorial3 ctlContinue PushButton 325 265 60 20 3 &Continue ctlBannerBitmap
<<NOKEEP
!IF "$(LANG)" == "en_US"
"en_US.$(PLAT).$(CFG).Control-2.idt" : "en_US.$(PLAT).$(CFG).Control-2.idtx"
copy /y $** $@ > NUL
!ELSE
"$(LANG).$(PLAT).$(CFG).Control-2.idt" : "en_US.$(PLAT).$(CFG).Control-2.idtx" "..\locale\$(LANG).po"
cscript.exe "..\..\MSI\MSIBuild\MSI.wsf" //Job:IDTTranslate //Nologo $@ $** /CP:$(MSIBUILD_CODEPAGE)
!ENDIF
######################################################################
# ControlEvent
All :: "$(LANG).$(PLAT).$(CFG).ControlEvent-1.idt"
"$(LANG).$(PLAT).$(CFG).ControlEvent-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Dialog_ Control_ Event Argument Condition Ordering
s$(MSIBUILD_LENGTH_ID) s50 s50 s255 S255 I2
ControlEvent Dialog_ Control_ Event Argument Condition
dlgTutorial1 ctlContinue EndDialog Return 1 1000
dlgTutorial2 ctlContinue EndDialog Return 1 1000
dlgTutorial3 ctlContinue EndDialog Return 1 1000
<<NOKEEP
######################################################################
# Dialog
All :: "$(LANG).$(PLAT).$(CFG).Dialog-1.idt"
"$(LANG).$(PLAT).$(CFG).Dialog-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Dialog HCentering VCentering Width Height Attributes Title Control_First Control_Default Control_Cancel
s$(MSIBUILD_LENGTH_ID) i2 i2 i2 i2 I4 L128 s50 S50 S50
Dialog Dialog
dlgTutorial1 50 50 400 300 3 [Setup] [SimpleProductName] [DisplayVersion] ctlTitle ctlContinue ctlContinue
dlgTutorial2 50 50 400 300 3 [Setup] [SimpleProductName] [DisplayVersion] ctlTitle ctlContinue ctlContinue
dlgTutorial3 50 50 400 300 3 [Setup] [SimpleProductName] [DisplayVersion] ctlTitle ctlContinue ctlContinue
<<NOKEEP
######################################################################
# InstallUISequence
All :: "$(LANG).$(PLAT).$(CFG).InstallUISequence-1.idt"
"$(LANG).$(PLAT).$(CFG).InstallUISequence-1.idt" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Action Condition Sequence
s$(MSIBUILD_LENGTH_ID) S255 I2
InstallUISequence Action
dlgTutorial1 NOT Installed AND &featZRCola>=3 1400
dlgTutorial2 NOT Installed AND &featZRCola>=3 1401
dlgTutorial3 NOT Installed AND &featZRCola>=3 1402
<<NOKEEP
######################################################################
# Feature
All :: "$(LANG).$(PLAT).$(CFG).Feature-2.idt"
"En.$(PLAT).$(CFG).Feature-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
"en_US.$(PLAT).$(CFG).Feature-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Feature Feature_Parent Title Description Display Level Directory_ Attributes
@@ -94,17 +220,13 @@ s$(MSIBUILD_LENGTH_ID) S$(MSIBUILD_LENGTH_ID) L64 L255 I2 i2 S$(MSIBUILD_LENGTH_
featZRCola ZRCola Input system for linguistic use 1 1 ZRCOLADIR 8
<<NOKEEP
"De.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\de_DE.po"
rcxgettext.exe idtp $@ $**
"En.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx"
!IF "$(LANG)" == "en_US"
"en_US.$(PLAT).$(CFG).Feature-2.idt" : "en_US.$(PLAT).$(CFG).Feature-2.idtx"
copy /y $** $@ > NUL
"It.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\it_IT.po"
rcxgettext.exe idtp $@ $**
"Sl.$(PLAT).$(CFG).Feature-2.idt" : "En.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\sl_SI.po"
rcxgettext.exe idtp $@ $**
!ELSE
"$(LANG).$(PLAT).$(CFG).Feature-2.idt" : "en_US.$(PLAT).$(CFG).Feature-2.idtx" "..\locale\$(LANG).po"
cscript.exe "..\..\MSI\MSIBuild\MSI.wsf" //Job:IDTTranslate //Nologo $@ $** /CP:$(MSIBUILD_CODEPAGE)
!ENDIF
######################################################################
@@ -127,14 +249,14 @@ featZRCola compLocalizationRepositoryPath
featZRCola compLanguage
featZRCola compDatabasePath
featZRCola compZRCola.zrcdb
featZRCola comp00_ZRCola_Re.ttf
!IF "$(LANG)" == "Sl"
featZRCola compZRCola.mo.sl_SI
featZRCola compZRCola.zrcdb.mo.sl_SI
featZRCola complibZRColaUI.mo.sl_SI
featZRCola compwxExtend.mo.sl_SI
featZRCola compUpdater.mo.sl_SI
featZRCola compwxstd.mo.sl_SI
featZRCola compZRCola_Re.otf
!IF "$(LANG)" != "en_US"
featZRCola compZRCola.mo.$(LANG)
featZRCola compZRCola.zrcdb.mo.$(LANG)
featZRCola complibZRColaUI.mo.$(LANG)
featZRCola compwxExtend.mo.$(LANG)
featZRCola compUpdater.mo.$(LANG)
featZRCola compwxstd.mo.$(LANG)
!ENDIF
<<NOKEEP
@@ -151,8 +273,8 @@ File Component_ FileName FileSize Version Language Attributes Sequence
s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l255 i4 S$(MSIBUILD_LENGTH_ID) S20 I2 i2
File File
fileZRCola.exe.$(PLAT) compZRCola.exe.$(PLAT) ZRCola.exe 0 0 1536 1
!IF "$(LANG)" == "Sl"
fileZRCola.mo.sl_SI compZRCola.mo.sl_SI ZRCola.mo 0 1060 0 1
!IF "$(LANG)" != "en_US"
fileZRCola.mo.$(LANG) compZRCola.mo.$(LANG) ZRCola.mo 0 $(MSIBUILD_LANGID) 0 1
!ENDIF
<<NOKEEP
@@ -197,7 +319,7 @@ rmfiZRCola compZRCola.exe.$(PLAT) ZRColaShortcutDir 2
All :: "$(LANG).$(PLAT).$(CFG).Shortcut-2.idt"
"En.$(PLAT).$(CFG).Shortcut-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
"en_US.$(PLAT).$(CFG).Shortcut-2.idtx" : "Makefile" "..\..\include\MSIBuildCfg.mak"
-if exist $@ del /f /q $@
move /y << $@ > NUL
Shortcut Directory_ Name Component_ Target Arguments Description Hotkey Icon_ IconIndex ShowCmd WkDir
@@ -206,17 +328,13 @@ s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l128 s$(MSIBUILD_LENGTH_ID) s$(MSI
shctZRCola ZRColaShortcutDir ZRCola compZRCola.exe.$(PLAT) featZRCola Input system for linguistic use iconZRCola.ico ZRCOLABINDIR
<<NOKEEP
"De.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\de_DE.po"
rcxgettext.exe idtp $@ $**
"En.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx"
!IF "$(LANG)" == "en_US"
"en_US.$(PLAT).$(CFG).Shortcut-2.idt" : "en_US.$(PLAT).$(CFG).Shortcut-2.idtx"
copy /y $** $@ > NUL
"It.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\it_IT.po"
rcxgettext.exe idtp $@ $**
"Sl.$(PLAT).$(CFG).Shortcut-2.idt" : "En.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\sl_SI.po"
rcxgettext.exe idtp $@ $**
!ELSE
"$(LANG).$(PLAT).$(CFG).Shortcut-2.idt" : "en_US.$(PLAT).$(CFG).Shortcut-2.idtx" "..\locale\$(LANG).po"
cscript.exe "..\..\MSI\MSIBuild\MSI.wsf" //Job:IDTTranslate //Nologo $@ $** /CP:$(MSIBUILD_CODEPAGE)
!ENDIF
######################################################################

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -91,6 +91,7 @@
<ClCompile Include="zrcolagui.cpp" />
<ClCompile Include="zrcolakeyhndlr.cpp" />
<ClCompile Include="zrcolasettings.cpp" />
<ClCompile Include="zrcolatranseq.cpp" />
<ClCompile Include="zrcolaupdater.cpp" />
</ItemGroup>
<ItemGroup>
@@ -106,6 +107,7 @@
<ClInclude Include="zrcolagui.h" />
<ClInclude Include="zrcolakeyhndlr.h" />
<ClInclude Include="zrcolasettings.h" />
<ClInclude Include="zrcolatranseq.h" />
<ClInclude Include="zrcolaupdater.h" />
</ItemGroup>
<ItemGroup>
@@ -115,7 +117,10 @@
<ProjectReference Include="..\lib\libZRCola\build\libZRCola.vcxproj">
<Project>{3c61929e-7289-4101-8d0a-da22d6e1aea8}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtend.vcxproj">
<ProjectReference Include="..\lib\WinStd\build\WinStd.vcxproj">
<Project>{47399d91-7eb9-41de-b521-514ba5db0c43}</Project>
</ProjectReference>
<ProjectReference Include="..\lib\wxExtend\build\wxExtendDll.vcxproj">
<Project>{a3a36689-ac35-4026-93da-a3ba0c0e767c}</Project>
</ProjectReference>
<ProjectReference Include="..\Updater\Updater\build\Updater.vcxproj">
@@ -125,6 +130,8 @@
<ItemGroup>
<None Include="locale\ZRCola.pot" />
<None Include="res\char_select.ico" />
<None Include="res\copy_composed_and_return.ico" />
<None Include="res\copy_decomposed_and_return.ico" />
<None Include="res\edit_copy.ico" />
<None Include="res\edit_cut.ico" />
<None Include="res\edit_paste.ico" />
@@ -134,7 +141,9 @@
<None Include="res\send_composed.ico" />
<None Include="res\send_decomposed.ico" />
<None Include="res\zrcola.ico" />
<None Include="ZRCola.fbp" />
<None Include="ZRCola.fbp">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRCola.rc" />

View File

@@ -58,6 +58,9 @@
<ClCompile Include="zrcolachrreq.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolatranseq.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@@ -99,6 +102,9 @@
<ClInclude Include="zrcolachrreq.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolatranseq.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="res\zrcola.ico">
@@ -137,6 +143,12 @@
<None Include="res\navigate_forward.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\copy_composed_and_return.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\copy_decomposed_and_return.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRCola.rc">

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,15 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2016-06-02 20:53+0200\n"
"PO-Revision-Date: 2016-06-02 20:53+0200\n"
"POT-Creation-Date: 2017-06-01 18:04+0200\n"
"PO-Revision-Date: 2017-06-01 18:04+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.8\n"
"X-Generator: Poedit 2.0.2\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
@@ -20,57 +20,79 @@ msgstr ""
msgid "© 2004-%s ZRC SAZU"
msgstr ""
#: zrcolaapp.cpp:79 zrcolafrm.cpp:90 zrcolagui.cpp:841 zrcolagui.h:104
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
#, fuzzy
#: zrcolaapp.cpp:72 zrcolafrm.cpp:106 zrcolagui.cpp:894 zrcolagui.h:108
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "ZRCola"
msgstr "ZRCola:."
msgstr "ZRCola"
#: zrcolachrreq.cpp:49 zrcolagui.cpp:970
#: zrcolachrreq.cpp:49 zrcolagui.cpp:1024
#, fuzzy
msgid "Character"
msgstr "Eingabe eines Zeichenstils"
#: zrcolachrreq.cpp:58 zrcolagui.cpp:991
#: zrcolachrreq.cpp:58 zrcolagui.cpp:1045
#, fuzzy
msgid "Context"
msgstr "Konnte den Kontext auf dem überlagerten Fenster nicht initialisieren."
#: zrcolachrreq.cpp:64 zrcolagui.h:357
#: zrcolachrreq.cpp:64 zrcolagui.h:366
msgid "Request a New Character"
msgstr ""
#: zrcolafrm.cpp:111
msgid ""
"ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality "
"will not be available."
#: zrcolachrslct.cpp:89
msgid "Too many digits in Unicode."
msgstr ""
#: zrcolafrm.cpp:111 zrcolafrm.cpp:113
#: zrcolachrslct.cpp:89 zrcolachrslct.cpp:107
msgid "Validation conflict"
msgstr "Fehler bei der Validierung"
#: zrcolachrslct.cpp:107
#, c-format
msgid "Invalid character in Unicode found: %c"
msgstr ""
#: zrcolachrslct.cpp:214 zrcolachrslct.cpp:390 zrcolachrslct.cpp:869
msgid "▸ Search Options"
msgstr ""
# Recitation separator
#: zrcolachrslct.cpp:328
#, fuzzy
msgid ", "
msgstr ", "
#: zrcolachrslct.cpp:393 zrcolachrslct.cpp:866
msgid "▾ Search Options"
msgstr ""
#: zrcolafrm.cpp:90
msgid "Custom Translation..."
msgstr ""
#: zrcolafrm.cpp:175
msgid "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."
msgstr ""
#: zrcolafrm.cpp:175 zrcolafrm.cpp:177
#, fuzzy
msgid "Warning"
msgstr "Warnung: "
#: zrcolafrm.cpp:113
msgid ""
"ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality "
"will not be available."
#: zrcolafrm.cpp:177
msgid "ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."
msgstr ""
#: zrcolafrm.cpp:351
msgid "http://zrcola-2.amebis.si/en/info/instructions/"
msgstr "http://zrcola-2.amebis.si/de/info/instructions/"
#: zrcolafrm.cpp:410
msgid "http://zrcola.zrc-sazu.si/en/info/instructions/"
msgstr "http://zrcola.zrc-sazu.si/de/info/instructions/"
#: zrcolafrm.cpp:375
msgid ""
"http://zrcola-2.amebis.si/wp-content/uploads/2016/04/5_ZRCola-"
"Tipkovnica_2009-06-21.pdf"
msgstr ""
"http://zrcola-2.amebis.si/wp-content/uploads/2016/04/5_ZRCola-"
"Tipkovnica_2009-06-21.pdf"
#: zrcolafrm.cpp:434
msgid "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
msgstr "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
#: zrcolagui.cpp:36
msgid "E&xit"
@@ -100,7 +122,7 @@ msgstr ""
msgid "Find C&haracter..."
msgstr "Eingabe eines Zeichenstils"
#: zrcolagui.cpp:78 zrcolagui.cpp:180
#: zrcolagui.cpp:78 zrcolagui.cpp:198
msgid "Display character search to select character to insert into text"
msgstr ""
@@ -109,458 +131,596 @@ msgstr ""
msgid "&Send Composed"
msgstr "Pošlji sestavljeno (F5)"
#: zrcolagui.cpp:89 zrcolagui.cpp:182
#: zrcolagui.cpp:89 zrcolagui.cpp:200
msgid "Send composed text to source window"
msgstr ""
#: zrcolagui.cpp:98
msgid "Copy Composed and &Return"
msgstr ""
#: zrcolagui.cpp:98
msgid "Copy composed text to clipboard and return focus to source window"
msgstr ""
#: zrcolagui.cpp:107
#, fuzzy
msgid "Send &Decomposed"
msgstr "Pošlji razstavljeno (F6)"
#: zrcolagui.cpp:98 zrcolagui.cpp:184
#: zrcolagui.cpp:107 zrcolagui.cpp:202
msgid "Send decomposed text to source window"
msgstr ""
#: zrcolagui.cpp:107
#: zrcolagui.cpp:116
msgid "Copy Decomposed and Re&turn"
msgstr ""
#: zrcolagui.cpp:116
msgid "Copy decomposed text to clipboard and return focus to source window"
msgstr ""
#: zrcolagui.cpp:125
msgid "Abort (De)composition"
msgstr ""
#: zrcolagui.cpp:107
#: zrcolagui.cpp:125
msgid "Abort composition and return focus to source window"
msgstr ""
#: zrcolagui.cpp:118
#: zrcolagui.cpp:136
msgid "&Settings..."
msgstr ""
#: zrcolagui.cpp:118
#: zrcolagui.cpp:136
msgid "Open program configuration dialog"
msgstr ""
#: zrcolagui.cpp:121
#: zrcolagui.cpp:139
#, fuzzy
msgid "&Edit"
msgstr "&Bearbeiten"
#: zrcolagui.cpp:125
#: zrcolagui.cpp:143
msgid "&Edit Toolbar"
msgstr ""
#: zrcolagui.cpp:125
#: zrcolagui.cpp:143
msgid "Toggle edit toolbar"
msgstr ""
#: zrcolagui.cpp:129
#: zrcolagui.cpp:147
msgid "&Compose Toolbar"
msgstr ""
#: zrcolagui.cpp:129
#: zrcolagui.cpp:147
msgid "Toggle compose toolbar"
msgstr ""
#: zrcolagui.cpp:135
#: zrcolagui.cpp:153
msgid "Character Catalo&g"
msgstr ""
#: zrcolagui.cpp:135
#: zrcolagui.cpp:153
msgid "Toggle character catalog panel"
msgstr ""
#: zrcolagui.cpp:138
#: zrcolagui.cpp:156
#, fuzzy
msgid "&View"
msgstr "&Ansicht..."
#: zrcolagui.cpp:142
#: zrcolagui.cpp:160
msgid "&Instructions..."
msgstr ""
#: zrcolagui.cpp:142
#: zrcolagui.cpp:160
msgid "Open a web site with product instructions"
msgstr ""
#: zrcolagui.cpp:146
#: zrcolagui.cpp:164
msgid "Keyboard &Shortcuts..."
msgstr ""
#: zrcolagui.cpp:146
#: zrcolagui.cpp:164
msgid "Open a list of keyboard shortcuts"
msgstr ""
#: zrcolagui.cpp:152
#: zrcolagui.cpp:170
msgid "&Request a new character..."
msgstr ""
#: zrcolagui.cpp:152
#: zrcolagui.cpp:170
msgid "Submit a request to ZRC to add a new character"
msgstr ""
#: zrcolagui.cpp:156
#: zrcolagui.cpp:174
msgid "Check for &Updates..."
msgstr ""
#: zrcolagui.cpp:156
#: zrcolagui.cpp:174
msgid "Check online for product update"
msgstr ""
#: zrcolagui.cpp:165
#: zrcolagui.cpp:180
#, fuzzy
msgid "&About..."
msgstr "Über..."
#: zrcolagui.cpp:183
#, fuzzy
msgid "&Help"
msgstr "&Hilfe"
#: zrcolagui.cpp:170
#: zrcolagui.cpp:188
#, fuzzy
msgid "Cut"
msgstr "Ausschneiden"
#: zrcolagui.cpp:170
#: zrcolagui.cpp:188
#, fuzzy
msgid "Cut selection"
msgstr "Auswahl ausschneiden"
#: zrcolagui.cpp:172
#: zrcolagui.cpp:190
#, fuzzy
msgid "Copy"
msgstr "Kopieren"
#: zrcolagui.cpp:172
#: zrcolagui.cpp:190
#, fuzzy
msgid "Copy selection"
msgstr "Auswahl kopieren"
#: zrcolagui.cpp:174
#: zrcolagui.cpp:192
#, fuzzy
msgid "Paste"
msgstr "Einfügen"
#: zrcolagui.cpp:174
#: zrcolagui.cpp:192
#, fuzzy
msgid "Paste selection"
msgstr "Auswahl einfügen"
#: zrcolagui.cpp:177
#: zrcolagui.cpp:195
#, fuzzy
msgid "Edit"
msgstr "Bearbeiten"
#: zrcolagui.cpp:180
#: zrcolagui.cpp:198
#, fuzzy
msgid "Find Character"
msgstr "Eingabe eines Zeichenstils"
#: zrcolagui.cpp:182
#: zrcolagui.cpp:200
#, fuzzy
msgid "Send Composed"
msgstr "Pošlji sestavljeno (F5)"
#: zrcolagui.cpp:184
#: zrcolagui.cpp:202
#, fuzzy
msgid "Send Decomposed"
msgstr "Pošlji razstavljeno (F6)"
#: zrcolagui.cpp:187
#: zrcolagui.cpp:209
msgid "Compose"
msgstr ""
#: zrcolagui.cpp:191
#: zrcolagui.cpp:213
msgid "Character Catalog"
msgstr ""
#: zrcolagui.cpp:195
#: zrcolagui.cpp:217
msgid "(De)Composer"
msgstr ""
#: zrcolagui.cpp:234
#: zrcolagui.cpp:258
msgid "Decomposed Text"
msgstr ""
#: zrcolagui.cpp:254
#: zrcolagui.cpp:278
msgid "Decomposed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:281
#: zrcolagui.cpp:305
msgid "Composed Text"
msgstr ""
#: zrcolagui.cpp:301
#: zrcolagui.cpp:325
msgid "Composed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:421
#: zrcolagui.cpp:379
msgid "Select category to display"
msgstr ""
#: zrcolagui.cpp:413
#, fuzzy
msgid "Show &All"
msgstr "Alles zeigen"
#: zrcolagui.cpp:414
msgid "Toggle display of less frequent characters"
msgstr ""
#: zrcolagui.cpp:454
#, fuzzy
msgid "&Browse"
msgstr "Durchsuchen"
#: zrcolagui.cpp:428
msgid ""
"Full or partial terms from Unicode character description (in English) to "
"search for"
#: zrcolagui.cpp:461
msgid "Full or partial terms from Unicode character description (in English) to search for"
msgstr ""
#: zrcolagui.cpp:434
#: zrcolagui.cpp:465
msgid "Search Options"
msgstr ""
#: zrcolagui.cpp:466
msgid "Shows/hides additional search options"
msgstr ""
#: zrcolagui.cpp:478
msgid "List of Unicode character categories to search in"
msgstr ""
#: zrcolagui.cpp:441
#: zrcolagui.cpp:485
#, fuzzy
msgid "All"
msgstr "Alle"
#: zrcolagui.cpp:442
#: zrcolagui.cpp:486
msgid "Select all categories"
msgstr ""
#: zrcolagui.cpp:446
#: zrcolagui.cpp:490
#, fuzzy
msgid "None"
msgstr "Kein"
#: zrcolagui.cpp:447
#: zrcolagui.cpp:491
#, fuzzy
msgid "Clear category selection"
msgstr "Auswahl kopieren"
#: zrcolagui.cpp:451
#: zrcolagui.cpp:495
msgid "Invert"
msgstr ""
#: zrcolagui.cpp:452
#: zrcolagui.cpp:496
#, fuzzy
msgid "Invert category selection"
msgstr "Auswahl einfügen"
#: zrcolagui.cpp:485
#: zrcolagui.cpp:535
#, fuzzy
msgid "Character search results"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:495
#: zrcolagui.cpp:545
msgid "Re&cently Used"
msgstr ""
#: zrcolagui.cpp:523
#: zrcolagui.cpp:573
msgid "List of recently inserted characters"
msgstr ""
#: zrcolagui.cpp:537
#, fuzzy
msgid "Preview"
msgstr " Vorschau"
#: zrcolagui.cpp:542
#, fuzzy
msgid "U+"
msgstr "Hilfeverzeichnis %u nicht gefunden."
#: zrcolagui.cpp:547
msgid "Unicode hexadecimal code"
msgstr ""
#: zrcolagui.cpp:552
msgid "Keyboard shortcut in Composer window"
msgstr ""
#: zrcolagui.cpp:587
#, fuzzy
msgid "Preview"
msgstr " Vorschau"
#: zrcolagui.cpp:592
msgid "U+"
msgstr "U+"
#: zrcolagui.cpp:597
msgid "Unicode hexadecimal code"
msgstr ""
#: zrcolagui.cpp:602
msgid "Keyboard shortcut in Composer window"
msgstr ""
#: zrcolagui.cpp:637
#, fuzzy
msgid "Character preview"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:592
#: zrcolagui.cpp:642
msgid "Unicode character description"
msgstr ""
#: zrcolagui.cpp:597
#: zrcolagui.cpp:647
#, fuzzy
msgid "Character tags"
msgstr "Eingabe eines Zeichenstils"
#: zrcolagui.cpp:652
msgid "Unicode character category"
msgstr ""
#: zrcolagui.cpp:604
#: zrcolagui.cpp:659
#, fuzzy
msgid "« Back"
msgstr "< &Zurück"
#: zrcolagui.cpp:606
#: zrcolagui.cpp:661
msgid "To previously viewed character"
msgstr ""
#: zrcolagui.cpp:610
#: zrcolagui.cpp:665
#, fuzzy
msgid "Forward »"
msgstr "&Vorwärts"
#: zrcolagui.cpp:612
#: zrcolagui.cpp:667
msgid "To following viewed character"
msgstr ""
#: zrcolagui.cpp:623
#: zrcolagui.cpp:678
msgid "Re&lated"
msgstr ""
#: zrcolagui.cpp:650
#: zrcolagui.cpp:705
msgid "List of related characters"
msgstr ""
#: zrcolagui.cpp:737
#: zrcolagui.cpp:794
msgid ""
"Some character native to specific language you are working with should not "
"decompose to primitives.\n"
"Some character native to specific language you are working with should not decompose to primitives.\n"
"For optimal decomposition you should set the language correctly."
msgstr ""
#: zrcolagui.cpp:741
#: zrcolagui.cpp:798
msgid "Select language &automatically according to selected keyboard"
msgstr ""
#: zrcolagui.cpp:744
#: zrcolagui.cpp:801
msgid "&Manually select the language from the list below:"
msgstr ""
#: zrcolagui.cpp:756
#: zrcolagui.cpp:812
msgid "Text Language"
msgstr ""
#: zrcolagui.cpp:761
#: zrcolagui.cpp:817
msgid ""
"ZRCola can be launched every time you log in to your computer.\n"
"It will be available on the system tray and via registered shortcuts Win+F5 "
"and Win+F6."
"It will be available on the system tray and via registered shortcuts Win+F5 and Win+F6."
msgstr ""
#: zrcolagui.cpp:765
#: zrcolagui.cpp:821
msgid "Start ZRCola &automatically on logon"
msgstr ""
#: zrcolagui.cpp:772
#: zrcolagui.cpp:827
msgid "Startup"
msgstr ""
#: zrcolagui.cpp:851
#: zrcolagui.cpp:905
msgid ""
"Program and Website Editor: Janoš Ježovnik\n"
"Development: Amebis, d. o. o., Kamnik\n"
"Development and maintenance (2004-2015): dr. Peter Weiss"
"Translation into English: Janoš Ježovnik\n"
"Translation into Russian language: Domen Krvina, Silvo Torkar, Anastasia Plotnikova\n"
"Development and maintenance of the original program (20042015): Peter Weiss"
msgstr ""
#: zrcolagui.cpp:859
#: zrcolagui.cpp:913
#, fuzzy
msgid "zrcola.zrc-sazu.si"
msgstr "http://zrcola.zrc-sazu.si/de/info/instructions/"
#: zrcolagui.cpp:919
msgid "Texts made using ZRCola have to include in a footnote or some other appropriate part of the publication the note below:"
msgstr ""
#: zrcolagui.cpp:865
msgid ""
"Texts made using ZRCola have to include in the colophon, foreword, footnote "
"or some other appropriate part of the publication the note below:"
#: zrcolagui.cpp:923
msgid "This text was written using the ZRCola input system (http://zrcola.zrc-sazu.si), developed at the Science and Research Centre of SAZU in Ljubljana (http://www.zrc-sazu.si) by Peter Weiss."
msgstr ""
#: zrcolagui.cpp:869
msgid ""
"This text was written using the ZRCola input system (http://zrcola.zrc-sazu."
"si), developed at the Science and Research Centre of SAZU in Ljubljana "
"(http://www.zrc-sazu.si) by Dr. Peter Weiss."
msgstr ""
#: zrcolagui.cpp:910
#: zrcolagui.cpp:964
#, fuzzy
msgid "Log"
msgstr "&Log"
#: zrcolagui.cpp:926
#: zrcolagui.cpp:980
#, fuzzy
msgid "Quit and &Update..."
msgstr "Kann Benutzer-Konfigurationsdatei nicht aktualisieren."
#: zrcolagui.cpp:928
#: zrcolagui.cpp:982
msgid "Exit this program and launch product update"
msgstr ""
#: zrcolagui.cpp:932
#: zrcolagui.cpp:986
#, fuzzy
msgid "&Close"
msgstr "&Schließen"
#: zrcolagui.cpp:933
#: zrcolagui.cpp:987
#, fuzzy
msgid "Close this window"
msgstr "Fenster schließen"
#: zrcolagui.cpp:972
#: zrcolagui.cpp:1026
msgid "Enter the &character you would like to request:"
msgstr ""
#: zrcolagui.cpp:979
#: zrcolagui.cpp:1033
msgid "Decomposed character to request"
msgstr ""
#: zrcolagui.cpp:983
#: zrcolagui.cpp:1037
msgid ""
"Please, use the decomposed form.\n"
"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste "
"it from the Decomposed window."
"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste it from the Decomposed window."
msgstr ""
#: zrcolagui.cpp:993
msgid ""
"The &context, examples or short description why and where the character is "
"required:"
#: zrcolagui.cpp:1047
msgid "The &context, examples or description why and where the character is required:"
msgstr ""
#: zrcolagui.cpp:999
#: zrcolagui.cpp:1053
msgid "Additional notes for character request"
msgstr ""
#: zrcolagui.cpp:1006
#: zrcolagui.cpp:1060
msgid ""
"After clicking OK button, your e-mail application should open allowing you "
"to submit the new character request to ZRCola Editor.\n"
"Your e-mail application might not display all the characters correctly, but "
"we'll encode the necessarry information so the Editor will be able to read "
"it correctly."
"After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor.\n"
"Your e-mail application might not display all the characters correctly, but the Editor will be able to read them correctly anyway."
msgstr ""
#: zrcolagui.cpp:1102
msgid "Translation"
msgstr ""
#: zrcolagui.cpp:1104
msgid ""
"ZRCola offers multiple text translations that can be arranged in a sequence.\n"
"Please select desired translations and the order they are applied."
msgstr ""
#: zrcolagui.cpp:1114
msgid "A&vailable:"
msgstr ""
#: zrcolagui.cpp:1129
msgid ">"
msgstr ">"
#: zrcolagui.cpp:1132
msgid "<"
msgstr "<"
#: zrcolagui.cpp:1141
#, fuzzy
msgid "&Selected:"
msgstr "Izreže izbrano besedilo in ga shrani na odložišče"
#: zrcolagui.cpp:1159
#, fuzzy
msgid "Up"
msgstr "Up"
#: zrcolagui.cpp:1162
#, fuzzy
msgid "Down"
msgstr "Down"
#: zrcolagui.h:250
#, fuzzy
msgid "Character Search"
msgstr "Skupine &znakov"
#: zrcolagui.h:286
msgid "Settings"
msgstr ""
#: zrcolagui.h:312
msgid "About ZRCola"
msgstr ""
#: zrcolagui.h:337 zrcolaupdater.cpp:94
msgid "Product Update"
msgstr ""
#: zrcolagui.h:408
msgid "Custom Translation Sequence"
msgstr ""
#: zrcolakeyhndlr.cpp:44
msgid ""
"INS key is pressed. Type the Unicode code of desired character now (up to "
"four hexadecimal digits: 0-9, A-F), then release INS."
msgid "INS key is pressed. Type the Unicode code of desired character now (up to four hexadecimal digits: 0-9, A-F), then release INS."
msgstr ""
#: zrcolasettings.cpp:93
#: zrcolasettings.cpp:87
msgid "Start ZRCola automatically on logon"
msgstr ""
#: zrcolatranseq.cpp:63
#, c-format
msgid "Unknown translation (%u)"
msgstr ""
#: zrcolaupdater.cpp:94
msgid ""
"This program will now close and the upgrade will be launched.\n"
"Are you sure?"
msgstr ""
#: zrcolaupdater.cpp:94 zrcolagui.h:328
msgid "Product Update"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:15
#: MSIBuild/en_US.x64.Release.Control-2.idtx:4
#: MSIBuild/en_US.x64.Release.Control-2.idtx:10
#: MSIBuild/en_US.x64.Release.Control-2.idtx:15
msgid "binUIHeader.bmp"
msgstr "binUIHeader.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:5
#: MSIBuild/en_US.x64.Release.Control-2.idtx:5
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Starting"
msgstr ""
#: zrcolagui.h:240
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:6
#: MSIBuild/en_US.x64.Release.Control-2.idtx:6
msgid "bintutorial1.bmp"
msgstr "bintutorial1.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:7
#: MSIBuild/en_US.x64.Release.Control-2.idtx:7
msgid "When configured, ZRCola starts at system startup and runs in the background. If needed, it can be brought up by pressing the combination Win+F5."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:8
#: MSIBuild/en_US.x64.Release.Control-2.idtx:8
msgid "IMPORTANT: Upon pressing the combination Win+F5 the program memorises the location of the cursor in the text. If ZRCola is brought to the foreground without using the aforementioned combination of keys, the program won't know where to insert the special characters!"
msgstr ""
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:19
#: MSIBuild/en_US.x64.Release.Control-2.idtx:9
#: MSIBuild/en_US.x64.Release.Control-2.idtx:14
#: MSIBuild/en_US.x64.Release.Control-2.idtx:19
#, fuzzy
msgid "Character Search"
msgstr "Skupine &znakov"
msgid "&Continue"
msgstr "Auf Volume \"[2]\" steht nicht genügend Speicherplatz für die Installation bei aktivierter Wiederherstellungsoption zur Verfügung. [3] KB sind erforderlich, aber nur [4] KB sind verfügbar. Klicken Sie auf \"Ignorieren\", um die Installation ohne Speicherung von Wiederherstellungsinformationen fortzusetzen, klicken Sie auf \"Wiederholen\", um den verfügbaren Speicher erneut zu überprüfen oder auf \"Abbrechen\", um die Installation abzubrechen."
#: zrcolagui.h:277
msgid "Settings"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:11
#: MSIBuild/en_US.x64.Release.Control-2.idtx:11
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Composition"
msgstr ""
#: zrcolagui.h:303
msgid "About ZRCola"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:12
#: MSIBuild/en_US.x64.Release.Control-2.idtx:12
msgid "bintutorial2.bmp"
msgstr "bintutorial2.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:13
#: MSIBuild/en_US.x64.Release.Control-2.idtx:13
msgid "The string of basic and substitute characters is entered into the upper input window of the program. In the window below the resulted special characters are displayed. To insert them in the text, the F5 key is used."
msgstr ""
# Windows charset for this language (decimal)
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:3
#: MSIBuild/En.x64.Release.Feature-2.idtx:3
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:3
#, fuzzy
msgid "1252"
msgstr "1252"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:16
#: MSIBuild/en_US.x64.Release.Control-2.idtx:16
msgid "[DlgTitleFont][SimpleProductName] Tutorial : Entering Characters"
msgstr ""
#: MSIBuild/En.Win32.Release.Feature-2.idtx:4
#: MSIBuild/En.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/En.x64.Release.Feature-2.idtx:4
#: MSIBuild/En.x64.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:17
#: MSIBuild/en_US.x64.Release.Control-2.idtx:17
msgid "bintutorial3.bmp"
msgstr "bintutorial3.bmp"
#: MSIBuild/en_US.Win32.Release.Control-2.idtx:18
#: MSIBuild/en_US.x64.Release.Control-2.idtx:18
msgid "Characters can be entered using keyboard shortcuts, the character catalogue (F4) or the character finding tool (F8)."
msgstr ""
#: MSIBuild/en_US.Win32.Release.Feature-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Shortcut-2.idtx:4
#: MSIBuild/en_US.x64.Release.Feature-2.idtx:4
#: MSIBuild/en_US.x64.Release.Shortcut-2.idtx:4
msgid "Input system for linguistic use"
msgstr ""

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

4
ZRCola/res/desktop.ini Normal file
View File

@@ -0,0 +1,4 @@
[ViewState]
Mode=
Vid=
FolderType=Pictures

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

1891
ZRCola/res/send_source.pdf Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -19,7 +19,7 @@
#pragma once
#include "../include/zrcola.h"
#include "../include/version.h"
#include "zrcolaabout.h"
#include "zrcolaapp.h"
#include "zrcolachrcatpnl.h"
@@ -29,6 +29,7 @@
#include "zrcolafrm.h"
#include "zrcolakeyhndlr.h"
#include "zrcolasettings.h"
#include "zrcolatranseq.h"
#include "zrcolaupdater.h"
#include <Updater/chkthread.h>
@@ -37,13 +38,15 @@
#include <wxex/url.h>
#include <wxex/persist/auimanager.h>
#include <wx/clipbrd.h>
#include <wx/ffile.h>
#include <wx/msgdlg.h>
#include <wx/persist.h>
#include <wx/persist/toplevel.h>
#include <wx/socket.h>
#include <wx/tokenzr.h>
#include <wx/utils.h>
#include <wx/valtext.h>
#include <wx/socket.h>
#include <WinStd/MSI.h>

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -26,7 +26,7 @@
wxZRColaAbout::wxZRColaAbout(wxWindow* parent) : wxZRColaAboutBase(parent)
{
m_staticTextVersion->SetLabelText(wxT(ZRCOLA_VERSION_STR));
m_staticTextVersion->SetLabelText(wxT(PRODUCT_VERSION_STR));
m_staticTextCopyright->SetLabelText(wxString::Format(_("© 2004-%s ZRC SAZU"), wxT(ZRCOLA_BUILD_YEAR_STR)));
m_staticTextCopyright->SetLabelText(wxString::Format(_("© 2004-%s ZRC SAZU"), wxT(PRODUCT_BUILD_YEAR_STR)));
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -32,9 +32,7 @@ wxIMPLEMENT_APP(ZRColaApp);
ZRColaApp::ZRColaApp() :
m_mainWnd(NULL),
#ifdef __WXMSW__
m_running(NULL),
#endif
m_lang_ui(wxLANGUAGE_DEFAULT),
wxApp()
{
}
@@ -46,25 +44,21 @@ bool ZRColaApp::OnInit()
// To compensate migration to non-advertised shortcut, do the Microsoft Installer's feature completeness check manually.
// If execution got this far in the first place (EXE and dependent DLLs are present and loadable).
// Furthermore, this increments program usage counter.
if (::MsiQueryFeatureState(_T(ZRCOLA_VERSION_GUID), _T("featZRCola")) != INSTALLSTATE_UNKNOWN)
::MsiUseFeature(_T(ZRCOLA_VERSION_GUID), _T("featZRCola"));
if (::MsiQueryFeatureState(_T(PRODUCT_VERSION_GUID), _T("featZRCola")) != INSTALLSTATE_UNKNOWN)
::MsiUseFeature(_T(PRODUCT_VERSION_GUID), _T("featZRCola"));
#endif
wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT(ZRCOLA_CFG_APPLICATION), wxT(ZRCOLA_CFG_VENDOR)));
// Initialize configuration.
wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT(PRODUCT_CFG_APPLICATION), wxT(PRODUCT_CFG_VENDOR)));
if (cfgPrev) wxDELETE(cfgPrev);
if (!wxApp::OnInit())
return false;
// Set desired locale.
wxLanguage language = (wxLanguage)wxConfigBase::Get()->Read(wxT("Language"), wxLANGUAGE_DEFAULT);
if (wxLocale::IsAvailable(language)) {
wxString sPath;
if (wxConfigBase::Get()->Read(wxT("LocalizationRepositoryPath"), &sPath))
m_locale.AddCatalogLookupPathPrefix(sPath);
wxVERIFY(m_locale.Init(language));
// Initialize locale.
if (wxInitializeLocale(m_locale, &m_lang_ui)) {
wxVERIFY(m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)));
wxVERIFY(m_locale.AddCatalog(wxT("Updater") wxT(wxUpdaterVersion)));
wxVERIFY(m_locale.AddCatalog(wxT("UpdaterZRCola")));
wxVERIFY(m_locale.AddCatalog(wxT("libZRColaUI")));
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola")));
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola-zrcdb")));
@@ -72,8 +66,7 @@ bool ZRColaApp::OnInit()
#ifdef __WXMSW__
// Create global event.
m_running = ::CreateEvent(NULL, FALSE, FALSE, _T(ZRCOLA_CFG_APPLICATION) _T("{BBDE7AAD-29B6-4B83-ADA1-92AFA81A0883}"));
wxASSERT(m_running);
m_running.attach(::CreateEvent(NULL, FALSE, FALSE, _T(PRODUCT_CFG_APPLICATION) _T("{BBDE7AAD-29B6-4B83-ADA1-92AFA81A0883}")));
if (::GetLastError() == ERROR_ALREADY_EXISTS) {
// ZRCola is already running. Find its window.
HWND okno = ::FindWindow(_T("wxWindowNR"), _("ZRCola"));
@@ -107,49 +100,61 @@ bool ZRColaApp::OnInit()
has_translation_data = true;
} else {
wxFAIL_MSG(wxT("Error reading translation data from ZRCola.zrcdb."));
m_t_db.idxComp .clear();
m_t_db.idxDecomp.clear();
m_t_db.data .clear();
m_t_db.clear();
}
} else if (id == ZRCola::transet_rec::id) {
dat >> ZRCola::transet_rec(m_ts_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading translation set data from ZRCola.zrcdb."));
m_ts_db.clear();
}
} else if (id == ZRCola::transeq_rec::id) {
dat >> ZRCola::transeq_rec(m_tsq_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading translation sequence data from ZRCola.zrcdb."));
m_tsq_db.clear();
}
} else if (id == ZRCola::langchar_rec::id) {
dat >> ZRCola::langchar_rec(m_lc_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
m_lc_db.idxChr.clear();
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
m_lc_db.idxLng.clear();
#endif
m_lc_db.data .clear();
m_lc_db.clear();
}
} else if (id == ZRCola::language_rec::id) {
dat >> ZRCola::language_rec(m_lang_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading language character data from ZRCola.zrcdb."));
m_lang_db.idxLng.clear();
m_lang_db.data .clear();
m_lang_db.clear();
}
} else if (id == ZRCola::keyseq_rec::id) {
dat >> ZRCola::keyseq_rec(m_ks_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading key sequences data from ZRCola.zrcdb."));
m_ks_db.idxChr.clear();
m_ks_db.idxKey.clear();
m_ks_db.data .clear();
m_ks_db.clear();
}
} else if (id == ZRCola::character_rec::id) {
dat >> ZRCola::character_rec(m_chr_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character data from ZRCola.zrcdb."));
m_chr_db.idxChr.clear();
m_chr_db.data .clear();
m_chr_db.clear();
}
} else if (id == ZRCola::chrcat_rec::id) {
dat >> ZRCola::chrcat_rec(m_cc_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character category data from ZRCola.zrcdb."));
m_cc_db.idxChrCat.clear();
m_cc_db.idxRnk .clear();
m_cc_db.data .clear();
m_cc_db.clear();
}
} else if (id == ZRCola::chrtag_rec::id) {
dat >> ZRCola::chrtag_rec(m_ct_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character tag data from ZRCola.zrcdb."));
m_ct_db.clear();
}
} else if (id == ZRCola::tagname_rec::id) {
dat >> ZRCola::tagname_rec(m_tn_db);
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading tag name data from ZRCola.zrcdb."));
m_tn_db.clear();
}
} else
stdex::idrec::ignore<ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat);
@@ -166,7 +171,6 @@ bool ZRColaApp::OnInit()
wxSocketBase::Initialize();
m_mainWnd = new wxZRColaFrame();
wxPersistentRegisterAndRestore<wxZRColaFrame>(m_mainWnd);
m_mainWnd->Show();
return true;
@@ -180,10 +184,7 @@ int ZRColaApp::OnExit()
int res = wxApp::OnExit();
#ifdef __WXMSW__
if (m_running) {
wxVERIFY(::CloseHandle(m_running));
m_running = NULL;
}
m_running.free();
#endif
return res;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -26,12 +26,14 @@ class ZRColaApp;
#pragma once
#include "zrcolafrm.h"
#include <WinStd/Win.h>
#include <wx/app.h>
#include <wx/config.h>
#include <wx/intl.h>
#include <zrcola/character.h>
#include <zrcola/language.h>
#include <zrcola/translate.h>
#include <zrcola/tag.h>
#include <zrcolaui/keyboard.h>
@@ -71,19 +73,24 @@ public:
public:
ZRCola::translation_db m_t_db; ///< Translation database
ZRCola::transet_db m_ts_db; ///< Translation set database
ZRCola::transeq_db m_tsq_db; ///< Translation sequence database
ZRCola::langchar_db m_lc_db; ///< Language character database
ZRCola::language_db m_lang_db; ///< Language database
ZRCola::keyseq_db m_ks_db; ///< Key sequence database
ZRCola::character_db m_chr_db; ///< Character database
ZRCola::chrcat_db m_cc_db; ///< Characted category database
ZRCola::chrtag_db m_ct_db; ///< Character tag database
ZRCola::tagname_db m_tn_db; ///< Tag name database
wxZRColaFrame *m_mainWnd; ///< Main window
wxLocale m_locale; ///< Current locale
wxLanguage m_lang_ui; ///< Translation language (language of User Interface, wxLANGUAGE_DEFAULT = English)
protected:
#ifdef __WXMSW__
HANDLE m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
winstd::win_handle m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
#endif
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -25,13 +25,13 @@
//////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxZRColaCharacterCatalogPanel, wxZRColaCharacterCatalogPanelBase)
EVT_MENU(wxZRColaCharacterCatalogPanel::wxID_FOCUS_DECOMPOSED, wxZRColaCharacterCatalogPanel::OnFocusDecomposed)
EVT_MENU(wxZRColaCharacterCatalogPanel::wxID_FOCUS_SOURCE, wxZRColaCharacterCatalogPanel::OnFocusSource)
END_EVENT_TABLE()
wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) : wxZRColaCharacterCatalogPanelBase(parent)
{
std::fstream dat((LPCTSTR)((ZRColaApp*)wxTheApp)->GetDatabaseFilePath(), std::ios_base::in | std::ios_base::binary);
std::fstream dat((LPCTSTR)dynamic_cast<ZRColaApp*>(wxTheApp)->GetDatabaseFilePath(), std::ios_base::in | std::ios_base::binary);
if (dat.good()) {
if (stdex::idrec::find<ZRCola::recordid_t, ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat, ZRCOLA_DB_ID, sizeof(ZRCola::recordid_t))) {
ZRCola::recordsize_t size;
@@ -42,8 +42,8 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) :
dat >> rec;
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading character group data from ZRCola.zrcdb."));
m_cg_db.idxRnk.clear();
m_cg_db.data .clear();
m_cg_db.idxRank.clear();
m_cg_db.data .clear();
}
} else
wxFAIL_MSG(wxT("ZRCola.zrcdb has no character group data."));
@@ -52,28 +52,25 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) :
wxFAIL_MSG(wxT("ZRCola.zrcdb is not a valid ZRCola database."));
}
if (!m_cg_db.idxRnk.empty()) {
if (!m_cg_db.idxRank.empty()) {
// Populate character group list.
for (size_t i = 0, n = m_cg_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[i];
for (size_t i = 0, n = m_cg_db.idxRank.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[i];
wxString
label(cg.data, cg.name_len),
label(cg.name(), cg.name_len()),
label_tran2(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
m_choice->Insert(label_tran2, i);
}
m_cg_id = m_cg_db.idxRnk[0].id;
m_cg_id = m_cg_db.idxRank[0].grp;
m_choice->Select(0);
// Update grid by simulating wxEVT_COMMAND_CHOICE_SELECTED event.
wxCommandEvent e(wxEVT_COMMAND_CHOICE_SELECTED, m_grid->GetId());
e.SetInt(0);
OnChoice(e);
Update();
}
// Register frame specific hotkey(s).
{
wxAcceleratorEntry entries[1];
entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_FOCUS_DECOMPOSED);
entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_FOCUS_SOURCE);
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
}
@@ -86,13 +83,12 @@ wxZRColaCharacterCatalogPanel::~wxZRColaCharacterCatalogPanel()
void wxZRColaCharacterCatalogPanel::OnChoice(wxCommandEvent& event)
{
ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[event.GetSelection()];
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[event.GetSelection()];
m_cg_id = cg.id;
m_grid->SetCharacters(wxString(cg.data + cg.name_len, cg.char_len));
// As size of the grid might have changed, relayout the panel.
Layout();
if (m_cg_id != cg.grp) {
m_cg_id = cg.grp;
Update();
}
event.Skip();
}
@@ -100,10 +96,10 @@ void wxZRColaCharacterCatalogPanel::OnChoice(wxCommandEvent& event)
void wxZRColaCharacterCatalogPanel::OnGridClick(wxGridEvent& event)
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
app->m_mainWnd->m_panel->m_source->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
app->m_mainWnd->m_panel->m_source->SetFocus();
}
event.Skip();
@@ -115,10 +111,10 @@ void wxZRColaCharacterCatalogPanel::OnGridKeyDown(wxKeyEvent& event)
switch (event.GetKeyCode()) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(m_grid->GetCursorRow(), m_grid->GetCursorColumn()));
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
app->m_mainWnd->m_panel->m_source->WriteText(m_grid->GetCellValue(m_grid->GetCursorRow(), m_grid->GetCursorColumn()));
app->m_mainWnd->m_panel->m_source->SetFocus();
event.StopPropagation();
return;
@@ -129,11 +125,21 @@ void wxZRColaCharacterCatalogPanel::OnGridKeyDown(wxKeyEvent& event)
}
void wxZRColaCharacterCatalogPanel::OnFocusDecomposed(wxCommandEvent& event)
void wxZRColaCharacterCatalogPanel::OnShowAll(wxCommandEvent& event)
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
UNREFERENCED_PARAMETER(event);
Update();
event.Skip();
}
void wxZRColaCharacterCatalogPanel::OnFocusSource(wxCommandEvent& event)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
app->m_mainWnd->m_panel->m_source->SetFocus();
event.StopPropagation();
return;
@@ -143,6 +149,35 @@ void wxZRColaCharacterCatalogPanel::OnFocusDecomposed(wxCommandEvent& event)
}
void wxZRColaCharacterCatalogPanel::Update()
{
const ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRank[m_choice->GetSelection()];
if (m_show_all->GetValue()) {
m_grid->SetCharacters(
wxString(cg.chrlst(), cg.chrlst_end()),
wxArrayShort(reinterpret_cast<const short*>(cg.chrshow()), reinterpret_cast<const short*>(cg.chrshow_end())));
} else {
// Select frequently used characters only.
const wchar_t *src = cg.chrlst();
const unsigned __int16 *shown = cg.chrshow();
wxArrayString chars;
for (size_t i = 0, i_end = cg.chrlst_len(), j = 0; i < i_end; j++) {
for (unsigned __int16 k = 0, mask = shown[j]; k < 16 && i < i_end; k++, mask >>= 1) {
size_t len = wcsnlen(src + i, i_end - i);
if (mask & 1)
chars.Add(wxString(src + i, len));
i += len + 1;
}
}
m_grid->SetCharacters(chars);
}
// As size of the grid might have changed, relayout the panel.
Layout();
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaCharacterCatalogPanel
//////////////////////////////////////////////////////////////////////////
@@ -160,34 +195,45 @@ wxString wxPersistentZRColaCharacterCatalogPanel::GetKind() const
void wxPersistentZRColaCharacterCatalogPanel::Save() const
{
const wxZRColaCharacterCatalogPanel * const wnd = static_cast<const wxZRColaCharacterCatalogPanel*>(GetWindow());
auto wnd = static_cast<const wxZRColaCharacterCatalogPanel*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("charGroup"), wnd->m_cg_id);
SaveValue(wxT("showAll" ), wnd->m_show_all->GetValue());
}
bool wxPersistentZRColaCharacterCatalogPanel::Restore()
{
wxZRColaCharacterCatalogPanel * const wnd = static_cast<wxZRColaCharacterCatalogPanel*>(GetWindow());
auto wnd = dynamic_cast<wxZRColaCharacterCatalogPanel*>(GetWindow());
bool update = false;
// Restore selected character group.
int cg_id;
if (RestoreValue(wxT("charGroup"), &cg_id)) {
for (size_t i = 0, n = wnd->m_cg_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = wnd->m_cg_db.idxRnk[i];
if (cg.id == cg_id) {
wnd->m_cg_id = cg.id;
wnd->m_choice->Select(i);
// Update grid by simulating wxEVT_COMMAND_CHOICE_SELECTED event.
wxCommandEvent e(wxEVT_COMMAND_CHOICE_SELECTED, wnd->m_grid->GetId());
e.SetInt(i);
wnd->OnChoice(e);
for (size_t i = 0, n = wnd->m_cg_db.idxRank.size(); i < n; i++) {
const ZRCola::chrgrp_db::chrgrp &cg = wnd->m_cg_db.idxRank[i];
if (cg.grp == cg_id) {
if (wnd->m_cg_id != cg.grp) {
wnd->m_cg_id = cg.grp;
wnd->m_choice->Select(i);
update = true;
}
break;
}
}
}
bool show_all;
if (RestoreValue(wxT("showAll"), &show_all)) {
if (wnd->m_show_all->GetValue() != show_all) {
wnd->m_show_all->SetValue(show_all);
update = true;
}
}
if (update)
wnd->Update();
return true;
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -38,7 +38,7 @@ class wxZRColaCharacterCatalogPanel : public wxZRColaCharacterCatalogPanelBase
public:
enum
{
wxID_FOCUS_DECOMPOSED = 6000,
wxID_FOCUS_SOURCE = 6000,
};
wxZRColaCharacterCatalogPanel(wxWindow* parent);
@@ -50,9 +50,12 @@ protected:
virtual void OnChoice(wxCommandEvent& event);
virtual void OnGridClick(wxGridEvent& event);
virtual void OnGridKeyDown(wxKeyEvent& event);
void OnFocusDecomposed(wxCommandEvent& event);
virtual void OnShowAll(wxCommandEvent& event);
void OnFocusSource(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
void Update();
protected:
ZRCola::chrgrp_db m_cg_db; ///< Character group database
int m_cg_id; ///< Selected character group ID

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -69,7 +69,44 @@ void wxZRColaCharGrid::Init()
void wxZRColaCharGrid::SetCharacters(const wxString &chars)
{
m_chars = chars;
m_chars.Clear();
const wxCStrData chr = chars.GetData();
for (size_t i = 0, i_end = chars.Length(), i_next; i < i_end; i = i_next + 1) {
i_next = i + _tcsnlen(chr + i, i_end - i);
m_chars.Add(wxString(chr + i, chr + i_next));
};
m_relevance.Clear();
m_regenerate = true;
// Invoke OnSize(), which will populate the grid.
wxSizeEvent e(GetSize(), m_windowId);
e.SetEventObject(this);
HandleWindowEvent(e);
}
void wxZRColaCharGrid::SetCharacters(const wxArrayString &chars)
{
m_chars = chars;
m_relevance.Clear();
m_regenerate = true;
// Invoke OnSize(), which will populate the grid.
wxSizeEvent e(GetSize(), m_windowId);
e.SetEventObject(this);
HandleWindowEvent(e);
}
void wxZRColaCharGrid::SetCharacters(const wxString &chars, const wxArrayShort &relevance)
{
m_chars.Clear();
const wxCStrData chr = chars.GetData();
for (size_t i = 0, i_end = chars.Length(), i_next; i < i_end; i = i_next + 1) {
i_next = i + _tcsnlen(chr + i, i_end - i);
m_chars.Add(wxString(chr + i, chr + i_next));
};
m_relevance = relevance;
m_regenerate = true;
// Invoke OnSize(), which will populate the grid.
@@ -81,25 +118,23 @@ void wxZRColaCharGrid::SetCharacters(const wxString &chars)
wxString wxZRColaCharGrid::GetToolTipText(int idx)
{
wxASSERT_MSG(idx < (int)m_chars.Length(), wxT("index out of bounds"));
wxASSERT_MSG(idx < (int)m_chars.GetCount(), wxT("index out of bounds"));
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
const auto &chr = m_chars[idx];
// See if this character has a key sequence registered.
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(wchar_t)*chr.length()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, chr.data(), chr.length());
ZRCola::keyseq_db::indexKey::size_type start;
bool found;
char ks[sizeof(ZRCola::keyseq_db::keyseq)] = {};
((ZRCola::keyseq_db::keyseq*)ks)->chr = m_chars[idx];
found = app->m_ks_db.idxChr.find(*(ZRCola::keyseq_db::keyseq*)ks, start);
if (found) {
if (app->m_ks_db.idxChr.find(*ks, start)) {
ZRCola::keyseq_db::keyseq &seq = app->m_ks_db.idxChr[start];
wxString ks_str;
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq, seq.seq_len, ks_str))
return wxString::Format(wxT("U+%04X (%s)"), (int)m_chars[idx], ks_str.c_str());
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq(), seq.seq_len(), ks_str))
return wxString::Format(wxT("U+%s (%s)"), ZRCola::GetUnicodeDump(chr.data(), chr.length(), _T("+")).c_str(), ks_str.c_str());
}
return wxString::Format(wxT("U+%04X"), (int)m_chars[idx]);
return wxString::Format(wxT("U+%s"), ZRCola::GetUnicodeDump(chr.data(), chr.length(), _T("+")).c_str());
}
@@ -115,17 +150,17 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
// Calculate initial estimate of columns and rows.
wxSize size(event.GetSize());
size_t
char_len = m_chars.Length();
char_count = m_chars.GetCount();
int
width = size.GetWidth() - m_rowLabelWidth - m_extraWidth,
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1),
rows = std::max<int>((char_len + cols - 1) / cols, 1);
width = size.GetWidth() - m_rowLabelWidth - m_extraWidth,
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1),
rows = std::max<int>((char_count + cols - 1) / cols, 1);
if (m_colLabelHeight + rows*wxZRColaCharacterGridRowHeight + m_extraHeight > size.GetHeight()) {
// Vertical scrollbar will be shown. Adjust the width and recalculate layout to avoid horizontal scrollbar.
width = std::max<int>(width - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this), 0);
cols = std::max<int>(width / wxZRColaCharacterGridColumnWidth, 1);
rows = std::max<int>((char_len + cols - 1) / cols, 1);
rows = std::max<int>((char_count + cols - 1) / cols, 1);
}
BeginBatch();
@@ -135,8 +170,19 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
wxGridStringTable *table = new wxGridStringTable(rows, cols);
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
table->SetValue(r, c, i < (int)char_len ? wxString(1, m_chars[i]) : wxEmptyString);
table->SetValue(r, c, i < (int)char_count ? m_chars[i] : wxEmptyString);
SetTable(table, true);
if (!m_relevance.IsEmpty()) {
const wxColour colour_def;
const wxColour colour_irr = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT);
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
SetCellBackgroundColour(r, c, i >= (int)char_count || ((unsigned short)(m_relevance[i/16]) & (1<<(i%16))) ? colour_def : colour_irr);
} else {
for (int r = 0, i = 0; r < rows; r++)
for (int c = 0; c < cols; c++, i++)
SetAttr(r, c, NULL);
}
m_regenerate = false;
}
@@ -195,7 +241,7 @@ void wxZRColaCharGrid::OnMotion(wxMouseEvent& event)
return;
size_t toolTipIdx = row*m_numCols + col;
if (toolTipIdx >= m_chars.Length()) {
if (toolTipIdx >= m_chars.GetCount()) {
// Index out of range.
m_toolTipIdx = (size_t)-1;
m_timerToolTip.Stop();
@@ -219,7 +265,7 @@ void wxZRColaCharGrid::OnTooltipTimer(wxTimerEvent& event)
{
event.Skip();
if (m_toolTipIdx >= m_chars.Length())
if (m_toolTipIdx >= m_chars.GetCount())
return;
GetGridWindow()->SetToolTip(GetToolTipText(m_toolTipIdx));

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -54,16 +54,31 @@ public:
///
/// Sets new array of characters to display
///
/// \param[in] chars The string containing characters to display
/// \param[in] chars The string containing characters to display (zero delimited)
///
void SetCharacters(const wxString &chars);
///
/// Sets new array of characters to display
///
/// \param[in] chars The array of characters to display
///
void SetCharacters(const wxArrayString &chars);
///
/// Sets new array of characters to display
///
/// \param[in] chars The string containing characters to display (zero delimited)
/// \param[in] relevance Bit-array of \p chars relevance (1=more relevant, 0=less relevant)
///
void SetCharacters(const wxString &chars, const wxArrayShort &relevance);
///
/// Returns displayed characters
///
/// \returns The string containing displayed characters
///
inline wxString GetCharacters() const
inline const wxArrayString& GetCharacters() const
{
return m_chars;
}
@@ -75,10 +90,14 @@ public:
///
/// \returns Grid coordinates of selected character or (-1, -1) if character not found.
///
inline wxGridCellCoords GetCharacterCoords(wchar_t c) const
inline wxGridCellCoords GetCharacterCoords(const wxString &c) const
{
int i = m_chars.Find(c);
return i != wxNOT_FOUND ? wxGridCellCoords(i / m_numCols, i % m_numCols) : wxGridCellCoords(-1, -1);
for (size_t i = 0, n = m_chars.GetCount(); ; i++) {
if (i >= n)
return wxGridCellCoords(-1, -1);
else if (m_chars[i] == c)
return wxGridCellCoords(i / m_numCols, i % m_numCols);
}
}
protected:
@@ -91,14 +110,15 @@ protected:
DECLARE_EVENT_TABLE()
private:
void Init(); // common part of all ctors
void Init(); // common part of all ctors
protected:
wxString m_chars; ///< Array of Unicode characters to display in the grid
wxArrayString m_chars; ///< Array of Unicode characters to display in the grid
wxArrayShort m_relevance; ///< Bit-array of `m_chars` relevance
private:
bool m_regenerate; ///< Force regenerate grid table
bool m_isResizing; ///< Prevents nesting of OnSize() method.
wxTimer m_timerToolTip; ///< Timer for displaying tooltip
size_t m_toolTipIdx; ///< Index of cell for tooltip display
bool m_regenerate; ///< Force regenerate grid table
bool m_isResizing; ///< Prevents nesting of OnSize() method.
wxTimer m_timerToolTip; ///< Timer for displaying tooltip
size_t m_toolTipIdx; ///< Index of cell for tooltip display
};

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -80,7 +80,7 @@ void wxPersistentZRColaCharRequest::Save() const
{
wxPersistentDialog::Save();
const wxZRColaCharRequest * const wnd = static_cast<const wxZRColaCharRequest*>(GetWindow());
auto wnd = static_cast<const wxZRColaCharRequest*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("character"), wnd->m_character->GetValue());
SaveValue(wxT("context"), wnd->m_context->GetValue());
@@ -89,7 +89,7 @@ void wxPersistentZRColaCharRequest::Save() const
bool wxPersistentZRColaCharRequest::Restore()
{
wxZRColaCharRequest * const wnd = static_cast<wxZRColaCharRequest*>(GetWindow());
auto wnd = dynamic_cast<wxZRColaCharRequest*>(GetWindow());
wxString str;
if (RestoreValue(wxT("character"), &str))

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
/*
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -20,6 +20,174 @@
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////
// wxZRColaUTF16CharValidator
//////////////////////////////////////////////////////////////////////
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUTF16CharValidator, wxValidator);
wxZRColaUTF16CharValidator::wxZRColaUTF16CharValidator(wchar_t *val) :
m_val(val),
wxValidator()
{
}
wxObject* wxZRColaUTF16CharValidator::Clone() const
{
return new wxZRColaUTF16CharValidator(*this);
}
bool wxZRColaUTF16CharValidator::Validate(wxWindow *parent)
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
if (!ctrl->IsEnabled()) return true;
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, parent);
}
bool wxZRColaUTF16CharValidator::TransferToWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
if (m_val)
((wxTextCtrl*)GetWindow())->SetValue(wxString::Format(wxT("%04X"), *m_val));
return true;
}
bool wxZRColaUTF16CharValidator::TransferFromWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, NULL, m_val);
}
bool wxZRColaUTF16CharValidator::Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wchar_t *val_out)
{
const wxStringCharType *buf = val_in;
wchar_t chr = 0;
for (size_t i = i_start;;) {
if (i >= i_end) {
// End of Unicode found.
if (val_out) *val_out = chr;
return true;
} else if (i >= i_start + 4) {
// Maximum characters exceeded.
ctrl->SetFocus();
ctrl->SetSelection(i, i_end);
wxMessageBox(_("Too many digits in Unicode."), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return false;
} else if (_T('0') <= buf[i] && buf[i] <= _T('9')) {
// Digit found.
chr = (chr << 4) | (buf[i] - _T('0'));
i++;
} else if (_T('A') <= buf[i] && buf[i] <= _T('F')) {
// Capital letter found.
chr = (chr << 4) | (buf[i] - _T('A') + 10);
i++;
} else if (_T('a') <= buf[i] && buf[i] <= _T('f')) {
// Lower letter found.
chr = (chr << 4) | (buf[i] - _T('a') + 10);
i++;
} else {
// Invalid character found.
ctrl->SetFocus();
ctrl->SetSelection(i, i + 1);
wxMessageBox(wxString::Format(_("Invalid character in Unicode found: %c"), buf[i]), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
return false;
}
}
}
//////////////////////////////////////////////////////////////////////
// wxZRColaUnicodeDumpValidator
//////////////////////////////////////////////////////////////////////
wxIMPLEMENT_DYNAMIC_CLASS(wxZRColaUnicodeDumpValidator, wxValidator);
wxZRColaUnicodeDumpValidator::wxZRColaUnicodeDumpValidator(wxString *val) :
m_val(val),
wxValidator()
{
}
wxObject* wxZRColaUnicodeDumpValidator::Clone() const
{
return new wxZRColaUnicodeDumpValidator(*this);
}
bool wxZRColaUnicodeDumpValidator::Validate(wxWindow *parent)
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
if (!ctrl->IsEnabled()) return true;
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, parent);
}
bool wxZRColaUnicodeDumpValidator::TransferToWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
if (m_val)
((wxTextCtrl*)GetWindow())->SetValue(ZRCola::GetUnicodeDumpW(m_val->c_str(), m_val->length(), L"+"));
return true;
}
bool wxZRColaUnicodeDumpValidator::TransferFromWindow()
{
wxASSERT(GetWindow()->IsKindOf(CLASSINFO(wxTextCtrl)));
wxTextCtrl *ctrl = (wxTextCtrl*)GetWindow();
wxString val(ctrl->GetValue());
return Parse(val, 0, val.Length(), ctrl, NULL, m_val);
}
bool wxZRColaUnicodeDumpValidator::Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wxString *val_out)
{
const wxStringCharType *buf = val_in;
wxString str;
for (size_t i = i_start;;) {
const wxStringCharType *buf_next;
wchar_t chr;
if ((buf_next = wmemchr(buf + i, L'+', i_end - i)) != NULL) {
// Unicode dump separator found.
if (!wxZRColaUTF16CharValidator::Parse(val_in, i, buf_next - buf, ctrl, parent, &chr))
return false;
str += chr;
i = buf_next - buf + 1;
} else if (wxZRColaUTF16CharValidator::Parse(val_in, i, i_end, ctrl, parent, &chr)) {
// The rest of the FQDN parsed succesfully.
if (chr) str += chr;
if (val_out) *val_out = str;
return true;
} else
return false;
}
}
//////////////////////////////////////////////////////////////////////////
// wxZRColaCharSelect
//////////////////////////////////////////////////////////////////////////
@@ -30,21 +198,30 @@ wxDEFINE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) :
m_searchChanged(false),
m_unicodeChanged(false),
m_char(0),
m_searchThread(NULL),
wxZRColaCharSelectBase(parent)
{
// Set tag lookup locale.
wxLanguage language = dynamic_cast<ZRColaApp*>(wxTheApp)->m_lang_ui;
if (wxLANGUAGE_DEFAULT == language ||
wxLANGUAGE_ENGLISH <= language && language <= wxLANGUAGE_ENGLISH_ZIMBABWE) m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT);
else if (wxLANGUAGE_RUSSIAN <= language && language <= wxLANGUAGE_RUSSIAN_UKRAINE ) m_locale = MAKELCID(MAKELANGID(LANG_RUSSIAN , SUBLANG_DEFAULT), SORT_DEFAULT);
else if (wxLANGUAGE_SLOVENIAN == language ) m_locale = MAKELCID(MAKELANGID(LANG_SLOVENIAN, SUBLANG_DEFAULT), SORT_DEFAULT);
else m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT);
Connect(wxID_ANY, wxEVT_SEARCH_COMPLETE, wxThreadEventHandler(wxZRColaCharSelect::OnSearchComplete), NULL, this);
m_unicode->SetValidator(wxHexValidator<wchar_t>(&m_char, wxNUM_VAL_DEFAULT, 4));
m_search_more->SetLabel(_(L"▸ Search Options"));
m_unicode->SetValidator(wxZRColaUnicodeDumpValidator(&m_char));
// Fill categories.
ZRColaApp *app = (ZRColaApp*)wxTheApp;
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrcat_db::chrcat &cc = app->m_cc_db.idxRnk[i];
int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name, cc.name_len), wxT("ZRCola-zrcdb")), i);
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name(), cc.name_len()), wxT("ZRCola-zrcdb")), i);
m_categories->Check(idx);
m_ccOrder.insert(std::make_pair(cc.id, idx));
m_ccOrder.insert(std::make_pair(cc.cat, idx));
}
ResetResults();
@@ -72,26 +249,26 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
if (m_unicodeChanged) {
if (m_unicode->GetValidator()->TransferFromWindow()) {
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_gridPreview->SetCellValue(wxString(1, m_char), 0, 0);
m_gridPreview->SetCellValue(m_char, 0, 0);
char chr[sizeof(ZRCola::character_db::character)] = {};
((ZRCola::character_db::character*)chr)->chr = m_char;
std::unique_ptr<ZRCola::character_db::character> chr((ZRCola::character_db::character*)new char[sizeof(ZRCola::character_db::character) + sizeof(wchar_t)*m_char.length()]);
chr->ZRCola::character_db::character::character(m_char.data(), m_char.length());
size_t start;
if (app->m_chr_db.idxChr.find(*(ZRCola::character_db::character*)chr, start)) {
const ZRCola::character_db::character &chr = app->m_chr_db.idxChr[start];
// Update characted description.
m_description->SetValue(wxString(chr.data, chr.desc_len));
if (app->m_chr_db.idxChr.find(*chr, start)) {
const auto &chr = app->m_chr_db.idxChr[start];
// Update character description.
m_description->SetValue(wxString(chr.desc(), chr.desc_len()));
{
// See if this character has a key sequence registered.
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(wchar_t)*m_char.length()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(NULL, 0, m_char.data(), m_char.length());
ZRCola::keyseq_db::indexKey::size_type start;
char ks[sizeof(ZRCola::keyseq_db::keyseq)] = {};
((ZRCola::keyseq_db::keyseq*)ks)->chr = m_char;
if (app->m_ks_db.idxChr.find(*(ZRCola::keyseq_db::keyseq*)ks, start)) {
if (app->m_ks_db.idxChr.find(*ks, start)) {
ZRCola::keyseq_db::keyseq &seq = app->m_ks_db.idxChr[start];
wxString ks_str;
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq, seq.seq_len, ks_str))
if (ZRCola::keyseq_db::GetSequenceAsText(seq.seq(), seq.seq_len(), ks_str))
m_shortcut->SetValue(ks_str);
else
m_shortcut->SetValue(wxEmptyString);
@@ -99,18 +276,16 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
m_shortcut->SetValue(wxEmptyString);
}
{
char cc[sizeof(ZRCola::chrcat_db::chrcat)] = {};
((ZRCola::chrcat_db::chrcat*)cc)->id = chr.cat;
size_t start;
// Update character category.
if (app->m_cc_db.idxChrCat.find(*((ZRCola::chrcat_db::chrcat*)cc), start)) {
const ZRCola::chrcat_db::chrcat &cat = app->m_cc_db.idxChrCat[start];
m_category->SetValue(wxGetTranslation(wxString(cat.name, cat.name_len), wxT("ZRCola-zrcdb")));
if (app->m_cc_db.idxChrCat.find(ZRCola::chrcat_db::chrcat(chr.cat), start)) {
const auto &cat = app->m_cc_db.idxChrCat[start];
m_category->SetValue(wxGetTranslation(wxString(cat.name(), cat.name_len()), wxT("ZRCola-zrcdb")));
} else
m_category->SetValue(wxEmptyString);
}
// Update related characters.
m_gridRelated->SetCharacters(wxString(chr.data + chr.desc_len, chr.rel_len));
m_gridRelated->SetCharacters(wxString(chr.rel(), chr.rel_end()));
} else {
m_description->SetValue(wxEmptyString);
m_shortcut->SetValue(wxEmptyString);
@@ -118,6 +293,43 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
m_gridRelated->ClearGrid();
}
// Find character tags.
std::list<std::wstring> tag_names;
std::unique_ptr<ZRCola::chrtag_db::chrtag> ct((ZRCola::chrtag_db::chrtag*)new char[sizeof(ZRCola::chrtag_db::chrtag) + sizeof(wchar_t)*m_char.length()]);
ct->ZRCola::chrtag_db::chrtag::chrtag(m_char.data(), m_char.length());
size_t end;
if (app->m_ct_db.idxChr.find(*ct, start, end)) {
for (size_t i = start; i < end; i++) {
const ZRCola::chrtag_db::chrtag &ct = app->m_ct_db.idxChr[i];
// Find tag names.
size_t start, end;
if (app->m_tn_db.idxTag.find(ZRCola::tagname_db::tagname(ct.tag, m_locale), start, end)) {
for (size_t i = start; i < end; i++) {
const ZRCola::tagname_db::tagname &tn = app->m_tn_db.idxTag[i];
// Add tag name to the list (prevent duplicates).
for (auto name = tag_names.cbegin(), name_end = tag_names.cend();; ++name) {
if (name == name_end) {
// Add name to the list.
tag_names.push_back(std::wstring(tn.name(), tn.name_end()));
break;
} else if (ZRCola::tagname_db::tagname::CompareName(m_locale, name->data(), (unsigned __int16)name->length(), tn.name(), tn.name_len()) == 0)
// Name is already on the list.
break;
}
}
}
}
}
wxString tags;
for (auto name = tag_names.cbegin(), name_end = tag_names.cend(); name != name_end; ++name) {
if (!tags.empty())
tags += _(", ");
tags += *name;
}
m_tags->SetValue(tags);
m_gridRelated->GoToCell(m_historyCursor->m_related.m_selected);
wxGridCellCoords coord(m_gridResults->GetCharacterCoords(m_char));
@@ -135,17 +347,17 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
wxString val(m_search->GetValue());
if (!val.IsEmpty()) {
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_searchThread = new SearchThread(this);
m_searchThread->m_search.assign(val.c_str(), val.Length());
// Select categories.
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrcat_db::chrcat &cc = app->m_cc_db.idxRnk[i];
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
if (m_categories->IsChecked(i))
m_searchThread->m_cats.insert(cc.id);
m_searchThread->m_cats.insert(cc.cat);
}
if (m_searchThread->Run() != wxTHREAD_NO_ERROR) {
@@ -169,12 +381,28 @@ void wxZRColaCharSelect::OnSearchText(wxCommandEvent& event)
}
void wxZRColaCharSelect::OnSearchMore(wxHyperlinkEvent& event)
{
event.StopPropagation();
if (m_search_panel->IsShown()) {
m_search_panel->Show(false);
m_search_more->SetLabel(_(L"▸ Search Options"));
} else {
m_search_panel->Show(true);
m_search_more->SetLabel(_(L"▾ Search Options"));
}
this->Layout();
}
void wxZRColaCharSelect::OnCategoriesAll(wxHyperlinkEvent& event)
{
event.StopPropagation();
ZRColaApp *app = (ZRColaApp*)wxTheApp;
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++)
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
m_categories->Check(i, true);
m_searchChanged = true;
@@ -185,8 +413,8 @@ void wxZRColaCharSelect::OnCategoriesNone(wxHyperlinkEvent& event)
{
event.StopPropagation();
ZRColaApp *app = (ZRColaApp*)wxTheApp;
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++)
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
m_categories->Check(i, false);
m_searchChanged = true;
@@ -197,8 +425,8 @@ void wxZRColaCharSelect::OnCategoriesInvert(wxHyperlinkEvent& event)
{
event.StopPropagation();
ZRColaApp *app = (ZRColaApp*)wxTheApp;
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++)
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
m_categories->Check(i, !m_categories->IsChecked(i));
m_searchChanged = true;
@@ -219,10 +447,10 @@ void wxZRColaCharSelect::OnSearchComplete(wxThreadEvent& event)
if (m_searchThread) {
// Display results.
wxString chars;
wxArrayString chars;
chars.reserve(m_searchThread->m_hits.size());
for (std::vector<std::pair<ZRCola::charrank_t, wchar_t> >::const_iterator i = m_searchThread->m_hits.cbegin(), i_end = m_searchThread->m_hits.cend(); i != i_end; ++i)
chars += i->second;
for (auto i = m_searchThread->m_hits.cbegin(), i_end = m_searchThread->m_hits.cend(); i != i_end; ++i)
chars.Add(i->second);
m_gridResults->SetCharacters(chars);
m_searchThread->Delete();
@@ -239,7 +467,7 @@ void wxZRColaCharSelect::OnResultSelectCell(wxGridEvent& event)
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val[0]);
NavigateTo(val);
}
@@ -249,7 +477,7 @@ void wxZRColaCharSelect::OnResultCellDClick(wxGridEvent& event)
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
@@ -263,7 +491,7 @@ void wxZRColaCharSelect::OnResultsKeyDown(wxKeyEvent& event)
case WXK_NUMPAD_ENTER:
wxString val(m_gridResults->GetCellValue(m_gridResults->GetCursorRow(), m_gridResults->GetCursorColumn()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
@@ -282,7 +510,7 @@ void wxZRColaCharSelect::OnRecentSelectCell(wxGridEvent& event)
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val[0]);
NavigateTo(val);
}
@@ -292,7 +520,7 @@ void wxZRColaCharSelect::OnRecentCellDClick(wxGridEvent& event)
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
@@ -306,7 +534,7 @@ void wxZRColaCharSelect::OnRecentKeyDown(wxKeyEvent& event)
case WXK_NUMPAD_ENTER:
wxString val(m_gridRecent->GetCellValue(m_gridRecent->GetCursorRow(), m_gridRecent->GetCursorColumn()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
NavigateTo(val);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
@@ -366,7 +594,7 @@ void wxZRColaCharSelect::OnRelatedSelectCell(wxGridEvent& event)
wxString val(m_gridRelated->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val[0]);
NavigateTo(val);
}
@@ -374,15 +602,15 @@ void wxZRColaCharSelect::OnOKButtonClick(wxCommandEvent& event)
{
event.Skip();
wxString
recent(m_gridRecent->GetCharacters()),
val(1, m_char);
for (size_t i = 0, n = recent.Length(); i < n; i++) {
const wxStringCharType c = recent[i];
const wxArrayString &recent = m_gridRecent->GetCharacters();
wxArrayString val;
val.reserve(recent.GetCount() + 1);
val.Add(m_char);
for (size_t i = 0, n = recent.GetCount(); i < n; i++) {
const wxString &c = recent[i];
if (c != m_char)
val += c;
val.Add(c);
}
m_gridRecent->SetCharacters(val);
}
@@ -390,15 +618,15 @@ void wxZRColaCharSelect::OnOKButtonClick(wxCommandEvent& event)
void wxZRColaCharSelect::ResetResults()
{
// Fill the results.
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
size_t i, n = app->m_chr_db.idxChr.size();
wxString val;
wxArrayString val;
val.reserve(n);
for (i = 0; i < n; i++) {
const ZRCola::character_db::character &chr = app->m_chr_db.idxChr[i];
std::map<ZRCola::chrcatid_t, int>::const_iterator idx = m_ccOrder.find(chr.cat);
const auto &chr = app->m_chr_db.idxChr[i];
auto idx = m_ccOrder.find(chr.cat);
if (idx == m_ccOrder.end() || m_categories->IsChecked(idx->second))
val += chr.chr;
val.Add(wxString(chr.chr(), chr.chr_len()));
}
m_gridResults->SetCharacters(val);
}
@@ -432,7 +660,7 @@ void wxZRColaCharSelect::NavigateBy(int offset)
}
m_navigateBack->Enable(m_historyCursor != m_history.begin());
std::list<NavigationState>::iterator cursor_next(m_historyCursor);
auto cursor_next = m_historyCursor;
++cursor_next;
m_navigateForward->Enable(cursor_next != m_history.end());
@@ -442,7 +670,7 @@ void wxZRColaCharSelect::NavigateBy(int offset)
}
void wxZRColaCharSelect::NavigateTo(wchar_t c)
void wxZRColaCharSelect::NavigateTo(const wxString &c)
{
if (m_char != c) {
// Update history state
@@ -459,7 +687,7 @@ void wxZRColaCharSelect::NavigateTo(wchar_t c)
m_historyCursor = m_history.insert(m_historyCursor, state);
// Purge the history's tail.
std::list<NavigationState>::iterator cursor_next(m_historyCursor);
auto cursor_next = m_historyCursor;
++cursor_next;
m_history.erase(cursor_next, m_history.end());
@@ -482,18 +710,25 @@ wxZRColaCharSelect::SearchThread::SearchThread(wxZRColaCharSelect *parent) :
wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
std::map<wchar_t, ZRCola::charrank_t> hits;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
std::map<std::wstring, ZRCola::charrank_t> hits;
if (TestDestroy()) return (wxThread::ExitCode)1;
{
// Search by indexes and merge results.
std::map<wchar_t, ZRCola::charrank_t> hits_sub;
// Search by tags: Get tags with given names. Then, get characters of found tags.
std::map<ZRCola::tagid_t, unsigned __int16> hits_tag;
if (!app->m_tn_db.Search(m_search.c_str(), m_parent->m_locale, hits_tag, TestDestroyS, this)) return (wxThread::ExitCode)1;
if (!app->m_ct_db.Search(hits_tag, app->m_chr_db, m_cats, hits, TestDestroyS, this)) return (wxThread::ExitCode)1;
}
{
// Search by description and merge results.
std::map<std::wstring, ZRCola::charrank_t> hits_sub;
if (!app->m_chr_db.Search(m_search.c_str(), m_cats, hits, hits_sub, TestDestroyS, this)) return (wxThread::ExitCode)1;
for (std::map<wchar_t, ZRCola::charrank_t>::const_iterator i = hits_sub.cbegin(), i_end = hits_sub.cend(); i != i_end; ++i) {
for (auto i = hits_sub.cbegin(), i_end = hits_sub.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
std::map<wchar_t, ZRCola::charrank_t>::iterator idx = hits.find(i->first);
auto idx = hits.find(i->first);
if (idx == hits.end())
hits.insert(std::make_pair(i->first, i->second / 4));
else
@@ -503,7 +738,7 @@ wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
// Get best rank.
ZRCola::charrank_t rank_ref = 0;
for (std::map<wchar_t, ZRCola::charrank_t>::const_iterator i = hits.cbegin(), i_end = hits.cend(); i != i_end; ++i) {
for (auto i = hits.cbegin(), i_end = hits.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
if (i->second > rank_ref)
rank_ref = i->second;
@@ -512,12 +747,12 @@ wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
// Now sort the characters by rank (taking only top 3/4 by rank).
ZRCola::charrank_t rank_threshold = rank_ref*3/4;
m_hits.reserve(hits.size());
for (std::map<wchar_t, ZRCola::charrank_t>::const_iterator i = hits.cbegin(), i_end = hits.cend(); i != i_end; ++i) {
for (auto i = hits.cbegin(), i_end = hits.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
if (i->second > rank_threshold)
m_hits.push_back(std::make_pair(i->second, i->first));
}
std::qsort(m_hits.data(), m_hits.size(), sizeof(std::pair<ZRCola::charrank_t, wchar_t>), CompareHits);
std::qsort(m_hits.data(), m_hits.size(), sizeof(std::pair<ZRCola::charrank_t, std::wstring>), CompareHits);
// Signal the event handler that this thread is going to be destroyed.
// NOTE: here we assume that using the m_parent pointer is safe,
@@ -562,37 +797,79 @@ void wxPersistentZRColaCharSelect::Save() const
{
wxPersistentDialog::Save();
const wxZRColaCharSelect * const wnd = static_cast<const wxZRColaCharSelect*>(GetWindow());
auto wnd = static_cast<const wxZRColaCharSelect*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
SaveValue(wxT("recentChars"), wnd->m_gridRecent->GetCharacters());
wxString str, str2;
auto &recent = wnd->m_gridRecent->GetCharacters();
for (size_t i = 0, n = recent.GetCount(); i < n; i++) {
if (i) str2 += wxT('|');
auto &chr = recent[i];
for (size_t j = 0, m = chr.Length(); j < m; j++) {
if (j) str2 += wxT('+');
str2 += wxString::Format(wxT("%04X"), chr[j]);
}
if (chr.Length() == 1)
str += chr[0];
}
SaveValue(wxT("recentChars" ), str ); // Save in legacy format for backward compatibility.
SaveValue(wxT("recentChars2"), str2); // Save in native format
ZRColaApp *app = (ZRColaApp*)wxTheApp;
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrcat_db::chrcat &cc = app->m_cc_db.idxRnk[i];
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
wxString name(wxT("category"));
name.Append(cc.id.data, _countof(cc.id.data));
name.Append(cc.cat.data, _countof(cc.cat.data));
SaveValue(name, wnd->m_categories->IsChecked(i));
}
SaveValue(wxT("searchPanel"), wnd->m_search_panel->IsShown());
}
bool wxPersistentZRColaCharSelect::Restore()
{
wxZRColaCharSelect * const wnd = static_cast<wxZRColaCharSelect*>(GetWindow());
auto wnd = dynamic_cast<wxZRColaCharSelect*>(GetWindow());
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString recent;
if (RestoreValue(wxT("recentChars"), &recent))
wnd->m_gridRecent->SetCharacters(recent);
wxString str;
if (RestoreValue(wxT("recentChars2"), &str)) {
// Native format found.
wxArrayString val;
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
wxString chr;
for (wxStringTokenizer tok_chr(tok.GetNextToken(), wxT("+")); tok_chr.HasMoreTokens(); )
chr += (wchar_t)_tcstoul(tok_chr.GetNextToken().c_str(), NULL, 16);
val.Add(chr);
}
wnd->m_gridRecent->SetCharacters(val);
} else if (RestoreValue(wxT("recentChars"), &str)) {
// Legacy value found.
wxArrayString val;
for (size_t i = 0, n = str.Length(); i < n; i++)
val.Add(wxString(1, str[i]));
wnd->m_gridRecent->SetCharacters(val);
}
ZRColaApp *app = (ZRColaApp*)wxTheApp;
for (size_t i = 0, n = app->m_cc_db.idxRnk.size(); i < n; i++) {
const ZRCola::chrcat_db::chrcat &cc = app->m_cc_db.idxRnk[i];
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
const auto &cc = app->m_cc_db.idxRank[i];
wxString name(wxT("category"));
name.Append(cc.id.data, _countof(cc.id.data));
name.Append(cc.cat.data, _countof(cc.cat.data));
bool val;
if (RestoreValue(name, &val))
wnd->m_categories->Check(i, val);
}
bool search_panel;
if (RestoreValue(wxT("searchPanel"), &search_panel)) {
if (search_panel) {
wnd->m_search_panel->Show(true);
wnd->m_search_more->SetLabel(_(L"▾ Search Options"));
} else {
wnd->m_search_panel->Show(false);
wnd->m_search_more->SetLabel(_(L"▸ Search Options"));
}
}
wnd->ResetResults();
return wxPersistentDialog::Restore();

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -28,15 +28,106 @@ class wxPersistentZRColaCharSelect;
#include "zrcolagui.h"
#include <zrcola/character.h>
#include <wxex/valhex.h>
#include <wx/validate.h>
#include <wxex/persist/dialog.h>
#include <wx/event.h>
#include <wx/thread.h>
#include <list>
#include <map>
#include <string>
#include <vector>
///
/// Validator for Unicode character
///
class WXEXTEND_API wxZRColaUTF16CharValidator : public wxValidator
{
public:
///
/// Construct the validator with a value to store data
///
wxZRColaUTF16CharValidator(wchar_t *val = NULL);
///
/// Copies this validator
///
virtual wxObject* Clone() const;
///
/// Validates the value
///
virtual bool Validate(wxWindow *parent);
///
/// Transfers the value to the window
///
virtual bool TransferToWindow();
///
/// Transfers the value from the window
///
virtual bool TransferFromWindow();
///
/// Parses FQDN value
///
static bool Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wchar_t *val_out = NULL);
protected:
wchar_t *m_val; ///< Pointer to variable to receive control's parsed value
private:
wxDECLARE_DYNAMIC_CLASS(wxZRColaUTF16CharValidator);
wxDECLARE_NO_ASSIGN_CLASS(wxZRColaUTF16CharValidator);
};
///
/// Validator for Unicode dump
///
class wxZRColaUnicodeDumpValidator : public wxValidator
{
public:
///
/// Construct the validator with a value to store data
///
wxZRColaUnicodeDumpValidator(wxString *val = NULL);
///
/// Copies this validator
///
virtual wxObject* Clone() const;
///
/// Validates the value
///
virtual bool Validate(wxWindow *parent);
///
/// Transfers the value to the window
///
virtual bool TransferToWindow();
///
/// Transfers the value from the window
///
virtual bool TransferFromWindow();
///
/// Parses Unicode dump value
///
static bool Parse(const wxString &val_in, size_t i_start, size_t i_end, wxTextCtrl *ctrl, wxWindow *parent, wxString *val_out = NULL);
protected:
wxString *m_val; ///< Pointer to variable to receive control's parsed value
private:
wxDECLARE_DYNAMIC_CLASS(wxZRColaUnicodeDumpValidator);
wxDECLARE_NO_ASSIGN_CLASS(wxZRColaUnicodeDumpValidator);
};
wxDECLARE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
@@ -55,6 +146,7 @@ public:
protected:
virtual void OnIdle(wxIdleEvent& event);
virtual void OnSearchText(wxCommandEvent& event);
virtual void OnSearchMore(wxHyperlinkEvent& event);
virtual void OnCategoriesAll(wxHyperlinkEvent& event);
virtual void OnCategoriesNone(wxHyperlinkEvent& event);
virtual void OnCategoriesInvert(wxHyperlinkEvent& event);
@@ -75,12 +167,13 @@ protected:
void ResetResults();
void NavigateBy(int offset);
void NavigateTo(wchar_t c);
void NavigateTo(const wxString &c);
public:
wchar_t m_char; ///< Currently selected character (0 when none)
wxString m_char; ///< Currently selected character (empty when none)
protected:
LCID m_locale; ///< Locale for tag lookup
bool m_searchChanged; ///< Did Search field or category selection change?
std::map<ZRCola::chrcatid_t, int> m_ccOrder; ///< Character category order
bool m_unicodeChanged; ///< Did Unicode field change?
@@ -102,7 +195,7 @@ protected:
public:
std::wstring m_search; ///< Search phrase
std::set<ZRCola::chrcatid_t> m_cats; ///< Search categories
std::vector<std::pair<ZRCola::charrank_t, wchar_t> > m_hits; ///< Search results
std::vector<std::pair<ZRCola::charrank_t, std::wstring> > m_hits; ///< Search results
protected:
wxZRColaCharSelect *m_parent; ///< Thread owner
@@ -114,7 +207,7 @@ protected:
///
struct NavigationState
{
wchar_t m_char;
std::wstring m_char;
struct {
wxGridCellCoords m_selected;
} m_related;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -25,42 +25,42 @@
//////////////////////////////////////////////////////////////////////////
wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
m_decomposedChanged(false),
m_composedChanged(false),
m_selDecomposed(0, 0),
m_selComposed(0, 0),
m_sourceChanged(false),
m_destinationChanged(false),
m_selSource(0, 0),
m_selDestination(0, 0),
wxZRColaComposerPanelBase(parent)
{
m_decomposed->PushEventHandler(&m_keyhandler);
m_source->PushEventHandler(&m_keyhandler);
// Restore the previously saved state (if exists).
wxString fileName(GetStateFileName());
if (wxFileExists(fileName)) {
wxFFile file(fileName, wxT("rb"));
if (file.IsOpened()) {
// Load decomposed text.
// Load source text.
unsigned __int64 n;
file.Read(&n, sizeof(n));
if (!file.Error()) {
wxString decomposed;
file.Read(wxStringBuffer(decomposed, n), sizeof(wchar_t)*n);
wxString source;
file.Read(wxStringBuffer(source, n), sizeof(wchar_t)*n);
if (!file.Error()) {
// Load composed text.
// Load destination text.
file.Read(&n, sizeof(n));
if (!file.Error()) {
wxString composed;
file.Read(wxStringBuffer(composed, n), sizeof(wchar_t)*n);
wxString destination;
file.Read(wxStringBuffer(destination, n), sizeof(wchar_t)*n);
if (!file.Error()) {
// Restore state.
m_decomposed->SetValue(decomposed);
m_decomposed->GetSelection(&m_selDecomposed.first, &m_selDecomposed.second);
SetHexValue(m_decomposedHex, m_selDecomposedHex, m_mappingDecomposedHex, decomposed.GetData(), decomposed.Length(), m_selDecomposed.first, m_selDecomposed.second);
m_decomposedChanged = false;
m_source->SetValue(source);
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, source.GetData(), source.Length(), m_selSource.first, m_selSource.second);
m_sourceChanged = false;
m_composed->SetValue(composed);
m_composed->GetSelection(&m_selComposed.first, &m_selComposed.second);
SetHexValue(m_composedHex, m_selComposedHex, m_mappingComposedHex, composed.GetData(), composed.Length(), m_selComposed.first, m_selComposed.second);
m_composedChanged = false;
m_destination->SetValue(destination);
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, destination.GetData(), destination.Length(), m_selDestination.first, m_selDestination.second);
m_destinationChanged = false;
}
}
}
@@ -72,7 +72,7 @@ wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
wxZRColaComposerPanel::~wxZRColaComposerPanel()
{
m_decomposed->PopEventHandler();
m_source->PopEventHandler();
// This is a controlled exit. Purge saved state.
wxString fileName(GetStateFileName());
@@ -83,194 +83,223 @@ wxZRColaComposerPanel::~wxZRColaComposerPanel()
void wxZRColaComposerPanel::SynchronizePanels()
{
if (m_decomposedChanged) {
if (m_sourceChanged) {
m_timerSave.Stop();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString src;
size_t len = GetValue(m_decomposed, src);
size_t len = GetValue(m_source, src);
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
std::wstring norm;
((ZRColaApp*)wxTheApp)->m_t_db.Decompose(src.data(), len, norm, &m_mapping1);
const ZRCola::transetid_t *sets_begin, *sets_end;
GetTranslationSeq(sets_begin, sets_end);
std::wstring dst;
((ZRColaApp*)wxTheApp)->m_t_db.Compose(norm.data(), norm.size(), dst, &m_mapping2);
m_mapping.clear();
for (auto s = sets_begin; s != sets_end; ++s) {
if (*s == 0) {
// ZRCola Decomposed => ZRCola Composed should decompose first.
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), dst2, &map);
m_mapping.push_back(std::move(map));
m_decomposed->GetSelection(&m_selDecomposed.first, &m_selDecomposed.second);
app->m_t_db.Translate(*s, dst2.data(), dst2.size(), dst, &map);
m_mapping.push_back(std::move(map));
} else {
// Other translates
app->m_t_db.Translate(*s, dst.data(), dst.size(), dst2, &map);
m_mapping.push_back(std::move(map));
dst = std::move(dst2);
}
}
// Update decomposed HEX dump.
SetHexValue(m_decomposedHex, m_selDecomposedHex, m_mappingDecomposedHex, src.data(), len, m_selDecomposed.first, m_selDecomposed.second);
m_source->GetSelection(&m_selSource.first, &m_selSource.second);
// Update composed text, and its HEX dump.
m_composed->SetValue(dst);
m_composed->SetSelection(
m_selComposed.first = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.first )),
m_selComposed.second = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.second)));
SetHexValue(m_composedHex, m_selComposedHex, m_mappingComposedHex, dst.data(), dst.length(), m_selComposed.first, m_selComposed.second);
// Update source HEX dump.
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, src.data(), len, m_selSource.first, m_selSource.second);
// Update destination text, and its HEX dump.
m_destination->SetValue(dst);
m_destination->SetSelection(
m_selDestination.first = MapToDestination(m_selSource.first ),
m_selDestination.second = MapToDestination(m_selSource.second));
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, dst.data(), dst.length(), m_selDestination.first, m_selDestination.second);
// Schedule state save after 3s.
m_timerSave.Start(3000, true);
} else if (m_composedChanged) {
} else if (m_destinationChanged) {
m_timerSave.Stop();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString src;
size_t len = GetValue(m_composed, src);
size_t len = GetValue(m_destination, src);
std::wstring dst(src.data(), len), dst2;
ZRCola::mapping_vector map;
ZRColaApp *app = (ZRColaApp*)wxTheApp;
std::wstring dst;
wxZRColaFrame *mainWnd = dynamic_cast<wxZRColaFrame*>(wxGetActiveWindow());
if (mainWnd)
app->m_t_db.Decompose(src.data(), len, &app->m_lc_db, mainWnd->m_settings->m_lang, dst, &m_mapping2);
else
app->m_t_db.Decompose(src.data(), len, dst, &m_mapping2);
const ZRCola::transetid_t *sets_begin, *sets_end;
GetTranslationSeq(sets_begin, sets_end);
m_mapping1.clear();
m_mapping2.invert();
m_mapping.clear();
for (auto s = sets_end; s != sets_begin; s--) {
if (*s) {
// ZRCola Decomposed => ZRCola Composed
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), &app->m_lc_db, app->m_mainWnd->m_settings->m_lang, dst2, &map);
} else {
// Other translates
app->m_t_db.TranslateInv(*s, dst.data(), dst.size(), dst2, &map);
}
dst = std::move(dst2);
m_composed->GetSelection(&m_selComposed.first, &m_selComposed.second);
map.invert();
m_mapping.push_back(std::move(map));
}
// Update composed HEX dump.
SetHexValue(m_composedHex, m_selComposedHex, m_mappingComposedHex, src.data(), len, m_selComposed.first, m_selComposed.second);
m_destination->GetSelection(&m_selDestination.first, &m_selDestination.second);
// Update decomposed text, and its HEX dump.
m_decomposed->SetValue(dst);
m_decomposed->SetSelection(
m_selDecomposed.first = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.first )),
m_selDecomposed.second = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.second)));
SetHexValue(m_decomposedHex, m_selDecomposedHex, m_mappingDecomposedHex, dst.data(), dst.length(), m_selDecomposed.first, m_selDecomposed.second);
// Update destination HEX dump.
SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, src.data(), len, m_selDestination.first, m_selDestination.second);
// Update source text, and its HEX dump.
m_source->SetValue(dst);
m_source->SetSelection(
m_selSource.first = MapToSource(m_selDestination.first ),
m_selSource.second = MapToSource(m_selDestination.second));
SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, dst.data(), dst.length(), m_selSource.first, m_selSource.second);
// Schedule state save after 3s.
m_timerSave.Start(3000, true);
}
m_decomposedChanged = false;
m_composedChanged = false;
m_sourceChanged = false;
m_destinationChanged = false;
}
void wxZRColaComposerPanel::OnDecomposedPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_decomposed->GetSelection(&from, &to);
m_source->GetSelection(&from, &to);
if (m_selDecomposed.first != from || m_selDecomposed.second != to) {
if (m_selSource.first != from || m_selSource.second != to) {
// Save new selection first, to avoid loop.
m_selDecomposed.first = from;
m_selDecomposed.second = to;
m_selSource.first = from;
m_selSource.second = to;
m_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(from),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(to ));
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(from),
m_selSourceHex.second = m_mappingSourceHex.to_dst(to ));
m_composed->SetSelection(
m_selComposed.first = m_mapping2.to_dst(m_mapping1.to_dst(from)),
m_selComposed.second = m_mapping2.to_dst(m_mapping1.to_dst(to )));
m_destination->SetSelection(
m_selDestination.first = MapToDestination(from),
m_selDestination.second = MapToDestination(to ));
m_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(m_selComposed.first ),
m_selComposedHex.second = m_mappingComposedHex.to_dst(m_selComposed.second));
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second));
}
}
void wxZRColaComposerPanel::OnDecomposedHexPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnSourceHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_decomposedHex->GetSelection(&from, &to);
m_sourceHex->GetSelection(&from, &to);
if (m_selDecomposedHex.first != from || m_selDecomposedHex.second != to) {
if (m_selSourceHex.first != from || m_selSourceHex.second != to) {
// Save new selection first, to avoid loop.
m_selDecomposedHex.first = from;
m_selDecomposedHex.second = to;
m_selSourceHex.first = from;
m_selSourceHex.second = to;
m_decomposed->SetSelection(
m_selDecomposed.first = m_mappingDecomposedHex.to_src(from),
m_selDecomposed.second = m_mappingDecomposedHex.to_src(to ));
m_source->SetSelection(
m_selSource.first = m_mappingSourceHex.to_src(from),
m_selSource.second = m_mappingSourceHex.to_src(to ));
m_composed->SetSelection(
m_selComposed.first = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.first )),
m_selComposed.second = m_mapping2.to_dst(m_mapping1.to_dst(m_selDecomposed.second)));
m_destination->SetSelection(
m_selDestination.first = MapToDestination(m_selSource.first ),
m_selDestination.second = MapToDestination(m_selSource.second));
m_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(m_selComposed.first ),
m_selComposedHex.second = m_mappingComposedHex.to_dst(m_selComposed.second));
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second));
}
}
void wxZRColaComposerPanel::OnDecomposedText(wxCommandEvent& event)
void wxZRColaComposerPanel::OnSourceText(wxCommandEvent& event)
{
event.Skip();
// Set the flag the decomposed text changed to trigger idle-time composition.
m_decomposedChanged = true;
// Set the flag the source text changed to trigger idle-time translation.
m_sourceChanged = true;
}
void wxZRColaComposerPanel::OnComposedPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnDestinationPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_composed->GetSelection(&from, &to);
m_destination->GetSelection(&from, &to);
if (m_selComposed.first != from || m_selComposed.second != to) {
if (m_selDestination.first != from || m_selDestination.second != to) {
// Save new selection first, to avoid loop.
m_selComposed.first = from;
m_selComposed.second = to;
m_selDestination.first = from;
m_selDestination.second = to;
m_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(from),
m_selComposedHex.second = m_mappingComposedHex.to_dst(to ));
m_destinationHex->SetSelection(
m_selDestinationHex.first = m_mappingDestinationHex.to_dst(from),
m_selDestinationHex.second = m_mappingDestinationHex.to_dst(to ));
m_decomposed->SetSelection(
m_selDecomposed.first = m_mapping1.to_src(m_mapping2.to_src(from)),
m_selDecomposed.second = m_mapping1.to_src(m_mapping2.to_src(to )));
m_source->SetSelection(
m_selSource.first = MapToSource(from),
m_selSource.second = MapToSource(to ));
m_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(m_selDecomposed.first ),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(m_selDecomposed.second));
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ),
m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second));
}
}
void wxZRColaComposerPanel::OnComposedHexPaint(wxPaintEvent& event)
void wxZRColaComposerPanel::OnDestinationHexPaint(wxPaintEvent& event)
{
event.Skip();
long from, to;
m_composedHex->GetSelection(&from, &to);
m_destinationHex->GetSelection(&from, &to);
if (m_selComposedHex.first != from || m_selComposedHex.second != to) {
if (m_selDestinationHex.first != from || m_selDestinationHex.second != to) {
// Save new selection first, to avoid loop.
m_selComposedHex.first = from;
m_selComposedHex.second = to;
m_selDestinationHex.first = from;
m_selDestinationHex.second = to;
m_composed->SetSelection(
m_selComposed.first = m_mappingComposedHex.to_src(from),
m_selComposed.second = m_mappingComposedHex.to_src(to ));
m_destination->SetSelection(
m_selDestination.first = m_mappingDestinationHex.to_src(from),
m_selDestination.second = m_mappingDestinationHex.to_src(to ));
m_decomposed->SetSelection(
m_selDecomposed.first = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.first )),
m_selDecomposed.second = m_mapping1.to_src(m_mapping2.to_src(m_selComposed.second)));
m_source->SetSelection(
m_selSource.first = MapToSource(m_selDestination.first ),
m_selSource.second = MapToSource(m_selDestination.second));
m_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(m_selDecomposed.first ),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(m_selDecomposed.second));
m_sourceHex->SetSelection(
m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ),
m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second));
}
}
void wxZRColaComposerPanel::OnComposedText(wxCommandEvent& event)
void wxZRColaComposerPanel::OnDestinationText(wxCommandEvent& event)
{
event.Skip();
// Set the flag the composed text changed to trigger idle-time decomposition.
m_composedChanged = true;
// Set the flag the destination text changed to trigger idle-time inverse translation.
m_destinationChanged = true;
}
@@ -282,13 +311,13 @@ void wxZRColaComposerPanel::OnSaveTimer(wxTimerEvent& event)
wxString text;
size_t len;
// Save decomposed text.
len = GetValue(m_decomposed, text);
// Save source text.
len = GetValue(m_source, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
// Save composed text.
len = GetValue(m_composed, text);
// Save destination text.
len = GetValue(m_destination, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
}
@@ -382,29 +411,29 @@ wxString wxPersistentZRColaComposerPanel::GetKind() const
void wxPersistentZRColaComposerPanel::Save() const
{
const wxZRColaComposerPanel * const wnd = static_cast<const wxZRColaComposerPanel*>(GetWindow());
auto const wnd = static_cast<const wxZRColaComposerPanel*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("splitDecomposed"), wnd->m_splitterDecomposed->GetSashPosition());
SaveValue(wxT("splitComposed" ), wnd->m_splitterComposed ->GetSashPosition());
SaveValue(wxT("splitDecomposed"), wnd->m_splitterSource->GetSashPosition());
SaveValue(wxT("splitComposed" ), wnd->m_splitterDestination ->GetSashPosition());
}
bool wxPersistentZRColaComposerPanel::Restore()
{
wxZRColaComposerPanel * const wnd = static_cast<wxZRColaComposerPanel*>(GetWindow());
auto wnd = dynamic_cast<wxZRColaComposerPanel*>(GetWindow());
int sashVal;
if (RestoreValue(wxT("splitDecomposed"), &sashVal)) {
// wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler.
wnd->m_splitterDecomposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDecomposedOnIdle ), NULL, wnd );
wnd->m_splitterDecomposed->SetSashPosition(sashVal);
wnd->m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, wnd );
wnd->m_splitterSource->SetSashPosition(sashVal);
}
if (RestoreValue(wxT("splitComposed"), &sashVal)) {
// wxFormBuilder sets initial splitter stash in idle event handler after GUI settles. Overriding our loaded value. Disconnect it's idle event handler.
wnd->m_splitterComposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterComposedOnIdle ), NULL, wnd );
wnd->m_splitterComposed->SetSashPosition(sashVal);
wnd->m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, wnd );
wnd->m_splitterDestination->SetSashPosition(sashVal);
}
return true;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -30,6 +30,7 @@ class wxZRColaComposerPanel;
#include <wx/persist/window.h>
#include <wx/timer.h>
#include <utility>
#include <vector>
///
@@ -46,31 +47,33 @@ public:
friend class wxPersistentZRColaComposerPanel; // Allow saving/restoring window state.
protected:
virtual void OnDecomposedPaint(wxPaintEvent& event);
virtual void OnDecomposedHexPaint(wxPaintEvent& event);
virtual void OnDecomposedText(wxCommandEvent& event);
virtual void OnComposedPaint(wxPaintEvent& event);
virtual void OnComposedHexPaint(wxPaintEvent& event);
virtual void OnComposedText(wxCommandEvent& event);
virtual void OnSourcePaint(wxPaintEvent& event);
virtual void OnSourceHexPaint(wxPaintEvent& event);
virtual void OnSourceText(wxCommandEvent& event);
virtual void OnDestinationPaint(wxPaintEvent& event);
virtual void OnDestinationHexPaint(wxPaintEvent& event);
virtual void OnDestinationText(wxCommandEvent& event);
virtual void OnSaveTimer(wxTimerEvent& event);
inline size_t MapToDestination(_In_ size_t src) const;
inline size_t MapToSource(_In_ size_t dst) const;
inline void GetTranslationSeq(_Out_ const ZRCola::transetid_t *&sets_begin, _Out_ const ZRCola::transetid_t *&sets_end) const;
static wxString GetStateFileName();
static size_t GetValue(wxTextCtrl *wnd, wxString &text);
static void SetHexValue(wxTextCtrl *wnd, std::pair<long, long> &range, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len, long from, long to);
protected:
bool m_decomposedChanged; ///< Boolean flag to mark decomposed text "dirty" to trigger composition
bool m_composedChanged; ///< Boolean flag to mark composed text "dirty" to trigger decomposition
ZRCola::mapping_vector m_mapping1; ///< Character index mapping vector between decomposed and normalized text
ZRCola::mapping_vector m_mapping2; ///< Character index mapping vector between normalized and composed text
bool m_sourceChanged; ///< Boolean flag to mark source text "dirty" to trigger translation
bool m_destinationChanged; ///< Boolean flag to mark destination text "dirty" to trigger inverse translation
std::vector<ZRCola::mapping_vector> m_mapping; ///< Character index mapping vector between source and normalized text
std::pair<long, long>
m_selDecomposed, ///< Character index of selected text in decomposed text control
m_selDecomposedHex, ///< Character index of selected text in decomposed HEX dump text control
m_selComposed, ///< Character index of selected text in composed text control
m_selComposedHex; ///< Character index of selected text in composed HEX dump text control
wxZRColaKeyHandler m_keyhandler; ///< Key handler for decomposed window
ZRCola::mapping_vector m_mappingDecomposedHex; ///< Character index mapping vector between decomposed text and its HEX dump
ZRCola::mapping_vector m_mappingComposedHex; ///< Character index mapping vector between composed text and its HEX dump
m_selSource, ///< Character index of selected text in source text control
m_selSourceHex, ///< Character index of selected text in source HEX dump text control
m_selDestination, ///< Character index of selected text in destination text control
m_selDestinationHex; ///< Character index of selected text in destination HEX dump text control
wxZRColaKeyHandler m_keyhandler; ///< Key handler for source window
ZRCola::mapping_vector m_mappingSourceHex; ///< Character index mapping vector between source text and its HEX dump
ZRCola::mapping_vector m_mappingDestinationHex; ///< Character index mapping vector between destination text and its HEX dump
};
@@ -88,6 +91,45 @@ public:
};
inline size_t wxZRColaComposerPanel::MapToDestination(_In_ size_t src) const
{
for (auto m = m_mapping.cbegin(), m_end = m_mapping.cend(); m != m_end; ++m)
src = m->to_dst(src);
return src;
}
inline size_t wxZRColaComposerPanel::MapToSource(_In_ size_t dst) const
{
for (auto m = m_mapping.crbegin(), m_end = m_mapping.crend(); m != m_end; ++m)
dst = m->to_src(dst);
return dst;
}
inline void wxZRColaComposerPanel::GetTranslationSeq(_Out_ const ZRCola::transetid_t *&sets_begin, _Out_ const ZRCola::transetid_t *&sets_end) const
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
if (app->m_mainWnd->m_transeq_id != ZRCOLA_TRANSEQID_CUSTOM) {
size_t start;
if (app->m_tsq_db.idxTranSeq.find(ZRCola::transeq_db::transeq(app->m_mainWnd->m_transeq_id), start)) {
const auto &ts = app->m_tsq_db.idxTranSeq[start];
sets_begin = ts.sets();
sets_end = ts.sets_end();
} else {
sets_begin = NULL;
sets_end = NULL;
}
} else {
sets_begin = app->m_mainWnd->m_transeq->m_transeq.data();
sets_end = sets_begin + app->m_mainWnd->m_transeq->m_transeq.size();
}
}
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaComposerPanel *wnd)
{
return new wxPersistentZRColaComposerPanel(wnd);

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -34,17 +34,19 @@ wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
EVT_MENU (wxID_CHARACTER_SELECTOR , wxZRColaFrame::OnInsertCharacter )
EVT_UPDATE_UI_RANGE(wxID_SEND_COMPOSED , wxID_SEND_ABORT, wxZRColaFrame::OnSendUpdate )
EVT_MENU (wxID_SEND_COMPOSED , wxZRColaFrame::OnSendComposed )
EVT_MENU (wxID_SEND_DECOMPOSED , wxZRColaFrame::OnSendDecomposed )
EVT_UPDATE_UI_RANGE(wxID_SEND_DESTINATION , wxID_SEND_ABORT, wxZRColaFrame::OnSendUpdate )
EVT_MENU (wxID_COPY_DESTINATION_AND_RETURN , wxZRColaFrame::OnCopyDestinationAndReturn )
EVT_MENU (wxID_SEND_DESTINATION , wxZRColaFrame::OnSendDestination )
EVT_MENU (wxID_COPY_SOURCE_AND_RETURN , wxZRColaFrame::OnCopySourceAndReturn )
EVT_MENU (wxID_SEND_SOURCE , wxZRColaFrame::OnSendSource )
EVT_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_MENU (wxID_SETTINGS , wxZRColaFrame::OnSettings )
EVT_UPDATE_UI (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEditUpdate )
EVT_MENU (wxID_TOOLBAR_EDIT , wxZRColaFrame::OnToolbarEdit )
EVT_UPDATE_UI (wxID_TOOLBAR_COMPOSE , wxZRColaFrame::OnToolbarComposeUpdate )
EVT_MENU (wxID_TOOLBAR_COMPOSE , wxZRColaFrame::OnToolbarCompose )
EVT_UPDATE_UI (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslateUpdate )
EVT_MENU (wxID_TOOLBAR_TRANSLATE , wxZRColaFrame::OnToolbarTranslate )
EVT_UPDATE_UI (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate)
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
@@ -63,16 +65,30 @@ wxZRColaFrame::wxZRColaFrame() :
m_chrSelect(NULL),
m_settings(NULL),
m_chrReq(NULL),
m_transeq_id(0), // By default use predefined translation sequence 0 (ZRCola Decomposed >> Composed)
m_transeq(NULL),
wxZRColaFrameBase(NULL)
{
{
// wxFrameBuilder 3.5 does not support wxAUI_TB_HORIZONTAL flag. Add it manually.
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarTranslate);
paneInfo.LeftDockable(false);
paneInfo.RightDockable(false);
m_toolbarCompose->SetWindowStyleFlag(m_toolbarCompose->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
m_toolbarTranslate->SetWindowStyleFlag(m_toolbarTranslate->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
}
// Populate list of translation sequences.
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_toolTranslationSeq->Clear();
for (size_t i = 0, n = app->m_tsq_db.idxRank.size(); i < n; i++) {
const ZRCola::transeq_db::transeq &ts = app->m_tsq_db.idxRank[i];
wxString
name(ts.name(), ts.name_len()),
name_tran(wxGetTranslation(name, wxT("ZRCola-zrcdb")));
m_toolTranslationSeq->Append(name_tran, reinterpret_cast<void*>(ts.seq));
}
m_toolTranslationSeq->Append(_("Custom Translation..."), reinterpret_cast<void*>(ZRCOLA_TRANSEQID_CUSTOM));
// Load main window icons.
#ifdef __WINDOWS__
wxIcon icon_small(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
@@ -97,6 +113,9 @@ wxZRColaFrame::wxZRColaFrame() :
m_settings = new wxZRColaSettings(this);
wxPersistentRegisterAndRestore<wxZRColaSettings>(m_settings);
m_transeq = new wxZRColaTranslationSeq(this);
wxPersistentRegisterAndRestore<wxZRColaTranslationSeq>(m_transeq);
m_chrSelect = new wxZRColaCharSelect(this);
wxPersistentRegisterAndRestore<wxZRColaCharSelect>(m_chrSelect);
@@ -104,13 +123,7 @@ wxZRColaFrame::wxZRColaFrame() :
wxPersistentRegisterAndRestore<wxZRColaCharRequest>(m_chrReq);
// Set focus.
m_panel->m_decomposed->SetFocus();
// Register global hotkey(s).
if (!RegisterHotKey(wxZRColaHKID_INVOKE_COMPOSE, wxMOD_WIN, VK_F5))
wxMessageBox(_("ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
if (!RegisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE, wxMOD_WIN, VK_F6))
wxMessageBox(_("ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
m_panel->m_source->SetFocus();
#if defined(__WXMSW__)
// Register notification sink for language detection.
@@ -141,11 +154,36 @@ wxZRColaFrame::wxZRColaFrame() :
// Restore persistent state of wxAuiManager manually, since m_mgr is not on the heap.
wxPersistentAuiManager(&m_mgr).Restore();
wxPersistentRegisterAndRestore<wxZRColaFrame>(this);
// Populate list of translation sequences.
for (unsigned int i = 0, n = m_toolTranslationSeq->GetCount(); ; i++) {
if (i < n) {
if (reinterpret_cast<ZRCola::transeqid_t>(m_toolTranslationSeq->GetClientData(i)) == m_transeq_id) {
m_toolTranslationSeq->SetSelection(i);
break;
}
} else {
m_transeq_id = reinterpret_cast<ZRCola::transeqid_t>(m_toolTranslationSeq->GetClientData(0));
m_toolTranslationSeq->SetSelection(0);
break;
}
}
// Register global hotkey(s).
if (!RegisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE, wxMOD_WIN, VK_F5))
wxMessageBox(_("ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
if (!RegisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE_INV, wxMOD_WIN, VK_F6))
wxMessageBox(_("ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."), _("Warning"), wxOK | wxICON_WARNING);
}
wxZRColaFrame::~wxZRColaFrame()
{
// Unregister global hotkey(s).
UnregisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE_INV);
UnregisterHotKey(wxZRColaHKID_INVOKE_TRANSLATE );
#if defined(__WXMSW__)
if (m_tfSource) {
m_tfSource->UnadviseSink(m_dwCookie);
@@ -153,19 +191,6 @@ wxZRColaFrame::~wxZRColaFrame()
}
#endif
// Unregister global hotkey(s).
UnregisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE);
UnregisterHotKey(wxZRColaHKID_INVOKE_COMPOSE);
if (m_chrReq)
delete m_chrReq;
if (m_chrSelect)
delete m_chrSelect;
if (m_settings)
delete m_settings;
if (m_taskBarIcon) {
m_taskBarIcon->Disconnect(wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEventHandler(wxZRColaFrame::OnTaskbarIconClick), NULL, this);
delete m_taskBarIcon;
@@ -211,9 +236,9 @@ void wxZRColaFrame::OnForwardEvent(wxCommandEvent& event)
void wxZRColaFrame::OnInsertCharacter(wxCommandEvent& event)
{
if (m_chrSelect->ShowModal() == wxID_OK && m_chrSelect->m_char) {
m_panel->m_decomposed->WriteText(m_chrSelect->m_char);
m_panel->m_decomposed->SetFocus();
if (m_chrSelect->ShowModal() == wxID_OK && !m_chrSelect->m_char.empty()) {
m_panel->m_source->WriteText(m_chrSelect->m_char);
m_panel->m_source->SetFocus();
}
}
@@ -224,19 +249,37 @@ void wxZRColaFrame::OnSendUpdate(wxUpdateUIEvent& event)
}
void wxZRColaFrame::OnSendComposed(wxCommandEvent& event)
void wxZRColaFrame::OnSendDestination(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_composed->GetValue());
DoSend(m_panel->m_destination->GetValue());
event.Skip();
}
void wxZRColaFrame::OnSendDecomposed(wxCommandEvent& event)
void wxZRColaFrame::OnCopyDestinationAndReturn(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_decomposed->GetValue());
DoCopyAndReturn(m_panel->m_destination->GetValue());
event.Skip();
}
void wxZRColaFrame::OnSendSource(wxCommandEvent& event)
{
if (m_hWndSource)
DoSend(m_panel->m_source->GetValue());
event.Skip();
}
void wxZRColaFrame::OnCopySourceAndReturn(wxCommandEvent& event)
{
if (m_hWndSource)
DoCopyAndReturn(m_panel->m_source->GetValue());
event.Skip();
}
@@ -252,8 +295,8 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
}
// Select all input in composer to prepare for the overwrite next time.
m_panel->m_decomposed->SelectAll();
m_panel->m_composed->SelectAll();
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
event.Skip();
}
@@ -306,20 +349,36 @@ void wxZRColaFrame::OnToolbarEdit(wxCommandEvent& event)
}
void wxZRColaFrame::OnToolbarComposeUpdate(wxUpdateUIEvent& event)
void wxZRColaFrame::OnToolbarTranslateUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_toolbarCompose).IsShown());
event.Check(m_mgr.GetPane(m_toolbarTranslate).IsShown());
}
void wxZRColaFrame::OnToolbarCompose(wxCommandEvent& event)
void wxZRColaFrame::OnToolbarTranslate(wxCommandEvent& event)
{
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarTranslate);
paneInfo.Show(!paneInfo.IsShown());
m_mgr.Update();
}
void wxZRColaFrame::OnTranslationSeqChoice(wxCommandEvent& event)
{
ZRCola::transeqid_t transeq_id = reinterpret_cast<ZRCola::transeqid_t>(event.GetClientData());
if (m_transeq_id != transeq_id) {
m_transeq_id = transeq_id;
// Notify source text something changed and should re-translate.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_source->ProcessWindowEvent(event2);
}
if (m_transeq_id == ZRCOLA_TRANSEQID_CUSTOM)
m_transeq->ShowModal();
}
void wxZRColaFrame::OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_panelChrCat).IsShown());
@@ -348,7 +407,7 @@ void wxZRColaFrame::OnPanelCharacterCatalogFocus(wxCommandEvent& event)
void wxZRColaFrame::OnHelpInstructions(wxCommandEvent& event)
{
wxLaunchDefaultBrowser(_("http://zrcola-2.amebis.si/en/info/instructions/"));
wxLaunchDefaultBrowser(_("http://zrcola.zrc-sazu.si/en/info/instructions/"));
}
@@ -358,21 +417,21 @@ void wxZRColaFrame::OnHelpShortcuts(wxCommandEvent& event)
#ifdef __WXMSW__
// Search and try to launch installed PDF.
INSTALLSTATE pdf_is = ::MsiGetComponentPath(_T(ZRCOLA_VERSION_GUID), _T("{68AC2C38-10E2-41A3-B92C-844C03FFDF6A}"), pdf_path);
INSTALLSTATE pdf_is = ::MsiGetComponentPath(_T(PRODUCT_VERSION_GUID), _T("{68AC2C38-10E2-41A3-B92C-844C03FFDF6A}"), pdf_path);
if ((pdf_is == INSTALLSTATE_LOCAL || pdf_is == INSTALLSTATE_SOURCE) &&
wxFileExists(pdf_path) &&
(int)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
#endif
// Search and try to launch local PDF copy.
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
pdf_path = app->GetDatabasePath();
pdf_path += _T("ZRCola_keyboard.pdf");
if (wxFileExists(pdf_path) &&
(int)::ShellExecute(GetHWND(), NULL, pdf_path.c_str(), NULL, NULL, SW_SHOWNORMAL) > 32) return;
// When everything else fail, try the online version.
wxLaunchDefaultBrowser(_("http://zrcola-2.amebis.si/wp-content/uploads/2016/04/5_ZRCola-Tipkovnica_2009-06-21.pdf"));
wxLaunchDefaultBrowser(_("http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"));
}
@@ -459,7 +518,7 @@ void wxZRColaFrame::DoSend(const wxString& str)
{
// Prepare the INPUT table.
wxString::size_type n = str.length();
wxString::const_iterator i_str = str.begin();
auto i_str = str.begin();
std::vector<INPUT> input;
input.reserve(n*2);
for (std::vector<INPUT>::size_type i = 0; i < n; i++, i_str++) {
@@ -483,9 +542,27 @@ void wxZRColaFrame::DoSend(const wxString& str)
::SendInput(input.size(), input.data(), sizeof(INPUT));
m_hWndSource = NULL;
// Select all input in composer and decomposed to prepare for the overwrite next time.
m_panel->m_decomposed->SelectAll();
m_panel->m_composed->SelectAll();
// Select all input in source and destination to prepare for the overwrite next time.
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
}
void wxZRColaFrame::DoCopyAndReturn(const wxString& str)
{
if (wxTheClipboard->Open()) {
wxTheClipboard->SetData(new wxTextDataObject(str));
wxTheClipboard->Close();
}
// Return focus to the source window.
::SetActiveWindow(m_hWndSource);
::SetForegroundWindow(m_hWndSource);
m_hWndSource = NULL;
// Select all input in composer and source to prepare for the overwrite next time.
m_panel->m_source ->SelectAll();
m_panel->m_destination->SelectAll();
}
@@ -498,8 +575,8 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
WXHWND hWndSource = ::GetForegroundWindow();
switch (wParam) {
case wxZRColaHKID_INVOKE_COMPOSE : m_panel->m_decomposed->SetFocus(); break;
case wxZRColaHKID_INVOKE_DECOMPOSE: m_panel->m_composed ->SetFocus(); break;
case wxZRColaHKID_INVOKE_TRANSLATE : m_panel->m_source ->SetFocus(); break;
case wxZRColaHKID_INVOKE_TRANSLATE_INV: m_panel->m_destination->SetFocus(); break;
default:
wxFAIL_MSG(wxT("not our registered shortcut"));
return wxZRColaFrameBase::MSWWindowProc(message, wParam, lParam);
@@ -549,23 +626,27 @@ wxPersistentZRColaFrame::wxPersistentZRColaFrame(wxZRColaFrame *wnd) : wxPersist
void wxPersistentZRColaFrame::Save() const
{
const wxZRColaFrame * const wnd = static_cast<const wxZRColaFrame*>(GetWindow());
wxPersistentTLW::Save();
auto wnd = static_cast<const wxZRColaFrame*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("transeqId"), static_cast<int>(wnd->m_transeq_id));
wxPersistentZRColaComposerPanel(wnd->m_panel).Save();
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Save();
wxPersistentTLW::Save();
}
bool wxPersistentZRColaFrame::Restore()
{
const bool r = wxPersistentTLW::Restore();
wxZRColaFrame * const wnd = static_cast<wxZRColaFrame*>(GetWindow());
auto wnd = dynamic_cast<wxZRColaFrame*>(GetWindow());
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Restore();
wxPersistentZRColaComposerPanel(wnd->m_panel).Restore();
return r;
int num;
if (RestoreValue(wxT("transeqId"), &num))
wnd->m_transeq_id = num;
return wxPersistentTLW::Restore();
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -29,7 +29,9 @@ class wxZRColaFrame;
#include "zrcolachrslct.h"
#include "zrcolachrreq.h"
#include "zrcolasettings.h"
#include "zrcolatranseq.h"
#include <zrcola/language.h>
#include <zrcola/translate.h>
#include <wx/taskbar.h>
#include <wx/persist/toplevel.h>
#if defined(__WXMSW__)
@@ -40,8 +42,8 @@ class wxZRColaFrame;
///
/// Global hotkey message identifiers
///
#define wxZRColaHKID_INVOKE_COMPOSE 0
#define wxZRColaHKID_INVOKE_DECOMPOSE 1
#define wxZRColaHKID_INVOKE_TRANSLATE 0
#define wxZRColaHKID_INVOKE_TRANSLATE_INV 1
///
@@ -72,8 +74,10 @@ protected:
void OnForwardEvent(wxCommandEvent& event);
void OnInsertCharacter(wxCommandEvent& event);
void OnSendUpdate(wxUpdateUIEvent& event);
void OnSendComposed(wxCommandEvent& event);
void OnSendDecomposed(wxCommandEvent& event);
void OnSendDestination(wxCommandEvent& event);
void OnCopyDestinationAndReturn(wxCommandEvent& event);
void OnSendSource(wxCommandEvent& event);
void OnCopySourceAndReturn(wxCommandEvent& event);
void OnSendAbort(wxCommandEvent& event);
void OnSettings(wxCommandEvent& event);
virtual void OnIdle(wxIdleEvent& event);
@@ -81,8 +85,9 @@ protected:
virtual void OnIconize(wxIconizeEvent& event);
void OnToolbarEditUpdate(wxUpdateUIEvent& event);
void OnToolbarEdit(wxCommandEvent& event);
void OnToolbarComposeUpdate(wxUpdateUIEvent& event);
void OnToolbarCompose(wxCommandEvent& event);
void OnToolbarTranslateUpdate(wxUpdateUIEvent& event);
void OnToolbarTranslate(wxCommandEvent& event);
virtual void OnTranslationSeqChoice(wxCommandEvent& event);
void OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event);
void OnPanelCharacterCatalog(wxCommandEvent& event);
void OnPanelCharacterCatalogFocus(wxCommandEvent& event);
@@ -111,6 +116,7 @@ protected:
private:
void DoSend(const wxString& str);
void DoCopyAndReturn(const wxString& str);
protected:
#ifdef __WXMSW__
@@ -123,6 +129,8 @@ protected:
wxZRColaCharSelect *m_chrSelect; ///< Character selection dialog
wxZRColaCharRequest *m_chrReq; ///< Request a New Character dialog
wxZRColaSettings *m_settings; ///< Configuration dialog
ZRCola::transeqid_t m_transeq_id; ///< Translation sequence ID
wxZRColaTranslationSeq *m_transeq; ///< Custom translation sequence dialog
};

View File

@@ -85,23 +85,41 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
m_menuEdit->AppendSeparator();
wxMenuItem* m_menuItemSendComposed;
m_menuItemSendComposed = new wxMenuItem( m_menuEdit, wxID_SEND_COMPOSED, wxString( _("&Send Composed") ) + wxT('\t') + wxT("F5"), _("Send composed text to source window"), wxITEM_NORMAL );
wxMenuItem* m_menuItemSendDestination;
m_menuItemSendDestination = new wxMenuItem( m_menuEdit, wxID_SEND_DESTINATION, wxString( _("&Send Composed") ) + wxT('\t') + wxT("F5"), _("Send composed text to source window"), wxITEM_NORMAL );
#ifdef __WXMSW__
m_menuItemSendComposed->SetBitmaps( wxIcon( wxT("send_composed.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
m_menuItemSendDestination->SetBitmaps( wxIcon( wxT("send_destination.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
m_menuItemSendComposed->SetBitmap( wxIcon( wxT("send_composed.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
m_menuItemSendDestination->SetBitmap( wxIcon( wxT("send_destination.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#endif
m_menuEdit->Append( m_menuItemSendComposed );
m_menuEdit->Append( m_menuItemSendDestination );
wxMenuItem* m_menuItemSendDecomposed;
m_menuItemSendDecomposed = new wxMenuItem( m_menuEdit, wxID_SEND_DECOMPOSED, wxString( _("Send &Decomposed") ) + wxT('\t') + wxT("F6"), _("Send decomposed text to source window"), wxITEM_NORMAL );
wxMenuItem* m_menuItemCopyDestinationAndReturn;
m_menuItemCopyDestinationAndReturn = new wxMenuItem( m_menuEdit, wxID_COPY_DESTINATION_AND_RETURN, wxString( _("Copy Composed and &Return") ) + wxT('\t') + wxT("Ctrl+F5"), _("Copy composed text to clipboard and return focus to source window"), wxITEM_NORMAL );
#ifdef __WXMSW__
m_menuItemSendDecomposed->SetBitmaps( wxIcon( wxT("send_decomposed.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
m_menuItemCopyDestinationAndReturn->SetBitmaps( wxIcon( wxT("copy_destination_and_return.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
m_menuItemSendDecomposed->SetBitmap( wxIcon( wxT("send_decomposed.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
m_menuItemCopyDestinationAndReturn->SetBitmap( wxIcon( wxT("copy_destination_and_return.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#endif
m_menuEdit->Append( m_menuItemSendDecomposed );
m_menuEdit->Append( m_menuItemCopyDestinationAndReturn );
wxMenuItem* m_menuItemSendSource;
m_menuItemSendSource = new wxMenuItem( m_menuEdit, wxID_SEND_SOURCE, wxString( _("Send &Decomposed") ) + wxT('\t') + wxT("F6"), _("Send decomposed text to source window"), wxITEM_NORMAL );
#ifdef __WXMSW__
m_menuItemSendSource->SetBitmaps( wxIcon( wxT("send_source.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
m_menuItemSendSource->SetBitmap( wxIcon( wxT("send_source.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#endif
m_menuEdit->Append( m_menuItemSendSource );
wxMenuItem* m_menuItemCopySourceAndReturn;
m_menuItemCopySourceAndReturn = new wxMenuItem( m_menuEdit, wxID_COPY_SOURCE_AND_RETURN, wxString( _("Copy Decomposed and Re&turn") ) + wxT('\t') + wxT("Ctrl+F6"), _("Copy decomposed text to clipboard and return focus to source window"), wxITEM_NORMAL );
#ifdef __WXMSW__
m_menuItemCopySourceAndReturn->SetBitmaps( wxIcon( wxT("copy_source_and_return.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
m_menuItemCopySourceAndReturn->SetBitmap( wxIcon( wxT("copy_source_and_return.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#endif
m_menuEdit->Append( m_menuItemCopySourceAndReturn );
wxMenuItem* m_menuItemSendAbort;
m_menuItemSendAbort = new wxMenuItem( m_menuEdit, wxID_SEND_ABORT, wxString( _("Abort (De)composition") ) + wxT('\t') + wxT("Esc"), _("Abort composition and return focus to source window"), wxITEM_NORMAL );
@@ -126,7 +144,7 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
m_menuView->Append( m_menuItemToolbarEdit );
wxMenuItem* m_menuItemToolbarCompose;
m_menuItemToolbarCompose = new wxMenuItem( m_menuView, wxID_TOOLBAR_COMPOSE, wxString( _("&Compose Toolbar") ) , _("Toggle compose toolbar"), wxITEM_CHECK );
m_menuItemToolbarCompose = new wxMenuItem( m_menuView, wxID_TOOLBAR_TRANSLATE, wxString( _("&Compose Toolbar") ) , _("Toggle compose toolbar"), wxITEM_CHECK );
m_menuView->Append( m_menuItemToolbarCompose );
m_menuView->AppendSeparator();
@@ -159,7 +177,7 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
m_menuHelp->AppendSeparator();
wxMenuItem* m_menuHelpAbout;
m_menuHelpAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( wxEmptyString ) , wxEmptyString, wxITEM_NORMAL );
m_menuHelpAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About...") ) , wxEmptyString, wxITEM_NORMAL );
m_menuHelp->Append( m_menuHelpAbout );
m_menubar->Append( m_menuHelp, _("&Help") );
@@ -176,15 +194,19 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
m_toolbarEdit->Realize();
m_mgr.AddPane( m_toolbarEdit, wxAuiPaneInfo().Name( wxT("toolbarEdit") ).Top().Caption( _("Edit") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
m_toolbarCompose = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT );
m_toolCharSelect = m_toolbarCompose->AddTool( wxID_CHARACTER_SELECTOR, _("Find Character"), wxIcon( wxT("char_select.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Find Character"), _("Display character search to select character to insert into text"), NULL );
m_toolbarTranslate = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT );
m_toolCharSelect = m_toolbarTranslate->AddTool( wxID_CHARACTER_SELECTOR, _("Find Character"), wxIcon( wxT("char_select.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Find Character"), _("Display character search to select character to insert into text"), NULL );
m_toolSendComposed = m_toolbarCompose->AddTool( wxID_SEND_COMPOSED, _("Send Composed"), wxIcon( wxT("send_composed.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Send Composed"), _("Send composed text to source window"), NULL );
m_toolSendDestination = m_toolbarTranslate->AddTool( wxID_SEND_DESTINATION, _("Send Composed"), wxIcon( wxT("send_destination.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Send Composed"), _("Send composed text to source window"), NULL );
m_toolSendDecomposed = m_toolbarCompose->AddTool( wxID_SEND_DECOMPOSED, _("Send Decomposed"), wxIcon( wxT("send_decomposed.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Send Decomposed"), _("Send decomposed text to source window"), NULL );
m_toolSendSource = m_toolbarTranslate->AddTool( wxID_SEND_SOURCE, _("Send Decomposed"), wxIcon( wxT("send_source.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Send Decomposed"), _("Send decomposed text to source window"), NULL );
m_toolbarCompose->Realize();
m_mgr.AddPane( m_toolbarCompose, wxAuiPaneInfo().Name( wxT("toolbarCompose") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
wxArrayString m_toolTranslationSeqChoices;
m_toolTranslationSeq = new wxChoice( m_toolbarTranslate, wxID_ANY, wxDefaultPosition, wxSize( 170,-1 ), m_toolTranslationSeqChoices, 0 );
m_toolTranslationSeq->SetSelection( 0 );
m_toolbarTranslate->AddControl( m_toolTranslationSeq );
m_toolbarTranslate->Realize();
m_mgr.AddPane( m_toolbarTranslate, wxAuiPaneInfo().Name( wxT("toolbarCompose") ).Top().Caption( _("Compose") ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).LeftDockable( false ).RightDockable( false ).Row( 0 ).Layer( 1 ).ToolbarPane() );
m_panelChrCat = new wxZRColaCharacterCatalogPanel( this );
@@ -203,6 +225,7 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
m_toolTranslationSeq->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
}
wxZRColaFrameBase::~wxZRColaFrameBase()
@@ -211,6 +234,7 @@ wxZRColaFrameBase::~wxZRColaFrameBase()
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
m_toolTranslationSeq->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnTranslationSeqChoice ), NULL, this );
m_mgr.UnInit();
@@ -221,99 +245,99 @@ wxZRColaComposerPanelBase::wxZRColaComposerPanelBase( wxWindow* parent, wxWindow
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
m_splitterDecomposed = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
m_splitterDecomposed->SetSashGravity( 1 );
m_splitterDecomposed->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDecomposedOnIdle ), NULL, this );
m_splitterDecomposed->SetMinimumPaneSize( 5 );
m_splitterSource = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
m_splitterSource->SetSashGravity( 1 );
m_splitterSource->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, this );
m_splitterSource->SetMinimumPaneSize( 5 );
m_panelDecomposedEdit = new wxPanel( m_splitterDecomposed, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerDecomposedEdit;
bSizerDecomposedEdit = new wxBoxSizer( wxVERTICAL );
m_panelSourceEdit = new wxPanel( m_splitterSource, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerSourceEdit;
bSizerSourceEdit = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* bSizerDecomposedEdit2;
bSizerDecomposedEdit2 = new wxStaticBoxSizer( new wxStaticBox( m_panelDecomposedEdit, wxID_ANY, _("Decomposed Text") ), wxVERTICAL );
wxStaticBoxSizer* bSizerSourceEdit2;
bSizerSourceEdit2 = new wxStaticBoxSizer( new wxStaticBox( m_panelSourceEdit, wxID_ANY, _("Decomposed Text") ), wxVERTICAL );
m_decomposed = new wxTextCtrl( bSizerDecomposedEdit2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_decomposed->SetFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_decomposed->SetMinSize( wxSize( 100,25 ) );
m_source = new wxTextCtrl( bSizerSourceEdit2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_source->SetFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_source->SetMinSize( wxSize( 100,25 ) );
bSizerDecomposedEdit2->Add( m_decomposed, 1, wxEXPAND, 5 );
bSizerSourceEdit2->Add( m_source, 1, wxEXPAND, 5 );
bSizerDecomposedEdit->Add( bSizerDecomposedEdit2, 1, wxEXPAND, 5 );
bSizerSourceEdit->Add( bSizerSourceEdit2, 1, wxEXPAND, 5 );
m_panelDecomposedEdit->SetSizer( bSizerDecomposedEdit );
m_panelDecomposedEdit->Layout();
bSizerDecomposedEdit->Fit( m_panelDecomposedEdit );
m_panelDecomposedHex = new wxPanel( m_splitterDecomposed, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerDecomposedHex;
bSizerDecomposedHex = new wxBoxSizer( wxVERTICAL );
m_panelSourceEdit->SetSizer( bSizerSourceEdit );
m_panelSourceEdit->Layout();
bSizerSourceEdit->Fit( m_panelSourceEdit );
m_panelSourceHex = new wxPanel( m_splitterSource, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerSourceHex;
bSizerSourceHex = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* bSizerDecomposedHex2;
bSizerDecomposedHex2 = new wxStaticBoxSizer( new wxStaticBox( m_panelDecomposedHex, wxID_ANY, _("Decomposed Unicode Dump") ), wxVERTICAL );
wxStaticBoxSizer* bSizerSourceHex2;
bSizerSourceHex2 = new wxStaticBoxSizer( new wxStaticBox( m_panelSourceHex, wxID_ANY, _("Decomposed Unicode Dump") ), wxVERTICAL );
m_decomposedHex = new wxTextCtrl( bSizerDecomposedHex2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_decomposedHex->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 76, 90, 90, false, wxEmptyString ) );
m_sourceHex = new wxTextCtrl( bSizerSourceHex2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_sourceHex->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 76, 90, 90, false, wxEmptyString ) );
bSizerDecomposedHex2->Add( m_decomposedHex, 1, wxEXPAND, 5 );
bSizerSourceHex2->Add( m_sourceHex, 1, wxEXPAND, 5 );
bSizerDecomposedHex->Add( bSizerDecomposedHex2, 1, wxEXPAND, 5 );
bSizerSourceHex->Add( bSizerSourceHex2, 1, wxEXPAND, 5 );
m_panelDecomposedHex->SetSizer( bSizerDecomposedHex );
m_panelDecomposedHex->Layout();
bSizerDecomposedHex->Fit( m_panelDecomposedHex );
m_splitterDecomposed->SplitVertically( m_panelDecomposedEdit, m_panelDecomposedHex, -5 );
bSizerMain->Add( m_splitterDecomposed, 50, wxALL|wxEXPAND, 5 );
m_panelSourceHex->SetSizer( bSizerSourceHex );
m_panelSourceHex->Layout();
bSizerSourceHex->Fit( m_panelSourceHex );
m_splitterSource->SplitVertically( m_panelSourceEdit, m_panelSourceHex, -5 );
bSizerMain->Add( m_splitterSource, 50, wxALL|wxEXPAND, 5 );
m_splitterComposed = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
m_splitterComposed->SetSashGravity( 1 );
m_splitterComposed->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterComposedOnIdle ), NULL, this );
m_splitterComposed->SetMinimumPaneSize( 5 );
m_splitterDestination = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
m_splitterDestination->SetSashGravity( 1 );
m_splitterDestination->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, this );
m_splitterDestination->SetMinimumPaneSize( 5 );
m_panelComposedEdit = new wxPanel( m_splitterComposed, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerComposedEdit;
bSizerComposedEdit = new wxBoxSizer( wxVERTICAL );
m_panelDestinationEdit = new wxPanel( m_splitterDestination, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerDestinationEdit;
bSizerDestinationEdit = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* bSizerComposedEdit2;
bSizerComposedEdit2 = new wxStaticBoxSizer( new wxStaticBox( m_panelComposedEdit, wxID_ANY, _("Composed Text") ), wxVERTICAL );
wxStaticBoxSizer* bSizerDestinationEdit2;
bSizerDestinationEdit2 = new wxStaticBoxSizer( new wxStaticBox( m_panelDestinationEdit, wxID_ANY, _("Composed Text") ), wxVERTICAL );
m_composed = new wxTextCtrl( bSizerComposedEdit2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_composed->SetFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_composed->SetMinSize( wxSize( 100,25 ) );
m_destination = new wxTextCtrl( bSizerDestinationEdit2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_destination->SetFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_destination->SetMinSize( wxSize( 100,25 ) );
bSizerComposedEdit2->Add( m_composed, 1, wxEXPAND, 5 );
bSizerDestinationEdit2->Add( m_destination, 1, wxEXPAND, 5 );
bSizerComposedEdit->Add( bSizerComposedEdit2, 1, wxEXPAND, 5 );
bSizerDestinationEdit->Add( bSizerDestinationEdit2, 1, wxEXPAND, 5 );
m_panelComposedEdit->SetSizer( bSizerComposedEdit );
m_panelComposedEdit->Layout();
bSizerComposedEdit->Fit( m_panelComposedEdit );
m_panelComposedHex = new wxPanel( m_splitterComposed, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerComposedHex;
bSizerComposedHex = new wxBoxSizer( wxVERTICAL );
m_panelDestinationEdit->SetSizer( bSizerDestinationEdit );
m_panelDestinationEdit->Layout();
bSizerDestinationEdit->Fit( m_panelDestinationEdit );
m_panelDestinationHex = new wxPanel( m_splitterDestination, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerDestinationHex;
bSizerDestinationHex = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* bSizerComposedHex2;
bSizerComposedHex2 = new wxStaticBoxSizer( new wxStaticBox( m_panelComposedHex, wxID_ANY, _("Composed Unicode Dump") ), wxVERTICAL );
wxStaticBoxSizer* bSizerDestinationHex2;
bSizerDestinationHex2 = new wxStaticBoxSizer( new wxStaticBox( m_panelDestinationHex, wxID_ANY, _("Composed Unicode Dump") ), wxVERTICAL );
m_composedHex = new wxTextCtrl( bSizerComposedHex2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_composedHex->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 76, 90, 90, false, wxEmptyString ) );
m_destinationHex = new wxTextCtrl( bSizerDestinationHex2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_destinationHex->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 76, 90, 90, false, wxEmptyString ) );
bSizerComposedHex2->Add( m_composedHex, 1, wxEXPAND, 5 );
bSizerDestinationHex2->Add( m_destinationHex, 1, wxEXPAND, 5 );
bSizerComposedHex->Add( bSizerComposedHex2, 1, wxEXPAND, 5 );
bSizerDestinationHex->Add( bSizerDestinationHex2, 1, wxEXPAND, 5 );
m_panelComposedHex->SetSizer( bSizerComposedHex );
m_panelComposedHex->Layout();
bSizerComposedHex->Fit( m_panelComposedHex );
m_splitterComposed->SplitVertically( m_panelComposedEdit, m_panelComposedHex, -5 );
bSizerMain->Add( m_splitterComposed, 50, wxALL|wxEXPAND, 5 );
m_panelDestinationHex->SetSizer( bSizerDestinationHex );
m_panelDestinationHex->Layout();
bSizerDestinationHex->Fit( m_panelDestinationHex );
m_splitterDestination->SplitVertically( m_panelDestinationEdit, m_panelDestinationHex, -5 );
bSizerMain->Add( m_splitterDestination, 50, wxALL|wxEXPAND, 5 );
this->SetSizer( bSizerMain );
@@ -322,24 +346,24 @@ wxZRColaComposerPanelBase::wxZRColaComposerPanelBase( wxWindow* parent, wxWindow
m_timerSave.SetOwner( this, wxID_TIMER_SAVE );
// Connect Events
m_decomposed->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDecomposedPaint ), NULL, this );
m_decomposed->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnDecomposedText ), NULL, this );
m_decomposedHex->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDecomposedHexPaint ), NULL, this );
m_composed->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnComposedPaint ), NULL, this );
m_composed->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnComposedText ), NULL, this );
m_composedHex->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnComposedHexPaint ), NULL, this );
m_source->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnSourcePaint ), NULL, this );
m_source->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnSourceText ), NULL, this );
m_sourceHex->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnSourceHexPaint ), NULL, this );
m_destination->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDestinationPaint ), NULL, this );
m_destination->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnDestinationText ), NULL, this );
m_destinationHex->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDestinationHexPaint ), NULL, this );
this->Connect( wxID_TIMER_SAVE, wxEVT_TIMER, wxTimerEventHandler( wxZRColaComposerPanelBase::OnSaveTimer ) );
}
wxZRColaComposerPanelBase::~wxZRColaComposerPanelBase()
{
// Disconnect Events
m_decomposed->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDecomposedPaint ), NULL, this );
m_decomposed->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnDecomposedText ), NULL, this );
m_decomposedHex->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDecomposedHexPaint ), NULL, this );
m_composed->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnComposedPaint ), NULL, this );
m_composed->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnComposedText ), NULL, this );
m_composedHex->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnComposedHexPaint ), NULL, this );
m_source->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnSourcePaint ), NULL, this );
m_source->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnSourceText ), NULL, this );
m_sourceHex->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnSourceHexPaint ), NULL, this );
m_destination->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDestinationPaint ), NULL, this );
m_destination->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaComposerPanelBase::OnDestinationText ), NULL, this );
m_destinationHex->Disconnect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDestinationHexPaint ), NULL, this );
this->Disconnect( wxID_TIMER_SAVE, wxEVT_TIMER, wxTimerEventHandler( wxZRColaComposerPanelBase::OnSaveTimer ) );
}
@@ -352,6 +376,8 @@ wxZRColaCharacterCatalogPanelBase::wxZRColaCharacterCatalogPanelBase( wxWindow*
wxArrayString m_choiceChoices;
m_choice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceChoices, 0 );
m_choice->SetSelection( 0 );
m_choice->SetToolTip( _("Select category to display") );
bSizer->Add( m_choice, 0, wxALL|wxEXPAND, 5 );
m_grid = new wxZRColaCharGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
@@ -378,12 +404,17 @@ wxZRColaCharacterCatalogPanelBase::wxZRColaCharacterCatalogPanelBase( wxWindow*
// Cell Defaults
m_grid->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_grid->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_grid->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_grid->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_grid->SetMinSize( wxSize( 35,35 ) );
bSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
m_show_all = new wxCheckBox( this, wxID_ANY, _("Show &All"), wxDefaultPosition, wxDefaultSize, 0 );
m_show_all->SetToolTip( _("Toggle display of less frequent characters") );
bSizer->Add( m_show_all, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( bSizer );
this->Layout();
@@ -393,6 +424,7 @@ wxZRColaCharacterCatalogPanelBase::wxZRColaCharacterCatalogPanelBase( wxWindow*
m_choice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaCharacterCatalogPanelBase::OnChoice ), NULL, this );
m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( wxZRColaCharacterCatalogPanelBase::OnGridClick ), NULL, this );
m_grid->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharacterCatalogPanelBase::OnGridKeyDown ), NULL, this );
m_show_all->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxZRColaCharacterCatalogPanelBase::OnShowAll ), NULL, this );
}
wxZRColaCharacterCatalogPanelBase::~wxZRColaCharacterCatalogPanelBase()
@@ -401,6 +433,7 @@ wxZRColaCharacterCatalogPanelBase::~wxZRColaCharacterCatalogPanelBase()
m_choice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaCharacterCatalogPanelBase::OnChoice ), NULL, this );
m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( wxZRColaCharacterCatalogPanelBase::OnGridClick ), NULL, this );
m_grid->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharacterCatalogPanelBase::OnGridKeyDown ), NULL, this );
m_show_all->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( wxZRColaCharacterCatalogPanelBase::OnShowAll ), NULL, this );
}
@@ -429,32 +462,49 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
sbSizerBrowse->Add( m_search, 0, wxALL|wxEXPAND, 5 );
m_search_more = new wxHyperlinkCtrl( sbSizerBrowse->GetStaticBox(), wxID_ANY, _("Search Options"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_search_more->SetToolTip( _("Shows/hides additional search options") );
sbSizerBrowse->Add( m_search_more, 0, wxALL|wxEXPAND, 5 );
m_search_panel = new wxPanel( sbSizerBrowse->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_search_panel->Hide();
wxBoxSizer* sbSizerSearch;
sbSizerSearch = new wxBoxSizer( wxVERTICAL );
wxArrayString m_categoriesChoices;
m_categories = new wxCheckListBox( sbSizerBrowse->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,60 ), m_categoriesChoices, 0 );
m_categories = new wxCheckListBox( m_search_panel, wxID_ANY, wxDefaultPosition, wxSize( -1,60 ), m_categoriesChoices, 0 );
m_categories->SetToolTip( _("List of Unicode character categories to search in") );
sbSizerBrowse->Add( m_categories, 0, wxALL|wxEXPAND, 5 );
sbSizerSearch->Add( m_categories, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerCategoriesCtrl;
bSizerCategoriesCtrl = new wxBoxSizer( wxHORIZONTAL );
m_categoriesAll = new wxHyperlinkCtrl( sbSizerBrowse->GetStaticBox(), wxID_ANY, _("All"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_categoriesAll = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("All"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_categoriesAll->SetToolTip( _("Select all categories") );
bSizerCategoriesCtrl->Add( m_categoriesAll, 0, wxALL, 5 );
m_categoriesNone = new wxHyperlinkCtrl( sbSizerBrowse->GetStaticBox(), wxID_ANY, _("None"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_categoriesNone = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("None"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_categoriesNone->SetToolTip( _("Clear category selection") );
bSizerCategoriesCtrl->Add( m_categoriesNone, 0, wxALL, 5 );
m_categoriesInvert = new wxHyperlinkCtrl( sbSizerBrowse->GetStaticBox(), wxID_ANY, _("Invert"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_categoriesInvert = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("Invert"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_categoriesInvert->SetToolTip( _("Invert category selection") );
bSizerCategoriesCtrl->Add( m_categoriesInvert, 0, wxALL, 5 );
sbSizerBrowse->Add( bSizerCategoriesCtrl, 0, wxALIGN_RIGHT, 5 );
sbSizerSearch->Add( bSizerCategoriesCtrl, 0, wxALIGN_RIGHT, 5 );
m_search_panel->SetSizer( sbSizerSearch );
m_search_panel->Layout();
sbSizerSearch->Fit( m_search_panel );
sbSizerBrowse->Add( m_search_panel, 0, wxEXPAND, 5 );
m_gridResults = new wxZRColaCharGrid( sbSizerBrowse->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxSTATIC_BORDER );
@@ -479,7 +529,7 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
// Label Appearance
// Cell Defaults
m_gridResults->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_gridResults->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_gridResults->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridResults->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) );
m_gridResults->SetToolTip( _("Character search results") );
@@ -517,7 +567,7 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
// Label Appearance
// Cell Defaults
m_gridRecent->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_gridRecent->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_gridRecent->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridRecent->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) );
m_gridRecent->SetToolTip( _("List of recently inserted characters") );
@@ -581,7 +631,7 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
// Label Appearance
// Cell Defaults
m_gridPreview->SetDefaultCellFont( wxFont( 96, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_gridPreview->SetDefaultCellFont( wxFont( 96, 70, 90, 90, false, wxT("ZRCola") ) );
m_gridPreview->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridPreview->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
m_gridPreview->SetToolTip( _("Character preview") );
@@ -593,6 +643,11 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
sbSizerPreview->Add( m_description, 1, wxALL|wxEXPAND, 5 );
m_tags = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE|wxTE_MULTILINE|wxTE_READONLY );
m_tags->SetToolTip( _("Character tags") );
sbSizerPreview->Add( m_tags, 1, wxALL|wxEXPAND, 5 );
m_category = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE|wxTE_READONLY );
m_category->SetToolTip( _("Unicode character category") );
@@ -645,7 +700,7 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
// Label Appearance
// Cell Defaults
m_gridRelated->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_gridRelated->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_gridRelated->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridRelated->SetToolTip( _("List of related characters") );
@@ -680,6 +735,7 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
// Connect Events
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
m_search->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), NULL, this );
m_search_more->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnSearchMore ), NULL, this );
m_categories->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnCategoriesToggle ), NULL, this );
m_categoriesAll->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesAll ), NULL, this );
m_categoriesNone->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesNone ), NULL, this );
@@ -703,6 +759,7 @@ wxZRColaCharSelectBase::~wxZRColaCharSelectBase()
// Disconnect Events
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
m_search->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), NULL, this );
m_search_more->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnSearchMore ), NULL, this );
m_categories->Disconnect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnCategoriesToggle ), NULL, this );
m_categoriesAll->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesAll ), NULL, this );
m_categoriesNone->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesNone ), NULL, this );
@@ -730,12 +787,12 @@ wxZRColaSettingsBase::wxZRColaSettingsBase( wxWindow* parent, wxWindowID id, con
bSizerContent = new wxBoxSizer( wxVERTICAL );
m_listbook = new wxListbook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT );
m_panelLanguage = new wxPanel( m_listbook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelLanguage = new wxPanel( m_listbook, wxID_ANY, wxDefaultPosition, wxSize( 500,-1 ), wxTAB_TRAVERSAL );
wxBoxSizer* bSizerLanguage;
bSizerLanguage = new wxBoxSizer( wxVERTICAL );
m_langLabel = new wxStaticText( m_panelLanguage, wxID_ANY, _("Some character native to specific language you are working with should not decompose to primitives.\nFor optimal decomposition you should set the language correctly."), wxDefaultPosition, wxDefaultSize, 0 );
m_langLabel->Wrap( -1 );
m_langLabel->Wrap( 490 );
bSizerLanguage->Add( m_langLabel, 0, wxALL|wxEXPAND, 5 );
m_langAuto = new wxRadioButton( m_panelLanguage, wxID_ANY, _("Select language &automatically according to selected keyboard"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
@@ -752,14 +809,13 @@ wxZRColaSettingsBase::wxZRColaSettingsBase( wxWindow* parent, wxWindowID id, con
m_panelLanguage->SetSizer( bSizerLanguage );
m_panelLanguage->Layout();
bSizerLanguage->Fit( m_panelLanguage );
m_listbook->AddPage( m_panelLanguage, _("Text Language"), true );
m_panelAutoStart = new wxPanel( m_listbook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelAutoStart = new wxPanel( m_listbook, wxID_ANY, wxDefaultPosition, wxSize( 500,-1 ), wxTAB_TRAVERSAL );
wxBoxSizer* bSizerAutoStart;
bSizerAutoStart = new wxBoxSizer( wxVERTICAL );
m_autoStartLabel = new wxStaticText( m_panelAutoStart, wxID_ANY, _("ZRCola can be launched every time you log in to your computer.\nIt will be available on the system tray and via registered shortcuts Win+F5 and Win+F6."), wxDefaultPosition, wxDefaultSize, 0 );
m_autoStartLabel->Wrap( -1 );
m_autoStartLabel->Wrap( 490 );
bSizerAutoStart->Add( m_autoStartLabel, 0, wxALL|wxEXPAND, 5 );
m_autoStart = new wxCheckBox( m_panelAutoStart, wxID_ANY, _("Start ZRCola &automatically on logon"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -768,7 +824,6 @@ wxZRColaSettingsBase::wxZRColaSettingsBase( wxWindow* parent, wxWindowID id, con
m_panelAutoStart->SetSizer( bSizerAutoStart );
m_panelAutoStart->Layout();
bSizerAutoStart->Fit( m_panelAutoStart );
m_listbook->AddPage( m_panelAutoStart, _("Startup"), false );
#ifdef __WXGTK__ // Small icon style not supported in GTK
wxListView* m_listbookListView = m_listbook->GetListView();
@@ -780,7 +835,7 @@ wxZRColaSettingsBase::wxZRColaSettingsBase( wxWindow* parent, wxWindowID id, con
m_listbookListView->SetWindowStyleFlag( m_listbookFlags );
#endif
bSizerContent->Add( m_listbook, 1, wxEXPAND | wxALL, 5 );
bSizerContent->Add( m_listbook, 1, wxALL|wxEXPAND, 5 );
bSizerContent->Add( 0, 0, 0, wxALL|wxEXPAND, 5 );
@@ -805,8 +860,7 @@ wxZRColaSettingsBase::wxZRColaSettingsBase( wxWindow* parent, wxWindowID id, con
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxZRColaSettingsBase::OnInitDialog ) );
m_langAuto->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( wxZRColaSettingsBase::OnLangAuto ), NULL, this );
m_langManual->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( wxZRColaSettingsBase::OnLangManual ), NULL, this );
m_panelLanguage->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxZRColaSettingsBase::OnLanguageUpdate ), NULL, this );
m_sdbSizerButtonsApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnApplyButtonClick ), NULL, this );
m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnOKButtonClick ), NULL, this );
}
@@ -815,8 +869,7 @@ wxZRColaSettingsBase::~wxZRColaSettingsBase()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxZRColaSettingsBase::OnInitDialog ) );
m_langAuto->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( wxZRColaSettingsBase::OnLangAuto ), NULL, this );
m_langManual->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( wxZRColaSettingsBase::OnLangManual ), NULL, this );
m_panelLanguage->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxZRColaSettingsBase::OnLanguageUpdate ), NULL, this );
m_sdbSizerButtonsApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnApplyButtonClick ), NULL, this );
m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnOKButtonClick ), NULL, this );
@@ -840,7 +893,8 @@ wxZRColaAboutBase::wxZRColaAboutBase( wxWindow* parent, wxWindowID id, const wxS
m_staticTextZRCola = new wxStaticText( this, wxID_ANY, _("ZRCola"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextZRCola->Wrap( -1 );
m_staticTextZRCola->SetFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_staticTextZRCola->SetFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_staticTextZRCola->SetMaxSize( wxSize( 400,-1 ) );
bSizerText->Add( m_staticTextZRCola, 0, wxALL|wxEXPAND, 5 );
@@ -848,8 +902,8 @@ wxZRColaAboutBase::wxZRColaAboutBase( wxWindow* parent, wxWindowID id, const wxS
m_staticTextVersion->Wrap( -1 );
bSizerText->Add( m_staticTextVersion, 0, wxALL|wxEXPAND, 5 );
m_staticTextColophone = new wxStaticText( this, wxID_ANY, _("Program and Website Editor: Janoš Ježovnik\nDevelopment: Amebis, d. o. o., Kamnik\nDevelopment and maintenance (2004-2015): dr. Peter Weiss"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextColophone->Wrap( -1 );
m_staticTextColophone = new wxStaticText( this, wxID_ANY, _("Program and Website Editor: Janoš Ježovnik\nDevelopment: Amebis, d. o. o., Kamnik\nTranslation into English: Janoš Ježovnik\nTranslation into Russian language: Domen Krvina, Silvo Torkar, Anastasia Plotnikova\nDevelopment and maintenance of the original program (20042015): Peter Weiss"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextColophone->Wrap( 400 );
bSizerText->Add( m_staticTextColophone, 0, wxALL|wxEXPAND, 5 );
m_staticTextCopyright = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
@@ -862,11 +916,11 @@ wxZRColaAboutBase::wxZRColaAboutBase( wxWindow* parent, wxWindowID id, const wxS
bSizerText->Add( 0, 0, 0, wxALL|wxEXPAND, 5 );
m_staticTextDeclaration = new wxStaticText( this, wxID_ANY, _("Texts made using ZRCola have to include in the colophon, foreword, footnote or some other appropriate part of the publication the note below:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDeclaration = new wxStaticText( this, wxID_ANY, _("Texts made using ZRCola have to include in a footnote or some other appropriate part of the publication the note below:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDeclaration->Wrap( 400 );
bSizerText->Add( m_staticTextDeclaration, 0, wxALL|wxEXPAND, 5 );
m_declaration = new wxTextCtrl( this, wxID_ANY, _("This text was written using the ZRCola input system (http://zrcola.zrc-sazu.si), developed at the Science and Research Centre of SAZU in Ljubljana (http://www.zrc-sazu.si) by Dr. Peter Weiss."), wxDefaultPosition, wxSize( -1,80 ), wxTE_MULTILINE|wxTE_READONLY );
m_declaration = new wxTextCtrl( this, wxID_ANY, _("This text was written using the ZRCola input system (http://zrcola.zrc-sazu.si), developed at the Science and Research Centre of SAZU in Ljubljana (http://www.zrc-sazu.si) by Peter Weiss."), wxDefaultPosition, wxSize( -1,80 ), wxTE_MULTILINE|wxTE_READONLY );
m_declaration->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 93, 90, false, wxEmptyString ) );
bSizerText->Add( m_declaration, 0, wxALL|wxEXPAND, 5 );
@@ -975,7 +1029,7 @@ wxZRColaCharRequestBase::wxZRColaCharRequestBase( wxWindow* parent, wxWindowID i
m_character = new wxTextCtrl( sbSizerCharacter->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_character->SetMaxLength( 20 );
m_character->SetFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_character->SetFont( wxFont( 20, 70, 90, 90, false, wxT("ZRCola") ) );
m_character->SetToolTip( _("Decomposed character to request") );
sbSizerCharacter->Add( m_character, 0, wxALL|wxEXPAND, 5 );
@@ -990,12 +1044,12 @@ wxZRColaCharRequestBase::wxZRColaCharRequestBase( wxWindow* parent, wxWindowID i
wxStaticBoxSizer* sbSizerContext;
sbSizerContext = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Context") ), wxVERTICAL );
m_contextLbl = new wxStaticText( sbSizerContext->GetStaticBox(), wxID_ANY, _("The &context, examples or short description why and where the character is required:"), wxDefaultPosition, wxDefaultSize, 0 );
m_contextLbl = new wxStaticText( sbSizerContext->GetStaticBox(), wxID_ANY, _("The &context, examples or description why and where the character is required:"), wxDefaultPosition, wxDefaultSize, 0 );
m_contextLbl->Wrap( 400 );
sbSizerContext->Add( m_contextLbl, 0, wxALL|wxEXPAND, 5 );
m_context = new wxTextCtrl( sbSizerContext->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_context->SetFont( wxFont( 16, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_context->SetFont( wxFont( 16, 70, 90, 90, false, wxT("ZRCola") ) );
m_context->SetToolTip( _("Additional notes for character request") );
sbSizerContext->Add( m_context, 1, wxALL|wxEXPAND, 5 );
@@ -1003,7 +1057,7 @@ wxZRColaCharRequestBase::wxZRColaCharRequestBase( wxWindow* parent, wxWindowID i
bSizerContent->Add( sbSizerContext, 60, wxALL|wxEXPAND, 5 );
m_note = new wxStaticText( this, wxID_ANY, _("After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor.\nYour e-mail application might not display all the characters correctly, but we'll encode the necessarry information so the Editor will be able to read it correctly."), wxDefaultPosition, wxDefaultSize, 0 );
m_note = new wxStaticText( this, wxID_ANY, _("After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor.\nYour e-mail application might not display all the characters correctly, but the Editor will be able to read them correctly anyway."), wxDefaultPosition, wxDefaultSize, 0 );
m_note->Wrap( 400 );
bSizerContent->Add( m_note, 0, wxALL|wxEXPAND, 5 );
@@ -1036,3 +1090,130 @@ wxZRColaCharRequestBase::~wxZRColaCharRequestBase()
m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaCharRequestBase::OnOKButtonClick ), NULL, this );
}
wxZRColaTranslationSeqBase::wxZRColaTranslationSeqBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerContent;
bSizerContent = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerTranslationSet;
sbSizerTranslationSet = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Translation") ), wxVERTICAL );
m_transLbl = new wxStaticText( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, _("ZRCola offers multiple text translations that can be arranged in a sequence.\nPlease select desired translations and the order they are applied."), wxDefaultPosition, wxDefaultSize, 0 );
m_transLbl->Wrap( 452 );
sbSizerTranslationSet->Add( m_transLbl, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerTranslation;
bSizerTranslation = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerTransAvailable;
bSizerTransAvailable = new wxBoxSizer( wxVERTICAL );
m_availableLbl = new wxStaticText( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, _("A&vailable:"), wxDefaultPosition, wxDefaultSize, 0 );
m_availableLbl->Wrap( -1 );
bSizerTransAvailable->Add( m_availableLbl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_available = new wxListBox( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( 200,-1 ), 0, NULL, wxLB_SINGLE|wxLB_SORT );
m_available->SetMinSize( wxSize( 200,150 ) );
bSizerTransAvailable->Add( m_available, 1, wxALL|wxEXPAND, 5 );
bSizerTranslation->Add( bSizerTransAvailable, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerTransSelect;
bSizerTransSelect = new wxBoxSizer( wxVERTICAL );
m_add = new wxButton( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, _(">"), wxDefaultPosition, wxSize( 32,32 ), 0 );
bSizerTransSelect->Add( m_add, 0, wxALL, 5 );
m_remove = new wxButton( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, _("<"), wxDefaultPosition, wxSize( 32,32 ), 0 );
bSizerTransSelect->Add( m_remove, 0, wxALL, 5 );
bSizerTranslation->Add( bSizerTransSelect, 0, wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* bSizerTransSelected;
bSizerTransSelected = new wxBoxSizer( wxVERTICAL );
m_selectedLbl = new wxStaticText( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, _("&Selected:"), wxDefaultPosition, wxDefaultSize, 0 );
m_selectedLbl->Wrap( -1 );
bSizerTransSelected->Add( m_selectedLbl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_selected = new wxListBox( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( 200,-1 ), 0, NULL, wxLB_SINGLE );
m_selected->SetMinSize( wxSize( 200,150 ) );
bSizerTransSelected->Add( m_selected, 1, wxALL|wxEXPAND, 5 );
bSizerTranslation->Add( bSizerTransSelected, 1, wxEXPAND, 5 );
sbSizerTranslationSet->Add( bSizerTranslation, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerTransActiveReorder;
bSizerTransActiveReorder = new wxBoxSizer( wxHORIZONTAL );
m_selectedUp = new wxButton( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, _("Up"), wxDefaultPosition, wxSize( 70,-1 ), 0 );
bSizerTransActiveReorder->Add( m_selectedUp, 0, wxALL, 5 );
m_selectedDown = new wxButton( sbSizerTranslationSet->GetStaticBox(), wxID_ANY, _("Down"), wxDefaultPosition, wxSize( 70,-1 ), 0 );
bSizerTransActiveReorder->Add( m_selectedDown, 0, wxALL, 5 );
sbSizerTranslationSet->Add( bSizerTransActiveReorder, 0, wxALIGN_RIGHT, 5 );
bSizerContent->Add( sbSizerTranslationSet, 1, wxEXPAND|wxALL, 5 );
bSizerContent->Add( 0, 0, 0, wxEXPAND|wxALL, 5 );
m_sdbSizerButtons = new wxStdDialogButtonSizer();
m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
m_sdbSizerButtons->Realize();
bSizerContent->Add( m_sdbSizerButtons, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bSizerContent );
this->Layout();
bSizerContent->Fit( this );
this->Centre( wxBOTH );
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxZRColaTranslationSeqBase::OnInitDialog ) );
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxZRColaTranslationSeqBase::OnUpdate ) );
m_available->Connect( wxEVT_CHAR, wxKeyEventHandler( wxZRColaTranslationSeqBase::OnAvailableChar ), NULL, this );
m_available->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnAvailableDClick ), NULL, this );
m_add->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnAdd ), NULL, this );
m_remove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnRemove ), NULL, this );
m_selected->Connect( wxEVT_CHAR, wxKeyEventHandler( wxZRColaTranslationSeqBase::OnSelectedChar ), NULL, this );
m_selected->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnSelectedDClick ), NULL, this );
m_selectedUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnSelectedUp ), NULL, this );
m_selectedDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnSelectedDown ), NULL, this );
m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnOKButtonClick ), NULL, this );
}
wxZRColaTranslationSeqBase::~wxZRColaTranslationSeqBase()
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( wxZRColaTranslationSeqBase::OnInitDialog ) );
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( wxZRColaTranslationSeqBase::OnUpdate ) );
m_available->Disconnect( wxEVT_CHAR, wxKeyEventHandler( wxZRColaTranslationSeqBase::OnAvailableChar ), NULL, this );
m_available->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnAvailableDClick ), NULL, this );
m_add->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnAdd ), NULL, this );
m_remove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnRemove ), NULL, this );
m_selected->Disconnect( wxEVT_CHAR, wxKeyEventHandler( wxZRColaTranslationSeqBase::OnSelectedChar ), NULL, this );
m_selected->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnSelectedDClick ), NULL, this );
m_selectedUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnSelectedUp ), NULL, this );
m_selectedDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnSelectedDown ), NULL, this );
m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaTranslationSeqBase::OnOKButtonClick ), NULL, this );
}

View File

@@ -25,6 +25,7 @@ class wxZRColaCharGrid;
#include <wx/settings.h>
#include <wx/aui/aui.h>
#include <wx/aui/auibar.h>
#include <wx/choice.h>
class wxZRColaCharacterCatalogPanel;
class wxZRColaComposerPanel;
#include <wx/statusbr.h>
@@ -35,17 +36,16 @@ class wxZRColaComposerPanel;
#include <wx/panel.h>
#include <wx/splitter.h>
#include <wx/timer.h>
#include <wx/choice.h>
#include <wx/grid.h>
#include <wx/checkbox.h>
#include <wx/srchctrl.h>
#include <wx/checklst.h>
#include <wx/hyperlink.h>
#include <wx/checklst.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/radiobut.h>
#include <wx/listbox.h>
#include <wx/checkbox.h>
#include <wx/listbook.h>
#include <wx/listctrl.h>
#include <wx/statbmp.h>
@@ -63,12 +63,14 @@ class wxZRColaFrameBase : public wxFrame
enum
{
wxID_CHARACTER_SELECTOR = 1000,
wxID_SEND_COMPOSED,
wxID_SEND_DECOMPOSED,
wxID_SEND_DESTINATION,
wxID_COPY_DESTINATION_AND_RETURN,
wxID_SEND_SOURCE,
wxID_COPY_SOURCE_AND_RETURN,
wxID_SEND_ABORT,
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_COMPOSE,
wxID_TOOLBAR_TRANSLATE,
wxID_PANEL_CHRGRPS,
wxID_HELP_INSTRUCTIONS,
wxID_HELP_SHORTCUTS,
@@ -85,10 +87,11 @@ class wxZRColaFrameBase : public wxFrame
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarCompose;
wxAuiToolBar* m_toolbarTranslate;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendComposed;
wxAuiToolBarItem* m_toolSendDecomposed;
wxAuiToolBarItem* m_toolSendDestination;
wxAuiToolBarItem* m_toolSendSource;
wxChoice* m_toolTranslationSeq;
wxZRColaCharacterCatalogPanel* m_panelChrCat;
wxStatusBar* m_statusBar;
@@ -96,6 +99,7 @@ class wxZRColaFrameBase : public wxFrame
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnTranslationSeqChoice( wxCommandEvent& event ) { event.Skip(); }
public:
@@ -121,43 +125,43 @@ class wxZRColaComposerPanelBase : public wxPanel
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterDecomposed;
wxPanel* m_panelDecomposedEdit;
wxPanel* m_panelDecomposedHex;
wxTextCtrl* m_decomposedHex;
wxSplitterWindow* m_splitterComposed;
wxPanel* m_panelComposedEdit;
wxPanel* m_panelComposedHex;
wxTextCtrl* m_composedHex;
wxSplitterWindow* m_splitterSource;
wxPanel* m_panelSourceEdit;
wxPanel* m_panelSourceHex;
wxTextCtrl* m_sourceHex;
wxSplitterWindow* m_splitterDestination;
wxPanel* m_panelDestinationEdit;
wxPanel* m_panelDestinationHex;
wxTextCtrl* m_destinationHex;
wxTimer m_timerSave;
// Virtual event handlers, overide them in your derived class
virtual void OnDecomposedPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDecomposedText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDecomposedHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnComposedPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnComposedText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnComposedHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSourcePaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSourceText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSourceHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnDestinationText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDestinationHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSaveTimer( wxTimerEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_decomposed;
wxTextCtrl* m_composed;
wxTextCtrl* m_source;
wxTextCtrl* m_destination;
wxZRColaComposerPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaComposerPanel") );
~wxZRColaComposerPanelBase();
void m_splitterDecomposedOnIdle( wxIdleEvent& )
void m_splitterSourceOnIdle( wxIdleEvent& )
{
m_splitterDecomposed->SetSashPosition( -5 );
m_splitterDecomposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDecomposedOnIdle ), NULL, this );
m_splitterSource->SetSashPosition( -5 );
m_splitterSource->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterSourceOnIdle ), NULL, this );
}
void m_splitterComposedOnIdle( wxIdleEvent& )
void m_splitterDestinationOnIdle( wxIdleEvent& )
{
m_splitterComposed->SetSashPosition( -5 );
m_splitterComposed->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterComposedOnIdle ), NULL, this );
m_splitterDestination->SetSashPosition( -5 );
m_splitterDestination->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaComposerPanelBase::m_splitterDestinationOnIdle ), NULL, this );
}
};
@@ -172,11 +176,13 @@ class wxZRColaCharacterCatalogPanelBase : public wxPanel
protected:
wxChoice* m_choice;
wxZRColaCharGrid* m_grid;
wxCheckBox* m_show_all;
// Virtual event handlers, overide them in your derived class
virtual void OnChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnGridClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnGridKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnShowAll( wxCommandEvent& event ) { event.Skip(); }
public:
@@ -195,6 +201,8 @@ class wxZRColaCharSelectBase : public wxDialog
protected:
wxSearchCtrl* m_search;
wxHyperlinkCtrl* m_search_more;
wxPanel* m_search_panel;
wxCheckListBox* m_categories;
wxHyperlinkCtrl* m_categoriesAll;
wxHyperlinkCtrl* m_categoriesNone;
@@ -206,6 +214,7 @@ class wxZRColaCharSelectBase : public wxDialog
wxTextCtrl* m_shortcut;
wxGrid* m_gridPreview;
wxTextCtrl* m_description;
wxTextCtrl* m_tags;
wxTextCtrl* m_category;
wxHyperlinkCtrl* m_navigateBack;
wxHyperlinkCtrl* m_navigateForward;
@@ -217,6 +226,7 @@ class wxZRColaCharSelectBase : public wxDialog
// Virtual event handlers, overide them in your derived class
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSearchMore( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
@@ -266,8 +276,7 @@ class wxZRColaSettingsBase : public wxDialog
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnLangAuto( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLangManual( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLanguageUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnApplyButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
@@ -359,4 +368,46 @@ class wxZRColaCharRequestBase : public wxDialog
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaTranslationSeqBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaTranslationSeqBase : public wxDialog
{
private:
protected:
wxStaticText* m_transLbl;
wxStaticText* m_availableLbl;
wxListBox* m_available;
wxButton* m_add;
wxButton* m_remove;
wxStaticText* m_selectedLbl;
wxListBox* m_selected;
wxButton* m_selectedUp;
wxButton* m_selectedDown;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnAvailableChar( wxKeyEvent& event ) { event.Skip(); }
virtual void OnAvailableDClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAdd( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemove( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedChar( wxKeyEvent& event ) { event.Skip(); }
virtual void OnSelectedDClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedUp( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectedDown( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaTranslationSeqBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Custom Translation Sequence"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
~wxZRColaTranslationSeqBase();
};
#endif //__ZRCOLAGUI_H__

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -39,12 +39,17 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
if (e.GetKeyCode() == WXK_INSERT) {
// Insert key has been pressed.
m_is_insert = true;
wxFrame *pFrame = wxDynamicCast(((ZRColaApp*)wxTheApp)->m_mainWnd, wxFrame);
wxFrame *pFrame = wxDynamicCast(dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd, wxFrame);
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(_("INS key is pressed. Type the Unicode code of desired character now (up to four hexadecimal digits: 0-9, A-F), then release INS."));
} else if (m_is_insert) {
wxChar chr = e.GetUnicodeKey();
wxFrame *pFrame = wxDynamicCast(((ZRColaApp*)wxTheApp)->m_mainWnd, wxFrame);
if (!chr) {
int key = e.GetKeyCode();
if (WXK_NUMPAD0 <= key && key <= WXK_NUMPAD9)
chr = '0' + (key - WXK_NUMPAD0);
}
wxFrame *pFrame = wxDynamicCast(dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd, wxFrame);
if (('0' <= chr && chr <= '9' || 'A' <= chr && chr <= 'F') && m_insert_seq.size() < 4) {
// A hex-digit pressed. Save it.
m_insert_seq.push_back((char)chr);
@@ -68,7 +73,7 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
#endif
)
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
ZRCola::keyseq_db::indexKey::size_type start;
bool found;
wxFrame *pFrame = wxDynamicCast(app->m_mainWnd, wxFrame);
@@ -91,13 +96,9 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
(e.AltDown() ? ZRCola::keyseq_db::keyseq::ALT : 0);
m_seq.push_back(key);
std::vector<ZRCola::keyseq_db::keyseq::key_t>::size_type n = m_seq.size();
ZRCola::keyseq_db::keyseq *ks = (ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::keyseq_db::keyseq::key_t)*n];
ks->chr = 0;
ks->seq_len = n;
memcpy(ks->seq, m_seq.data(), sizeof(ZRCola::keyseq_db::keyseq::key_t)*n);
std::unique_ptr<ZRCola::keyseq_db::keyseq> ks((ZRCola::keyseq_db::keyseq*)new char[sizeof(ZRCola::keyseq_db::keyseq) + sizeof(ZRCola::keyseq_db::keyseq::key_t)*m_seq.size()]);
ks->ZRCola::keyseq_db::keyseq::keyseq(m_seq.data(), m_seq.size());
found = app->m_ks_db.idxKey.find(*ks, start);
delete ks;
}
if (found) {
@@ -111,14 +112,14 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
wxObject *obj = event.GetEventObject();
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
// Push text to source control.
((wxTextCtrl*)obj)->WriteText(ks.chr);
((wxTextCtrl*)obj)->WriteText(wxString(ks.chr(), ks.chr_len()));
// Event is fully processed now.
event.StopPropagation();
return true;
}
} else if (start < app->m_ks_db.idxKey.size() &&
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), app->m_ks_db.idxKey[start].seq, std::min<unsigned __int16>(app->m_ks_db.idxKey[start].seq_len, m_seq.size())) == 0)
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), app->m_ks_db.idxKey[start].seq(), std::min<size_t>(app->m_ks_db.idxKey[start].seq_len(), m_seq.size())) == 0)
{
// The sequence is a partial match. Continue watching.
if (pFrame && pFrame->GetStatusBar())
@@ -138,11 +139,11 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
wxKeyEvent &e = (wxKeyEvent&)event;
if (m_is_insert && e.GetKeyCode() == WXK_INSERT) {
// Insert key has been depressed.
wxFrame *pFrame = wxDynamicCast(((ZRColaApp*)wxTheApp)->m_mainWnd, wxFrame);
wxFrame *pFrame = wxDynamicCast(dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd, wxFrame);
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(wxEmptyString);
std::vector<char>::size_type count = m_insert_seq.size();
auto count = m_insert_seq.size();
if (count) {
// Zero terminate sequence and parse the Unicode value.
m_insert_seq.push_back(0);

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -26,15 +26,15 @@
wxZRColaSettings::wxZRColaSettings(wxWindow* parent) :
m_lang_auto(true),
m_lang(ZRCola::langid_t_blank),
m_lang(ZRCola::langid_t::blank),
wxZRColaSettingsBase(parent)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_languages->Clear();
for (size_t i = 0, n = app->m_lang_db.idxLng.size(); i < n; i++) {
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i];
for (size_t i = 0, n = app->m_lang_db.idxLang.size(); i < n; i++) {
const auto &lang = app->m_lang_db.idxLang[i];
wxString
label(lang.name, lang.name_len),
label(lang.name(), lang.name_len()),
label_tran(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
m_languages->Insert(label_tran, i);
}
@@ -57,23 +57,17 @@ void wxZRColaSettings::OnInitDialog(wxInitDialogEvent& event)
m_languages->Enable(!m_lang_auto);
(m_lang_auto ? m_langAuto : m_langManual)->SetValue(true);
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
char l[sizeof(ZRCola::language_db::language)] = {};
((ZRCola::language_db::language*)l)->id = m_lang;
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
ZRCola::language_db::indexLang::size_type start;
m_languages->Select(app->m_lang_db.idxLng.find(*(ZRCola::language_db::language*)l, start) ? start : -1);
m_languages->Select(app->m_lang_db.idxLang.find(ZRCola::language_db::language(m_lang), start) ? start : -1);
}
void wxZRColaSettings::OnLangAuto(wxCommandEvent& event)
void wxZRColaSettings::OnLanguageUpdate(wxUpdateUIEvent& event)
{
m_languages->Enable(!event.IsChecked());
}
m_languages->Enable(m_langManual->GetValue());
void wxZRColaSettings::OnLangManual(wxCommandEvent& event)
{
m_languages->Enable(event.IsChecked());
wxZRColaSettingsBase::OnLanguageUpdate(event);
}
@@ -121,21 +115,20 @@ void wxZRColaSettings::OnApplyButtonClick(wxCommandEvent& event)
} else {
m_lang_auto = false;
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[m_languages->GetSelection()];
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
const auto &lang = app->m_lang_db.idxLang[m_languages->GetSelection()];
if (m_lang != lang.id) {
m_lang = lang.id;
if (m_lang != lang.lang) {
m_lang = lang.lang;
// Notify composed text something changed and should re-decompose.
// Notify destination text something changed and should re-inverse translate.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
app->m_mainWnd->m_panel->m_composed->ProcessWindowEvent(event2);
app->m_mainWnd->m_panel->m_destination->ProcessWindowEvent(event2);
}
}
}
void wxZRColaSettings::OnOKButtonClick(wxCommandEvent& event)
{
wxZRColaSettings::OnApplyButtonClick(event);
@@ -155,7 +148,7 @@ void wxPersistentZRColaSettings::Save() const
{
wxPersistentDialog::Save();
const wxZRColaSettings * const wnd = static_cast<const wxZRColaSettings*>(GetWindow());
auto wnd = static_cast<const wxZRColaSettings*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
SaveValue(wxT("langAuto"), wnd->m_lang_auto);
SaveValue(wxT("lang" ), wxString::FromAscii(wnd->m_lang.data, _countof(wnd->m_lang.data)));
@@ -164,9 +157,8 @@ void wxPersistentZRColaSettings::Save() const
bool wxPersistentZRColaSettings::Restore()
{
wxZRColaSettings * const wnd = static_cast<wxZRColaSettings*>(GetWindow());
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
auto wnd = dynamic_cast<wxZRColaSettings*>(GetWindow());
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString lang;
// Restore automatic language detection setting first.
@@ -180,11 +172,11 @@ bool wxPersistentZRColaSettings::Restore()
} else if (RestoreValue(wxT("lang"), &lang) && lang.Length() == 3) {
// The language was read from configuration.
wnd->m_lang = lang.c_str();
} else if (!app->m_lang_db.idxLng.empty()) {
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[0];
wnd->m_lang = lang.id;
} else if (!app->m_lang_db.idxLang.empty()) {
const auto &lang = app->m_lang_db.idxLang[0];
wnd->m_lang = lang.lang;
} else
wnd->m_lang = ZRCola::langid_t_blank;
wnd->m_lang = ZRCola::langid_t::blank;
return wxPersistentDialog::Restore();
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -28,6 +28,7 @@ class wxPersistentZRColaSettings;
#include "zrcolagui.h"
#include <wxex/persist/dialog.h>
#include <vector>
///
@@ -42,14 +43,13 @@ public:
protected:
virtual void OnInitDialog(wxInitDialogEvent& event);
virtual void OnLangAuto(wxCommandEvent& event);
virtual void OnLangManual(wxCommandEvent& event);
virtual void OnLanguageUpdate(wxUpdateUIEvent& event);
virtual void OnApplyButtonClick(wxCommandEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
public:
bool m_lang_auto; ///< Is language for decomposing resolved using currently selected keyboard
ZRCola::langid_t m_lang; ///< Language for decomposing
bool m_lang_auto; ///< Is language for inverse translation resolved using currently selected keyboard
ZRCola::langid_t m_lang; ///< Language for inverse translation
};

253
ZRCola/zrcolatranseq.cpp Normal file
View File

@@ -0,0 +1,253 @@
/*
Copyright 2015-2017 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////
// wxZRColaTranslationSeq
//////////////////////////////////////////////////////////////////////////
wxZRColaTranslationSeq::wxZRColaTranslationSeq(wxWindow* parent) :
wxZRColaTranslationSeqBase(parent)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_available->Clear();
for (size_t i = 0, n = app->m_ts_db.idxTranSet.size(); i < n; i++) {
const ZRCola::transet_db::transet &ts = app->m_ts_db.idxTranSet[i];
wxString
src(ts.src(), ts.src_len()),
dst(ts.dst(), ts.dst_len()),
src_tran(wxGetTranslation(src, wxT("ZRCola-zrcdb"))),
dst_tran(wxGetTranslation(dst, wxT("ZRCola-zrcdb"))),
label_tran(wxString::Format(wxT("%s \x00bb %s"), src_tran.c_str(), dst_tran.c_str()));
m_available->Append(label_tran, (void*)ts.set);
}
}
void wxZRColaTranslationSeq::OnInitDialog(wxInitDialogEvent& event)
{
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_selected->Clear();
for (auto s = m_transeq.cbegin(), s_end = m_transeq.cend(); s != s_end; ++s) {
ZRCola::transet_db::indexTranSet::size_type start;
if (app->m_ts_db.idxTranSet.find(ZRCola::transet_db::transet(*s), start)) {
const ZRCola::transet_db::transet &ts = app->m_ts_db.idxTranSet[start];
wxString
src(ts.src(), ts.src_len()),
dst(ts.dst(), ts.dst_len()),
src_tran(wxGetTranslation(src, wxT("ZRCola-zrcdb"))),
dst_tran(wxGetTranslation(dst, wxT("ZRCola-zrcdb"))),
label_tran(wxString::Format(wxT("%s \x00bb %s"), src_tran.c_str(), dst_tran.c_str()));
m_selected->Append(label_tran, (void*)ts.set);
} else {
wxString label_tran(wxString::Format(_("Unknown translation (%u)"), (unsigned int)*s));
m_selected->Append(label_tran, (void*)*s);
}
}
wxZRColaTranslationSeqBase::OnInitDialog(event);
}
void wxZRColaTranslationSeq::OnUpdate(wxUpdateUIEvent& event)
{
m_add->Enable(m_available->GetSelection() != wxNOT_FOUND);
int idx = m_selected->GetSelection();
m_remove ->Enable(idx != wxNOT_FOUND);
m_selectedUp ->Enable(idx != wxNOT_FOUND && (unsigned int)idx > 0);
m_selectedDown->Enable(idx != wxNOT_FOUND && (unsigned int)idx < m_selected->GetCount() - 1);
wxZRColaTranslationSeqBase::OnUpdate(event);
}
void wxZRColaTranslationSeq::OnAvailableChar(wxKeyEvent& event)
{
if (event.GetRawKeyCode() == VK_INSERT) {
int idx = m_available->GetSelection();
if (idx != wxNOT_FOUND) {
m_selected->Append(
m_available->GetString(idx),
m_available->GetClientData(idx));
}
}
wxZRColaTranslationSeqBase::OnAvailableChar(event);
}
void wxZRColaTranslationSeq::OnAvailableDClick(wxCommandEvent& event)
{
int idx = m_available->GetSelection();
if (idx != wxNOT_FOUND) {
m_selected->Append(
m_available->GetString(idx),
m_available->GetClientData(idx));
}
wxZRColaTranslationSeqBase::OnAvailableDClick(event);
}
void wxZRColaTranslationSeq::OnAdd(wxCommandEvent& event)
{
int idx = m_available->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND, wxT("no available translation selected"));
m_selected->Append(
m_available->GetString(idx),
m_available->GetClientData(idx));
wxZRColaTranslationSeqBase::OnAdd(event);
}
void wxZRColaTranslationSeq::OnRemove(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND, wxT("no active translation selected"));
m_selected->Delete(idx);
wxZRColaTranslationSeqBase::OnRemove(event);
}
void wxZRColaTranslationSeq::OnSelectedChar(wxKeyEvent& event)
{
if (event.GetRawKeyCode() == VK_DELETE) {
int idx = m_selected->GetSelection();
if (idx != wxNOT_FOUND)
m_selected->Delete(idx);
}
wxZRColaTranslationSeqBase::OnSelectedChar(event);
}
void wxZRColaTranslationSeq::OnSelectedDClick(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
if (idx != wxNOT_FOUND)
m_selected->Delete(idx);
wxZRColaTranslationSeqBase::OnSelectedDClick(event);
}
void wxZRColaTranslationSeq::OnSelectedUp(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND && (unsigned int)idx > 0, wxT("no or first active translation selected"));
wxString label = m_selected->GetString(idx);
void *data = m_selected->GetClientData(idx);
m_selected->Delete(idx);
m_selected->Insert(label, idx - 1, data);
m_selected->Select(idx - 1);
wxZRColaTranslationSeqBase::OnSelectedUp(event);
}
void wxZRColaTranslationSeq::OnSelectedDown(wxCommandEvent& event)
{
int idx = m_selected->GetSelection();
wxASSERT_MSG(idx != wxNOT_FOUND && (unsigned int)idx < m_selected->GetCount() - 1, wxT("no or last active translation selected"));
wxString label = m_selected->GetString(idx);
void *data = m_selected->GetClientData(idx);
m_selected->Delete(idx);
m_selected->Insert(label, idx + 1, data);
m_selected->Select(idx + 1);
wxZRColaTranslationSeqBase::OnSelectedDown(event);
}
void wxZRColaTranslationSeq::OnApplyButtonClick(wxCommandEvent& event)
{
event.Skip();
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_transeq.clear();
for (unsigned int i = 0, n = m_selected->GetCount(); i < n; i++)
m_transeq.push_back(reinterpret_cast<ZRCola::transetid_t>(m_selected->GetClientData(i)));
// Notify source text something changed and should re-translate.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
app->m_mainWnd->m_panel->m_source->ProcessWindowEvent(event2);
}
void wxZRColaTranslationSeq::OnOKButtonClick(wxCommandEvent& event)
{
wxZRColaTranslationSeq::OnApplyButtonClick(event);
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaTranslationSeq
//////////////////////////////////////////////////////////////////////////
wxPersistentZRColaTranslationSeq::wxPersistentZRColaTranslationSeq(wxZRColaTranslationSeq *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaTranslationSeq::Save() const
{
wxPersistentDialog::Save();
auto wnd = static_cast<const wxZRColaTranslationSeq*>(GetWindow()); // dynamic_cast is not reliable as we are typically called late in the wxTopLevelWindowMSW destructor.
wxString str;
bool first = true;
for (auto s = wnd->m_transeq.cbegin(), s_end = wnd->m_transeq.cend(); s != s_end; ++s, first = false)
str += wxString::Format(first ? wxT("%u") : wxT("|%u"), *s);
SaveValue(wxT("transeq"), str);
}
bool wxPersistentZRColaTranslationSeq::Restore()
{
auto wnd = dynamic_cast<wxZRColaTranslationSeq*>(GetWindow());
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
wxString str;
if (RestoreValue(wxT("transeq"), &str)) {
std::vector<ZRCola::transetid_t> transet;
for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) {
unsigned long val = _tcstoul(tok.GetNextToken().c_str(), NULL, 10);
for (size_t i = 0, n = app->m_ts_db.idxTranSet.size(); i < n; i++) {
const ZRCola::transet_db::transet &cg = app->m_ts_db.idxTranSet[i];
if (cg.set == val) {
transet.push_back(val);
break;
}
}
}
if (!transet.empty())
wnd->m_transeq = std::move(transet);
}
return wxPersistentDialog::Restore();
}

80
ZRCola/zrcolatranseq.h Normal file
View File

@@ -0,0 +1,80 @@
/*
Copyright 2015-2017 Amebis
This file is part of ZRCola.
ZRCola is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZRCola is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
class wxZRColaTranslationSeq;
class wxPersistentZRColaTranslationSeq;
#pragma once
#include "zrcolagui.h"
#include <zrcola/translate.h>
#include <wxex/persist/dialog.h>
#include <vector>
///
/// Configuration dialog
///
class wxZRColaTranslationSeq : public wxZRColaTranslationSeqBase
{
public:
wxZRColaTranslationSeq(wxWindow* parent);
friend class wxPersistentZRColaTranslationSeq; // Allow saving/restoring window state.
protected:
virtual void OnInitDialog(wxInitDialogEvent& event);
virtual void OnUpdate(wxUpdateUIEvent& event);
virtual void OnAvailableChar(wxKeyEvent& event);
virtual void OnAvailableDClick(wxCommandEvent& event);
virtual void OnAdd(wxCommandEvent& event);
virtual void OnRemove(wxCommandEvent& event);
virtual void OnSelectedChar(wxKeyEvent& event);
virtual void OnSelectedDClick(wxCommandEvent& event);
virtual void OnSelectedUp(wxCommandEvent& event);
virtual void OnSelectedDown(wxCommandEvent& event);
virtual void OnApplyButtonClick(wxCommandEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
public:
std::vector<ZRCola::transetid_t> m_transeq; ///< Custom translation set sequence
};
///
/// Supports saving/restoring wxZRColaTranslationSeq state
///
class wxPersistentZRColaTranslationSeq : public wxPersistentDialog
{
public:
wxPersistentZRColaTranslationSeq(wxZRColaTranslationSeq *wnd);
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaTranslationSeq *wnd)
{
return new wxPersistentZRColaTranslationSeq(wnd);
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.
@@ -40,8 +40,8 @@ wxZRColaUpdater::wxZRColaUpdater(wxWindow* parent) :
//Connect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
// Prepare Updater.
ZRColaApp *app = (ZRColaApp*)wxTheApp;
m_updater = new wxUpdCheckThread(app->m_locale.GetCanonicalName(), this);
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
m_updater = new wxUpdCheckThread(app->m_lang_ui == wxLANGUAGE_DEFAULT ? wxT("en_US") : wxLocale::GetLanguageCanonicalName(app->m_lang_ui), this);
//if (m_updater->Run() != wxTHREAD_NO_ERROR) {
// wxFAIL_MSG(wxT("Can't create the thread!"));
// delete m_updater;
@@ -95,7 +95,7 @@ void wxZRColaUpdater::OnUpdate(wxCommandEvent& event)
m_updater->LaunchUpdate();
Close(true);
((ZRColaApp*)wxTheApp)->m_mainWnd->Close();
dynamic_cast<ZRColaApp*>(wxTheApp)->m_mainWnd->Close();
}
}
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015-2016 Amebis
Copyright 2015-2017 Amebis
This file is part of ZRCola.

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\lib\stdex\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\lib\WinStd\include;..\lib\stdex\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>

Some files were not shown because too many files have changed in this diff Show More