Compare commits

...

100 Commits

Author SHA1 Message Date
Simon Rozman
3f64aef58d Version set to 2.0-beta2 2016-05-31 10:41:15 +02:00
Simon Rozman
2dc6b2d4f5 ZRCola declaration instruction added 2016-05-31 10:39:10 +02:00
Simon Rozman
c938320c45 Character selector dialog upgrade: tool tips and keyboard shortcut display added 2016-05-31 08:32:32 +02:00
Simon Rozman
d7968f539c Related character detection is smarter and more accurate now 2016-05-30 12:11:16 +02:00
Simon Rozman
beabeb17aa Character preview grid control allows Tab traversal now 2016-05-30 11:55:22 +02:00
Simon Rozman
155f12f44e Backward/forward navigation in Character Selector introduced 2016-05-30 09:43:28 +02:00
Simon Rozman
d46a1d4041 Select All/None/Invert feature added to categories in Character Selector 2016-05-26 17:16:51 +02:00
Simon Rozman
c195a07982 Code simplified as the benefit did not outweigh complexity 2016-05-26 16:27:55 +02:00
Simon Rozman
6c82b6333f AEsthetic modifications 2016-05-26 16:02:44 +02:00
Simon Rozman
1178406aa9 Related character generation finished
(closes #26)
2016-05-26 15:57:49 +02:00
Simon Rozman
1e09407742 Related characters preparation multi-threaded now 2016-05-26 12:59:06 +02:00
Simon Rozman
a7b5e1a573 Related characters feature work continues... 2016-05-26 12:03:43 +02:00
Simon Rozman
d70b72b0c1 Inactive related characters removed 2016-05-26 08:53:38 +02:00
Simon Rozman
7bbe92d359 Version set to 2.0-beta1. 2016-05-26 07:22:00 +02:00
Simon Rozman
0e844cd5e4 Incorrect string reset in DBSource::GetValue() fixed 2016-05-25 15:49:56 +02:00
Simon Rozman
67a6fd18e4 Empty character categories removed from database 2016-05-25 13:57:33 +02:00
Simon Rozman
1fcd2d2689 std namespace omitted for code clarity 2016-05-25 13:24:37 +02:00
Simon Rozman
1becda5600 ZRColaInstall*.exe utility publishing added 2016-05-25 13:21:46 +02:00
Simon Rozman
9bccaefabb Other language variations of ZRColaInstallSl.exe utility added 2016-05-25 13:21:13 +02:00
Simon Rozman
7e3e24232d Key codes are translated to English U.S. keyboard correctly now 2016-05-25 12:44:00 +02:00
Simon Rozman
6733ef3cfc wxAuiManager persistence changed to resolve asserts in Win32 builds 2016-05-25 00:07:34 +02:00
Simon Rozman
38f47db6d6 Temporary modal dialogs moved to stack 2016-05-24 23:18:45 +02:00
Simon Rozman
5a26350153 Sub-module update 2016-05-24 23:18:26 +02:00
Simon Rozman
5570a73895 Log level for is now adjusted to allow display of Updater progress for release builds too 2016-05-24 23:17:09 +02:00
Simon Rozman
de98129893 Database update 2016-05-24 22:24:17 +02:00
Simon Rozman
4898492972 Sub-module update 2016-05-24 22:13:09 +02:00
Simon Rozman
73c2146fe2 Missing wxSocketBase::Shutdown() added 2016-05-24 21:47:34 +02:00
Simon Rozman
44c86e2886 Manual check for updates added
(closes #22)
2016-05-24 16:53:26 +02:00
Simon Rozman
3c2e689ae2 Index-out-of-bounds issue fixed 2016-05-24 12:18:49 +02:00
Simon Rozman
5d215f628b Icon for ZRColaInstall added 2016-05-24 11:40:39 +02:00
Simon Rozman
e055207cea Installer bootstrap utility introduced 2016-05-24 10:31:53 +02:00
Simon Rozman
8f10cff923 Digital signatures reverted to SHA-1 for Windows XP and Vista support 2016-05-24 10:31:11 +02:00
Simon Rozman
91c44c388f About dialog extended 2016-05-24 08:43:03 +02:00
Simon Rozman
79664972a3 Grid navigation to previous/next row using left and right arrow keys added 2016-05-23 18:59:12 +02:00
Simon Rozman
d36c47e8a6 Character not implemented in 00 ZRCola font removed 2016-05-23 18:41:36 +02:00
Simon Rozman
16a28cd011 Font and database update 2016-05-23 15:35:50 +02:00
Simon Rozman
73f1d4d2c9 Unicode control characters removed from the lists 2016-05-23 15:15:31 +02:00
Simon Rozman
26c899734b The character entered via Unicode in Character Selector is now looked up in search results, brought into view and selected. 2016-05-23 15:03:09 +02:00
Simon Rozman
ff6a551c50 Unicode code in Character Selector is four hexadecimal digits long now 2016-05-23 15:02:08 +02:00
Simon Rozman
72ba4377c8 Sub-module update 2016-05-23 15:01:01 +02:00
Simon Rozman
3f02306182 Font of character preview in character selector reduced for less clipping 2016-05-23 10:50:43 +02:00
Simon Rozman
9c03547378 ZRCola window is now brought front and focused when invoked from iconized state.
(fixes #25)
2016-05-23 10:41:32 +02:00
Simon Rozman
5271aca526 Double application launch prevention lock added
(fixes #24)
2016-05-23 10:40:07 +02:00
Simon Rozman
dbcf539616 Sub-module update 2016-05-23 10:32:25 +02:00
Simon Rozman
903c635b34 Sub-module update 2016-05-16 12:23:14 +02:00
Simon Rozman
6c13837398 Couple of compiler warnings resolved 2016-05-16 10:44:05 +02:00
Simon Rozman
3126091e0b Sub-module update 2016-05-13 20:05:34 +02:00
Simon Rozman
bb1b0e64d6 German and Russian translation stub added 2016-05-13 20:05:18 +02:00
Simon Rozman
78ccf1b2cf Version set to 2.0-beta 2016-05-13 18:54:11 +02:00
Simon Rozman
c921d533a9 Issue with non included term trailing in sub-word index fixed 2016-05-13 18:47:12 +02:00
Simon Rozman
e4fb91e305 Settings moved from menu(s) to configuration dialog
(closes #21)
2016-05-13 16:22:51 +02:00
Simon Rozman
a81dd7e250 Character request feature added
(closes #13)
2016-05-13 13:36:25 +02:00
Simon Rozman
a4fe4b6a26 Current character category display added to character selector 2016-05-13 13:24:18 +02:00
Simon Rozman
1198579963 Character category index fixed 2016-05-13 13:22:17 +02:00
Simon Rozman
5d732522fe wxZRColaCharGrid memory leak fixed
(fixes #23)
2016-05-13 13:21:39 +02:00
Simon Rozman
155fb03c5a Character search moved to separate thread for smoother experience 2016-05-13 12:11:38 +02:00
Simon Rozman
710937f8df Language ID type redeclaration for easier and safer work 2016-05-13 10:16:29 +02:00
Simon Rozman
4e435b044c Additional operators 2016-05-13 10:16:23 +02:00
Simon Rozman
4ec7dc3ca5 Search optimizations 2016-05-13 09:32:36 +02:00
Simon Rozman
9c3c1585d5 Character Select finished
(closes #11)
2016-05-13 03:44:28 +02:00
Simon Rozman
53ce3a2411 COMDAT Folding disabled for debug builds 2016-05-12 17:15:04 +02:00
Simon Rozman
643a8dcb82 Sub-module update 2016-05-12 14:12:09 +02:00
Simon Rozman
9337b660d2 Database update 2016-05-12 10:56:07 +02:00
Simon Rozman
44f2ef1ae1 Work on character selector continues 2016-05-11 14:39:57 +02:00
Simon Rozman
4aa0d9183e Support for Unicode character database added 2016-05-11 14:39:20 +02:00
Simon Rozman
e3c6a01722 ZRCola::index::compare_sort() reverts to compare() by default now 2016-05-11 12:40:14 +02:00
Simon Rozman
0d30a89d22 Character selector merged back to continue work
# Conflicts:
#	ZRCola/ZRCola.fbp
#	ZRCola/ZRCola.vcxproj
#	ZRCola/ZRCola.vcxproj.filters
#	ZRCola/locale/sl_SI.po
#	ZRCola/zrcolafrm.cpp
#	ZRCola/zrcolafrm.h
#	ZRCola/zrcolagui.cpp
#	ZRCola/zrcolagui.h
2016-05-11 09:00:59 +02:00
Simon Rozman
23ba447283 ZRCola now minimizes to system tray.
(closes #20)
2016-05-10 13:10:37 +02:00
Simon Rozman
a27f7f470d (De)Composition moved to idle processing & other optimizations
(fixes #19)
2016-05-10 09:41:35 +02:00
Simon Rozman
50790ad01d ZRCola no longer responds to Ctrl+Alt shortcuts when invoked with AltGr 2016-05-09 16:48:54 +02:00
Simon Rozman
ae3344d5eb Aesthetic modifications 2016-05-09 11:57:19 +02:00
Simon Rozman
79ae4855e3 Additional "text updated" event generation added to fix premature event receiving on EM_REPLACESEL
(fixes #19)
2016-05-09 11:57:02 +02:00
Simon Rozman
349bc34fa8 libZRColaUI extended to use wxWidgets and ZRColaApp::GetKeySequenceAsText() moved back to ZRCola::keyseq_db::GetSequenceAsText() for general accessibility 2016-05-09 11:05:21 +02:00
Simon Rozman
92bbc9a8bf Version set to 2.0-alpha7. 2016-05-06 15:05:43 +02:00
Simon Rozman
b88cafcdfd Missing dependency added 2016-05-06 15:05:26 +02:00
Simon Rozman
994ec6461e Non-working locale-specific key sequences issue fixed 2016-05-06 14:27:12 +02:00
Simon Rozman
1867235007 Key sequences (shortcuts) added to Character Catalog tooltips 2016-05-06 13:42:14 +02:00
Simon Rozman
7545e9dadf Key sequence naming moved to ZRCola to allow localization 2016-05-06 13:40:55 +02:00
Simon Rozman
eb67174bed - Key sequences moved to wxZRCola app for global availability
- Top window retrieval mechanism in wxZRColaKeyHandler more robust now
2016-05-06 12:24:21 +02:00
Simon Rozman
8f33c72ad7 Inline function optimization more aggressive now 2016-05-06 12:11:41 +02:00
Simon Rozman
dbdfa139c4 Sub-module update 2016-05-06 12:11:10 +02:00
Simon Rozman
dd87605ac2 Character grid updated to show wxAui style tool tips 2016-05-06 11:56:41 +02:00
Simon Rozman
5c9a9cab03 INS+Unicode status bar message more descriptive now 2016-05-06 11:32:30 +02:00
Simon Rozman
d86c1d004d Tooltips added to character grid 2016-05-06 11:25:41 +02:00
Simon Rozman
7bd217ec47 Aesthetic modifications 2016-05-06 11:25:12 +02:00
Simon Rozman
01c50ba9e1 wxZRColaCharGrid now forwards Tab key to allow classic dialog control navigation 2016-05-06 08:40:03 +02:00
Simon Rozman
f9ef646f22 On-screen character catalog added 2016-05-05 15:37:44 +02:00
Simon Rozman
2a6212d19d Character group data cleanup 2016-05-05 15:21:25 +02:00
Simon Rozman
1a6dc8b723 AUI initial organization fixed 2016-05-05 08:15:54 +02:00
Simon Rozman
3b6eff0b44 Changed Cut/Copy/Paste event forwarding logic to avoid deadlocks in future 2016-05-04 15:54:07 +02:00
Simon Rozman
9a2bc6b743 Language localization optimization 2016-05-04 15:52:47 +02:00
Simon Rozman
6e4cd60152 Character group database support added 2016-05-04 15:49:51 +02:00
Simon Rozman
f2f0b007c4 wxAui becoming main UI 2016-05-03 13:33:43 +02:00
Simon Rozman
306be13fca GUI switched to wxAui 2016-05-03 13:29:24 +02:00
Simon Rozman
eb75e020e9 Folder icon added 2016-05-03 12:44:58 +02:00
Simon Rozman
bbb09f3779 8.3 file names now unique across module variations 2016-05-03 12:43:10 +02:00
Simon Rozman
99a4b2e6c8 Insert+Unicode keyboard feature added 2016-04-30 15:37:06 +02:00
Simon Rozman
3ff9459198 Slovenian translation update 2016-04-30 15:36:03 +02:00
Simon Rozman
8bdef858a0 Composition recognition improvements 2016-04-30 14:55:52 +02:00
Simon Rozman
b7533d4b27 Character selector feature skeleton added 2016-04-26 16:05:42 +02:00
151 changed files with 45502 additions and 1437 deletions

View File

@@ -0,0 +1 @@
System Folder\wxmsw30u_adv_vc100.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

View File

@@ -0,0 +1 @@
System (64-bit) Folder\wxmsw30u_adv_vc100_x64.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

View File

@@ -0,0 +1 @@
System Folder\wxmsw30u_aui_vc100.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

View File

@@ -0,0 +1 @@
System (64-bit) Folder\wxmsw30u_aui_vc100_x64.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

View File

@@ -0,0 +1 @@
System Folder\wxmsw30ud_adv_vc100.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

View File

@@ -0,0 +1 @@
System (64-bit) Folder\wxmsw30ud_adv_vc100_x64.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

View File

@@ -0,0 +1 @@
System Folder\wxmsw30ud_aui_vc100.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

View File

@@ -0,0 +1 @@
System (64-bit) Folder\wxmsw30ud_aui_vc100_x64.dll

Binary file not shown.

View File

@@ -0,0 +1,24 @@
#
# Copyright 1991-2016 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/>.
#
[splosno]
jezik=0
deli=featZRCola
[parametri]

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ZRCola MSI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-14 17:26+0100\n"
"POT-Creation-Date: 2016-05-31 10:09+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <simon.rozman@amebis.si>\n"
@@ -17,8 +18,19 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
#: En.Win32.Debug.Registry-2.idtx:4 En.Win32.Release.Registry-2.idtx:4 En.x64.Debug.Registry-2.idtx:4 En.x64.Release.Registry-2.idtx:4
msgid "#58"
msgstr ""
#, fuzzy
msgid "#60"
msgstr "#176"
#: En.Win32.Debug.Control-2.idtx:11 En.Win32.Release.Control-2.idtx:11 En.x64.Debug.Control-2.idtx:11 En.x64.Release.Control-2.idtx:11
#, fuzzy
msgid "&Continue"
msgstr "&Nadaljuj"
#: En.Win32.Debug.Control-2.idtx:6 En.Win32.Release.Control-2.idtx:6 En.x64.Debug.Control-2.idtx:6 En.x64.Release.Control-2.idtx:6
#, fuzzy
msgid "[DlgTitleFont][SimpleProductName] Declaration"
msgstr "[DlgTitleFont]Deklaracija [SimpleProductName]"
#: En.Win32.Debug.Control-2.idtx:4 En.Win32.Release.Control-2.idtx:4 En.x64.Debug.Control-2.idtx:4 En.x64.Release.Control-2.idtx:4
msgid ""
@@ -758,12 +770,66 @@ msgid ""
"0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000c0ef044c8850cf01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}}"
msgstr ""
#: En.Win32.Debug.Control-2.idtx:3 En.Win32.Debug.Directory-2.idtx:3 En.Win32.Debug.Registry-2.idtx:3 En.Win32.Release.Control-2.idtx:3 En.Win32.Release.Directory-2.idtx:3
#: En.Win32.Release.Registry-2.idtx:3 En.x64.Debug.Control-2.idtx:3 En.x64.Debug.Directory-2.idtx:3 En.x64.Debug.Registry-2.idtx:3 En.x64.Release.Control-2.idtx:3
#: En.x64.Release.Directory-2.idtx:3 En.x64.Release.Registry-2.idtx:3
#: En.Win32.Debug.Control-2.idtx:8 En.Win32.Release.Control-2.idtx:8 En.x64.Debug.Control-2.idtx:8 En.x64.Release.Control-2.idtx:8
#, fuzzy
msgid ""
"{\\rtf1\\ansi\\ansicpg1250\\deff0\\deflang1060\\deflangfe1060\\deftab708{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset238 Calibri;}{\\f1\\froman\\fprq2\\fcharset238{\\*\\fname Times New "
"Roman;}Times New Roman CE;}}{\\colortbl ;\\red0\\green0\\blue255;}{\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\pard\\sa200\\sl276\\slmult1\\i\\f0\\fs22 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.\\f1\\par}"
msgstr ""
"{\\rtf1\\ansi\\ansicpg1250\\deff0\\deflang1060\\deflangfe1060\\deftab708{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset238 Calibri;}{\\f1\\froman\\fprq2\\fcharset238{\\*\\fname Times New "
"Roman;}Times New Roman CE;}}{\\colortbl ;\\red0\\green0\\blue255;}{\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\pard\\sa200\\sl276\\slmult1\\i\\f0\\fs22 Besedilo je bilo "
"pripravljeno z vna\\'9aalnim sistemom ZRCola (http://zrcola.zrc-sazu.si), ki ga je na Znanstvenoraziskovalnem centru SAZU v Ljubljani (http://www.zrc-sazu.si) razvil dr. Peter Weiss."
"\\i0\\f1\\par}"
#: En.Win32.Debug.Feature-2.idtx:5 En.Win32.Release.Feature-2.idtx:5 En.x64.Debug.Feature-2.idtx:5 En.x64.Release.Feature-2.idtx:5
#, fuzzy
msgid "00 ZRCola"
msgstr "00 ZRCola"
#: En.Win32.Debug.Control-2.idtx:3 En.Win32.Debug.Directory-2.idtx:3 En.Win32.Debug.Feature-2.idtx:3 En.Win32.Debug.Registry-2.idtx:3 En.Win32.Release.Control-2.idtx:3
#: En.Win32.Release.Directory-2.idtx:3 En.Win32.Release.Feature-2.idtx:3 En.Win32.Release.Registry-2.idtx:3 En.x64.Debug.Control-2.idtx:3 En.x64.Debug.Directory-2.idtx:3
#: En.x64.Debug.Feature-2.idtx:3 En.x64.Debug.Registry-2.idtx:3 En.x64.Release.Control-2.idtx:3 En.x64.Release.Directory-2.idtx:3 En.x64.Release.Feature-2.idtx:3
#: En.x64.Release.Registry-2.idtx:3
#, fuzzy
msgid "1252"
msgstr "1250"
#: En.Win32.Debug.Control-2.idtx:5 En.Win32.Release.Control-2.idtx:5 En.x64.Debug.Control-2.idtx:5 En.x64.Release.Control-2.idtx:5
#, fuzzy
msgid "binUIHeader.bmp"
msgstr "binUIHeader.bmp"
#: En.Win32.Debug.Feature-2.idtx:4 En.Win32.Release.Feature-2.idtx:4 En.x64.Debug.Feature-2.idtx:4 En.x64.Release.Feature-2.idtx:4
#, fuzzy
msgid "Fonts"
msgstr "Pisave"
#: En.Win32.Debug.Feature-2.idtx:4 En.Win32.Release.Feature-2.idtx:4 En.x64.Debug.Feature-2.idtx:4 En.x64.Release.Feature-2.idtx:4
#, fuzzy
msgid "Fonts used by ZRCola"
msgstr "Pisave, ki jih uporablja ZRCola"
#: En.Win32.Debug.Control-2.idtx:10 En.Win32.Release.Control-2.idtx:10 En.x64.Debug.Control-2.idtx:10 En.x64.Release.Control-2.idtx:10
#, fuzzy
msgid "I &agree."
msgstr "&Strinjam se."
#: En.Win32.Debug.Control-2.idtx:9 En.Win32.Release.Control-2.idtx:9 En.x64.Debug.Control-2.idtx:9 En.x64.Release.Control-2.idtx:9
msgid "Note: This declaration is also available in [SimpleProductName]'s about dialog or on its website."
msgstr ""
#: En.Win32.Debug.Control-2.idtx:7 En.Win32.Release.Control-2.idtx:7 En.x64.Debug.Control-2.idtx:7 En.x64.Release.Control-2.idtx:7
#, fuzzy
msgid "Texts made using ZRCola have to include in the colophon, foreword, footnote or some other appropriate part of the publication the note below:"
msgstr "Besedilo, nastalo z uporabo ZRCole, mora biti v kolofonu, predgovoru, v opombi ali na drugem ustreznem mestu v publikaciji opremljeno z naslednjim zapisom:"
#: En.Win32.Debug.Feature-2.idtx:5 En.Win32.Release.Feature-2.idtx:5 En.x64.Debug.Feature-2.idtx:5 En.x64.Release.Feature-2.idtx:5
#, fuzzy
msgid "Times New Roman based font"
msgstr "Pisava na osnovi Times New Roman"
#: En.Win32.Debug.Directory-2.idtx:4 En.Win32.Release.Directory-2.idtx:4 En.x64.Debug.Directory-2.idtx:4 En.x64.Release.Directory-2.idtx:4
#, fuzzy
msgid "ZRCola:."
msgstr ""
msgstr "ZRCola:."

1562
MSI/ZRCola/locale/de_DE.po Normal file

File diff suppressed because one or more lines are too long

1561
MSI/ZRCola/locale/ru_RU.po Normal file

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ZRCola MSI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-24 12:36+0100\n"
"POT-Creation-Date: 2016-05-31 10:09+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <simon.rozman@amebis.si>\n"
@@ -12,16 +12,23 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-Basepath: ../Main\n"
"X-Poedit-Basepath: .\n"
"X-Generator: Poedit 1.8.7\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
"X-Poedit-SearchPath-0: .\n"
# wxLanguage enum value for this language (decimal, # prefixed)
#: En.Win32.Debug.Registry-2.idtx:4 En.Win32.Release.Registry-2.idtx:4 En.x64.Debug.Registry-2.idtx:4 En.x64.Release.Registry-2.idtx:4
msgid "#60"
msgstr "#176"
#: En.Win32.Debug.Control-2.idtx:11 En.Win32.Release.Control-2.idtx:11 En.x64.Debug.Control-2.idtx:11 En.x64.Release.Control-2.idtx:11
msgid "&Continue"
msgstr "&Nadaljuj"
#: En.Win32.Debug.Control-2.idtx:6 En.Win32.Release.Control-2.idtx:6 En.x64.Debug.Control-2.idtx:6 En.x64.Release.Control-2.idtx:6
msgid "[DlgTitleFont][SimpleProductName] Declaration"
msgstr "[DlgTitleFont]Deklaracija [SimpleProductName]"
# Licence Agreement
# 1. Translate as a separate RTF document.
# 2. Remove ALL line breaks from RTF file.
@@ -1498,6 +1505,21 @@ msgstr ""
"TOC Heading;}}{\\*\\datastore "
"0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000c0ef044c8850cf01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}}"
# Declaration
# 1. Translate as a separate RTF document.
# 2. Remove ALL line breaks from RTF file.
# 3. Paste translation.
#: En.Win32.Debug.Control-2.idtx:8 En.Win32.Release.Control-2.idtx:8 En.x64.Debug.Control-2.idtx:8 En.x64.Release.Control-2.idtx:8
msgid ""
"{\\rtf1\\ansi\\ansicpg1250\\deff0\\deflang1060\\deflangfe1060\\deftab708{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset238 Calibri;}{\\f1\\froman\\fprq2\\fcharset238{\\*\\fname Times New "
"Roman;}Times New Roman CE;}}{\\colortbl ;\\red0\\green0\\blue255;}{\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\pard\\sa200\\sl276\\slmult1\\i\\f0\\fs22 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.\\f1\\par}"
msgstr ""
"{\\rtf1\\ansi\\ansicpg1250\\deff0\\deflang1060\\deflangfe1060\\deftab708{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset238 Calibri;}{\\f1\\froman\\fprq2\\fcharset238{\\*\\fname Times New "
"Roman;}Times New Roman CE;}}{\\colortbl ;\\red0\\green0\\blue255;}{\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\pard\\sa200\\sl276\\slmult1\\i\\f0\\fs22 Besedilo je bilo "
"pripravljeno z vna\\'9aalnim sistemom ZRCola (http://zrcola.zrc-sazu.si), ki ga je na Znanstvenoraziskovalnem centru SAZU v Ljubljani (http://www.zrc-sazu.si) razvil dr. Peter Weiss."
"\\i0\\f1\\par}"
#: En.Win32.Debug.Feature-2.idtx:5 En.Win32.Release.Feature-2.idtx:5 En.x64.Debug.Feature-2.idtx:5 En.x64.Release.Feature-2.idtx:5
msgid "00 ZRCola"
msgstr "00 ZRCola"
@@ -1510,6 +1532,10 @@ msgstr "00 ZRCola"
msgid "1252"
msgstr "1250"
#: En.Win32.Debug.Control-2.idtx:5 En.Win32.Release.Control-2.idtx:5 En.x64.Debug.Control-2.idtx:5 En.x64.Release.Control-2.idtx:5
msgid "binUIHeader.bmp"
msgstr "binUIHeader.bmp"
#: En.Win32.Debug.Feature-2.idtx:4 En.Win32.Release.Feature-2.idtx:4 En.x64.Debug.Feature-2.idtx:4 En.x64.Release.Feature-2.idtx:4
msgid "Fonts"
msgstr "Pisave"
@@ -1518,6 +1544,18 @@ msgstr "Pisave"
msgid "Fonts used by ZRCola"
msgstr "Pisave, ki jih uporablja ZRCola"
#: En.Win32.Debug.Control-2.idtx:10 En.Win32.Release.Control-2.idtx:10 En.x64.Debug.Control-2.idtx:10 En.x64.Release.Control-2.idtx:10
msgid "I &agree."
msgstr "&Strinjam se."
#: En.Win32.Debug.Control-2.idtx:9 En.Win32.Release.Control-2.idtx:9 En.x64.Debug.Control-2.idtx:9 En.x64.Release.Control-2.idtx:9
msgid "Note: This declaration is also available in [SimpleProductName]'s about dialog or on its website."
msgstr "Opomba: Ta deklaracija je na voljo tudi v dialogu vizitke [SimpleProductName] ali na spletni strani."
#: En.Win32.Debug.Control-2.idtx:7 En.Win32.Release.Control-2.idtx:7 En.x64.Debug.Control-2.idtx:7 En.x64.Release.Control-2.idtx:7
msgid "Texts made using ZRCola have to include in the colophon, foreword, footnote or some other appropriate part of the publication the note below:"
msgstr "Besedilo, nastalo z uporabo ZRCole, mora biti v kolofonu, predgovoru, v opombi ali na drugem ustreznem mestu v publikaciji opremljeno z naslednjim zapisom:"
#: En.Win32.Debug.Feature-2.idtx:5 En.Win32.Release.Feature-2.idtx:5 En.x64.Debug.Feature-2.idtx:5 En.x64.Release.Feature-2.idtx:5
msgid "Times New Roman based font"
msgstr "Pisava na osnovi Times New Roman"
@@ -1525,3 +1563,7 @@ msgstr "Pisava na osnovi Times New Roman"
#: En.Win32.Debug.Directory-2.idtx:4 En.Win32.Release.Directory-2.idtx:4 En.x64.Debug.Directory-2.idtx:4 En.x64.Release.Directory-2.idtx:4
msgid "ZRCola:."
msgstr "ZRCola:."
#, fuzzy
#~ msgid "Determining required space for installation..."
#~ msgstr "Ugotavljanje potrebnega prostora za namestitev ..."

View File

@@ -189,7 +189,12 @@ PublishPre :: \
$(REDIST_EN_WIN32) \
$(REDIST_EN_X64) \
$(REDIST_SL_WIN32) \
$(REDIST_SL_X64)
$(REDIST_SL_X64) \
"$(PUBLISH_DIR)" \
"$(PUBLISH_DIR)\ZRColaInstallDe.exe" \
"$(PUBLISH_DIR)\ZRColaInstallEn.exe" \
"$(PUBLISH_DIR)\ZRColaInstallRu.exe" \
"$(PUBLISH_DIR)\ZRColaInstallSl.exe"
Publish :: \
PublishPre \
@@ -258,6 +263,18 @@ $(REDIST_SL_X64) : "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
"$(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"
copy /y $** $@ > NUL
######################################################################
# Shortcut creation
@@ -307,6 +324,18 @@ $(REDIST_SL_X64) : "$(OUTPUT_DIR)\ZRColaSl64.3.msi"
"$(OUTPUT_DIR)\ZRColaSl64D.3.msi" ::
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)\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)\ZRColaEn32.3.msi" \
"$(OUTPUT_DIR)\ZRColaSl32.3.msi" ::
devenv.com "MSI\MSICA\MSICA.sln" /build "Release|Win32"

Submodule Updater updated: f1a3ae730a...54846632f3

View File

@@ -18,6 +18,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libZRColaUI", "lib\libZRCol
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stdex", "lib\stdex\build\stdex.vcxproj", "{518777CC-0A59-4415-A12A-82751ED75343}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "Updater\Updater\build\Updater.vcxproj", "{990D8CF9-4457-4DC0-AA18-4968EF434741}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -66,6 +68,14 @@ Global
{518777CC-0A59-4415-A12A-82751ED75343}.Release|Win32.Build.0 = Release|Win32
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x64.ActiveCfg = Release|x64
{518777CC-0A59-4415-A12A-82751ED75343}.Release|x64.Build.0 = Release|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|Win32.ActiveCfg = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|Win32.Build.0 = Debug|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x64.ActiveCfg = Debug|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Debug|x64.Build.0 = Debug|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|Win32.ActiveCfg = Release|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|Win32.Build.0 = Release|Win32
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.ActiveCfg = Release|x64
{990D8CF9-4457-4DC0-AA18-4968EF434741}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -75,5 +85,6 @@ Global
{3C61929E-7289-4101-8D0A-DA22D6E1AEA8} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{C0A84BD2-3870-4CD6-B281-0AB322E3C579} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{518777CC-0A59-4415-A12A-82751ED75343} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
{990D8CF9-4457-4DC0-AA18-4968EF434741} = {6D85AD6A-69D6-40EB-BF0C-7495479DDCE5}
EndGlobalSection
EndGlobal

View File

@@ -122,6 +122,7 @@ featZRCola compZRCola.exe.$(PLAT)
featZRCola complibZRCola.dll.$(PLAT)
featZRCola complibZRColaUI.dll.$(PLAT)
featZRCola compwxExtend.dll.$(PLAT)
featZRCola compUpdater.dll.$(PLAT)
featZRCola compLocalizationRepositoryPath
featZRCola compLanguage
featZRCola compDatabasePath
@@ -130,7 +131,9 @@ 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
!ENDIF
<<NOKEEP

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\lib\stdex\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib\wxExtend\include;..\Updater\Updater\include;..\lib\stdex\include;..\lib\libZRCola\include;..\lib\libZRColaUI\include</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />

Binary file not shown.

View File

@@ -80,19 +80,31 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="zrcolaabout.cpp" />
<ClCompile Include="zrcolaapp.cpp" />
<ClCompile Include="zrcolachrcatpnl.cpp" />
<ClCompile Include="zrcolachrgrid.cpp" />
<ClCompile Include="zrcolachrslct.cpp" />
<ClCompile Include="zrcolacomppnl.cpp" />
<ClCompile Include="zrcolafrm.cpp" />
<ClCompile Include="zrcolagui.cpp" />
<ClCompile Include="zrcolakeyhndlr.cpp" />
<ClCompile Include="zrcolasettings.cpp" />
<ClCompile Include="zrcolaupdater.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="zrcolaabout.h" />
<ClInclude Include="zrcolaapp.h" />
<ClInclude Include="zrcolachrcatpnl.h" />
<ClInclude Include="zrcolachrgrid.h" />
<ClInclude Include="zrcolachrslct.h" />
<ClInclude Include="zrcolacomppnl.h" />
<ClInclude Include="zrcolafrm.h" />
<ClInclude Include="zrcolagui.h" />
<ClInclude Include="zrcolakeyhndlr.h" />
<ClInclude Include="zrcolasettings.h" />
<ClInclude Include="zrcolaupdater.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lib\libZRColaUI\build\libZRColaUI.vcxproj">
@@ -104,11 +116,18 @@
<ProjectReference Include="..\lib\wxExtend\build\wxExtend.vcxproj">
<Project>{a3a36689-ac35-4026-93da-a3ba0c0e767c}</Project>
</ProjectReference>
<ProjectReference Include="..\Updater\Updater\build\Updater.vcxproj">
<Project>{990d8cf9-4457-4dc0-aa18-4968ef434741}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="locale\ZRCola.pot" />
<None Include="res\char_select.ico" />
<None Include="res\edit_copy.ico" />
<None Include="res\edit_cut.ico" />
<None Include="res\edit_paste.ico" />
<None Include="res\navigate_back.ico" />
<None Include="res\navigate_forward.ico" />
<None Include="res\send_abort.ico" />
<None Include="res\send_composed.ico" />
<None Include="res\send_decomposed.ico" />
@@ -119,6 +138,8 @@
<ResourceCompile Include="ZRCola.rc" />
</ItemGroup>
<ItemGroup>
<POCompile Include="locale\de_DE.po" />
<POCompile Include="locale\ru_RU.po" />
<POCompile Include="locale\sl_SI.po" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@@ -37,6 +37,24 @@
<ClCompile Include="zrcolakeyhndlr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolachrgrid.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolachrcatpnl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolachrslct.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolasettings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolaabout.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zrcolaupdater.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@@ -57,6 +75,24 @@
<ClInclude Include="zrcolakeyhndlr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolachrgrid.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolachrcatpnl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolachrslct.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolasettings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolaabout.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zrcolaupdater.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="res\zrcola.ico">
@@ -83,6 +119,18 @@
<None Include="ZRCola.fbp">
<Filter>Resource Files</Filter>
</None>
<None Include="res\char_select.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="locale\ZRCola.pot">
<Filter>Resource Files\Localization</Filter>
</None>
<None Include="res\navigate_back.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="res\navigate_forward.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRCola.rc">
@@ -93,5 +141,11 @@
<POCompile Include="locale\sl_SI.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\de_DE.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\ru_RU.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
</Project>

798
ZRCola/locale/ZRCola.pot Normal file
View File

@@ -0,0 +1,798 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2016-05-31 08:45+0200\n"
"PO-Revision-Date: 2016-05-13 15:52+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: sl_SI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: zrcolaabout.cpp:31
#, fuzzy, c-format
msgid "© 2004-%s ZRC SAZU"
msgstr "© 2004-%s ZRC SAZU"
#: zrcolaapp.cpp:79 zrcolafrm.cpp:86 zrcolagui.cpp:831 zrcolagui.h:102
#: 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
msgid "ZRCola"
msgstr "ZRCola"
#: zrcolafrm.cpp:104
#, fuzzy
msgid ""
"ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality "
"will not be available."
msgstr ""
"ZRColine bližnjice na tipkovnici Win+F5 ni mogoče registrirati. Nekaj "
"funkcionalnosti ne bo na voljo."
#: zrcolafrm.cpp:104 zrcolafrm.cpp:106
#, fuzzy
msgid "Warning"
msgstr "Opozorilo"
#: zrcolafrm.cpp:106
#, fuzzy
msgid ""
"ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality "
"will not be available."
msgstr ""
"ZRColine bližnjice na tipkovnici Win+F6 ni mogoče registrirati. Nekaj "
"funkcionalnosti ne bo na voljo."
#: zrcolafrm.cpp:341
#, fuzzy
msgid "http://zrcola-2.amebis.si/en/contact/"
msgstr "http://zrcola-2.amebis.si/contact/"
#: zrcolagui.cpp:36
#, fuzzy
msgid "E&xit"
msgstr "I&zhod"
#: zrcolagui.cpp:36
#, fuzzy
msgid "Quit this program"
msgstr "Zapri ta program"
#: zrcolagui.cpp:39
#, fuzzy
msgid "&Program"
msgstr "&Program"
#: zrcolagui.cpp:72
#, fuzzy
msgid "Select &All"
msgstr "Izberi &vse"
#: zrcolagui.cpp:72
#, fuzzy
msgid "Select all text"
msgstr "Izberi celotno besedilo"
#: zrcolagui.cpp:78
#, fuzzy
msgid "C&haracter Selector..."
msgstr "Izbirnik &znaka ..."
#: zrcolagui.cpp:78 zrcolagui.cpp:170
#, fuzzy
msgid "Display character selector to select character to insert into text"
msgstr "Prikaži izbirnik znaka za izbor znaka za vstavljanje v besedilo"
#: zrcolagui.cpp:89
#, fuzzy
msgid "&Send Composed"
msgstr "Pošlji &sestavljeno"
#: zrcolagui.cpp:89 zrcolagui.cpp:172
#, fuzzy
msgid "Send composed text to source window"
msgstr "Pošlji sestavljeno besedilo izvornemu oknu"
#: zrcolagui.cpp:98
#, fuzzy
msgid "Send &Decomposed"
msgstr "Pošlji &razstavljeno"
#: zrcolagui.cpp:98 zrcolagui.cpp:174
#, fuzzy
msgid "Send decomposed text to source window"
msgstr "Pošlji razstavljeno besedilo izvornemu oknu"
#: zrcolagui.cpp:107
#, fuzzy
msgid "Abort (De)composition"
msgstr "Prekini raz/sestavljanje"
#: zrcolagui.cpp:107
#, fuzzy
msgid "Abort composition and return focus to source window"
msgstr "Prekini sestavljanje in vrni fokus nazaj izvornemu oknu"
#: zrcolagui.cpp:118
#, fuzzy
msgid "&Settings..."
msgstr "Na&stavitve ..."
#: zrcolagui.cpp:118
#, fuzzy
msgid "Open program configuration dialog"
msgstr "Odpri nastavitveni dialog programa"
#: zrcolagui.cpp:121
#, fuzzy
msgid "&Edit"
msgstr "Ur&edi"
#: zrcolagui.cpp:125
#, fuzzy
msgid "&Edit Toolbar"
msgstr "Orodna vrstica za ur&ejanje"
#: zrcolagui.cpp:125
#, fuzzy
msgid "Toggle edit toolbar"
msgstr "Prikaži/skrij orodno vrstico za urejanje"
#: zrcolagui.cpp:129
#, fuzzy
msgid "&Compose Toolbar"
msgstr "Orodna vrsti&ca za sestavljanje"
#: zrcolagui.cpp:129
#, fuzzy
msgid "Toggle compose toolbar"
msgstr "Prikaži/skrij orodno vrstico za sestavljanje"
#: zrcolagui.cpp:135
#, fuzzy
msgid "Character Catalo&g"
msgstr "Katalo&g znakov"
#: zrcolagui.cpp:135
#, fuzzy
msgid "Toggle character catalog panel"
msgstr "Prikaži/skrij katalog znakov"
#: zrcolagui.cpp:138
#, fuzzy
msgid "&View"
msgstr "Po&gled"
#: zrcolagui.cpp:142
#, fuzzy
msgid "&Request a new character..."
msgstr "&Zahtevaj nov znak ..."
#: zrcolagui.cpp:142
#, fuzzy
msgid "Submit a request to ZRC to add a new character"
msgstr "Oddaj prošnjo ZRC-u za dodajanje novega znaka"
#: zrcolagui.cpp:146
#, fuzzy
msgid "Check for &Updates..."
msgstr "Preveri za &posodobitev ..."
#: zrcolagui.cpp:146
#, fuzzy
msgid "Check online for product update"
msgstr "Preveri na spletu za posodobitev izdelka"
#: zrcolagui.cpp:155
#, fuzzy
msgid "&Help"
msgstr "Po&moč"
#: zrcolagui.cpp:160
#, fuzzy
msgid "Cut"
msgstr "Izreži"
#: zrcolagui.cpp:160
#, fuzzy
msgid "Cut selection"
msgstr "Izreži izbor"
#: zrcolagui.cpp:162
#, fuzzy
msgid "Copy"
msgstr "&Kopiraj"
#: zrcolagui.cpp:162
#, fuzzy
msgid "Copy selection"
msgstr "Kopiraj izbor"
#: zrcolagui.cpp:164
#, fuzzy
msgid "Paste"
msgstr "Prilepi"
#: zrcolagui.cpp:164
#, fuzzy
msgid "Paste selection"
msgstr "Prilepi izbor"
#: zrcolagui.cpp:167
#, fuzzy
msgid "Edit"
msgstr "Urejanje"
#: zrcolagui.cpp:170 zrcolagui.h:238
#, fuzzy
msgid "Character Selector"
msgstr "Izbirnik znaka"
#: zrcolagui.cpp:172
#, fuzzy
msgid "Send Composed"
msgstr "Pošlji sestavljeno"
#: zrcolagui.cpp:174
#, fuzzy
msgid "Send Decomposed"
msgstr "Pošlji razstavljeno"
#: zrcolagui.cpp:177
#, fuzzy
msgid "Compose"
msgstr "Sestavljanje"
#: zrcolagui.cpp:181
#, fuzzy
msgid "Character Catalog"
msgstr "Katalog znakov"
#: zrcolagui.cpp:185
#, fuzzy
msgid "(De)Composer"
msgstr "Raz/Sestavljalnik"
#: zrcolagui.cpp:224
#, fuzzy
msgid "Decomposed Text"
msgstr "Razstavljeno besedilo"
#: zrcolagui.cpp:244
#, fuzzy
msgid "Decomposed Unicode Dump"
msgstr "Unicode razstavljenega"
#: zrcolagui.cpp:271
#, fuzzy
msgid "Composed Text"
msgstr "Sestavljeno besedilo"
#: zrcolagui.cpp:291
#, fuzzy
msgid "Composed Unicode Dump"
msgstr "Unicode sestavljenega"
#: zrcolagui.cpp:411
#, fuzzy
msgid "&Browse"
msgstr "Pre&brskaj"
#: zrcolagui.cpp:418
#, fuzzy
msgid ""
"Full or partial terms from Unicode character description (in English) to "
"search for"
msgstr ""
"Polne ali delne besede iz opisa znaka Unicode (v angleščini) za iskanje"
#: zrcolagui.cpp:424
#, fuzzy
msgid "List of Unicode character categories to search in"
msgstr "Seznam kategorij znaka Unicode za iskanje"
#: zrcolagui.cpp:431
#, fuzzy
msgid "All"
msgstr "Vse"
#: zrcolagui.cpp:432
#, fuzzy
msgid "Select all categories"
msgstr "Izberi vse kategorije"
#: zrcolagui.cpp:436
#, fuzzy
msgid "None"
msgstr "Nič"
#: zrcolagui.cpp:437
#, fuzzy
msgid "Clear category selection"
msgstr "Počisti izbor kategorij"
#: zrcolagui.cpp:441
#, fuzzy
msgid "Invert"
msgstr "Obrni"
#: zrcolagui.cpp:442
#, fuzzy
msgid "Invert category selection"
msgstr "Obrni izbor kategorij"
#: zrcolagui.cpp:475
#, fuzzy
msgid "Character search results"
msgstr "Rezultati iskanja znakov"
#: zrcolagui.cpp:485
#, fuzzy
msgid "Re&cently Used"
msgstr "Nedavno &uporabljeni"
#: zrcolagui.cpp:513
#, fuzzy
msgid "List of recently inserted characters"
msgstr "Seznam nedavno vstavljenih znakov"
#: zrcolagui.cpp:527
#, fuzzy
msgid "Preview"
msgstr "Predogled:"
#: zrcolagui.cpp:532
#, fuzzy
msgid "U+"
msgstr "U+"
#: zrcolagui.cpp:537
#, fuzzy
msgid "Unicode hexadecimal code"
msgstr "Šestnajstiška koda Unicode"
#: zrcolagui.cpp:542
#, fuzzy
msgid "Keyboard shortcut in Composer window"
msgstr "Bližnjica na tipkovnici v oknu sestavljalnika"
#: zrcolagui.cpp:577
#, fuzzy
msgid "Character preview"
msgstr "Predogled znaka"
#: zrcolagui.cpp:582
#, fuzzy
msgid "Unicode character description"
msgstr "Opis znaka Unicode"
#: zrcolagui.cpp:587
#, fuzzy
msgid "Unicode character category"
msgstr "Kategorija znaka Unicode"
#: zrcolagui.cpp:594
#, fuzzy
msgid "« Back"
msgstr "< &Nazaj"
#: zrcolagui.cpp:596
#, fuzzy
msgid "To previously viewed character"
msgstr "Na prejšnji prikazan znak"
#: zrcolagui.cpp:600
#, fuzzy
msgid "Forward »"
msgstr "Naprej »"
#: zrcolagui.cpp:602
#, fuzzy
msgid "To following viewed character"
msgstr "Na naslednji prikazan znak"
#: zrcolagui.cpp:613
#, fuzzy
msgid "Re&lated"
msgstr "&Sorodni"
#: zrcolagui.cpp:640
#, fuzzy
msgid "List of related characters"
msgstr "Seznam sorodnih znakov"
#: zrcolagui.cpp:727
#, fuzzy
msgid ""
"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 ""
"Nekateri znaki iz posameznih jezikov, s katerimi delate, se ne smejo "
"razstaviti v dele.\n"
"Za optimalno razstavljanje izberite pravilni jezik."
#: zrcolagui.cpp:731
#, fuzzy
msgid "Select language &automatically according to selected keyboard"
msgstr "S&amodejno izberi jezik glede na izbrano tipkovnico"
#: zrcolagui.cpp:734
#, fuzzy
msgid "&Manually select the language from the list below:"
msgstr "Ročno izberi jezik na spodnje&m spisku:"
#: zrcolagui.cpp:746
#, fuzzy
msgid "Text Language"
msgstr "Jezik besedila"
#: zrcolagui.cpp:751
#, fuzzy
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."
msgstr ""
"ZRCola se lahko zažene ob vsaki prijavi v vaš računalnik.\n"
"Na voljo bo na vrstici za sistemska obvestila ter preko registriranih "
"bližnjic Win+F5 in Win+F6."
#: zrcolagui.cpp:755
#, fuzzy
msgid "Start ZRCola &automatically on logon"
msgstr "S&amodejno zaženi ZRColo ob prijavi"
#: zrcolagui.cpp:762
#, fuzzy
msgid "Startup"
msgstr "Zagon"
#: zrcolagui.cpp:841
#, fuzzy
msgid ""
"Editor: Janoš Ježovnik\n"
"Development: Amebis d. o. o.\n"
"Development and maintenance (2004-2015): dr. Peter Weiss"
msgstr ""
"Urednik: Janoš Ježovnik\n"
"Razvoj: Amebis d. o. o.\n"
"Razvoj in vzdrževanje (2004-2015): dr. Peter Weiss"
#: zrcolagui.cpp:849
#, fuzzy
msgid "www.zrc-sazu.si"
msgstr "www.zrc-sazu.si"
#: zrcolagui.cpp:855
msgid ""
"Texts made using ZRCola have to include in the colophon, foreword, footnote "
"or some other appropriate part of the publication the note below:"
msgstr ""
#: zrcolagui.cpp:859
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:900
#, fuzzy
msgid "Log"
msgstr "Dnevnik"
#: zrcolagui.cpp:916
#, fuzzy
msgid "&Update"
msgstr "&Posodobi"
#: zrcolagui.cpp:921
#, fuzzy
msgid "&Close"
msgstr "&Zapri"
#: zrcolakeyhndlr.cpp:44
#, fuzzy
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 ""
"Pritisnjena tipka INS. Zdaj vtpikajte kodo Unicode želenega znaka (do štiri "
"šestnajstiške števke: 0-9, A-F), nato izpustite INS."
#: zrcolasettings.cpp:93
#, fuzzy
msgid "Start ZRCola automatically on logon"
msgstr "Samodejno zaženi ZRColo ob prijavi"
#: zrcolagui.h:275
#, fuzzy
msgid "Settings"
msgstr "Nastavitve"
#: zrcolagui.h:301
#, fuzzy
msgid "About ZRCola"
msgstr "O ZRColi"
#: zrcolagui.h:324
#, fuzzy
msgid "Product Update"
msgstr "Posodabljanje izdelka"
#: 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 "1250"
#: 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
msgid "Input system for linguistic use"
msgstr "Vnašalni sistem za jezikoslovno rabo"
#~ msgid "Auto Start"
#~ msgstr "Samodejni zagon"
#~ msgid "Select %s language for decomposition"
#~ msgstr "Izberi jezik %s za razstavljanje"
#~ msgid "&Start on Logon"
#~ msgstr "Z&aženi ob prijavi"
#~ msgid "Start this program automatically on logon"
#~ msgstr "Samodejno zaženi ta program ob prijavi"
#~ msgid "Set language according to keyboard layout automatically"
#~ msgstr "Samodejno nastavi jezik glede na izbrano tipkovnico"
#~ msgid "&Unicode"
#~ msgstr "&Unicode"
#~ msgid "Esc"
#~ msgstr "Esc"
#~ msgid "F1"
#~ msgstr "F1"
#~ msgid "F2"
#~ msgstr "F2"
#~ msgid "F3"
#~ msgstr "F3"
#~ msgid "F4"
#~ msgstr "F4"
#~ msgid "F5"
#~ msgstr "F5"
#~ msgid "F6"
#~ msgstr "F6"
#~ msgid "F7"
#~ msgstr "F7"
#~ msgid "F8"
#~ msgstr "F8"
#~ msgid "F9"
#~ msgstr "F9"
#~ msgid "F10"
#~ msgstr "F10"
#~ msgid "F11"
#~ msgstr "F11"
#~ msgid "F12"
#~ msgstr "F12"
#~ msgid "Print Screen"
#~ msgstr "Print Screen"
#~ msgid "Scroll Lock"
#~ msgstr "Scroll Lock"
#~ msgid "Pause"
#~ msgstr "Pause"
#~ msgid "Backspace"
#~ msgstr "Backspace"
#~ msgid "Tab"
#~ msgstr "Tab"
#~ msgid "Caps Lock"
#~ msgstr "Caps Lock"
#~ msgid "Return"
#~ msgstr "Return"
#~ msgid "Space"
#~ msgstr "preslednica"
#~ msgid "Shift"
#~ msgstr "Shift"
#~ msgid "Alt"
#~ msgstr "Alt"
#~ msgid "Ctrl"
#~ msgstr "Ctrl"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Insert"
#~ msgstr "Insert"
#~ msgid "Delete"
#~ msgstr "Delete"
#~ msgid "Page Up"
#~ msgstr "Page Up"
#~ msgid "Page Down"
#~ msgstr "Page Down"
#~ msgid "Home"
#~ msgstr "Home"
#~ msgid "End"
#~ msgstr "End"
#~ msgid "Left"
#~ msgstr "Left"
#~ msgid "Up"
#~ msgstr "Up"
#~ msgid "Right"
#~ msgstr "Right"
#~ msgid "Down"
#~ msgstr "Down"
#~ msgid "Num Lock"
#~ msgstr "Num Lock"
#~ msgid "`"
#~ msgstr "`"
#~ msgid "-"
#~ msgstr "-"
#~ msgid "["
#~ msgstr "["
#~ msgid "]"
#~ msgstr "]"
#~ msgid ":"
#~ msgstr ":"
#~ msgid "'"
#~ msgstr "'"
#~ msgid "\\"
#~ msgstr "\\"
#~ msgid ","
#~ msgstr ","
#~ msgid "."
#~ msgstr "."
#~ msgid "/"
#~ msgstr "/"
#~ msgid "INS"
#~ msgstr "INS"
#~ msgid "Character &Groups"
#~ msgstr "Skupine &znakov"
#~ msgid "Language:"
#~ msgstr "Jezik:"
#~ msgid "&About"
#~ msgstr "O progr&amu"
#~ msgid "Cuts selected text and puts it on the clipboard"
#~ msgstr "Izreže izbrano besedilo in ga shrani na odložišče"
#~ msgid "Copies selected text to the clipboard"
#~ msgstr "Kopira izbrano besedilo na odložišče"
#~ msgid "Inserts text from the clipboard"
#~ msgstr "Vstavi besedilo z odložišča"
#~ msgid "&Copy"
#~ msgstr "&Kopiraj"
#~ msgid "&Paste"
#~ msgstr "&Prilepi"
#~ msgid "&File"
#~ msgstr "&Datoteka"
#~ msgid "Send Decomposed (F6)"
#~ msgstr "Pošlji razstavljeno (F6)"
#~ msgid "Send Composed (F5)"
#~ msgstr "Pošlji sestavljeno (F5)"
#~ msgid ""
#~ "ZRCola keyboard shortcut Win+Shift+Z could not be registered. Some "
#~ "functionality will not be available."
#~ msgstr ""
#~ "ZRColine bližnjice na tipkovnici Win+Shift+Z ni mogoče registrirati. "
#~ "Nekaj funkcionalnosti ne bo na voljo."
#, fuzzy
#~ msgid "Authentication progress real time monitor"
#~ msgstr "Nadzira postopek overovljanja v realnem času"
#~ msgid "Grave\t&7"
#~ msgstr "Krativec\t&7"
#~ msgid "Acute\t&9"
#~ msgstr "Ostrivec\t&9"
#~ msgid "Circumflex\t&3"
#~ msgstr "Cirkumfleks\t&3"
#~ msgid "Inverted &breve"
#~ msgstr "O&brnjen polkrog"
#~ msgid "&Accents"
#~ msgstr "N&aglasi"
#~ msgid ""
#~ "There is already an auto hidden bar on this edge.\n"
#~ "Only one auto hidden bar is allowed on each edge.\n"
#~ "Auto-hide feature is now off."
#~ msgstr ""
#~ "Ob tem robu je že samodejno skrita pasica.\n"
#~ "Na vsakem robu je lahko samo ena samodejno skrita pasica.\n"
#~ "Samodejno skrivanje je zdaj izklopljeno."
#~ msgid "Hello World"
#~ msgstr "Zdravo svet"
#~ msgid "&Hello...\tCtrl+H"
#~ msgstr "&Pozdrav ...\tCtrl+H"
#~ msgid "Help string shown in status bar for this menu item"
#~ msgstr "Niz s pomočjo prikazan v statusni vrstici za to točko menija"
#~ msgid "This is a wxWidgets' Hello world sample"
#~ msgstr "To je primer Zdravo svet v wxWidgets"
#~ msgid "About Hello World"
#~ msgstr "O Zdravo svet"
#~ msgid "Hello world from wxWidgets!"
#~ msgstr "Zdravo svet iz wxWidgets!"
#~ msgid "Welcome to wxWidgets!"
#~ msgstr "Dobrodošli v wxWidgets!"

716
ZRCola/locale/de_DE.po Normal file
View File

@@ -0,0 +1,716 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2016-05-31 08:47+0200\n"
"PO-Revision-Date: 2016-05-31 08:47+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.7\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: zrcolaabout.cpp:31
#, c-format
msgid "© 2004-%s ZRC SAZU"
msgstr ""
#: zrcolaapp.cpp:79 zrcolafrm.cpp:86 zrcolagui.cpp:831 zrcolagui.h:102
#: 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
msgid "ZRCola"
msgstr "ZRCola:."
#: zrcolafrm.cpp:104
msgid ""
"ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality "
"will not be available."
msgstr ""
#: zrcolafrm.cpp:104 zrcolafrm.cpp:106
#, fuzzy
msgid "Warning"
msgstr "Warnung: "
#: zrcolafrm.cpp:106
msgid ""
"ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality "
"will not be available."
msgstr ""
#: zrcolafrm.cpp:341
msgid "http://zrcola-2.amebis.si/en/contact/"
msgstr ""
#: zrcolagui.cpp:36
msgid "E&xit"
msgstr ""
#: zrcolagui.cpp:36
#, fuzzy
msgid "Quit this program"
msgstr "Dieses Programm beenden"
#: zrcolagui.cpp:39
#, fuzzy
msgid "&Program"
msgstr "Konnte das Hildon Programm nicht initialisieren"
#: zrcolagui.cpp:72
#, fuzzy
msgid "Select &All"
msgstr "Alles auswählen"
#: zrcolagui.cpp:72
msgid "Select all text"
msgstr ""
#: zrcolagui.cpp:78
msgid "C&haracter Selector..."
msgstr ""
#: zrcolagui.cpp:78 zrcolagui.cpp:170
msgid "Display character selector to select character to insert into text"
msgstr ""
#: zrcolagui.cpp:89
msgid "&Send Composed"
msgstr ""
#: zrcolagui.cpp:89 zrcolagui.cpp:172
msgid "Send composed text to source window"
msgstr ""
#: zrcolagui.cpp:98
msgid "Send &Decomposed"
msgstr ""
#: zrcolagui.cpp:98 zrcolagui.cpp:174
msgid "Send decomposed text to source window"
msgstr ""
#: zrcolagui.cpp:107
msgid "Abort (De)composition"
msgstr ""
#: zrcolagui.cpp:107
msgid "Abort composition and return focus to source window"
msgstr ""
#: zrcolagui.cpp:118
msgid "&Settings..."
msgstr ""
#: zrcolagui.cpp:118
msgid "Open program configuration dialog"
msgstr ""
#: zrcolagui.cpp:121
#, fuzzy
msgid "&Edit"
msgstr "&Bearbeiten"
#: zrcolagui.cpp:125
msgid "&Edit Toolbar"
msgstr ""
#: zrcolagui.cpp:125
msgid "Toggle edit toolbar"
msgstr ""
#: zrcolagui.cpp:129
msgid "&Compose Toolbar"
msgstr ""
#: zrcolagui.cpp:129
msgid "Toggle compose toolbar"
msgstr ""
#: zrcolagui.cpp:135
msgid "Character Catalo&g"
msgstr ""
#: zrcolagui.cpp:135
msgid "Toggle character catalog panel"
msgstr ""
#: zrcolagui.cpp:138
#, fuzzy
msgid "&View"
msgstr "&Ansicht..."
#: zrcolagui.cpp:142
msgid "&Request a new character..."
msgstr ""
#: zrcolagui.cpp:142
msgid "Submit a request to ZRC to add a new character"
msgstr ""
#: zrcolagui.cpp:146
msgid "Check for &Updates..."
msgstr ""
#: zrcolagui.cpp:146
msgid "Check online for product update"
msgstr ""
#: zrcolagui.cpp:155
#, fuzzy
msgid "&Help"
msgstr "&Hilfe"
#: zrcolagui.cpp:160
#, fuzzy
msgid "Cut"
msgstr "Ausschneiden"
#: zrcolagui.cpp:160
#, fuzzy
msgid "Cut selection"
msgstr "Auswahl ausschneiden"
#: zrcolagui.cpp:162
#, fuzzy
msgid "Copy"
msgstr "Kopieren"
#: zrcolagui.cpp:162
#, fuzzy
msgid "Copy selection"
msgstr "Auswahl kopieren"
#: zrcolagui.cpp:164
#, fuzzy
msgid "Paste"
msgstr "Einfügen"
#: zrcolagui.cpp:164
#, fuzzy
msgid "Paste selection"
msgstr "Auswahl einfügen"
#: zrcolagui.cpp:167
#, fuzzy
msgid "Edit"
msgstr "Bearbeiten"
#: zrcolagui.cpp:170 zrcolagui.h:238
msgid "Character Selector"
msgstr ""
#: zrcolagui.cpp:172
msgid "Send Composed"
msgstr ""
#: zrcolagui.cpp:174
msgid "Send Decomposed"
msgstr ""
#: zrcolagui.cpp:177
msgid "Compose"
msgstr ""
#: zrcolagui.cpp:181
msgid "Character Catalog"
msgstr ""
#: zrcolagui.cpp:185
msgid "(De)Composer"
msgstr ""
#: zrcolagui.cpp:224
msgid "Decomposed Text"
msgstr ""
#: zrcolagui.cpp:244
msgid "Decomposed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:271
msgid "Composed Text"
msgstr ""
#: zrcolagui.cpp:291
msgid "Composed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:411
#, fuzzy
msgid "&Browse"
msgstr "Durchsuchen"
#: zrcolagui.cpp:418
msgid ""
"Full or partial terms from Unicode character description (in English) to "
"search for"
msgstr ""
#: zrcolagui.cpp:424
msgid "List of Unicode character categories to search in"
msgstr ""
#: zrcolagui.cpp:431
#, fuzzy
msgid "All"
msgstr "Alle"
#: zrcolagui.cpp:432
msgid "Select all categories"
msgstr ""
#: zrcolagui.cpp:436
#, fuzzy
msgid "None"
msgstr "Kein"
#: zrcolagui.cpp:437
#, fuzzy
msgid "Clear category selection"
msgstr "Auswahl kopieren"
#: zrcolagui.cpp:441
msgid "Invert"
msgstr ""
#: zrcolagui.cpp:442
#, fuzzy
msgid "Invert category selection"
msgstr "Auswahl einfügen"
#: zrcolagui.cpp:475
#, fuzzy
msgid "Character search results"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:485
msgid "Re&cently Used"
msgstr ""
#: zrcolagui.cpp:513
msgid "List of recently inserted characters"
msgstr ""
#: zrcolagui.cpp:527
#, fuzzy
msgid "Preview"
msgstr " Vorschau"
#: zrcolagui.cpp:532
#, fuzzy
msgid "U+"
msgstr "Hilfeverzeichnis %u nicht gefunden."
#: zrcolagui.cpp:537
msgid "Unicode hexadecimal code"
msgstr ""
#: zrcolagui.cpp:542
msgid "Keyboard shortcut in Composer window"
msgstr ""
#: zrcolagui.cpp:577
#, fuzzy
msgid "Character preview"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:582
msgid "Unicode character description"
msgstr ""
#: zrcolagui.cpp:587
msgid "Unicode character category"
msgstr ""
#: zrcolagui.cpp:594
#, fuzzy
msgid "« Back"
msgstr "< &Zurück"
#: zrcolagui.cpp:596
msgid "To previously viewed character"
msgstr ""
#: zrcolagui.cpp:600
#, fuzzy
msgid "Forward »"
msgstr "&Vorwärts"
#: zrcolagui.cpp:602
msgid "To following viewed character"
msgstr ""
#: zrcolagui.cpp:613
msgid "Re&lated"
msgstr ""
#: zrcolagui.cpp:640
msgid "List of related characters"
msgstr ""
#: zrcolagui.cpp:727
msgid ""
"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:731
msgid "Select language &automatically according to selected keyboard"
msgstr ""
#: zrcolagui.cpp:734
msgid "&Manually select the language from the list below:"
msgstr ""
#: zrcolagui.cpp:746
msgid "Text Language"
msgstr ""
#: zrcolagui.cpp:751
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."
msgstr ""
#: zrcolagui.cpp:755
msgid "Start ZRCola &automatically on logon"
msgstr ""
#: zrcolagui.cpp:762
msgid "Startup"
msgstr ""
#: zrcolagui.cpp:841
msgid ""
"Editor: Janoš Ježovnik\n"
"Development: Amebis d. o. o.\n"
"Development and maintenance (2004-2015): dr. Peter Weiss"
msgstr ""
#: zrcolagui.cpp:849
msgid "www.zrc-sazu.si"
msgstr ""
#: zrcolagui.cpp:855
msgid ""
"Texts made using ZRCola have to include in the colophon, foreword, footnote "
"or some other appropriate part of the publication the note below:"
msgstr ""
#: zrcolagui.cpp:859
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:900
#, fuzzy
msgid "Log"
msgstr "&Log"
#: zrcolagui.cpp:916
#, fuzzy
msgid "&Update"
msgstr "Kann Benutzer-Konfigurationsdatei nicht aktualisieren."
#: zrcolagui.cpp:921
#, fuzzy
msgid "&Close"
msgstr "&Schließen"
#: 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."
msgstr ""
#: zrcolasettings.cpp:93
msgid "Start ZRCola automatically on logon"
msgstr ""
#: zrcolagui.h:275
msgid "Settings"
msgstr ""
#: zrcolagui.h:301
msgid "About ZRCola"
msgstr ""
#: zrcolagui.h:324
msgid "Product Update"
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.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
msgid "Input system for linguistic use"
msgstr ""
#~ msgid "Auto Start"
#~ msgstr "Samodejni zagon"
#~ msgid "Select %s language for decomposition"
#~ msgstr "Izberi jezik %s za razstavljanje"
#~ msgid "&Start on Logon"
#~ msgstr "Z&aženi ob prijavi"
#~ msgid "Start this program automatically on logon"
#~ msgstr "Samodejno zaženi ta program ob prijavi"
#~ msgid "Set language according to keyboard layout automatically"
#~ msgstr "Samodejno nastavi jezik glede na izbrano tipkovnico"
#~ msgid "&Unicode"
#~ msgstr "&Unicode"
#~ msgid "Esc"
#~ msgstr "Esc"
#~ msgid "F1"
#~ msgstr "F1"
#~ msgid "F2"
#~ msgstr "F2"
#~ msgid "F3"
#~ msgstr "F3"
#~ msgid "F4"
#~ msgstr "F4"
#~ msgid "F5"
#~ msgstr "F5"
#~ msgid "F6"
#~ msgstr "F6"
#~ msgid "F7"
#~ msgstr "F7"
#~ msgid "F8"
#~ msgstr "F8"
#~ msgid "F9"
#~ msgstr "F9"
#~ msgid "F10"
#~ msgstr "F10"
#~ msgid "F11"
#~ msgstr "F11"
#~ msgid "F12"
#~ msgstr "F12"
#~ msgid "Print Screen"
#~ msgstr "Print Screen"
#~ msgid "Scroll Lock"
#~ msgstr "Scroll Lock"
#~ msgid "Pause"
#~ msgstr "Pause"
#~ msgid "Backspace"
#~ msgstr "Backspace"
#~ msgid "Tab"
#~ msgstr "Tab"
#~ msgid "Caps Lock"
#~ msgstr "Caps Lock"
#~ msgid "Return"
#~ msgstr "Return"
#~ msgid "Space"
#~ msgstr "preslednica"
#~ msgid "Shift"
#~ msgstr "Shift"
#~ msgid "Alt"
#~ msgstr "Alt"
#~ msgid "Ctrl"
#~ msgstr "Ctrl"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Insert"
#~ msgstr "Insert"
#~ msgid "Delete"
#~ msgstr "Delete"
#~ msgid "Page Up"
#~ msgstr "Page Up"
#~ msgid "Page Down"
#~ msgstr "Page Down"
#~ msgid "Home"
#~ msgstr "Home"
#~ msgid "End"
#~ msgstr "End"
#~ msgid "Left"
#~ msgstr "Left"
#~ msgid "Up"
#~ msgstr "Up"
#~ msgid "Right"
#~ msgstr "Right"
#~ msgid "Down"
#~ msgstr "Down"
#~ msgid "Num Lock"
#~ msgstr "Num Lock"
#~ msgid "`"
#~ msgstr "`"
#~ msgid "-"
#~ msgstr "-"
#~ msgid "["
#~ msgstr "["
#~ msgid "]"
#~ msgstr "]"
#~ msgid ":"
#~ msgstr ":"
#~ msgid "'"
#~ msgstr "'"
#~ msgid "\\"
#~ msgstr "\\"
#~ msgid ","
#~ msgstr ","
#~ msgid "."
#~ msgstr "."
#~ msgid "/"
#~ msgstr "/"
#~ msgid "INS"
#~ msgstr "INS"
#~ msgid "Character &Groups"
#~ msgstr "Skupine &znakov"
#~ msgid "Language:"
#~ msgstr "Jezik:"
#~ msgid "&About"
#~ msgstr "O progr&amu"
#~ msgid "Cuts selected text and puts it on the clipboard"
#~ msgstr "Izreže izbrano besedilo in ga shrani na odložišče"
#~ msgid "Copies selected text to the clipboard"
#~ msgstr "Kopira izbrano besedilo na odložišče"
#~ msgid "Inserts text from the clipboard"
#~ msgstr "Vstavi besedilo z odložišča"
#~ msgid "&Copy"
#~ msgstr "&Kopiraj"
#~ msgid "&Paste"
#~ msgstr "&Prilepi"
#~ msgid "&File"
#~ msgstr "&Datoteka"
#~ msgid "Send Decomposed (F6)"
#~ msgstr "Pošlji razstavljeno (F6)"
#~ msgid "Send Composed (F5)"
#~ msgstr "Pošlji sestavljeno (F5)"
#~ msgid ""
#~ "ZRCola keyboard shortcut Win+Shift+Z could not be registered. Some "
#~ "functionality will not be available."
#~ msgstr ""
#~ "ZRColine bližnjice na tipkovnici Win+Shift+Z ni mogoče registrirati. "
#~ "Nekaj funkcionalnosti ne bo na voljo."
#, fuzzy
#~ msgid "Authentication progress real time monitor"
#~ msgstr "Nadzira postopek overovljanja v realnem času"
#~ msgid "Grave\t&7"
#~ msgstr "Krativec\t&7"
#~ msgid "Acute\t&9"
#~ msgstr "Ostrivec\t&9"
#~ msgid "Circumflex\t&3"
#~ msgstr "Cirkumfleks\t&3"
#~ msgid "Inverted &breve"
#~ msgstr "O&brnjen polkrog"
#~ msgid "&Accents"
#~ msgstr "N&aglasi"
#~ msgid ""
#~ "There is already an auto hidden bar on this edge.\n"
#~ "Only one auto hidden bar is allowed on each edge.\n"
#~ "Auto-hide feature is now off."
#~ msgstr ""
#~ "Ob tem robu je že samodejno skrita pasica.\n"
#~ "Na vsakem robu je lahko samo ena samodejno skrita pasica.\n"
#~ "Samodejno skrivanje je zdaj izklopljeno."
#~ msgid "Hello World"
#~ msgstr "Zdravo svet"
#~ msgid "&Hello...\tCtrl+H"
#~ msgstr "&Pozdrav ...\tCtrl+H"
#~ msgid "Help string shown in status bar for this menu item"
#~ msgstr "Niz s pomočjo prikazan v statusni vrstici za to točko menija"
#~ msgid "This is a wxWidgets' Hello world sample"
#~ msgstr "To je primer Zdravo svet v wxWidgets"
#~ msgid "About Hello World"
#~ msgstr "O Zdravo svet"
#~ msgid "Hello world from wxWidgets!"
#~ msgstr "Zdravo svet iz wxWidgets!"
#~ msgid "Welcome to wxWidgets!"
#~ msgstr "Dobrodošli v wxWidgets!"

692
ZRCola/locale/ru_RU.po Normal file
View File

@@ -0,0 +1,692 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2016-05-31 08:46+0200\n"
"PO-Revision-Date: 2016-05-31 08:46+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: zrcolaabout.cpp:31
#, c-format
msgid "© 2004-%s ZRC SAZU"
msgstr ""
#: zrcolaapp.cpp:79 zrcolafrm.cpp:86 zrcolagui.cpp:831 zrcolagui.h:102
#: 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
msgid "ZRCola"
msgstr "ZRCola:."
#: zrcolafrm.cpp:104
msgid ""
"ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality "
"will not be available."
msgstr ""
#: zrcolafrm.cpp:104 zrcolafrm.cpp:106
msgid "Warning"
msgstr ""
#: zrcolafrm.cpp:106
msgid ""
"ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality "
"will not be available."
msgstr ""
#: zrcolafrm.cpp:341
msgid "http://zrcola-2.amebis.si/en/contact/"
msgstr ""
#: zrcolagui.cpp:36
msgid "E&xit"
msgstr ""
#: zrcolagui.cpp:36
msgid "Quit this program"
msgstr ""
#: zrcolagui.cpp:39
msgid "&Program"
msgstr ""
#: zrcolagui.cpp:72
msgid "Select &All"
msgstr ""
#: zrcolagui.cpp:72
msgid "Select all text"
msgstr ""
#: zrcolagui.cpp:78
msgid "C&haracter Selector..."
msgstr ""
#: zrcolagui.cpp:78 zrcolagui.cpp:170
msgid "Display character selector to select character to insert into text"
msgstr ""
#: zrcolagui.cpp:89
msgid "&Send Composed"
msgstr ""
#: zrcolagui.cpp:89 zrcolagui.cpp:172
msgid "Send composed text to source window"
msgstr ""
#: zrcolagui.cpp:98
msgid "Send &Decomposed"
msgstr ""
#: zrcolagui.cpp:98 zrcolagui.cpp:174
msgid "Send decomposed text to source window"
msgstr ""
#: zrcolagui.cpp:107
msgid "Abort (De)composition"
msgstr ""
#: zrcolagui.cpp:107
msgid "Abort composition and return focus to source window"
msgstr ""
#: zrcolagui.cpp:118
msgid "&Settings..."
msgstr ""
#: zrcolagui.cpp:118
msgid "Open program configuration dialog"
msgstr ""
#: zrcolagui.cpp:121
msgid "&Edit"
msgstr ""
#: zrcolagui.cpp:125
msgid "&Edit Toolbar"
msgstr ""
#: zrcolagui.cpp:125
msgid "Toggle edit toolbar"
msgstr ""
#: zrcolagui.cpp:129
msgid "&Compose Toolbar"
msgstr ""
#: zrcolagui.cpp:129
msgid "Toggle compose toolbar"
msgstr ""
#: zrcolagui.cpp:135
msgid "Character Catalo&g"
msgstr ""
#: zrcolagui.cpp:135
msgid "Toggle character catalog panel"
msgstr ""
#: zrcolagui.cpp:138
msgid "&View"
msgstr ""
#: zrcolagui.cpp:142
msgid "&Request a new character..."
msgstr ""
#: zrcolagui.cpp:142
msgid "Submit a request to ZRC to add a new character"
msgstr ""
#: zrcolagui.cpp:146
msgid "Check for &Updates..."
msgstr ""
#: zrcolagui.cpp:146
msgid "Check online for product update"
msgstr ""
#: zrcolagui.cpp:155
msgid "&Help"
msgstr ""
#: zrcolagui.cpp:160
msgid "Cut"
msgstr ""
#: zrcolagui.cpp:160
msgid "Cut selection"
msgstr ""
#: zrcolagui.cpp:162
msgid "Copy"
msgstr ""
#: zrcolagui.cpp:162
msgid "Copy selection"
msgstr ""
#: zrcolagui.cpp:164
msgid "Paste"
msgstr ""
#: zrcolagui.cpp:164
msgid "Paste selection"
msgstr ""
#: zrcolagui.cpp:167
msgid "Edit"
msgstr ""
#: zrcolagui.cpp:170 zrcolagui.h:238
msgid "Character Selector"
msgstr ""
#: zrcolagui.cpp:172
msgid "Send Composed"
msgstr ""
#: zrcolagui.cpp:174
msgid "Send Decomposed"
msgstr ""
#: zrcolagui.cpp:177
msgid "Compose"
msgstr ""
#: zrcolagui.cpp:181
msgid "Character Catalog"
msgstr ""
#: zrcolagui.cpp:185
msgid "(De)Composer"
msgstr ""
#: zrcolagui.cpp:224
msgid "Decomposed Text"
msgstr ""
#: zrcolagui.cpp:244
msgid "Decomposed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:271
msgid "Composed Text"
msgstr ""
#: zrcolagui.cpp:291
msgid "Composed Unicode Dump"
msgstr ""
#: zrcolagui.cpp:411
msgid "&Browse"
msgstr ""
#: zrcolagui.cpp:418
msgid ""
"Full or partial terms from Unicode character description (in English) to "
"search for"
msgstr ""
#: zrcolagui.cpp:424
msgid "List of Unicode character categories to search in"
msgstr ""
#: zrcolagui.cpp:431
#, fuzzy
msgid "All"
msgstr "Alt"
#: zrcolagui.cpp:432
msgid "Select all categories"
msgstr ""
#: zrcolagui.cpp:436
msgid "None"
msgstr ""
#: zrcolagui.cpp:437
msgid "Clear category selection"
msgstr ""
#: zrcolagui.cpp:441
msgid "Invert"
msgstr ""
#: zrcolagui.cpp:442
msgid "Invert category selection"
msgstr ""
#: zrcolagui.cpp:475
#, fuzzy
msgid "Character search results"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:485
msgid "Re&cently Used"
msgstr ""
#: zrcolagui.cpp:513
msgid "List of recently inserted characters"
msgstr ""
#: zrcolagui.cpp:527
msgid "Preview"
msgstr ""
#: zrcolagui.cpp:532
msgid "U+"
msgstr ""
#: zrcolagui.cpp:537
msgid "Unicode hexadecimal code"
msgstr ""
#: zrcolagui.cpp:542
msgid "Keyboard shortcut in Composer window"
msgstr ""
#: zrcolagui.cpp:577
#, fuzzy
msgid "Character preview"
msgstr "Skupine &znakov"
#: zrcolagui.cpp:582
msgid "Unicode character description"
msgstr ""
#: zrcolagui.cpp:587
msgid "Unicode character category"
msgstr ""
#: zrcolagui.cpp:594
msgid "« Back"
msgstr ""
#: zrcolagui.cpp:596
msgid "To previously viewed character"
msgstr ""
#: zrcolagui.cpp:600
msgid "Forward »"
msgstr ""
#: zrcolagui.cpp:602
msgid "To following viewed character"
msgstr ""
#: zrcolagui.cpp:613
msgid "Re&lated"
msgstr ""
#: zrcolagui.cpp:640
msgid "List of related characters"
msgstr ""
#: zrcolagui.cpp:727
msgid ""
"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:731
msgid "Select language &automatically according to selected keyboard"
msgstr ""
#: zrcolagui.cpp:734
msgid "&Manually select the language from the list below:"
msgstr ""
#: zrcolagui.cpp:746
msgid "Text Language"
msgstr ""
#: zrcolagui.cpp:751
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."
msgstr ""
#: zrcolagui.cpp:755
msgid "Start ZRCola &automatically on logon"
msgstr ""
#: zrcolagui.cpp:762
msgid "Startup"
msgstr ""
#: zrcolagui.cpp:841
msgid ""
"Editor: Janoš Ježovnik\n"
"Development: Amebis d. o. o.\n"
"Development and maintenance (2004-2015): dr. Peter Weiss"
msgstr ""
#: zrcolagui.cpp:849
msgid "www.zrc-sazu.si"
msgstr ""
#: zrcolagui.cpp:855
msgid ""
"Texts made using ZRCola have to include in the colophon, foreword, footnote "
"or some other appropriate part of the publication the note below:"
msgstr ""
#: zrcolagui.cpp:859
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:900
msgid "Log"
msgstr ""
#: zrcolagui.cpp:916
msgid "&Update"
msgstr ""
#: zrcolagui.cpp:921
msgid "&Close"
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."
msgstr ""
#: zrcolasettings.cpp:93
msgid "Start ZRCola automatically on logon"
msgstr ""
#: zrcolagui.h:275
msgid "Settings"
msgstr ""
#: zrcolagui.h:301
msgid "About ZRCola"
msgstr ""
#: zrcolagui.h:324
msgid "Product Update"
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 "1251"
#: 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
msgid "Input system for linguistic use"
msgstr ""
#~ msgid "Auto Start"
#~ msgstr "Samodejni zagon"
#~ msgid "Select %s language for decomposition"
#~ msgstr "Izberi jezik %s za razstavljanje"
#~ msgid "&Start on Logon"
#~ msgstr "Z&aženi ob prijavi"
#~ msgid "Start this program automatically on logon"
#~ msgstr "Samodejno zaženi ta program ob prijavi"
#~ msgid "Set language according to keyboard layout automatically"
#~ msgstr "Samodejno nastavi jezik glede na izbrano tipkovnico"
#~ msgid "&Unicode"
#~ msgstr "&Unicode"
#~ msgid "Esc"
#~ msgstr "Esc"
#~ msgid "F1"
#~ msgstr "F1"
#~ msgid "F2"
#~ msgstr "F2"
#~ msgid "F3"
#~ msgstr "F3"
#~ msgid "F4"
#~ msgstr "F4"
#~ msgid "F5"
#~ msgstr "F5"
#~ msgid "F6"
#~ msgstr "F6"
#~ msgid "F7"
#~ msgstr "F7"
#~ msgid "F8"
#~ msgstr "F8"
#~ msgid "F9"
#~ msgstr "F9"
#~ msgid "F10"
#~ msgstr "F10"
#~ msgid "F11"
#~ msgstr "F11"
#~ msgid "F12"
#~ msgstr "F12"
#~ msgid "Print Screen"
#~ msgstr "Print Screen"
#~ msgid "Scroll Lock"
#~ msgstr "Scroll Lock"
#~ msgid "Pause"
#~ msgstr "Pause"
#~ msgid "Backspace"
#~ msgstr "Backspace"
#~ msgid "Tab"
#~ msgstr "Tab"
#~ msgid "Caps Lock"
#~ msgstr "Caps Lock"
#~ msgid "Return"
#~ msgstr "Return"
#~ msgid "Space"
#~ msgstr "preslednica"
#~ msgid "Shift"
#~ msgstr "Shift"
#~ msgid "Alt"
#~ msgstr "Alt"
#~ msgid "Ctrl"
#~ msgstr "Ctrl"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Insert"
#~ msgstr "Insert"
#~ msgid "Delete"
#~ msgstr "Delete"
#~ msgid "Page Up"
#~ msgstr "Page Up"
#~ msgid "Page Down"
#~ msgstr "Page Down"
#~ msgid "Home"
#~ msgstr "Home"
#~ msgid "End"
#~ msgstr "End"
#~ msgid "Left"
#~ msgstr "Left"
#~ msgid "Up"
#~ msgstr "Up"
#~ msgid "Right"
#~ msgstr "Right"
#~ msgid "Down"
#~ msgstr "Down"
#~ msgid "Num Lock"
#~ msgstr "Num Lock"
#~ msgid "`"
#~ msgstr "`"
#~ msgid "-"
#~ msgstr "-"
#~ msgid "["
#~ msgstr "["
#~ msgid "]"
#~ msgstr "]"
#~ msgid ":"
#~ msgstr ":"
#~ msgid "'"
#~ msgstr "'"
#~ msgid "\\"
#~ msgstr "\\"
#~ msgid ","
#~ msgstr ","
#~ msgid "."
#~ msgstr "."
#~ msgid "/"
#~ msgstr "/"
#~ msgid "INS"
#~ msgstr "INS"
#~ msgid "Character &Groups"
#~ msgstr "Skupine &znakov"
#~ msgid "Language:"
#~ msgstr "Jezik:"
#~ msgid "&About"
#~ msgstr "O progr&amu"
#~ msgid "Cuts selected text and puts it on the clipboard"
#~ msgstr "Izreže izbrano besedilo in ga shrani na odložišče"
#~ msgid "Copies selected text to the clipboard"
#~ msgstr "Kopira izbrano besedilo na odložišče"
#~ msgid "Inserts text from the clipboard"
#~ msgstr "Vstavi besedilo z odložišča"
#~ msgid "&Copy"
#~ msgstr "&Kopiraj"
#~ msgid "&Paste"
#~ msgstr "&Prilepi"
#~ msgid "&File"
#~ msgstr "&Datoteka"
#~ msgid "Send Decomposed (F6)"
#~ msgstr "Pošlji razstavljeno (F6)"
#~ msgid "Send Composed (F5)"
#~ msgstr "Pošlji sestavljeno (F5)"
#~ msgid ""
#~ "ZRCola keyboard shortcut Win+Shift+Z could not be registered. Some "
#~ "functionality will not be available."
#~ msgstr ""
#~ "ZRColine bližnjice na tipkovnici Win+Shift+Z ni mogoče registrirati. "
#~ "Nekaj funkcionalnosti ne bo na voljo."
#, fuzzy
#~ msgid "Authentication progress real time monitor"
#~ msgstr "Nadzira postopek overovljanja v realnem času"
#~ msgid "Grave\t&7"
#~ msgstr "Krativec\t&7"
#~ msgid "Acute\t&9"
#~ msgstr "Ostrivec\t&9"
#~ msgid "Circumflex\t&3"
#~ msgstr "Cirkumfleks\t&3"
#~ msgid "Inverted &breve"
#~ msgstr "O&brnjen polkrog"
#~ msgid "&Accents"
#~ msgstr "N&aglasi"
#~ msgid ""
#~ "There is already an auto hidden bar on this edge.\n"
#~ "Only one auto hidden bar is allowed on each edge.\n"
#~ "Auto-hide feature is now off."
#~ msgstr ""
#~ "Ob tem robu je že samodejno skrita pasica.\n"
#~ "Na vsakem robu je lahko samo ena samodejno skrita pasica.\n"
#~ "Samodejno skrivanje je zdaj izklopljeno."
#~ msgid "Hello World"
#~ msgstr "Zdravo svet"
#~ msgid "&Hello...\tCtrl+H"
#~ msgstr "&Pozdrav ...\tCtrl+H"
#~ msgid "Help string shown in status bar for this menu item"
#~ msgstr "Niz s pomočjo prikazan v statusni vrstici za to točko menija"
#~ msgid "This is a wxWidgets' Hello world sample"
#~ msgstr "To je primer Zdravo svet v wxWidgets"
#~ msgid "About Hello World"
#~ msgstr "O Zdravo svet"
#~ msgid "Hello world from wxWidgets!"
#~ msgstr "Zdravo svet iz wxWidgets!"
#~ msgid "Welcome to wxWidgets!"
#~ msgstr "Dobrodošli v wxWidgets!"

View File

@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRCola\n"
"POT-Creation-Date: 2016-04-29 12:50+0200\n"
"PO-Revision-Date: 2016-04-29 12:50+0200\n"
"POT-Creation-Date: 2016-05-31 08:46+0200\n"
"PO-Revision-Date: 2016-05-31 08:46+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: sl_SI\n"
@@ -10,19 +10,26 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: zrcolafrm.cpp:76
#: zrcolaabout.cpp:31
#, c-format
msgid "Select %s language for decomposition"
msgstr "Izberi jezik %s za razstavljanje"
msgid "© 2004-%s ZRC SAZU"
msgstr "© 2004-%s ZRC SAZU"
#: zrcolafrm.cpp:87
#: zrcolaapp.cpp:79 zrcolafrm.cpp:86 zrcolagui.cpp:831 zrcolagui.h:102
#: 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
msgid "ZRCola"
msgstr "ZRCola"
#: zrcolafrm.cpp:104
msgid ""
"ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality "
"will not be available."
@@ -30,11 +37,11 @@ msgstr ""
"ZRColine bližnjice na tipkovnici Win+F5 ni mogoče registrirati. Nekaj "
"funkcionalnosti ne bo na voljo."
#: zrcolafrm.cpp:87 zrcolafrm.cpp:89
#: zrcolafrm.cpp:104 zrcolafrm.cpp:106
msgid "Warning"
msgstr "Opozorilo"
#: zrcolafrm.cpp:89
#: zrcolafrm.cpp:106
msgid ""
"ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality "
"will not be available."
@@ -42,153 +49,401 @@ msgstr ""
"ZRColine bližnjice na tipkovnici Win+F6 ni mogoče registrirati. Nekaj "
"funkcionalnosti ne bo na voljo."
#: zrcolafrm.cpp:151
msgid "Start ZRCola automatically on logon"
msgstr "Samodejno zaženi ZRColo ob prijavi"
#: zrcolafrm.cpp:341
msgid "http://zrcola-2.amebis.si/en/contact/"
msgstr "http://zrcola-2.amebis.si/contact/"
#: zrcolafrm.cpp:309
#, c-format
msgid ""
"ZRCola v%s\n"
"Copyright 2015-%s Amebis"
msgstr ""
"ZRCola v%s\n"
"Vse pravice pridržane 2015-%s Amebis"
#: zrcolafrm.cpp:309
msgid "About ZRCola"
msgstr "O ZRColi"
#: zrcolagui.cpp:32
msgid "&Start on Logon"
msgstr "Z&aženi ob prijavi"
#: zrcolagui.cpp:32
msgid "Start this program automatically on logon"
msgstr "Samodejno zaženi ta program ob prijavi"
#: zrcolagui.cpp:38
#: zrcolagui.cpp:36
msgid "E&xit"
msgstr "I&zhod"
#: zrcolagui.cpp:38
#: zrcolagui.cpp:36
msgid "Quit this program"
msgstr "Zapri ta program"
#: zrcolagui.cpp:41
#: zrcolagui.cpp:39
msgid "&Program"
msgstr "&Program"
#: zrcolagui.cpp:74
#: zrcolagui.cpp:72
msgid "Select &All"
msgstr "Izberi &vse"
#: zrcolagui.cpp:74
#: zrcolagui.cpp:72
msgid "Select all text"
msgstr "Izberi celotno besedilo"
#: zrcolagui.cpp:80
#: zrcolagui.cpp:78
msgid "C&haracter Selector..."
msgstr "Izbirnik &znaka ..."
#: zrcolagui.cpp:78 zrcolagui.cpp:170
msgid "Display character selector to select character to insert into text"
msgstr "Prikaži izbirnik znaka za izbor znaka za vstavljanje v besedilo"
#: zrcolagui.cpp:89
msgid "&Send Composed"
msgstr "Pošlji &sestavljeno"
#: zrcolagui.cpp:80 zrcolagui.cpp:137
#: zrcolagui.cpp:89 zrcolagui.cpp:172
msgid "Send composed text to source window"
msgstr "Pošlji sestavljeno besedilo izvornemu oknu"
#: zrcolagui.cpp:89
#: zrcolagui.cpp:98
msgid "Send &Decomposed"
msgstr "Pošlji &razstavljeno"
#: zrcolagui.cpp:89 zrcolagui.cpp:139
#: zrcolagui.cpp:98 zrcolagui.cpp:174
msgid "Send decomposed text to source window"
msgstr "Pošlji razstavljeno besedilo izvornemu oknu"
#: zrcolagui.cpp:98
#: zrcolagui.cpp:107
msgid "Abort (De)composition"
msgstr "Prekini raz/sestavljanje"
#: zrcolagui.cpp:98
#: zrcolagui.cpp:107
msgid "Abort composition and return focus to source window"
msgstr "Prekini sestavljanje in vrni fokus nazaj izvornemu oknu"
#: zrcolagui.cpp:107
msgid "&Language"
msgstr "&Jezik"
#: zrcolagui.cpp:118
msgid "&Settings..."
msgstr "Na&stavitve ..."
#: zrcolagui.cpp:109
msgid "&Automatic"
msgstr "S&amodejno"
#: zrcolagui.cpp:118
msgid "Open program configuration dialog"
msgstr "Odpri nastavitveni dialog programa"
#: zrcolagui.cpp:109
msgid "Set language according to keyboard layout automatically"
msgstr "Samodejno nastavi jezik glede na izbrano tipkovnico"
#: zrcolagui.cpp:116
#: zrcolagui.cpp:121
msgid "&Edit"
msgstr "Ur&edi"
#: zrcolagui.cpp:123
msgid "&Help"
msgstr "&Pomoč"
#: zrcolagui.cpp:125
msgid "&Edit Toolbar"
msgstr "Orodna vrstica za ur&ejanje"
#: zrcolagui.cpp:125
msgid "Toggle edit toolbar"
msgstr "Prikaži/skrij orodno vrstico za urejanje"
#: zrcolagui.cpp:129
msgid "&Compose Toolbar"
msgstr "Orodna vrsti&ca za sestavljanje"
#: zrcolagui.cpp:129
msgid "Toggle compose toolbar"
msgstr "Prikaži/skrij orodno vrstico za sestavljanje"
#: zrcolagui.cpp:135
msgid "Character Catalo&g"
msgstr "Katalo&g znakov"
#: zrcolagui.cpp:135
msgid "Toggle character catalog panel"
msgstr "Prikaži/skrij katalog znakov"
#: zrcolagui.cpp:138
msgid "&View"
msgstr "Po&gled"
#: zrcolagui.cpp:142
msgid "&Request a new character..."
msgstr "&Zahtevaj nov znak ..."
#: zrcolagui.cpp:142
msgid "Submit a request to ZRC to add a new character"
msgstr "Oddaj prošnjo ZRC-u za dodajanje novega znaka"
#: zrcolagui.cpp:146
msgid "Check for &Updates..."
msgstr "Preveri za &posodobitev ..."
#: zrcolagui.cpp:146
msgid "Check online for product update"
msgstr "Preveri na spletu za posodobitev izdelka"
#: zrcolagui.cpp:155
msgid "&Help"
msgstr "Po&moč"
#: zrcolagui.cpp:160
msgid "Cut"
msgstr "Izreži"
#: zrcolagui.cpp:129
#: zrcolagui.cpp:160
msgid "Cut selection"
msgstr "Izreži izbor"
#: zrcolagui.cpp:131
#: zrcolagui.cpp:162
msgid "Copy"
msgstr "Kopiraj"
#: zrcolagui.cpp:131
#: zrcolagui.cpp:162
msgid "Copy selection"
msgstr "Kopiraj izbor"
#: zrcolagui.cpp:133
#: zrcolagui.cpp:164
msgid "Paste"
msgstr "Prilepi"
#: zrcolagui.cpp:133
#: zrcolagui.cpp:164
msgid "Paste selection"
msgstr "Prilepi izbor"
#: zrcolagui.cpp:137
#: zrcolagui.cpp:167
msgid "Edit"
msgstr "Urejanje"
#: zrcolagui.cpp:170 zrcolagui.h:238
msgid "Character Selector"
msgstr "Izbirnik znaka"
#: zrcolagui.cpp:172
msgid "Send Composed"
msgstr "Pošlji sestavljeno"
#: zrcolagui.cpp:139
#: zrcolagui.cpp:174
msgid "Send Decomposed"
msgstr "Pošlji razstavljeno"
#: zrcolagui.cpp:141
msgid "Language:"
msgstr "Jezik:"
#: zrcolagui.cpp:177
msgid "Compose"
msgstr "Sestavljanje"
#: zrcolagui.cpp:190
#: zrcolagui.cpp:181
msgid "Character Catalog"
msgstr "Katalog znakov"
#: zrcolagui.cpp:185
msgid "(De)Composer"
msgstr "Raz/Sestavljalnik"
#: zrcolagui.cpp:224
msgid "Decomposed Text"
msgstr "Razstavljeno besedilo"
#: zrcolagui.cpp:210
#: zrcolagui.cpp:244
msgid "Decomposed Unicode Dump"
msgstr "Unicode razstavljenega"
#: zrcolagui.cpp:237
#: zrcolagui.cpp:271
msgid "Composed Text"
msgstr "Sestavljeno besedilo"
#: zrcolagui.cpp:257
#: zrcolagui.cpp:291
msgid "Composed Unicode Dump"
msgstr "Unicode sestavljenega"
#: zrcolagui.h:77 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
msgid "ZRCola"
msgstr "ZRCola"
#: zrcolagui.cpp:411
msgid "&Browse"
msgstr "Pre&brskaj"
#: zrcolagui.cpp:418
msgid ""
"Full or partial terms from Unicode character description (in English) to "
"search for"
msgstr ""
"Polne ali delne besede iz opisa znaka Unicode (v angleščini) za iskanje"
#: zrcolagui.cpp:424
msgid "List of Unicode character categories to search in"
msgstr "Seznam kategorij znaka Unicode za iskanje"
#: zrcolagui.cpp:431
msgid "All"
msgstr "Vse"
#: zrcolagui.cpp:432
msgid "Select all categories"
msgstr "Izberi vse kategorije"
#: zrcolagui.cpp:436
msgid "None"
msgstr "Nič"
#: zrcolagui.cpp:437
msgid "Clear category selection"
msgstr "Počisti izbor kategorij"
#: zrcolagui.cpp:441
msgid "Invert"
msgstr "Obrni"
#: zrcolagui.cpp:442
msgid "Invert category selection"
msgstr "Obrni izbor kategorij"
#: zrcolagui.cpp:475
msgid "Character search results"
msgstr "Rezultati iskanja znakov"
#: zrcolagui.cpp:485
msgid "Re&cently Used"
msgstr "Nedavno &uporabljeni"
#: zrcolagui.cpp:513
msgid "List of recently inserted characters"
msgstr "Seznam nedavno vstavljenih znakov"
#: zrcolagui.cpp:527
msgid "Preview"
msgstr "Predogled"
#: zrcolagui.cpp:532
msgid "U+"
msgstr "U+"
#: zrcolagui.cpp:537
msgid "Unicode hexadecimal code"
msgstr "Šestnajstiška koda Unicode"
#: zrcolagui.cpp:542
msgid "Keyboard shortcut in Composer window"
msgstr "Bližnjica na tipkovnici v oknu sestavljalnika"
#: zrcolagui.cpp:577
msgid "Character preview"
msgstr "Predogled znaka"
#: zrcolagui.cpp:582
msgid "Unicode character description"
msgstr "Opis znaka Unicode"
#: zrcolagui.cpp:587
msgid "Unicode character category"
msgstr "Kategorija znaka Unicode"
#: zrcolagui.cpp:594
msgid "« Back"
msgstr "« Nazaj"
#: zrcolagui.cpp:596
msgid "To previously viewed character"
msgstr "Na prejšnji prikazan znak"
#: zrcolagui.cpp:600
msgid "Forward »"
msgstr "Naprej »"
#: zrcolagui.cpp:602
msgid "To following viewed character"
msgstr "Na naslednji prikazan znak"
#: zrcolagui.cpp:613
msgid "Re&lated"
msgstr "&Sorodni"
#: zrcolagui.cpp:640
msgid "List of related characters"
msgstr "Seznam sorodnih znakov"
#: zrcolagui.cpp:727
msgid ""
"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 ""
"Nekateri znaki iz posameznih jezikov, s katerimi delate, se ne smejo "
"razstaviti v dele.\n"
"Za optimalno razstavljanje izberite pravilni jezik."
#: zrcolagui.cpp:731
msgid "Select language &automatically according to selected keyboard"
msgstr "S&amodejno izberi jezik glede na izbrano tipkovnico"
#: zrcolagui.cpp:734
msgid "&Manually select the language from the list below:"
msgstr "Ročno izberi jezik na spodnje&m spisku:"
#: zrcolagui.cpp:746
msgid "Text Language"
msgstr "Jezik besedila"
#: zrcolagui.cpp:751
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."
msgstr ""
"ZRCola se lahko zažene ob vsaki prijavi v vaš računalnik.\n"
"Na voljo bo na vrstici za sistemska obvestila ter preko registriranih "
"bližnjic Win+F5 in Win+F6."
#: zrcolagui.cpp:755
msgid "Start ZRCola &automatically on logon"
msgstr "S&amodejno zaženi ZRColo ob prijavi"
#: zrcolagui.cpp:762
msgid "Startup"
msgstr "Zagon"
#: zrcolagui.cpp:841
msgid ""
"Editor: Janoš Ježovnik\n"
"Development: Amebis d. o. o.\n"
"Development and maintenance (2004-2015): dr. Peter Weiss"
msgstr ""
"Urednik: Janoš Ježovnik\n"
"Razvoj: Amebis d. o. o.\n"
"Razvoj in vzdrževanje (2004-2015): dr. Peter Weiss"
#: zrcolagui.cpp:849
msgid "www.zrc-sazu.si"
msgstr "www.zrc-sazu.si"
#: zrcolagui.cpp:855
msgid ""
"Texts made using ZRCola have to include in the colophon, foreword, footnote "
"or some other appropriate part of the publication the note below:"
msgstr ""
"Besedilo, nastalo z uporabo ZRCole, mora biti v kolofonu, predgovoru, v "
"opombi ali na drugem ustreznem mestu v publikaciji opremljeno z naslednjim "
"zapisom:"
#: zrcolagui.cpp:859
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 ""
"Besedilo je bilo pripravljeno z vnašalnim sistemom ZRCola (http://zrcola.zrc-"
"sazu.si), ki ga je na Znanstvenoraziskovalnem centru SAZU v Ljubljani "
"(http://www.zrc-sazu.si) razvil dr. Peter Weiss."
#: zrcolagui.cpp:900
msgid "Log"
msgstr "Dnevnik"
#: zrcolagui.cpp:916
msgid "&Update"
msgstr "&Posodobi"
#: zrcolagui.cpp:921
msgid "&Close"
msgstr "&Zapri"
#: 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."
msgstr ""
"Pritisnjena tipka INS. Zdaj vtpikajte kodo Unicode želenega znaka (do štiri "
"šestnajstiške števke: 0-9, A-F), nato izpustite INS."
#: zrcolasettings.cpp:93
msgid "Start ZRCola automatically on logon"
msgstr "Samodejno zaženi ZRColo ob prijavi"
#: zrcolagui.h:275
msgid "Settings"
msgstr "Nastavitve"
#: zrcolagui.h:301
msgid "About ZRCola"
msgstr "O ZRColi"
#: zrcolagui.h:324
msgid "Product Update"
msgstr "Posodabljanje izdelka"
# Windows charset for this language (decimal)
#: MSIBuild/En.Win32.Release.Feature-2.idtx:3
@@ -205,6 +460,171 @@ msgstr "1250"
msgid "Input system for linguistic use"
msgstr "Vnašalni sistem za jezikoslovno rabo"
#~ msgid "Auto Start"
#~ msgstr "Samodejni zagon"
#~ msgid "Select %s language for decomposition"
#~ msgstr "Izberi jezik %s za razstavljanje"
#~ msgid "&Start on Logon"
#~ msgstr "Z&aženi ob prijavi"
#~ msgid "Start this program automatically on logon"
#~ msgstr "Samodejno zaženi ta program ob prijavi"
#~ msgid "Set language according to keyboard layout automatically"
#~ msgstr "Samodejno nastavi jezik glede na izbrano tipkovnico"
#~ msgid "&Unicode"
#~ msgstr "&Unicode"
#~ msgid "Esc"
#~ msgstr "Esc"
#~ msgid "F1"
#~ msgstr "F1"
#~ msgid "F2"
#~ msgstr "F2"
#~ msgid "F3"
#~ msgstr "F3"
#~ msgid "F4"
#~ msgstr "F4"
#~ msgid "F5"
#~ msgstr "F5"
#~ msgid "F6"
#~ msgstr "F6"
#~ msgid "F7"
#~ msgstr "F7"
#~ msgid "F8"
#~ msgstr "F8"
#~ msgid "F9"
#~ msgstr "F9"
#~ msgid "F10"
#~ msgstr "F10"
#~ msgid "F11"
#~ msgstr "F11"
#~ msgid "F12"
#~ msgstr "F12"
#~ msgid "Print Screen"
#~ msgstr "Print Screen"
#~ msgid "Scroll Lock"
#~ msgstr "Scroll Lock"
#~ msgid "Pause"
#~ msgstr "Pause"
#~ msgid "Backspace"
#~ msgstr "Backspace"
#~ msgid "Tab"
#~ msgstr "Tab"
#~ msgid "Caps Lock"
#~ msgstr "Caps Lock"
#~ msgid "Return"
#~ msgstr "Return"
#~ msgid "Space"
#~ msgstr "preslednica"
#~ msgid "Shift"
#~ msgstr "Shift"
#~ msgid "Alt"
#~ msgstr "Alt"
#~ msgid "Ctrl"
#~ msgstr "Ctrl"
#~ msgid "Menu"
#~ msgstr "Menu"
#~ msgid "Insert"
#~ msgstr "Insert"
#~ msgid "Delete"
#~ msgstr "Delete"
#~ msgid "Page Up"
#~ msgstr "Page Up"
#~ msgid "Page Down"
#~ msgstr "Page Down"
#~ msgid "Home"
#~ msgstr "Home"
#~ msgid "End"
#~ msgstr "End"
#~ msgid "Left"
#~ msgstr "Left"
#~ msgid "Up"
#~ msgstr "Up"
#~ msgid "Right"
#~ msgstr "Right"
#~ msgid "Down"
#~ msgstr "Down"
#~ msgid "Num Lock"
#~ msgstr "Num Lock"
#~ msgid "`"
#~ msgstr "`"
#~ msgid "-"
#~ msgstr "-"
#~ msgid "["
#~ msgstr "["
#~ msgid "]"
#~ msgstr "]"
#~ msgid ":"
#~ msgstr ":"
#~ msgid "'"
#~ msgstr "'"
#~ msgid "\\"
#~ msgstr "\\"
#~ msgid ","
#~ msgstr ","
#~ msgid "."
#~ msgstr "."
#~ msgid "/"
#~ msgstr "/"
#~ msgid "INS"
#~ msgstr "INS"
#~ msgid "Character &Groups"
#~ msgstr "Skupine &znakov"
#~ msgid "Language:"
#~ msgstr "Jezik:"
#~ msgid "&About"
#~ msgstr "O progr&amu"
@@ -287,3 +707,10 @@ msgstr "Vnašalni sistem za jezikoslovno rabo"
#~ msgid "Welcome to wxWidgets!"
#~ msgstr "Dobrodošli v wxWidgets!"
#~ msgid ""
#~ "ZRCola v%s\n"
#~ "Copyright 2015-%s Amebis"
#~ msgstr ""
#~ "ZRCola v%s\n"
#~ "Vse pravice pridržane 2015-%s Amebis"

BIN
ZRCola/res/char_select.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

1794
ZRCola/res/char_select.pdf Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

1936
ZRCola/res/navigate_back.pdf Normal file

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

View File

@@ -20,19 +20,32 @@
#pragma once
#include "../include/zrcola.h"
#include "zrcolaabout.h"
#include "zrcolaapp.h"
#include "zrcolachrgrid.h"
#include "zrcolachrcatpnl.h"
#include "zrcolacomppnl.h"
#include "zrcolafrm.h"
#include "zrcolakeyhndlr.h"
#include "zrcolasettings.h"
#include "zrcolaupdater.h"
#include <Updater/chkthread.h>
#include <wxex/common.h>
#include <wxex/persist/auimanager.h>
#include <wx/ffile.h>
#include <wx/msgdlg.h>
#include <wx/persist.h>
#include <wx/persist/toplevel.h>
#include <wxex/common.h>
#include <wx/utils.h>
#include <wx/valtext.h>
#include <wx/socket.h>
#include <fstream>
#include <string>
#include <utility>
#include <vector>
#include <stdex/idrec.h>

32
ZRCola/zrcolaabout.cpp Normal file
View File

@@ -0,0 +1,32 @@
/*
Copyright 2015-2016 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"
//////////////////////////////////////////////////////////////////////////
// wxZRColaAbout
//////////////////////////////////////////////////////////////////////////
wxZRColaAbout::wxZRColaAbout(wxWindow* parent) : wxZRColaAboutBase(parent)
{
m_staticTextVersion->SetLabelText(wxT(ZRCOLA_VERSION_STR));
m_staticTextCopyright->SetLabelText(wxString::Format(_("© 2004-%s ZRC SAZU"), wxT(ZRCOLA_BUILD_YEAR_STR)));
}

38
ZRCola/zrcolaabout.h Normal file
View File

@@ -0,0 +1,38 @@
/*
Copyright 2015-2016 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 wxZRColaAbout;
#pragma once
#include "zrcolagui.h"
///
/// About ZRCola dialog
///
class wxZRColaAbout : public wxZRColaAboutBase
{
public:
wxZRColaAbout(wxWindow* parent);
};

View File

@@ -30,7 +30,12 @@
wxIMPLEMENT_APP(ZRColaApp);
ZRColaApp::ZRColaApp() : wxApp()
ZRColaApp::ZRColaApp() :
m_mainWnd(NULL),
#ifdef __WXMSW__
m_running(NULL),
#endif
wxApp()
{
}
@@ -58,11 +63,32 @@ bool ZRColaApp::OnInit()
if (wxConfigBase::Get()->Read(wxT("LocalizationRepositoryPath"), &sPath))
m_locale.AddCatalogLookupPathPrefix(sPath);
wxVERIFY(m_locale.Init(language));
wxVERIFY(m_locale.AddCatalog(wxT("wxExtend")));
wxVERIFY(m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)));
wxVERIFY(m_locale.AddCatalog(wxT("Updater") wxT(wxUpdaterVersion)));
wxVERIFY(m_locale.AddCatalog(wxT("libZRColaUI")));
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola")));
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola-zrcdb")));
}
#ifdef __WXMSW__
// Create global event.
m_running = ::CreateEvent(NULL, FALSE, FALSE, _T(ZRCOLA_CFG_APPLICATION) _T("{BBDE7AAD-29B6-4B83-ADA1-92AFA81A0883}"));
wxASSERT(m_running);
if (::GetLastError() == ERROR_ALREADY_EXISTS) {
// ZRCola is already running. Find its window.
HWND okno = ::FindWindow(_T("wxWindowNR"), _("ZRCola"));
if (okno) {
if (::IsIconic(okno))
::SendMessage(okno, WM_SYSCOMMAND, SC_RESTORE, 0);
::SetActiveWindow(okno);
::SetForegroundWindow(okno);
// Not an error condition actually; Just nothing else to do...
return false;
}
}
#endif
std::fstream dat((LPCTSTR)GetDatabasePath(), 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))) {
@@ -102,7 +128,31 @@ bool ZRColaApp::OnInit()
m_lang_db.idxLng.clear();
m_lang_db.data .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();
}
} 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();
}
} 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();
}
} else
stdex::idrec::ignore<ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dat);
}
if (!has_translation_data)
@@ -112,9 +162,29 @@ bool ZRColaApp::OnInit()
wxFAIL_MSG(wxT("ZRCola.zrcdb is not a valid ZRCola database."));
}
wxZRColaFrame* mainFrame = new wxZRColaFrame();
wxPersistentRegisterAndRestore<wxZRColaFrame>(mainFrame);
mainFrame->Show();
// Initialize sockets. Otherwise Updater thread will not work.
wxSocketBase::Initialize();
m_mainWnd = new wxZRColaFrame();
wxPersistentRegisterAndRestore<wxZRColaFrame>(m_mainWnd);
m_mainWnd->Show();
return true;
}
int ZRColaApp::OnExit()
{
wxSocketBase::Shutdown();
int res = wxApp::OnExit();
#ifdef __WXMSW__
if (m_running) {
wxVERIFY(::CloseHandle(m_running));
m_running = NULL;
}
#endif
return res;
}

View File

@@ -25,11 +25,14 @@ class ZRColaApp;
#pragma once
#include "zrcolafrm.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 <zrcolaui/keyboard.h>
///
@@ -49,20 +52,34 @@ public:
///
virtual bool OnInit();
///
/// Called when application uninitializes.
///
/// \returns Result code to return to OS
///
virtual int OnExit();
///
/// \returns Path to ZRCola.zrcdb file
///
inline wxString GetDatabasePath() const;
public:
ZRCola::translation_db m_t_db; ///< Translation 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
wxZRColaFrame *m_mainWnd; ///< Main window
wxLocale m_locale; ///< Current locale
protected:
wxLocale m_locale; ///< Current locale
#ifdef __WXMSW__
HANDLE m_running; ///< Global Win32 event to determine if another instance of ZRCola is already running
#endif
};

193
ZRCola/zrcolachrcatpnl.cpp Normal file
View File

@@ -0,0 +1,193 @@
/*
Copyright 2015-2016 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"
//////////////////////////////////////////////////////////////////////////
// wxZRColaCharacterCatalogPanel
//////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxZRColaCharacterCatalogPanel, wxZRColaCharacterCatalogPanelBase)
EVT_MENU(wxZRColaCharacterCatalogPanel::wxID_FOCUS_DECOMPOSED, wxZRColaCharacterCatalogPanel::OnFocusDecomposed)
END_EVENT_TABLE()
wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) : wxZRColaCharacterCatalogPanelBase(parent)
{
std::fstream dat((LPCTSTR)((ZRColaApp*)wxTheApp)->GetDatabasePath(), 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;
dat.read((char*)&size, sizeof(ZRCola::recordsize_t));
if (dat.good()) {
ZRCola::chrgrp_rec rec(m_cg_db);
if (rec.find(dat, size)) {
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();
}
} else
wxFAIL_MSG(wxT("ZRCola.zrcdb has no character group data."));
}
} else
wxFAIL_MSG(wxT("ZRCola.zrcdb is not a valid ZRCola database."));
}
if (!m_cg_db.idxRnk.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];
wxString
label(cg.data, 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_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);
}
// Register frame specific hotkey(s).
{
wxAcceleratorEntry entries[1];
entries[0].Set(wxACCEL_NORMAL, WXK_ESCAPE, wxID_FOCUS_DECOMPOSED);
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
}
wxZRColaCharacterCatalogPanel::~wxZRColaCharacterCatalogPanel()
{
}
void wxZRColaCharacterCatalogPanel::OnChoice(wxCommandEvent& event)
{
ZRCola::chrgrp_db::chrgrp &cg = m_cg_db.idxRnk[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();
event.Skip();
}
void wxZRColaCharacterCatalogPanel::OnGridClick(wxGridEvent& event)
{
ZRColaApp *app = (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();
}
event.Skip();
}
void wxZRColaCharacterCatalogPanel::OnGridKeyDown(wxKeyEvent& event)
{
switch (event.GetKeyCode()) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
ZRColaApp *app = (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();
event.StopPropagation();
return;
}
}
event.Skip();
}
void wxZRColaCharacterCatalogPanel::OnFocusDecomposed(wxCommandEvent& event)
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
if (app->m_mainWnd) {
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
event.StopPropagation();
return;
}
event.Skip();
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaCharacterCatalogPanel
//////////////////////////////////////////////////////////////////////////
wxPersistentZRColaCharacterCatalogPanel::wxPersistentZRColaCharacterCatalogPanel(wxZRColaCharacterCatalogPanel *wnd) : wxPersistentWindow<wxZRColaCharacterCatalogPanel>(wnd)
{
}
wxString wxPersistentZRColaCharacterCatalogPanel::GetKind() const
{
return wxT(wxPERSIST_TLW_KIND);
}
void wxPersistentZRColaCharacterCatalogPanel::Save() const
{
const wxZRColaCharacterCatalogPanel * const wnd = static_cast<const wxZRColaCharacterCatalogPanel*>(GetWindow());
SaveValue(wxT("charGroup"), wnd->m_cg_id);
}
bool wxPersistentZRColaCharacterCatalogPanel::Restore()
{
wxZRColaCharacterCatalogPanel * const wnd = static_cast<wxZRColaCharacterCatalogPanel*>(GetWindow());
// 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);
break;
}
}
}
return true;
}

79
ZRCola/zrcolachrcatpnl.h Normal file
View File

@@ -0,0 +1,79 @@
/*
Copyright 2015-2016 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 wxZRColaCharacterCatalogPanel;
#pragma once
#include "zrcolagui.h"
#include <zrcolaui/chargroup.h>
#include <wx/persist/window.h>
///
/// ZRCola character groups panel
///
class wxZRColaCharacterCatalogPanel : public wxZRColaCharacterCatalogPanelBase
{
public:
enum
{
wxID_FOCUS_DECOMPOSED = 6000,
};
wxZRColaCharacterCatalogPanel(wxWindow* parent);
virtual ~wxZRColaCharacterCatalogPanel();
friend class wxPersistentZRColaCharacterCatalogPanel; // Allow saving/restoring window state.
protected:
virtual void OnChoice(wxCommandEvent& event);
virtual void OnGridClick(wxGridEvent& event);
virtual void OnGridKeyDown(wxKeyEvent& event);
void OnFocusDecomposed(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
protected:
ZRCola::chrgrp_db m_cg_db; ///< Character group database
int m_cg_id; ///< Selected character group ID
};
///
/// Supports saving/restoring wxZRColaCharacterCatalogPanel state
///
class wxPersistentZRColaCharacterCatalogPanel : public wxPersistentWindow<wxZRColaCharacterCatalogPanel>
{
public:
wxPersistentZRColaCharacterCatalogPanel(wxZRColaCharacterCatalogPanel *wnd);
virtual wxString GetKind() const;
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaCharacterCatalogPanel *wnd)
{
return new wxPersistentZRColaCharacterCatalogPanel(wnd);
}

226
ZRCola/zrcolachrgrid.cpp Normal file
View File

@@ -0,0 +1,226 @@
/*
Copyright 2015-2016 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"
//////////////////////////////////////////////////////////////////////////
// wxZRColaCharGrid
//////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxZRColaCharGrid, wxGrid)
EVT_SIZE(wxZRColaCharGrid::OnSize)
EVT_KEY_DOWN(wxZRColaCharGrid::OnKeyDown)
EVT_TIMER(wxZRColaCharGrid::wxID_TOOLTIP_TIMER, wxZRColaCharGrid::OnTooltipTimer)
END_EVENT_TABLE()
wxZRColaCharGrid::wxZRColaCharGrid() : wxGrid()
{
Init();
}
wxZRColaCharGrid::wxZRColaCharGrid(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxGrid(parent, id, pos, size, wxWANTS_CHARS, name)
{
Init();
SetDefaultRowSize(wxZRColaCharacterGridRowHeight);
// Create timer for saving the state.
m_timerToolTip.SetOwner(this, wxID_TOOLTIP_TIMER);
// wxEVT_MOTION event must be connected to the wxGridWindow, not wxGrid itself.
wxWindow *gridWnd = GetGridWindow();
gridWnd->Connect(gridWnd->GetId(), wxEVT_MOTION, wxMouseEventHandler(wxZRColaCharGrid::OnMotion), NULL, this);
}
wxZRColaCharGrid::~wxZRColaCharGrid()
{
wxWindow *gridWnd = GetGridWindow();
gridWnd->Disconnect(gridWnd->GetId(), wxEVT_MOTION, wxMouseEventHandler(wxZRColaCharGrid::OnMotion), NULL, this);
}
void wxZRColaCharGrid::Init()
{
m_regenerate = false;
m_isResizing = false;
m_toolTipIdx = (size_t)-1;
}
void wxZRColaCharGrid::SetCharacters(const wxString &chars)
{
m_chars = chars;
m_regenerate = true;
// Invoke OnSize(), which will populate the grid.
wxSizeEvent e(GetSize(), m_windowId);
e.SetEventObject(this);
HandleWindowEvent(e);
}
wxString wxZRColaCharGrid::GetToolTipText(int idx)
{
wxASSERT_MSG(idx < (int)m_chars.Length(), wxT("index out of bounds"));
ZRColaApp *app = (ZRColaApp*)wxTheApp;
// See if this character has a key sequence registered.
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) {
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());
}
return wxString::Format(wxT("U+%04X"), (int)m_chars[idx]);
}
void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
{
event.Skip();
if (m_isResizing)
return;
m_isResizing = true;
// Calculate initial estimate of columns and rows.
wxSize size(event.GetSize());
size_t
char_len = m_chars.Length();
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);
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);
}
BeginBatch();
if (m_regenerate || cols != m_numCols) {
// Build and set new grid data.
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);
SetTable(table, true);
m_regenerate = false;
}
for (int c = 0; c < cols; c++)
SetColSize(c, wxZRColaCharacterGridColumnWidth);
//// Set column widths to stretch to full width.
//for (int c = 0, x_l = 0; c < cols; c++) {
// int x_r = (c + 1)*width/cols;
// SetColSize(c, x_r - x_l);
// x_l = x_r;
//}
EndBatch();
m_isResizing = false;
}
void wxZRColaCharGrid::OnKeyDown(wxKeyEvent& event)
{
wxWindow *parentWnd;
int key_code = event.GetKeyCode();
if (key_code == WXK_TAB && (parentWnd = GetParent()) != NULL) {
wxNavigationKeyEvent eventNav;
eventNav.SetDirection(!event.ShiftDown());
eventNav.SetWindowChange(event.ControlDown());
eventNav.SetEventObject(this);
if (parentWnd->HandleWindowEvent(eventNav))
return;
} else if (key_code == WXK_LEFT && m_currentCellCoords.GetCol() == 0 && m_currentCellCoords.GetRow()) {
GoToCell(m_currentCellCoords.GetRow() - 1, m_numCols - 1);
event.StopPropagation();
return;
} else if (key_code == WXK_RIGHT && m_currentCellCoords.GetCol() == m_numCols - 1 && m_currentCellCoords.GetRow() < m_numRows - 1) {
GoToCell(m_currentCellCoords.GetRow() + 1, 0);
event.StopPropagation();
return;
}
event.Skip();
}
void wxZRColaCharGrid::OnMotion(wxMouseEvent& event)
{
event.Skip();
wxPoint ptMouse(CalcUnscrolledPosition(event.GetPosition()));
int
col = XToCol(ptMouse.x - m_rowLabelWidth ),
row = YToRow(ptMouse.y - m_colLabelHeight);
if (col == wxNOT_FOUND || row == wxNOT_FOUND )
return;
size_t toolTipIdx = row*m_numCols + col;
if (toolTipIdx >= m_chars.Length()) {
// Index out of range.
m_toolTipIdx = (size_t)-1;
m_timerToolTip.Stop();
return;
} else if (toolTipIdx != m_toolTipIdx) {
// Cell changed.
m_toolTipIdx = toolTipIdx;
wxWindow *gridWnd = GetGridWindow();
if (gridWnd->GetToolTip()) {
// The tooltip is already shown. Update it immediately.
gridWnd->SetToolTip(GetToolTipText(m_toolTipIdx));
} else {
// This must be our initial entry. Schedule tooltip display after 1s.
m_timerToolTip.Start(1000, true);
}
}
}
void wxZRColaCharGrid::OnTooltipTimer(wxTimerEvent& event)
{
event.Skip();
if (m_toolTipIdx >= m_chars.Length())
return;
GetGridWindow()->SetToolTip(GetToolTipText(m_toolTipIdx));
}

104
ZRCola/zrcolachrgrid.h Normal file
View File

@@ -0,0 +1,104 @@
/*
Copyright 2015-2016 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 wxZRColaCharGrid;
#pragma once
#include <wx/grid.h>
///
/// Character grid layout
///
#define wxZRColaCharacterGridColumnWidth 35
#define wxZRColaCharacterGridRowHeight 35
///
/// ZRCola character grid
///
class wxZRColaCharGrid : public wxGrid
{
public:
enum
{
wxID_TOOLTIP_TIMER = 2000,
};
wxZRColaCharGrid();
wxZRColaCharGrid(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxWANTS_CHARS, const wxString& name = wxGridNameStr);
virtual ~wxZRColaCharGrid();
///
/// Sets new array of characters to display
///
/// \param[in] chars The string containing characters to display
///
void SetCharacters(const wxString &chars);
///
/// Returns displayed characters
///
/// \returns The string containing displayed characters
///
inline wxString GetCharacters() const
{
return m_chars;
}
///
/// Returns given character coordinates
///
/// \param[in] c Character
///
/// \returns Grid coordinates of selected character or (-1, -1) if character not found.
///
inline wxGridCellCoords GetCharacterCoords(wchar_t c) const
{
int i = m_chars.Find(c);
return i != wxNOT_FOUND ? wxGridCellCoords(i / m_numCols, i % m_numCols) : wxGridCellCoords(-1, -1);
}
protected:
virtual wxString GetToolTipText(int idx);
void OnSize(wxSizeEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnMotion(wxMouseEvent& event);
void OnTooltipTimer(wxTimerEvent& event);
DECLARE_EVENT_TABLE()
private:
void Init(); // common part of all ctors
protected:
wxString m_chars; ///< Array of Unicode characters to display in the grid
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
};

589
ZRCola/zrcolachrslct.cpp Normal file
View File

@@ -0,0 +1,589 @@
/*
Copyright 2015-2016 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"
//////////////////////////////////////////////////////////////////////////
// wxZRColaCharSelect
//////////////////////////////////////////////////////////////////////////
wxDEFINE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) :
m_searchChanged(false),
m_unicodeChanged(false),
m_char(0),
m_searchThread(NULL),
wxZRColaCharSelectBase(parent)
{
Connect(wxID_ANY, wxEVT_SEARCH_COMPLETE, wxThreadEventHandler(wxZRColaCharSelect::OnSearchComplete), NULL, this);
m_unicode->SetValidator(wxHexValidator<wchar_t>(&m_char, wxNUM_VAL_DEFAULT, 4));
// 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);
m_categories->Check(idx);
m_ccOrder.insert(std::make_pair(cc.id, idx));
}
ResetResults();
NavigationState state;
state.m_char = m_char;
state.m_related.m_selected.SetCol(m_gridRelated->GetGridCursorCol());
state.m_related.m_selected.SetRow(m_gridRelated->GetGridCursorRow());
m_historyCursor = m_history.insert(m_history.end(), state);
}
wxZRColaCharSelect::~wxZRColaCharSelect()
{
if (m_searchThread)
m_searchThread->Delete();
Disconnect(wxID_ANY, wxEVT_SEARCH_COMPLETE, wxThreadEventHandler(wxZRColaCharSelect::OnSearchComplete), NULL, this);
}
void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
{
event.Skip();
if (m_unicodeChanged) {
if (m_unicode->GetValidator()->TransferFromWindow()) {
ZRColaApp *app = (ZRColaApp*)wxTheApp;
m_gridPreview->SetCellValue(wxString(1, m_char), 0, 0);
char chr[sizeof(ZRCola::character_db::character)] = {};
((ZRCola::character_db::character*)chr)->chr = m_char;
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));
{
// See if this character has a key sequence registered.
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)) {
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))
m_shortcut->SetValue(ks_str);
else
m_shortcut->SetValue(wxEmptyString);
} else
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")));
} else
m_category->SetValue(wxEmptyString);
}
// Update related characters.
m_gridRelated->SetCharacters(wxString(chr.data + chr.desc_len, chr.rel_len));
} else {
m_description->SetValue(wxEmptyString);
m_shortcut->SetValue(wxEmptyString);
m_category->SetValue(wxEmptyString);
m_gridRelated->ClearGrid();
}
m_gridRelated->GoToCell(m_historyCursor->m_related.m_selected);
wxGridCellCoords coord(m_gridResults->GetCharacterCoords(m_char));
if (coord.GetRow() != -1 && coord.GetCol() != -1) {
m_gridResults->GoToCell(coord);
m_gridResults->SetGridCursor(coord);
} else
m_gridResults->ClearSelection();
}
m_unicodeChanged = false;
} else if (m_searchChanged) {
if (m_searchThread)
m_searchThread->Delete();
wxString val(m_search->GetValue());
if (!val.IsEmpty()) {
ZRColaApp *app = (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];
if (m_categories->IsChecked(i))
m_searchThread->m_cats.insert(cc.id);
}
if (m_searchThread->Run() != wxTHREAD_NO_ERROR) {
wxFAIL_MSG("Can't create the thread!");
delete m_searchThread;
m_searchThread = NULL;
}
} else
ResetResults();
m_searchChanged = false;
}
}
void wxZRColaCharSelect::OnSearchText(wxCommandEvent& event)
{
event.Skip();
m_searchChanged = true;
}
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++)
m_categories->Check(i, true);
m_searchChanged = true;
}
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++)
m_categories->Check(i, false);
m_searchChanged = true;
}
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++)
m_categories->Check(i, !m_categories->IsChecked(i));
m_searchChanged = true;
}
void wxZRColaCharSelect::OnCategoriesToggle(wxCommandEvent& event)
{
event.Skip();
m_searchChanged = true;
}
void wxZRColaCharSelect::OnSearchComplete(wxThreadEvent& event)
{
event.Skip();
if (m_searchThread) {
// Display results.
wxString chars;
chars.reserve(m_searchThread->m_hits.size());
for (std::vector< std::pair<unsigned long, wchar_t> >::const_iterator i = m_searchThread->m_hits.cbegin(), i_end = m_searchThread->m_hits.cend(); i != i_end; ++i)
chars += i->second;
m_gridResults->SetCharacters(chars);
m_searchThread->Delete();
m_searchThread = NULL;
m_gridResults->Scroll(0, 0);
}
}
void wxZRColaCharSelect::OnResultSelectCell(wxGridEvent& event)
{
if (m_unicodeChanged) return;
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val[0]);
}
void wxZRColaCharSelect::OnResultCellDClick(wxGridEvent& event)
{
event.Skip();
wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
}
void wxZRColaCharSelect::OnResultsKeyDown(wxKeyEvent& event)
{
switch (event.GetKeyCode()) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
wxString val(m_gridResults->GetCellValue(m_gridResults->GetCursorRow(), m_gridResults->GetCursorColumn()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
event.StopPropagation();
return;
}
}
event.Skip();
}
void wxZRColaCharSelect::OnRecentSelectCell(wxGridEvent& event)
{
if (m_unicodeChanged) return;
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val[0]);
}
void wxZRColaCharSelect::OnRecentCellDClick(wxGridEvent& event)
{
event.Skip();
wxString val(m_gridRecent->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
}
}
void wxZRColaCharSelect::OnRecentKeyDown(wxKeyEvent& event)
{
switch (event.GetKeyCode()) {
case WXK_RETURN:
case WXK_NUMPAD_ENTER:
wxString val(m_gridRecent->GetCellValue(m_gridRecent->GetCursorRow(), m_gridRecent->GetCursorColumn()));
if (!val.IsEmpty()) {
NavigateTo(val[0]);
wxCommandEvent e(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
m_sdbSizerButtonsOK->GetEventHandler()->ProcessEvent(e);
event.StopPropagation();
return;
}
}
event.Skip();
}
void wxZRColaCharSelect::OnUnicodeText(wxCommandEvent& event)
{
event.Skip();
m_unicodeChanged = true;
}
void wxZRColaCharSelect::OnPreviewKeyDown(wxKeyEvent& event)
{
int key_code = event.GetKeyCode();
if (key_code == WXK_TAB != NULL) {
wxNavigationKeyEvent eventNav;
eventNav.SetDirection(!event.ShiftDown());
eventNav.SetWindowChange(event.ControlDown());
eventNav.SetEventObject(this);
if (HandleWindowEvent(eventNav))
return;
}
event.Skip();
}
void wxZRColaCharSelect::OnNavigateBack(wxHyperlinkEvent& event)
{
event.StopPropagation();
NavigateBy(-1);
}
void wxZRColaCharSelect::OnNavigateForward(wxHyperlinkEvent& event)
{
event.StopPropagation();
NavigateBy(+1);
}
void wxZRColaCharSelect::OnRelatedSelectCell(wxGridEvent& event)
{
if (m_unicodeChanged) return;
wxString val(m_gridRelated->GetCellValue(event.GetRow(), event.GetCol()));
if (!val.IsEmpty())
NavigateTo(val[0]);
}
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];
if (c != m_char)
val += c;
}
m_gridRecent->SetCharacters(val);
}
void wxZRColaCharSelect::ResetResults()
{
// Fill the results.
ZRColaApp *app = (ZRColaApp*)wxTheApp;
size_t i, n = app->m_chr_db.idxChr.size();
wxString 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);
if (idx == m_ccOrder.end() || m_categories->IsChecked(idx->second))
val += chr.chr;
}
m_gridResults->SetCharacters(val);
}
void wxZRColaCharSelect::NavigateBy(int offset)
{
if (offset != 0) {
// Update history state
m_historyCursor->m_related.m_selected.SetCol(m_gridRelated->GetGridCursorCol());
m_historyCursor->m_related.m_selected.SetRow(m_gridRelated->GetGridCursorRow());
if (offset < 0) {
while (m_historyCursor != m_history.begin() && offset) {
--m_historyCursor; offset++;
m_char = m_historyCursor->m_char;
m_unicodeChanged = true;
}
} else {
while (offset) {
++m_historyCursor;
if (m_historyCursor == m_history.end()) {
// We're past the last history entry.
--m_historyCursor;
break;
}
offset--;
m_char = m_historyCursor->m_char;
m_unicodeChanged = true;
}
}
m_navigateBack->Enable(m_historyCursor != m_history.begin());
std::list<NavigationState>::iterator cursor_next(m_historyCursor);
++cursor_next;
m_navigateForward->Enable(cursor_next != m_history.end());
if (m_unicodeChanged)
m_unicode->GetValidator()->TransferToWindow();
}
}
void wxZRColaCharSelect::NavigateTo(wchar_t c)
{
if (m_char != c) {
// Update history state
m_historyCursor->m_related.m_selected.SetCol(m_gridRelated->GetGridCursorCol());
m_historyCursor->m_related.m_selected.SetRow(m_gridRelated->GetGridCursorRow());
++m_historyCursor;
// Create new state.
NavigationState state;
state.m_char = m_char = c;
state.m_related.m_selected.SetCol(0);
state.m_related.m_selected.SetRow(0);
m_historyCursor = m_history.insert(m_historyCursor, state);
// Purge the history's tail.
std::list<NavigationState>::iterator cursor_next(m_historyCursor);
++cursor_next;
m_history.erase(cursor_next, m_history.end());
m_unicode->GetValidator()->TransferToWindow();
m_navigateBack->Enable(true);
m_navigateForward->Enable(false);
}
}
wxZRColaCharSelect::SearchThread::SearchThread(wxZRColaCharSelect *parent) :
m_parent(parent),
wxThread(wxTHREAD_JOINABLE)
{
//// This is a worker thread. Set priority between minimal and normal.
//SetPriority((wxPRIORITY_MIN + wxPRIORITY_DEFAULT) / 2);
}
wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
std::map<wchar_t, unsigned long> hits;
if (TestDestroy()) return (wxThread::ExitCode)1;
{
// Search by indexes and merge results.
std::map<wchar_t, unsigned long> 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, unsigned long>::const_iterator i = hits_sub.cbegin(), i_end = hits_sub.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
std::map<wchar_t, unsigned long>::iterator idx = hits.find(i->first);
if (idx == hits.end())
hits.insert(std::make_pair(i->first, i->second / 4));
else
idx->second += i->second / 4;
}
}
// Now sort the characters by rank.
m_hits.reserve(hits.size());
for (std::map<wchar_t, unsigned long>::const_iterator i = hits.cbegin(), i_end = hits.cend(); i != i_end; ++i) {
if (TestDestroy()) return (wxThread::ExitCode)1;
m_hits.push_back(std::make_pair(i->second, i->first));
}
std::qsort(m_hits.data(), m_hits.size(), sizeof(std::pair<unsigned long, wchar_t>), 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,
// (in this case this is assured by the wxZRColaCharSelect destructor)
wxQueueEvent(m_parent, new wxThreadEvent(wxEVT_SEARCH_COMPLETE));
return 0;
}
int __cdecl wxZRColaCharSelect::SearchThread::CompareHits(const void *a, const void *b)
{
const std::pair<unsigned long, wchar_t> *_a = (const std::pair<unsigned long, wchar_t>*)a;
const std::pair<unsigned long, wchar_t> *_b = (const std::pair<unsigned long, wchar_t>*)b;
if (_a->first > _b->first) return -1;
else if (_a->first < _b->first) return 1;
if (_a->second < _b->second) return -1;
else if (_a->second > _b->second) return 1;
return 0;
}
bool __cdecl wxZRColaCharSelect::SearchThread::TestDestroyS(void *cookie)
{
return static_cast<wxZRColaCharSelect::SearchThread*>(cookie)->TestDestroy();
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaCharSelect
//////////////////////////////////////////////////////////////////////////
wxPersistentZRColaCharSelect::wxPersistentZRColaCharSelect(wxZRColaCharSelect *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaCharSelect::Save() const
{
wxPersistentDialog::Save();
const wxZRColaCharSelect * const wnd = static_cast<const wxZRColaCharSelect*>(GetWindow());
SaveValue(wxT("recentChars"), wnd->m_gridRecent->GetCharacters());
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];
wxString name(wxT("category"));
name.Append(cc.id.data, _countof(cc.id.data));
SaveValue(name, wnd->m_categories->IsChecked(i));
}
}
bool wxPersistentZRColaCharSelect::Restore()
{
wxZRColaCharSelect * const wnd = static_cast<wxZRColaCharSelect*>(GetWindow());
wxString recent;
if (RestoreValue(wxT("recentChars"), &recent))
wnd->m_gridRecent->SetCharacters(recent);
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];
wxString name(wxT("category"));
name.Append(cc.id.data, _countof(cc.id.data));
bool val;
if (RestoreValue(name, &val))
wnd->m_categories->Check(i, val);
}
wnd->ResetResults();
return wxPersistentDialog::Restore();
}

143
ZRCola/zrcolachrslct.h Normal file
View File

@@ -0,0 +1,143 @@
/*
Copyright 2015-2016 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 wxZRColaCharSelect;
class wxPersistentZRColaCharSelect;
#pragma once
#include "zrcolagui.h"
#include <zrcola/character.h>
#include <wxex/valhex.h>
#include <wxex/persist/dialog.h>
#include <wx/event.h>
#include <wx/thread.h>
#include <list>
#include <map>
wxDECLARE_EVENT(wxEVT_SEARCH_COMPLETE, wxThreadEvent);
///
/// ZRCola character select dialog
///
class wxZRColaCharSelect : public wxZRColaCharSelectBase
{
public:
wxZRColaCharSelect(wxWindow* parent);
virtual ~wxZRColaCharSelect();
friend class wxPersistentZRColaCharSelect; // Allow saving/restoring window state.
friend class SearchThread; // For search thread back-notifications
protected:
virtual void OnIdle(wxIdleEvent& event);
virtual void OnSearchText(wxCommandEvent& event);
virtual void OnCategoriesAll(wxHyperlinkEvent& event);
virtual void OnCategoriesNone(wxHyperlinkEvent& event);
virtual void OnCategoriesInvert(wxHyperlinkEvent& event);
virtual void OnCategoriesToggle(wxCommandEvent& event);
void OnSearchComplete(wxThreadEvent& event);
virtual void OnResultSelectCell(wxGridEvent& event);
virtual void OnResultCellDClick(wxGridEvent& event);
virtual void OnResultsKeyDown(wxKeyEvent& event);
virtual void OnRecentSelectCell(wxGridEvent& event);
virtual void OnRecentCellDClick(wxGridEvent& event);
virtual void OnRecentKeyDown(wxKeyEvent& event);
virtual void OnNavigateBack(wxHyperlinkEvent& event);
virtual void OnNavigateForward(wxHyperlinkEvent& event);
virtual void OnUnicodeText(wxCommandEvent& event);
virtual void OnPreviewKeyDown(wxKeyEvent& event);
virtual void OnRelatedSelectCell(wxGridEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
void ResetResults();
void NavigateBy(int offset);
void NavigateTo(wchar_t c);
public:
wchar_t m_char; ///< Currently selected character (0 when none)
protected:
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?
///
/// Search worker thread
///
class SearchThread : public wxThread
{
public:
SearchThread(wxZRColaCharSelect *parent);
protected:
virtual ExitCode Entry();
static int __cdecl CompareHits(const void *a, const void *b);
static bool __cdecl TestDestroyS(void *cookie);
public:
std::wstring m_search; ///< Search phrase
std::set<ZRCola::chrcatid_t> m_cats; ///< Search categories
std::vector< std::pair<unsigned long, wchar_t> > m_hits; ///< Search results
protected:
wxZRColaCharSelect *m_parent; ///< Thread owner
} *m_searchThread; ///< Search thread
///
/// Navigation state
///
struct NavigationState
{
wchar_t m_char;
struct {
wxGridCellCoords m_selected;
} m_related;
};
std::list<NavigationState> m_history; ///< Navigation history
std::list<NavigationState>::iterator m_historyCursor; ///< Navigation history cursor
};
///
/// Supports saving/restoring wxZRColaCharSelect state
///
class wxPersistentZRColaCharSelect : public wxPersistentDialog
{
public:
wxPersistentZRColaCharSelect(wxZRColaCharSelect *wnd);
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaCharSelect *wnd)
{
return new wxPersistentZRColaCharSelect(wnd);
}

View File

@@ -24,22 +24,15 @@
// wxZRColaComposerPanel
//////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxZRColaComposerPanel, wxZRColaComposerPanelBase)
EVT_TIMER(wxZRColaComposerPanel::wxID_TIMER, wxZRColaComposerPanel::OnTimerTimeout)
END_EVENT_TABLE()
wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
m_progress(false),
m_decomposedChanged(false),
m_composedChanged(false),
m_selDecomposed(0, 0),
m_selComposed(0, 0),
wxZRColaComposerPanelBase(parent)
{
m_decomposed->PushEventHandler(&m_keyhandler);
// Create timer for saving the state.
m_timer = new wxTimer(this, wxID_TIMER);
// Restore the previously saved state (if exists).
wxString fileName(GetStateFileName());
if (wxFileExists(fileName)) {
@@ -59,10 +52,15 @@ wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
file.Read(wxStringBuffer(composed, n), sizeof(wchar_t)*n);
if (!file.Error()) {
// Restore state.
m_progress = true;
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_composed->SetValue(composed);
m_progress = false;
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;
}
}
}
@@ -74,9 +72,6 @@ wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) :
wxZRColaComposerPanel::~wxZRColaComposerPanel()
{
if (m_timer)
delete m_timer;
m_decomposed->PopEventHandler();
// This is a controlled exit. Purge saved state.
@@ -86,6 +81,73 @@ wxZRColaComposerPanel::~wxZRColaComposerPanel()
}
void wxZRColaComposerPanel::SynchronizePanels()
{
if (m_decomposedChanged) {
m_timerSave.Stop();
wxString src;
size_t len = GetValue(m_decomposed, src);
std::wstring norm;
((ZRColaApp*)wxTheApp)->m_t_db.Decompose(src.data(), len, norm, &m_mapping1);
std::wstring dst;
((ZRColaApp*)wxTheApp)->m_t_db.Compose(norm.data(), norm.size(), dst, &m_mapping2);
m_decomposed->GetSelection(&m_selDecomposed.first, &m_selDecomposed.second);
// Update decomposed HEX dump.
SetHexValue(m_decomposedHex, m_selDecomposedHex, m_mappingDecomposedHex, src.data(), len, m_selDecomposed.first, m_selDecomposed.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);
// Schedule state save after 3s.
m_timerSave.Start(3000, true);
} else if (m_composedChanged) {
m_timerSave.Stop();
wxString src;
size_t len = GetValue(m_composed, src);
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);
m_mapping1.clear();
m_mapping2.invert();
m_composed->GetSelection(&m_selComposed.first, &m_selComposed.second);
// Update composed HEX dump.
SetHexValue(m_composedHex, m_selComposedHex, m_mappingComposedHex, src.data(), len, m_selComposed.first, m_selComposed.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);
// Schedule state save after 3s.
m_timerSave.Start(3000, true);
}
m_decomposedChanged = false;
m_composedChanged = false;
}
void wxZRColaComposerPanel::OnDecomposedPaint(wxPaintEvent& event)
{
event.Skip();
@@ -97,9 +159,18 @@ void wxZRColaComposerPanel::OnDecomposedPaint(wxPaintEvent& event)
// Save new selection first, to avoid loop.
m_selDecomposed.first = from;
m_selDecomposed.second = to;
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
m_composed->SetSelection(from = m_mapping2.to_dst(m_mapping1.to_dst(from)), to = m_mapping2.to_dst(m_mapping1.to_dst(to)));
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
m_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(from),
m_selDecomposedHex.second = m_mappingDecomposedHex.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_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(m_selComposed.first ),
m_selComposedHex.second = m_mappingComposedHex.to_dst(m_selComposed.second));
}
}
@@ -115,63 +186,28 @@ void wxZRColaComposerPanel::OnDecomposedHexPaint(wxPaintEvent& event)
// Save new selection first, to avoid loop.
m_selDecomposedHex.first = from;
m_selDecomposedHex.second = to;
m_decomposed->SetSelection(from = m_mappingDecomposedHex.to_src(from), to = m_mappingDecomposedHex.to_src(to));
m_composed->SetSelection(from = m_mapping2.to_dst(m_mapping1.to_dst(from)), to = m_mapping2.to_dst(m_mapping1.to_dst(to)));
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
m_decomposed->SetSelection(
m_selDecomposed.first = m_mappingDecomposedHex.to_src(from),
m_selDecomposed.second = m_mappingDecomposedHex.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_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(m_selComposed.first ),
m_selComposedHex.second = m_mappingComposedHex.to_dst(m_selComposed.second));
}
}
void wxZRColaComposerPanel::OnDecomposedText(wxCommandEvent& event)
{
if (m_progress) {
// We are being updated by wxZRColaComposerPanel::OnComposedText()
event.Skip();
} else {
m_timer->Stop();
event.Skip();
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_decomposed->GetHWND();
size_t len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> src(len + 1);
::GetWindowTextW(hWnd, src.data(), src.size());
#else
wxString src(m_decomposed->GetValue());
size_t len = src.Length();
#endif
std::wstring norm;
((ZRColaApp*)wxTheApp)->m_t_db.Decompose(src.data(), len, norm, &m_mapping1);
std::wstring dst;
((ZRColaApp*)wxTheApp)->m_t_db.Compose(norm.data(), norm.size(), dst, &m_mapping2);
long from, to;
m_decomposed->GetSelection(&from, &to);
// Update decomposed HEX dump.
wxString hex;
GetHex(hex, m_mappingDecomposedHex, src.data(), len);
m_decomposedHex->SetValue(hex);
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
// Update composed text.
m_progress = true;
m_composed->SetValue(dst);
m_composed->SetSelection(from = m_mapping2.to_dst(m_mapping1.to_dst(from)), to = m_mapping2.to_dst(m_mapping1.to_dst(to)));
// Update composed HEX dump.
GetHex(hex, m_mappingComposedHex, dst.data(), dst.length());
m_composedHex->SetValue(hex);
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
event.Skip();
m_progress = false;
// Schedule state save after 3s.
m_timer->Start(3000, true);
}
// Set the flag the decomposed text changed to trigger idle-time composition.
m_decomposedChanged = true;
}
@@ -186,9 +222,18 @@ void wxZRColaComposerPanel::OnComposedPaint(wxPaintEvent& event)
// Save new selection first, to avoid loop.
m_selComposed.first = from;
m_selComposed.second = to;
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
m_decomposed->SetSelection(from = m_mapping1.to_src(m_mapping2.to_src(from)), to = m_mapping1.to_src(m_mapping2.to_src(to)));
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
m_composedHex->SetSelection(
m_selComposedHex.first = m_mappingComposedHex.to_dst(from),
m_selComposedHex.second = m_mappingComposedHex.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_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(m_selDecomposed.first ),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(m_selDecomposed.second));
}
}
@@ -204,107 +249,48 @@ void wxZRColaComposerPanel::OnComposedHexPaint(wxPaintEvent& event)
// Save new selection first, to avoid loop.
m_selComposedHex.first = from;
m_selComposedHex.second = to;
m_composed->SetSelection(from = m_mappingComposedHex.to_src(from), to = m_mappingComposedHex.to_src(to));
m_decomposed->SetSelection(from = m_mapping1.to_src(m_mapping2.to_src(from)), to = m_mapping1.to_src(m_mapping2.to_src(to)));
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
m_composed->SetSelection(
m_selComposed.first = m_mappingComposedHex.to_src(from),
m_selComposed.second = m_mappingComposedHex.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_decomposedHex->SetSelection(
m_selDecomposedHex.first = m_mappingDecomposedHex.to_dst(m_selDecomposed.first ),
m_selDecomposedHex.second = m_mappingDecomposedHex.to_dst(m_selDecomposed.second));
}
}
void wxZRColaComposerPanel::OnComposedText(wxCommandEvent& event)
{
if (m_progress) {
// We are being updated by wxZRColaComposerPanel::OnDecomposedText()
event.Skip();
} else {
m_timer->Stop();
event.Skip();
#ifdef __WINDOWS__
// Use Windows GetWindowTextLength() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_composed->GetHWND();
size_t len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> src(len + 1);
::GetWindowTextW(hWnd, src.data(), src.size());
#else
wxString src(m_composed->GetValue());
size_t len = src.Length();
#endif
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_lang, dst, &m_mapping2);
else
app->m_t_db.Decompose(src.data(), len, dst, &m_mapping2);
m_mapping1.clear();
m_mapping2.invert();
long from, to;
m_composed->GetSelection(&from, &to);
// Update composed HEX dump.
wxString hex;
GetHex(hex, m_mappingComposedHex, src.data(), len);
m_composedHex->SetValue(hex);
m_composedHex->SetSelection(m_mappingComposedHex.to_dst(from), m_mappingComposedHex.to_dst(to));
// Update decomposed text.
m_progress = true;
m_decomposed->SetValue(dst);
m_decomposed->SetSelection(from = m_mapping1.to_src(m_mapping2.to_src(from)), to = m_mapping1.to_src(m_mapping2.to_src(to)));
// Update decomposed HEX dump.
GetHex(hex, m_mappingDecomposedHex, dst.data(), dst.length());
m_decomposedHex->SetValue(hex);
m_decomposedHex->SetSelection(m_mappingDecomposedHex.to_dst(from), m_mappingDecomposedHex.to_dst(to));
event.Skip();
m_progress = false;
// Schedule state save after 3s.
m_timer->Start(3000, true);
}
// Set the flag the composed text changed to trigger idle-time decomposition.
m_composedChanged = true;
}
void wxZRColaComposerPanel::OnTimerTimeout(wxTimerEvent& event)
void wxZRColaComposerPanel::OnSaveTimer(wxTimerEvent& event)
{
wxString fileName(GetStateFileName());
wxFFile file(fileName, wxT("wb"));
if (file.IsOpened()) {
wxString text;
size_t len;
// Save decomposed text.
{
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_decomposed->GetHWND();
unsigned __int64 len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> text(len + 1);
::GetWindowTextW(hWnd, text.data(), text.size());
#else
wxString text(m_decomposed->GetValue());
unsigned __int64 len = text.Length();
#endif
file.Write(&len, sizeof(len));
file.Write(text.data(), sizeof(wchar_t)*len);
}
len = GetValue(m_decomposed, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
// Save composed text.
{
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = m_composed->GetHWND();
unsigned __int64 len = ::GetWindowTextLengthW(hWnd);
std::vector<wchar_t> text(len + 1);
::GetWindowTextW(hWnd, text.data(), text.size());
#else
wxString text(m_composed->GetValue());
unsigned __int64 len = text.Length();
#endif
file.Write(&len, sizeof(len));
file.Write(text.data(), sizeof(wchar_t)*len);
}
len = GetValue(m_composed, text);
file.Write(&len, sizeof(len));
file.Write((const wchar_t*)text, sizeof(wchar_t)*len);
}
event.Skip();
@@ -329,10 +315,36 @@ wxString wxZRColaComposerPanel::GetStateFileName()
}
void wxZRColaComposerPanel::GetHex(wxString &hex, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len)
size_t wxZRColaComposerPanel::GetValue(wxTextCtrl *wnd, wxString &text)
{
#ifdef __WINDOWS__
// Use Windows GetWindowText() function to avoid line ending conversion incompletely imposed by wxWidgets.
WXHWND hWnd = wnd->GetHWND();
size_t len = ::GetWindowTextLengthW(hWnd);
if (len < 0x100) {
WCHAR buf[0x100];
::GetWindowTextW(hWnd, buf, len + 1);
text.assign(buf, len);
} else {
LPWSTR buf = new WCHAR[len + 1];
::GetWindowTextW(hWnd, buf, len + 1);
text.assign(buf, len);
delete [] buf;
}
return len;
#else
text = wnd->GetValue();
return text.Length();
#endif
}
void wxZRColaComposerPanel::SetHexValue(wxTextCtrl *wnd, std::pair<long, long> &range, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len, long from, long to)
{
wxString hex;
bool first = true;
hex.clear();
mapping.clear();
for (size_t i = 0; i < len && src[i]; i++) {
wchar_t c = src[i];
@@ -345,6 +357,11 @@ void wxZRColaComposerPanel::GetHex(wxString &hex, ZRCola::mapping_vector &mappin
first = false;
}
}
wnd->SetValue(hex);
wnd->SetSelection(
range.first = mapping.to_dst(from),
range.second = mapping.to_dst(to ));
}

View File

@@ -38,15 +38,11 @@ class wxZRColaComposerPanel;
class wxZRColaComposerPanel : public wxZRColaComposerPanelBase
{
public:
enum
{
wxID_TIMER = 1,
};
wxZRColaComposerPanel(wxWindow* parent);
virtual ~wxZRColaComposerPanel();
friend class wxZRColaFrame; // Allow main frame direct access to our members.
void SynchronizePanels();
friend class wxPersistentZRColaComposerPanel; // Allow saving/restoring window state.
protected:
@@ -56,14 +52,15 @@ protected:
virtual void OnComposedPaint(wxPaintEvent& event);
virtual void OnComposedHexPaint(wxPaintEvent& event);
virtual void OnComposedText(wxCommandEvent& event);
virtual void OnTimerTimeout(wxTimerEvent& event);
DECLARE_EVENT_TABLE()
virtual void OnSaveTimer(wxTimerEvent& event);
static wxString GetStateFileName();
static void GetHex(wxString &hex, ZRCola::mapping_vector &mapping, const wchar_t *src, size_t len);
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_progress; ///< Boolean flag to avoid recursive updates of composed and decomposed text controls
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
std::pair<long, long>
@@ -72,7 +69,6 @@ protected:
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
wxTimer *m_timer; ///< Timer to trigger the state save
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
};

View File

@@ -25,60 +25,77 @@
//////////////////////////////////////////////////////////////////////////
wxBEGIN_EVENT_TABLE(wxZRColaFrame, wxZRColaFrameBase)
EVT_UPDATE_UI (wxID_AUTOSTART , wxZRColaFrame::OnAutostartUpdate )
EVT_MENU (wxID_AUTOSTART , wxZRColaFrame::OnAutostart )
EVT_MENU (wxID_EXIT , wxZRColaFrame::OnExit )
EVT_MENU (wxID_EXIT , wxZRColaFrame::OnExit )
EVT_UPDATE_UI_RANGE(wxID_CUT, wxID_CLEAR , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU_RANGE (wxID_CUT, wxID_CLEAR , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI (wxID_SELECTALL , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU (wxID_SELECTALL , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI_RANGE(wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU_RANGE (wxID_CUT , wxID_CLEAR , wxZRColaFrame::OnForwardEvent )
EVT_UPDATE_UI (wxID_SELECTALL , wxZRColaFrame::OnForwardEventUpdate )
EVT_MENU (wxID_SELECTALL , wxZRColaFrame::OnForwardEvent )
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_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_MENU (wxID_CHARACTER_SELECTOR , wxZRColaFrame::OnInsertCharacter )
EVT_UPDATE_UI (wxID_DECOMP_LANG_AUTO , wxZRColaFrame::OnDecomposedLanguageAutoUpdate)
EVT_MENU (wxID_DECOMP_LANG_AUTO , wxZRColaFrame::OnDecomposedLanguageAuto )
EVT_UPDATE_UI_RANGE(wxID_DECOMP_LANGUAGE_START, wxID_DECOMP_LANGUAGE_END, wxZRColaFrame::OnDecomposedLanguageUpdate )
EVT_MENU_RANGE (wxID_DECOMP_LANGUAGE_START, wxID_DECOMP_LANGUAGE_END, wxZRColaFrame::OnDecomposedLanguage )
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_MENU (wxID_SEND_ABORT , wxZRColaFrame::OnSendAbort )
EVT_MENU (wxID_ABOUT , wxZRColaFrame::OnAbout )
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_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalogUpdate)
EVT_MENU (wxID_PANEL_CHRGRPS , wxZRColaFrame::OnPanelCharacterCatalog )
EVT_MENU (wxID_FOCUS_CHARACTER_CATALOG , wxZRColaFrame::OnPanelCharacterCatalogFocus )
EVT_MENU (wxID_HELP_REQCHAR , wxZRColaFrame::OnHelpReqChar )
EVT_MENU (wxID_HELP_UPDATE , wxZRColaFrame::OnHelpUpdate )
EVT_MENU (wxID_ABOUT , wxZRColaFrame::OnHelpAbout )
wxEND_EVENT_TABLE()
wxZRColaFrame::wxZRColaFrame() :
m_lang_auto(true),
m_hWndSource(NULL),
m_chrSelect(NULL),
m_settings(NULL),
wxZRColaFrameBase(NULL)
{
{
// wxFrameBuilder 3.5 does not support wxAUI_TB_HORIZONTAL flag. Add it manually.
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
paneInfo.LeftDockable(false);
paneInfo.RightDockable(false);
m_toolbarCompose->SetWindowStyleFlag(m_toolbarCompose->GetWindowStyleFlag() | wxAUI_TB_HORIZONTAL);
}
// Load main window icons.
#ifdef __WINDOWS__
wxIcon icon_small(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
wxIconBundle icons;
icons.AddIcon(wxIcon(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)));
icons.AddIcon(icon_small);
icons.AddIcon(wxIcon(wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, ::GetSystemMetrics(SM_CXICON ), ::GetSystemMetrics(SM_CYICON )));
SetIcons(icons);
#else
SetIcon(wxICON(00_zrcola.ico));
wxIcon icon_small(wxICON(00_zrcola.ico));
SetIcon(icon_small);
#endif
// Populate language lists.
memcpy(m_lang, ZRCOLA_LANG_VOID, sizeof(m_lang));
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
m_toolDecompLanguage->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];
wxString
label(lang.name, lang.name_len),
label_tran(wxGetTranslation(label));
if (i < wxID_DECOMP_LANGUAGE_END - wxID_DECOMP_LANGUAGE_START + 1)
m_menuDecompLanguage->AppendRadioItem(wxID_DECOMP_LANGUAGE_START + i, label_tran, wxString::Format(_("Select %s language for decomposition"), (const wxStringCharType*)label_tran));
m_toolDecompLanguage->Insert(label_tran, i);
if (memcmp(m_lang, lang.id, sizeof(m_lang)) == 0)
m_toolDecompLanguage->Select(i);
m_taskBarIcon = new wxTaskBarIcon();
if (m_taskBarIcon->IsOk()) {
m_taskBarIcon->SetIcon(icon_small, _("ZRCola"));
m_taskBarIcon->Connect(wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEventHandler(wxZRColaFrame::OnTaskbarIconClick), NULL, this);
} else {
// Taskbar icon creation failed. Not the end of the world. No taskbar icon then.
delete m_taskBarIcon;
}
m_settings = new wxZRColaSettings(this);
wxPersistentRegisterAndRestore<wxZRColaSettings>(m_settings);
m_chrSelect = new wxZRColaCharSelect(this);
wxPersistentRegisterAndRestore<wxZRColaCharSelect>(m_chrSelect);
// Set focus.
m_panel->m_decomposed->SetFocus();
@@ -107,6 +124,16 @@ wxZRColaFrame::wxZRColaFrame() :
pProfiles->Release();
}
#endif
// Register frame specific hotkey(s).
{
wxAcceleratorEntry entries[1];
entries[0].Set(wxACCEL_NORMAL, WXK_F4, wxID_FOCUS_CHARACTER_CATALOG);
SetAcceleratorTable(wxAcceleratorTable(_countof(entries), entries));
}
// Restore persistent state of wxAuiManager manually, since m_mgr is not on the heap.
wxPersistentAuiManager(&m_mgr).Restore();
}
@@ -122,51 +149,27 @@ wxZRColaFrame::~wxZRColaFrame()
// Unregister global hotkey(s).
UnregisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE);
UnregisterHotKey(wxZRColaHKID_INVOKE_COMPOSE);
}
if (m_chrSelect)
delete m_chrSelect;
void wxZRColaFrame::OnAutostartUpdate(wxUpdateUIEvent& event)
{
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
event.Check(wxFileExists(linkName));
#else
event.Enable(false);
#endif
}
if (m_settings)
delete m_settings;
void wxZRColaFrame::OnAutostart(wxCommandEvent& event)
{
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
if (wxFileExists(linkName)) {
// The shortcut already exists. Remove it.
wxRemoveFile(linkName);
} else {
// Create the shortcut.
IShellLink *sl;
HRESULT hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&sl);
if (SUCCEEDED(hr)) {
// Setup ZRCola shortcut.
sl->SetPath(wxTheApp->argv[0]);
sl->SetDescription(_("Start ZRCola automatically on logon"));
sl->SetShowCmd(SW_SHOWMINNOACTIVE);
// Query IShellLink for the IPersistFile interface, used for saving the
// shortcut in persistent storage.
IPersistFile *pf;
hr = sl->QueryInterface(IID_IPersistFile, (LPVOID*)&pf);
if (SUCCEEDED(hr)) {
// Save the link by calling IPersistFile::Save.
hr = pf->Save(linkName, TRUE);
pf->Release();
}
sl->Release();
}
if (m_taskBarIcon) {
m_taskBarIcon->Disconnect(wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEventHandler(wxZRColaFrame::OnTaskbarIconClick), NULL, this);
delete m_taskBarIcon;
}
#endif
}
void wxZRColaFrame::OnClose(wxCloseEvent& event)
{
event.Skip();
// Save wxAuiManager's state before destructor.
// Since the destructor calls m_mgr.UnInit() the regular persistence mechanism is useless to save wxAuiManager's state.
wxPersistentAuiManager(&m_mgr).Save();
}
@@ -179,7 +182,7 @@ void wxZRColaFrame::OnExit(wxCommandEvent& event)
void wxZRColaFrame::OnForwardEventUpdate(wxUpdateUIEvent& event)
{
wxControl *focusWnd = wxDynamicCast(FindFocus(), wxControl);
if (focusWnd && !m_toolbar->IsDescendant(focusWnd))
if (focusWnd && focusWnd->IsKindOf(wxCLASSINFO(wxTextCtrl)))
focusWnd->GetEventHandler()->ProcessEvent(event);
else
event.Enable(false);
@@ -196,6 +199,15 @@ 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();
}
}
void wxZRColaFrame::OnSendUpdate(wxUpdateUIEvent& event)
{
event.Enable(m_hWndSource ? true : false);
@@ -237,78 +249,110 @@ void wxZRColaFrame::OnSendAbort(wxCommandEvent& event)
}
void wxZRColaFrame::OnDecomposedLanguageAutoUpdate(wxUpdateUIEvent& event)
void wxZRColaFrame::OnSettings(wxCommandEvent& event)
{
#if defined(__WXMSW__)
event.Check(m_lang_auto);
#else
event.Enable(false);
#endif
m_settings->ShowModal();
}
void wxZRColaFrame::OnDecomposedLanguageAuto(wxCommandEvent& event)
void wxZRColaFrame::OnIdle(wxIdleEvent& event)
{
// Toggle auto language flag.
m_lang_auto = !m_lang_auto;
m_panel->SynchronizePanels();
if (m_lang_auto) {
#if defined(__WXMSW__)
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), m_lang);
UpdateDecomposedLanguage();
#endif
event.Skip();
}
void wxZRColaFrame::OnTaskbarIconClick(wxTaskBarIconEvent& event)
{
Iconize(false);
Show(true);
Raise();
event.Skip();
}
void wxZRColaFrame::OnIconize(wxIconizeEvent& event)
{
if (m_taskBarIcon)
Show(!event.IsIconized());
event.Skip();
}
void wxZRColaFrame::OnToolbarEditUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_toolbarEdit).IsShown());
}
void wxZRColaFrame::OnToolbarEdit(wxCommandEvent& event)
{
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarEdit);
paneInfo.Show(!paneInfo.IsShown());
m_mgr.Update();
}
void wxZRColaFrame::OnToolbarComposeUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_toolbarCompose).IsShown());
}
void wxZRColaFrame::OnToolbarCompose(wxCommandEvent& event)
{
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_toolbarCompose);
paneInfo.Show(!paneInfo.IsShown());
m_mgr.Update();
}
void wxZRColaFrame::OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event)
{
event.Check(m_mgr.GetPane(m_panelChrCat).IsShown());
}
void wxZRColaFrame::OnPanelCharacterCatalog(wxCommandEvent& event)
{
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_panelChrCat);
paneInfo.Show(!paneInfo.IsShown());
m_mgr.Update();
}
void wxZRColaFrame::OnPanelCharacterCatalogFocus(wxCommandEvent& event)
{
wxAuiPaneInfo &paneInfo = m_mgr.GetPane(m_panelChrCat);
if (!paneInfo.IsShown()) {
paneInfo.Show(true);
m_mgr.Update();
}
m_panelChrCat->SetFocus();
}
void wxZRColaFrame::OnDecomposedLanguageUpdate(wxUpdateUIEvent& event)
void wxZRColaFrame::OnHelpReqChar(wxCommandEvent& event)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[event.GetId() - wxID_DECOMP_LANGUAGE_START];
event.Check(memcmp(m_lang, lang.id, sizeof(m_lang)) == 0);
wxLaunchDefaultBrowser(_("http://zrcola-2.amebis.si/en/contact/"));
}
void wxZRColaFrame::OnDecomposedLanguage(wxCommandEvent& event)
void wxZRColaFrame::OnHelpUpdate(wxCommandEvent& event)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
size_t i = event.GetId() - wxID_DECOMP_LANGUAGE_START;
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i];
if (memcmp(m_lang, lang.id, sizeof(m_lang)) != 0) {
memcpy(m_lang, lang.id, sizeof(m_lang));
m_toolDecompLanguage->Select(i);
// Notify composed text something changed and should re-decompose.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_composed->ProcessWindowEvent(event2);
m_lang_auto = false;
}
wxZRColaUpdater dlg(this);
dlg.ShowModal();
}
void wxZRColaFrame::OnDecompLanguageChoice(wxCommandEvent& event)
void wxZRColaFrame::OnHelpAbout(wxCommandEvent& event)
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
size_t i = event.GetSelection();
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[i];
if (memcmp(m_lang, lang.id, sizeof(m_lang)) != 0) {
memcpy(m_lang, lang.id, sizeof(m_lang));
// Notify composed text something changed and should re-decompose.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
m_panel->m_composed->ProcessWindowEvent(event2);
m_lang_auto = false;
}
}
void wxZRColaFrame::OnAbout(wxCommandEvent& event)
{
wxMessageBox(wxString::Format(_("ZRCola v%s\nCopyright 2015-%s Amebis"), wxT(ZRCOLA_VERSION_STR), wxT(ZRCOLA_BUILD_YEAR_STR)), _("About ZRCola"), wxOK | wxICON_INFORMATION);
wxZRColaAbout dlg(this);
dlg.ShowModal();
}
@@ -323,11 +367,10 @@ HRESULT STDMETHODCALLTYPE wxZRColaFrame::OnLanguageChange(LANGID langid, __RPC__
HRESULT STDMETHODCALLTYPE wxZRColaFrame::OnLanguageChanged()
{
if (m_lang_auto) {
if (m_settings->m_lang_auto) {
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), m_lang);
UpdateDecomposedLanguage();
ZRCola::LangConvert(LOWORD(hkl), m_settings->m_lang);
}
return S_OK;
@@ -406,20 +449,6 @@ void wxZRColaFrame::DoSend(const wxString& str)
}
void wxZRColaFrame::UpdateDecomposedLanguage()
{
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
// Find language on the language list.
ZRCola::language_db::language *l = new ZRCola::language_db::language;
memcpy(l->id, m_lang, sizeof(l->id));
l->name_len = 0;
ZRCola::language_db::indexLang::size_type start, end;
m_toolDecompLanguage->SetSelection(app->m_lang_db.idxLng.find(*l, start, end) ? start : -1);
delete l;
}
#ifdef __WXMSW__
WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
@@ -444,12 +473,10 @@ WXLRESULT wxZRColaFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM
m_hWndSource = hWndSource;
//if (m_state == wxABS_FLOAT) {
if (IsIconized()) {
if (IsIconized())
::SendMessage(m_hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
} else {
::SetActiveWindow(m_hWnd);
::SetForegroundWindow(m_hWnd);
}
::SetActiveWindow(m_hWnd);
::SetForegroundWindow(m_hWnd);
//} else if (wxAppBarIsDocked(m_state)) {
// // ZRCola window is currently docked.
@@ -485,8 +512,8 @@ void wxPersistentZRColaFrame::Save() const
const wxZRColaFrame * const wnd = static_cast<const wxZRColaFrame*>(GetWindow());
wxPersistentZRColaComposerPanel(wnd->m_panel).Save();
SaveValue(wxT("langAuto"), wnd->m_lang_auto);
SaveValue(wxT("lang" ), wxString::FromAscii(wnd->m_lang, sizeof(wnd->m_lang)));
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Save();
wxPersistentTLW::Save();
}
@@ -497,27 +524,7 @@ bool wxPersistentZRColaFrame::Restore()
wxZRColaFrame * const wnd = static_cast<wxZRColaFrame*>(GetWindow());
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
wxString lang;
// Restore automatic language detection setting first.
RestoreValue(wxT("langAuto"), &(wnd->m_lang_auto));
if (wnd->m_lang_auto) {
#if defined(__WXMSW__)
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), wnd->m_lang);
#endif
} else if (RestoreValue(wxT("lang"), &lang) && lang.Length() == 3) {
// The language was read from configuration.
memcpy(wnd->m_lang, (const char*)lang.c_str(), sizeof(wnd->m_lang));
} else if (!app->m_lang_db.idxLng.empty()) {
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[0];
memcpy(wnd->m_lang, lang.id, sizeof(wnd->m_lang));
} else
memcpy(wnd->m_lang, ZRCOLA_LANG_VOID, sizeof(wnd->m_lang));
wnd->UpdateDecomposedLanguage();
wxPersistentZRColaCharacterCatalogPanel(wnd->m_panelChrCat).Restore();
wxPersistentZRColaComposerPanel(wnd->m_panel).Restore();
return r;

View File

@@ -17,7 +17,6 @@
along with ZRCola. If not, see <http://www.gnu.org/licenses/>.
*/
///
/// Forward declarations
///
@@ -27,7 +26,10 @@ class wxZRColaFrame;
#pragma once
#include "zrcolagui.h"
#include "zrcolachrslct.h"
#include "zrcolasettings.h"
#include <zrcola/language.h>
#include <wx/taskbar.h>
#include <wx/persist/toplevel.h>
#if defined(__WXMSW__)
#include <msctf.h>
@@ -53,8 +55,7 @@ class wxZRColaFrame :
public:
enum
{
wxID_DECOMP_LANGUAGE_START = 6000,
wxID_DECOMP_LANGUAGE_END = 6099,
wxID_FOCUS_CHARACTER_CATALOG = 2000,
};
wxZRColaFrame();
@@ -64,21 +65,29 @@ public:
friend class wxZRColaComposerPanel;
protected:
void OnAutostartUpdate(wxUpdateUIEvent& event);
void OnAutostart(wxCommandEvent& event);
virtual void OnClose(wxCloseEvent& event);
void OnExit(wxCommandEvent& event);
void OnForwardEventUpdate(wxUpdateUIEvent& event);
void OnForwardEvent(wxCommandEvent& event);
void OnInsertCharacter(wxCommandEvent& event);
void OnSendUpdate(wxUpdateUIEvent& event);
void OnSendComposed(wxCommandEvent& event);
void OnSendDecomposed(wxCommandEvent& event);
void OnSendAbort(wxCommandEvent& event);
void OnDecomposedLanguageAutoUpdate(wxUpdateUIEvent& event);
void OnDecomposedLanguageAuto(wxCommandEvent& event);
void OnDecomposedLanguageUpdate(wxUpdateUIEvent& event);
void OnDecomposedLanguage(wxCommandEvent& event);
virtual void OnDecompLanguageChoice(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnSettings(wxCommandEvent& event);
virtual void OnIdle(wxIdleEvent& event);
void OnTaskbarIconClick(wxTaskBarIconEvent& event);
virtual void OnIconize(wxIconizeEvent& event);
void OnToolbarEditUpdate(wxUpdateUIEvent& event);
void OnToolbarEdit(wxCommandEvent& event);
void OnToolbarComposeUpdate(wxUpdateUIEvent& event);
void OnToolbarCompose(wxCommandEvent& event);
void OnPanelCharacterCatalogUpdate(wxUpdateUIEvent& event);
void OnPanelCharacterCatalog(wxCommandEvent& event);
void OnPanelCharacterCatalogFocus(wxCommandEvent& event);
void OnHelpReqChar(wxCommandEvent& event);
void OnHelpUpdate(wxCommandEvent& event);
void OnHelpAbout(wxCommandEvent& event);
wxDECLARE_EVENT_TABLE();
protected:
@@ -99,7 +108,6 @@ protected:
private:
void DoSend(const wxString& str);
void UpdateDecomposedLanguage();
protected:
#ifdef __WXMSW__
@@ -107,9 +115,10 @@ protected:
#endif
protected:
bool m_lang_auto; ///< Automatic language selection according to keyboard layout
ZRCola::langid_t m_lang; ///< Language for decomposing
WXHWND m_hWndSource; ///< handle of the active window, when the ZRCola hotkey was pressed
WXHWND m_hWndSource; ///< Handle of the active window, when the ZRCola hotkey was pressed
wxTaskBarIcon *m_taskBarIcon; ///< Taskbar icon
wxZRColaCharSelect *m_chrSelect; ///< Character selection dialog
wxZRColaSettings *m_settings; ///< Configuration dialog
};

View File

@@ -1,4 +1,4 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
@@ -7,6 +7,8 @@
#include "stdafx.h"
#include "zrcolachrgrid.h"
#include "zrcolagui.h"
// Using the construction of a static object to ensure that the help provider is set
@@ -25,15 +27,11 @@ static wxFBContextSensitiveHelpSetter s_wxFBSetTheHelpProvider;
wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxFrame( parent, id, title, pos, size, style, name )
{
this->SetSizeHints( wxSize( 150,150 ), wxDefaultSize );
m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT);
m_menubar = new wxMenuBar( 0 );
m_menuProgram = new wxMenu();
wxMenuItem* m_menuItemAutoStart;
m_menuItemAutoStart = new wxMenuItem( m_menuProgram, wxID_AUTOSTART, wxString( _("&Start on Logon") ) , _("Start this program automatically on logon"), wxITEM_CHECK );
m_menuProgram->Append( m_menuItemAutoStart );
m_menuProgram->AppendSeparator();
wxMenuItem* m_menuItemExit;
m_menuItemExit = new wxMenuItem( m_menuProgram, wxID_EXIT, wxString( _("E&xit") ) + wxT('\t') + wxT("Alt+F4"), _("Quit this program"), wxITEM_NORMAL );
m_menuProgram->Append( m_menuItemExit );
@@ -76,6 +74,17 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
m_menuEdit->AppendSeparator();
wxMenuItem* m_menuCharSelect;
m_menuCharSelect = new wxMenuItem( m_menuEdit, wxID_CHARACTER_SELECTOR, wxString( _("C&haracter Selector...") ) + wxT('\t') + wxT("F8"), _("Display character selector to select character to insert into text"), wxITEM_NORMAL );
#ifdef __WXMSW__
m_menuCharSelect->SetBitmaps( wxIcon( wxT("char_select.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
m_menuCharSelect->SetBitmap( wxIcon( wxT("char_select.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 16, 16 ) );
#endif
m_menuEdit->Append( m_menuCharSelect );
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 );
#ifdef __WXMSW__
@@ -103,72 +112,97 @@ wxZRColaFrameBase::wxZRColaFrameBase( wxWindow* parent, wxWindowID id, const wxS
#endif
m_menuEdit->Append( m_menuItemSendAbort );
m_menuDecompLanguage = new wxMenu();
wxMenuItem* m_menuDecompLanguageItem = new wxMenuItem( m_menuEdit, wxID_ANY, _("&Language"), wxEmptyString, wxITEM_NORMAL, m_menuDecompLanguage );
wxMenuItem* m_menuDecompLanguageAuto;
m_menuDecompLanguageAuto = new wxMenuItem( m_menuDecompLanguage, wxID_DECOMP_LANG_AUTO, wxString( _("&Automatic") ) , _("Set language according to keyboard layout automatically"), wxITEM_CHECK );
m_menuDecompLanguage->Append( m_menuDecompLanguageAuto );
m_menuEdit->AppendSeparator();
m_menuDecompLanguage->AppendSeparator();
m_menuEdit->Append( m_menuDecompLanguageItem );
wxMenuItem* m_menuSettings;
m_menuSettings = new wxMenuItem( m_menuEdit, wxID_SETTINGS, wxString( _("&Settings...") ) , _("Open program configuration dialog"), wxITEM_NORMAL );
m_menuEdit->Append( m_menuSettings );
m_menubar->Append( m_menuEdit, _("&Edit") );
m_menuView = new wxMenu();
wxMenuItem* m_menuItemToolbarEdit;
m_menuItemToolbarEdit = new wxMenuItem( m_menuView, wxID_TOOLBAR_EDIT, wxString( _("&Edit Toolbar") ) , _("Toggle edit toolbar"), wxITEM_CHECK );
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_menuView->Append( m_menuItemToolbarCompose );
m_menuView->AppendSeparator();
wxMenuItem* m_menuItemPanelChrGrps;
m_menuItemPanelChrGrps = new wxMenuItem( m_menuView, wxID_PANEL_CHRGRPS, wxString( _("Character Catalo&g") ) , _("Toggle character catalog panel"), wxITEM_CHECK );
m_menuView->Append( m_menuItemPanelChrGrps );
m_menubar->Append( m_menuView, _("&View") );
m_menuHelp = new wxMenu();
wxMenuItem* m_menuItemAbout;
m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( wxEmptyString ) , wxEmptyString, wxITEM_NORMAL );
m_menuHelp->Append( m_menuItemAbout );
wxMenuItem* m_menuHelpReqChar;
m_menuHelpReqChar = new wxMenuItem( m_menuHelp, wxID_HELP_REQCHAR, wxString( _("&Request a new character...") ) , _("Submit a request to ZRC to add a new character"), wxITEM_NORMAL );
m_menuHelp->Append( m_menuHelpReqChar );
wxMenuItem* m_menuHelpUpdate;
m_menuHelpUpdate = new wxMenuItem( m_menuHelp, wxID_HELP_UPDATE, wxString( _("Check for &Updates...") ) , _("Check online for product update"), wxITEM_NORMAL );
m_menuHelp->Append( m_menuHelpUpdate );
m_menuHelp->AppendSeparator();
wxMenuItem* m_menuHelpAbout;
m_menuHelpAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( wxEmptyString ) , wxEmptyString, wxITEM_NORMAL );
m_menuHelp->Append( m_menuHelpAbout );
m_menubar->Append( m_menuHelp, _("&Help") );
this->SetMenuBar( m_menubar );
m_toolbar = this->CreateToolBar( wxTB_HORIZONTAL, wxID_ANY );
m_toolbar->SetToolBitmapSize( wxSize( 16,16 ) );
m_toolEditCut = m_toolbar->AddTool( wxID_CUT, _("Cut"), wxIcon( wxT("edit_cut.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Cut"), _("Cut selection"), NULL );
m_toolbarEdit = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT );
m_toolEditCut = m_toolbarEdit->AddTool( wxID_CUT, _("Cut"), wxIcon( wxT("edit_cut.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Cut"), _("Cut selection"), NULL );
m_toolEditCopy = m_toolbar->AddTool( wxID_COPY, _("Copy"), wxIcon( wxT("edit_copy.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Copy"), _("Copy selection"), NULL );
m_toolEditCopy = m_toolbarEdit->AddTool( wxID_COPY, _("Copy"), wxIcon( wxT("edit_copy.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Copy"), _("Copy selection"), NULL );
m_toolEditPaste = m_toolbar->AddTool( wxID_PASTE, _("Paste"), wxIcon( wxT("edit_paste.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Paste"), _("Paste selection"), NULL );
m_toolEditPaste = m_toolbarEdit->AddTool( wxID_PASTE, _("Paste"), wxIcon( wxT("edit_paste.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Paste"), _("Paste selection"), NULL );
m_toolbar->AddSeparator();
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_toolSendComposed = m_toolbar->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_toolbarCompose = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_LAYOUT );
m_toolCharSelect = m_toolbarCompose->AddTool( wxID_CHARACTER_SELECTOR, _("Character Selector"), wxIcon( wxT("char_select.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24 ), wxNullBitmap, wxITEM_NORMAL, _("Character Selector"), _("Display character selector to select character to insert into text"), NULL );
m_toolSendDecomposed = m_toolbar->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_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_toolDecompLanguageLbl = new wxStaticText( m_toolbar, wxID_ANY, _("Language:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
m_toolDecompLanguageLbl->Wrap( -1 );
m_toolbar->AddControl( m_toolDecompLanguageLbl );
wxArrayString m_toolDecompLanguageChoices;
m_toolDecompLanguage = new wxChoice( m_toolbar, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_toolDecompLanguageChoices, 0 );
m_toolDecompLanguage->SetSelection( 0 );
m_toolbar->AddControl( m_toolDecompLanguage );
m_toolbar->Realize();
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 );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
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() );
m_panelChrCat = new wxZRColaCharacterCatalogPanel( this );
m_mgr.AddPane( m_panelChrCat, wxAuiPaneInfo() .Name( wxT("panelChrGrp") ).Left() .Caption( _("Character Catalog") ).PinButton( true ).Dock().Resizable().FloatingSize( wxDefaultSize ).Row( 1 ).BestSize( wxSize( 150,200 ) ).MinSize( wxSize( 100,100 ) ).Layer( 1 ) );
m_panel = new wxZRColaComposerPanel( this );
bSizerMain->Add( m_panel, 100, wxEXPAND, 5 );
m_mgr.AddPane( m_panel, wxAuiPaneInfo() .Name( wxT("composerPanel") ).Center() .Caption( _("(De)Composer") ).CaptionVisible( false ).CloseButton( false ).PaneBorder( false ).Dock().Resizable().FloatingSize( wxDefaultSize ).Floatable( false ) );
this->SetSizer( bSizerMain );
this->Layout();
m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
m_mgr.Update();
this->Centre( wxBOTH );
// Connect Events
m_toolDecompLanguage->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnDecompLanguageChoice ), NULL, this );
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
}
wxZRColaFrameBase::~wxZRColaFrameBase()
{
// Disconnect Events
m_toolDecompLanguage->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( wxZRColaFrameBase::OnDecompLanguageChoice ), NULL, this );
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( wxZRColaFrameBase::OnClose ) );
this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( wxZRColaFrameBase::OnIconize ) );
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaFrameBase::OnIdle ) );
m_mgr.UnInit();
}
@@ -275,6 +309,7 @@ wxZRColaComposerPanelBase::wxZRColaComposerPanelBase( wxWindow* parent, wxWindow
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
m_timerSave.SetOwner( this, wxID_TIMER_SAVE );
// Connect Events
m_decomposed->Connect( wxEVT_PAINT, wxPaintEventHandler( wxZRColaComposerPanelBase::OnDecomposedPaint ), NULL, this );
@@ -283,6 +318,7 @@ wxZRColaComposerPanelBase::wxZRColaComposerPanelBase( wxWindow* parent, wxWindow
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 );
this->Connect( wxID_TIMER_SAVE, wxEVT_TIMER, wxTimerEventHandler( wxZRColaComposerPanelBase::OnSaveTimer ) );
}
wxZRColaComposerPanelBase::~wxZRColaComposerPanelBase()
@@ -294,5 +330,614 @@ wxZRColaComposerPanelBase::~wxZRColaComposerPanelBase()
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 );
this->Disconnect( wxID_TIMER_SAVE, wxEVT_TIMER, wxTimerEventHandler( wxZRColaComposerPanelBase::OnSaveTimer ) );
}
wxZRColaCharacterCatalogPanelBase::wxZRColaCharacterCatalogPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizer;
bSizer = new wxBoxSizer( wxVERTICAL );
wxArrayString m_choiceChoices;
m_choice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceChoices, 0 );
m_choice->SetSelection( 0 );
bSizer->Add( m_choice, 0, wxALL|wxEXPAND, 5 );
m_grid = new wxZRColaCharGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_grid->CreateGrid( 0, 0 );
m_grid->EnableEditing( false );
m_grid->EnableGridLines( false );
m_grid->EnableDragGridSize( false );
m_grid->SetMargins( 0, 0 );
// Columns
m_grid->EnableDragColMove( false );
m_grid->EnableDragColSize( false );
m_grid->SetColLabelSize( 0 );
m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_grid->EnableDragRowSize( false );
m_grid->SetRowLabelSize( 0 );
m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_grid->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_grid->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_grid->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_grid->SetMinSize( wxSize( 35,35 ) );
bSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
this->SetSizer( bSizer );
this->Layout();
bSizer->Fit( this );
// Connect Events
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 );
}
wxZRColaCharacterCatalogPanelBase::~wxZRColaCharacterCatalogPanelBase()
{
// Disconnect Events
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 );
}
wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxDialog( parent, id, title, pos, size, style, name )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerContent;
bSizerContent = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerColumns;
bSizerColumns = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerLeft;
bSizerLeft = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerBrowse;
sbSizerBrowse = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("&Browse") ), wxVERTICAL );
m_search = new wxSearchCtrl( sbSizerBrowse->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
#ifndef __WXMAC__
m_search->ShowSearchButton( true );
#endif
m_search->ShowCancelButton( true );
m_search->SetToolTip( _("Full or partial terms from Unicode character description (in English) to search for") );
sbSizerBrowse->Add( m_search, 0, wxALL|wxEXPAND, 5 );
wxArrayString m_categoriesChoices;
m_categories = new wxCheckListBox( sbSizerBrowse->GetStaticBox(), 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 );
wxBoxSizer* bSizerCategoriesCtrl;
bSizerCategoriesCtrl = new wxBoxSizer( wxHORIZONTAL );
m_categoriesAll = new wxHyperlinkCtrl( sbSizerBrowse->GetStaticBox(), 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->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->SetToolTip( _("Invert category selection") );
bSizerCategoriesCtrl->Add( m_categoriesInvert, 0, wxALL, 5 );
sbSizerBrowse->Add( bSizerCategoriesCtrl, 0, wxALIGN_RIGHT, 5 );
m_gridResults = new wxZRColaCharGrid( sbSizerBrowse->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxSTATIC_BORDER );
// Grid
m_gridResults->CreateGrid( 0, 0 );
m_gridResults->EnableEditing( false );
m_gridResults->EnableGridLines( false );
m_gridResults->EnableDragGridSize( false );
m_gridResults->SetMargins( 0, 0 );
// Columns
m_gridResults->EnableDragColMove( false );
m_gridResults->EnableDragColSize( false );
m_gridResults->SetColLabelSize( 0 );
m_gridResults->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_gridResults->EnableDragRowSize( false );
m_gridResults->SetRowLabelSize( 0 );
m_gridResults->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_gridResults->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 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") );
m_gridResults->SetMinSize( wxSize( 560,35 ) );
m_gridResults->SetMaxSize( wxSize( 560,-1 ) );
sbSizerBrowse->Add( m_gridResults, 1, wxALL|wxEXPAND, 5 );
bSizerLeft->Add( sbSizerBrowse, 1, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerRecent;
sbSizerRecent = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Re&cently Used") ), wxVERTICAL );
m_gridRecent = new wxZRColaCharGrid( sbSizerRecent->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,35 ), wxSTATIC_BORDER );
// Grid
m_gridRecent->CreateGrid( 0, 0 );
m_gridRecent->EnableEditing( false );
m_gridRecent->EnableGridLines( false );
m_gridRecent->EnableDragGridSize( false );
m_gridRecent->SetMargins( 0, 0 );
// Columns
m_gridRecent->EnableDragColMove( false );
m_gridRecent->EnableDragColSize( false );
m_gridRecent->SetColLabelSize( 0 );
m_gridRecent->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_gridRecent->EnableDragRowSize( false );
m_gridRecent->SetRowLabelSize( 0 );
m_gridRecent->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_gridRecent->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 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") );
sbSizerRecent->Add( m_gridRecent, 0, wxALL|wxEXPAND, 5 );
bSizerLeft->Add( sbSizerRecent, 0, wxALL|wxEXPAND, 5 );
bSizerColumns->Add( bSizerLeft, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerPreview;
sbSizerPreview = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Preview") ), wxVERTICAL );
wxBoxSizer* bSizerUnicode;
bSizerUnicode = new wxBoxSizer( wxHORIZONTAL );
m_labelUnicode = new wxStaticText( sbSizerPreview->GetStaticBox(), wxID_ANY, _("U+"), wxDefaultPosition, wxDefaultSize, 0 );
m_labelUnicode->Wrap( -1 );
bSizerUnicode->Add( m_labelUnicode, 0, wxALIGN_CENTER|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_unicode = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 50,-1 ), 0 );
m_unicode->SetToolTip( _("Unicode hexadecimal code") );
bSizerUnicode->Add( m_unicode, 0, wxALIGN_CENTER|wxBOTTOM|wxRIGHT|wxTOP, 5 );
m_shortcut = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE|wxTE_READONLY );
m_shortcut->SetToolTip( _("Keyboard shortcut in Composer window") );
bSizerUnicode->Add( m_shortcut, 1, wxALL|wxEXPAND, 5 );
sbSizerPreview->Add( bSizerUnicode, 0, wxEXPAND, 5 );
m_gridPreview = new wxGrid( sbSizerPreview->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER );
// Grid
m_gridPreview->CreateGrid( 1, 1 );
m_gridPreview->EnableEditing( false );
m_gridPreview->EnableGridLines( false );
m_gridPreview->EnableDragGridSize( false );
m_gridPreview->SetMargins( 0, 0 );
// Columns
m_gridPreview->SetColSize( 0, 200 );
m_gridPreview->EnableDragColMove( false );
m_gridPreview->EnableDragColSize( false );
m_gridPreview->SetColLabelSize( 0 );
m_gridPreview->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_gridPreview->SetRowSize( 0, 200 );
m_gridPreview->EnableDragRowSize( false );
m_gridPreview->SetRowLabelSize( 0 );
m_gridPreview->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_gridPreview->SetDefaultCellFont( wxFont( 96, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_gridPreview->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridPreview->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
m_gridPreview->SetToolTip( _("Character preview") );
sbSizerPreview->Add( m_gridPreview, 0, wxALL|wxEXPAND, 5 );
m_description = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CENTRE|wxTE_MULTILINE|wxTE_READONLY );
m_description->SetToolTip( _("Unicode character description") );
sbSizerPreview->Add( m_description, 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") );
sbSizerPreview->Add( m_category, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerNavigateButtons;
bSizerNavigateButtons = new wxBoxSizer( wxHORIZONTAL );
m_navigateBack = new wxHyperlinkCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, _("« Back"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_navigateBack->Enable( false );
m_navigateBack->SetToolTip( _("To previously viewed character") );
bSizerNavigateButtons->Add( m_navigateBack, 0, wxALL, 5 );
m_navigateForward = new wxHyperlinkCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, _("Forward »"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_navigateForward->Enable( false );
m_navigateForward->SetToolTip( _("To following viewed character") );
bSizerNavigateButtons->Add( m_navigateForward, 0, wxALL, 5 );
sbSizerPreview->Add( bSizerNavigateButtons, 0, wxALIGN_RIGHT, 5 );
bSizerRight->Add( sbSizerPreview, 70, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerRelated;
sbSizerRelated = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Re&lated") ), wxVERTICAL );
m_gridRelated = new wxZRColaCharGrid( sbSizerRelated->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxSTATIC_BORDER );
// Grid
m_gridRelated->CreateGrid( 0, 0 );
m_gridRelated->EnableEditing( false );
m_gridRelated->EnableGridLines( false );
m_gridRelated->EnableDragGridSize( false );
m_gridRelated->SetMargins( 0, 0 );
// Columns
m_gridRelated->EnableDragColMove( false );
m_gridRelated->EnableDragColSize( false );
m_gridRelated->SetColLabelSize( 0 );
m_gridRelated->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_gridRelated->EnableDragRowSize( false );
m_gridRelated->SetRowLabelSize( 0 );
m_gridRelated->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_gridRelated->SetDefaultCellFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) );
m_gridRelated->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridRelated->SetToolTip( _("List of related characters") );
sbSizerRelated->Add( m_gridRelated, 1, wxALL|wxEXPAND, 5 );
bSizerRight->Add( sbSizerRelated, 30, wxALL|wxEXPAND, 5 );
bSizerColumns->Add( bSizerRight, 0, wxEXPAND, 5 );
bSizerContent->Add( bSizerColumns, 1, wxALL|wxEXPAND, 5 );
bSizerContent->Add( 5, 5, 0, wxALL|wxEXPAND, 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, wxALL|wxEXPAND, 5 );
this->SetSizer( bSizerContent );
this->Layout();
bSizerContent->Fit( this );
// Connect Events
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
m_search->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), 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 );
m_categoriesInvert->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesInvert ), NULL, this );
m_gridResults->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnResultCellDClick ), NULL, this );
m_gridResults->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnResultSelectCell ), NULL, this );
m_gridResults->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnResultsKeyDown ), NULL, this );
m_gridRecent->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnRecentCellDClick ), NULL, this );
m_gridRecent->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnRecentSelectCell ), NULL, this );
m_gridRecent->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnRecentKeyDown ), NULL, this );
m_unicode->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnUnicodeText ), NULL, this );
m_gridPreview->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnPreviewKeyDown ), NULL, this );
m_navigateBack->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnNavigateBack ), NULL, this );
m_navigateForward->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnNavigateForward ), NULL, this );
m_gridRelated->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnRelatedSelectCell ), NULL, this );
m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaCharSelectBase::OnOKButtonClick ), NULL, this );
}
wxZRColaCharSelectBase::~wxZRColaCharSelectBase()
{
// Disconnect Events
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
m_search->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), 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 );
m_categoriesInvert->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesInvert ), NULL, this );
m_gridResults->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnResultCellDClick ), NULL, this );
m_gridResults->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnResultSelectCell ), NULL, this );
m_gridResults->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnResultsKeyDown ), NULL, this );
m_gridRecent->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnRecentCellDClick ), NULL, this );
m_gridRecent->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnRecentSelectCell ), NULL, this );
m_gridRecent->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnRecentKeyDown ), NULL, this );
m_unicode->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnUnicodeText ), NULL, this );
m_gridPreview->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnPreviewKeyDown ), NULL, this );
m_navigateBack->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnNavigateBack ), NULL, this );
m_navigateForward->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnNavigateForward ), NULL, this );
m_gridRelated->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnRelatedSelectCell ), NULL, this );
m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaCharSelectBase::OnOKButtonClick ), NULL, this );
}
wxZRColaSettingsBase::wxZRColaSettingsBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxDialog( parent, id, title, pos, size, style, name )
{
this->SetSizeHints( wxDefaultSize, wxSize( -1,-1 ) );
wxBoxSizer* bSizerContent;
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 );
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 );
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 );
bSizerLanguage->Add( m_langAuto, 0, wxALL|wxEXPAND, 5 );
m_langManual = new wxRadioButton( m_panelLanguage, wxID_ANY, _("&Manually select the language from the list below:"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerLanguage->Add( m_langManual, 0, wxALL|wxEXPAND, 5 );
m_languages = new wxListBox( m_panelLanguage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_languages->SetMinSize( wxSize( -1,150 ) );
bSizerLanguage->Add( m_languages, 1, wxALL|wxEXPAND, 5 );
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 );
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 );
bSizerAutoStart->Add( m_autoStartLabel, 0, wxALL|wxEXPAND, 5 );
m_autoStart = new wxCheckBox( m_panelAutoStart, wxID_ANY, _("Start ZRCola &automatically on logon"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerAutoStart->Add( m_autoStart, 0, wxALL|wxEXPAND, 5 );
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();
long m_listbookFlags = m_listbookListView->GetWindowStyleFlag();
if( m_listbookFlags & wxLC_SMALL_ICON )
{
m_listbookFlags = ( m_listbookFlags & ~wxLC_SMALL_ICON ) | wxLC_ICON;
}
m_listbookListView->SetWindowStyleFlag( m_listbookFlags );
#endif
bSizerContent->Add( m_listbook, 1, wxEXPAND | wxALL, 5 );
bSizerContent->Add( 0, 0, 0, wxALL|wxEXPAND, 5 );
m_sdbSizerButtons = new wxStdDialogButtonSizer();
m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
m_sdbSizerButtonsApply = new wxButton( this, wxID_APPLY );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsApply );
m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
m_sdbSizerButtons->Realize();
bSizerContent->Add( m_sdbSizerButtons, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( bSizerContent );
this->Layout();
bSizerContent->Fit( this );
this->Centre( wxBOTH );
// 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_sdbSizerButtonsApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnApplyButtonClick ), NULL, this );
m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnOKButtonClick ), NULL, this );
}
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_sdbSizerButtonsApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnApplyButtonClick ), NULL, this );
m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaSettingsBase::OnOKButtonClick ), NULL, this );
}
wxZRColaAboutBase::wxZRColaAboutBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxDialog( parent, id, title, pos, size, style, name )
{
this->SetSizeHints( wxDefaultSize, wxSize( -1,-1 ) );
wxBoxSizer* bSizerContent;
bSizerContent = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerColumns;
bSizerColumns = new wxBoxSizer( wxHORIZONTAL );
m_bitmapIcon = new wxStaticBitmap( this, wxID_ANY, wxIcon( wxT("00_zrcola.ico"), wxBITMAP_TYPE_ICO_RESOURCE, 32, 32 ), wxDefaultPosition, wxDefaultSize, 0 );
bSizerColumns->Add( m_bitmapIcon, 0, wxALL, 5 );
wxBoxSizer* bSizerText;
bSizerText = new wxBoxSizer( wxVERTICAL );
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") ) );
bSizerText->Add( m_staticTextZRCola, 0, wxALL|wxEXPAND, 5 );
m_staticTextVersion = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextVersion->Wrap( -1 );
bSizerText->Add( m_staticTextVersion, 0, wxALL|wxEXPAND, 5 );
m_staticTextColophone = new wxStaticText( this, wxID_ANY, _("Editor: Janoš Ježovnik\nDevelopment: Amebis d. o. o.\nDevelopment and maintenance (2004-2015): dr. Peter Weiss"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextColophone->Wrap( -1 );
bSizerText->Add( m_staticTextColophone, 0, wxALL|wxEXPAND, 5 );
m_staticTextCopyright = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCopyright->Wrap( -1 );
bSizerText->Add( m_staticTextCopyright, 0, wxALL|wxEXPAND, 5 );
m_hyperlink = new wxHyperlinkCtrl( this, wxID_ANY, _("www.zrc-sazu.si"), wxT("http://www.zrc-sazu.si/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
bSizerText->Add( m_hyperlink, 0, wxALL|wxEXPAND, 5 );
bSizerText->Add( 0, 10, 1, 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->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->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 93, 90, false, wxEmptyString ) );
bSizerText->Add( m_declaration, 0, wxALL|wxEXPAND, 5 );
bSizerColumns->Add( bSizerText, 1, wxEXPAND, 5 );
bSizerContent->Add( bSizerColumns, 1, wxALL|wxEXPAND, 5 );
bSizerContent->Add( 0, 0, 0, wxALL|wxEXPAND, 5 );
m_sdbSizerButtons = new wxStdDialogButtonSizer();
m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
m_sdbSizerButtons->Realize();
bSizerContent->Add( m_sdbSizerButtons, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( bSizerContent );
this->Layout();
bSizerContent->Fit( this );
this->Centre( wxBOTH );
}
wxZRColaAboutBase::~wxZRColaAboutBase()
{
}
wxZRColaUpdaterBase::wxZRColaUpdaterBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxDialog( parent, id, title, pos, size, style, name )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerContent;
bSizerContent = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerLog;
sbSizerLog = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Log") ), wxVERTICAL );
m_log = new wxTextCtrl( sbSizerLog->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_log->SetMinSize( wxSize( 450,150 ) );
sbSizerLog->Add( m_log, 1, wxEXPAND, 5 );
bSizerContent->Add( sbSizerLog, 1, wxALL|wxEXPAND, 5 );
bSizerContent->Add( 0, 0, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_buttonUpdate = new wxButton( this, wxID_ANY, _("&Update"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonUpdate->Enable( false );
bSizerButtons->Add( m_buttonUpdate, 0, wxALL, 5 );
m_buttonClose = new wxButton( this, wxID_OK, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonClose, 0, wxALL, 5 );
bSizerContent->Add( bSizerButtons, 0, wxALIGN_RIGHT, 5 );
this->SetSizer( bSizerContent );
this->Layout();
bSizerContent->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_buttonUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaUpdaterBase::OnUpdate ), NULL, this );
}
wxZRColaUpdaterBase::~wxZRColaUpdaterBase()
{
// Disconnect Events
m_buttonUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaUpdaterBase::OnUpdate ), NULL, this );
}

View File

@@ -1,4 +1,4 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
@@ -12,6 +12,8 @@
#include <wx/xrc/xmlres.h>
#include <wx/cshelp.h>
#include <wx/intl.h>
class wxZRColaCharGrid;
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
@@ -21,17 +23,32 @@
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/toolbar.h>
#include "zrcolacomppnl.h"
#include <wx/sizer.h>
#include <wx/aui/aui.h>
#include <wx/aui/auibar.h>
class wxZRColaCharacterCatalogPanel;
class wxZRColaComposerPanel;
#include <wx/statusbr.h>
#include <wx/frame.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
#include <wx/splitter.h>
#include <wx/timer.h>
#include <wx/choice.h>
#include <wx/grid.h>
#include <wx/srchctrl.h>
#include <wx/checklst.h>
#include <wx/hyperlink.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>
///////////////////////////////////////////////////////////////////////////
@@ -45,36 +62,45 @@ class wxZRColaFrameBase : public wxFrame
protected:
enum
{
wxID_AUTOSTART = 1000,
wxID_CHARACTER_SELECTOR = 1000,
wxID_SEND_COMPOSED,
wxID_SEND_DECOMPOSED,
wxID_SEND_ABORT,
wxID_DECOMP_LANG_AUTO
wxID_SETTINGS,
wxID_TOOLBAR_EDIT,
wxID_TOOLBAR_COMPOSE,
wxID_PANEL_CHRGRPS,
wxID_HELP_REQCHAR,
wxID_HELP_UPDATE
};
wxMenuBar* m_menubar;
wxMenu* m_menuProgram;
wxMenu* m_menuEdit;
wxMenu* m_menuDecompLanguage;
wxMenu* m_menuView;
wxMenu* m_menuHelp;
wxToolBar* m_toolbar;
wxToolBarToolBase* m_toolEditCut;
wxToolBarToolBase* m_toolEditCopy;
wxToolBarToolBase* m_toolEditPaste;
wxToolBarToolBase* m_toolSendComposed;
wxToolBarToolBase* m_toolSendDecomposed;
wxStaticText* m_toolDecompLanguageLbl;
wxChoice* m_toolDecompLanguage;
wxZRColaComposerPanel* m_panel;
wxAuiToolBar* m_toolbarEdit;
wxAuiToolBarItem* m_toolEditCut;
wxAuiToolBarItem* m_toolEditCopy;
wxAuiToolBarItem* m_toolEditPaste;
wxAuiToolBar* m_toolbarCompose;
wxAuiToolBarItem* m_toolCharSelect;
wxAuiToolBarItem* m_toolSendComposed;
wxAuiToolBarItem* m_toolSendDecomposed;
wxZRColaCharacterCatalogPanel* m_panelChrCat;
wxStatusBar* m_statusBar;
// Virtual event handlers, overide them in your derived class
virtual void OnDecompLanguageChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ) { event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
public:
wxZRColaComposerPanel* m_panel;
wxZRColaFrameBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 600,400 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("ZRCola") );
wxAuiManager m_mgr;
~wxZRColaFrameBase();
@@ -88,16 +114,20 @@ class wxZRColaComposerPanelBase : public wxPanel
private:
protected:
enum
{
wxID_TIMER_SAVE = 1000
};
wxSplitterWindow* m_splitterDecomposed;
wxPanel* m_panelDecomposedEdit;
wxTextCtrl* m_decomposed;
wxPanel* m_panelDecomposedHex;
wxTextCtrl* m_decomposedHex;
wxSplitterWindow* m_splitterComposed;
wxPanel* m_panelComposedEdit;
wxTextCtrl* m_composed;
wxPanel* m_panelComposedHex;
wxTextCtrl* m_composedHex;
wxTimer m_timerSave;
// Virtual event handlers, overide them in your derived class
virtual void OnDecomposedPaint( wxPaintEvent& event ) { event.Skip(); }
@@ -106,9 +136,12 @@ class wxZRColaComposerPanelBase : public wxPanel
virtual void OnComposedPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnComposedText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnComposedHexPaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnSaveTimer( wxTimerEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_decomposed;
wxTextCtrl* m_composed;
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();
@@ -127,4 +160,170 @@ class wxZRColaComposerPanelBase : public wxPanel
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharacterCatalogPanelBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharacterCatalogPanelBase : public wxPanel
{
private:
protected:
wxChoice* m_choice;
wxZRColaCharGrid* m_grid;
// 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(); }
public:
wxZRColaCharacterCatalogPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxT("ZRColaCharacterCatalog") );
~wxZRColaCharacterCatalogPanelBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaCharSelectBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaCharSelectBase : public wxDialog
{
private:
protected:
wxSearchCtrl* m_search;
wxCheckListBox* m_categories;
wxHyperlinkCtrl* m_categoriesAll;
wxHyperlinkCtrl* m_categoriesNone;
wxHyperlinkCtrl* m_categoriesInvert;
wxZRColaCharGrid* m_gridResults;
wxZRColaCharGrid* m_gridRecent;
wxStaticText* m_labelUnicode;
wxTextCtrl* m_unicode;
wxTextCtrl* m_shortcut;
wxGrid* m_gridPreview;
wxTextCtrl* m_description;
wxTextCtrl* m_category;
wxHyperlinkCtrl* m_navigateBack;
wxHyperlinkCtrl* m_navigateForward;
wxZRColaCharGrid* m_gridRelated;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// 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 OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnCategoriesInvert( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnResultCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnResultsKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnRecentCellDClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnRecentKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnUnicodeText( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPreviewKeyDown( wxKeyEvent& event ) { event.Skip(); }
virtual void OnNavigateBack( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnNavigateForward( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void OnRelatedSelectCell( wxGridEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Character Selector"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharSelect") );
~wxZRColaCharSelectBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaSettingsBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaSettingsBase : public wxDialog
{
private:
protected:
wxListbook* m_listbook;
wxPanel* m_panelLanguage;
wxStaticText* m_langLabel;
wxRadioButton* m_langAuto;
wxRadioButton* m_langManual;
wxListBox* m_languages;
wxPanel* m_panelAutoStart;
wxStaticText* m_autoStartLabel;
wxCheckBox* m_autoStart;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsApply;
wxButton* m_sdbSizerButtonsCancel;
// 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 OnApplyButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaSettingsBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaSettings") );
~wxZRColaSettingsBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaAboutBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaAboutBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapIcon;
wxStaticText* m_staticTextZRCola;
wxStaticText* m_staticTextVersion;
wxStaticText* m_staticTextColophone;
wxStaticText* m_staticTextCopyright;
wxHyperlinkCtrl* m_hyperlink;
wxStaticText* m_staticTextDeclaration;
wxTextCtrl* m_declaration;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
public:
wxZRColaAboutBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About ZRCola"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaAbout") );
~wxZRColaAboutBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class wxZRColaUpdaterBase
///////////////////////////////////////////////////////////////////////////////
class wxZRColaUpdaterBase : public wxDialog
{
private:
protected:
wxTextCtrl* m_log;
wxButton* m_buttonUpdate;
wxButton* m_buttonClose;
// Virtual event handlers, overide them in your derived class
virtual void OnUpdate( wxCommandEvent& event ) { event.Skip(); }
public:
wxZRColaUpdaterBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Product Update"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaUpdater") );
~wxZRColaUpdaterBase();
};
#endif //__ZRCOLAGUI_H__

View File

@@ -24,29 +24,10 @@
// wxZRColaKeyHandler
//////////////////////////////////////////////////////////////////////////
wxZRColaKeyHandler::wxZRColaKeyHandler() : wxEvtHandler()
wxZRColaKeyHandler::wxZRColaKeyHandler() :
m_is_insert(false),
wxEvtHandler()
{
std::fstream dat((LPCTSTR)((ZRColaApp*)wxTheApp)->GetDatabasePath(), 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;
dat.read((char*)&size, sizeof(ZRCola::recordsize_t));
if (dat.good()) {
ZRCola::keyseq_rec rec(m_ks_db);
if (rec.find(dat, size)) {
dat >> rec;
if (!dat.good()) {
wxFAIL_MSG(wxT("Error reading translation data from ZRCola.zrcdb."));
m_ks_db.idxChr.clear();
m_ks_db.idxKey.clear();
m_ks_db.data .clear();
}
} else
wxFAIL_MSG(wxT("ZRCola.zrcdb has no translation data."));
}
} else
wxFAIL_MSG(wxT("ZRCola.zrcdb is not a valid ZRCola database."));
}
}
@@ -55,15 +36,55 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
if (event.GetEventType() == wxEVT_KEY_DOWN) {
// The character event occured.
wxKeyEvent &e = (wxKeyEvent&)event;
if (e.GetUnicodeKey() || !e.HasAnyModifiers()) {
ZRCola::keyseq_db::indexKey::size_type start, end;
if (e.GetKeyCode() == WXK_INSERT) {
// Insert key has been pressed.
m_is_insert = true;
wxFrame *pFrame = wxDynamicCast(((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 (('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);
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(wxString::Format(wxT("U+%s"), (const wxStringCharType*)wxString(m_insert_seq.data(), m_insert_seq.size())));
event.StopPropagation();
return true;
} else {
// Not a hex-digit.
m_is_insert = false;
m_insert_seq.clear();
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(wxEmptyString);
}
} else if ((e.GetUnicodeKey() || !e.HasAnyModifiers())
#if defined(__WXMSW__)
&& ::GetKeyState(VK_RMENU) >= 0
#endif
)
{
ZRColaApp *app = (ZRColaApp*)wxTheApp;
ZRCola::keyseq_db::indexKey::size_type start;
bool found;
wxFrame *pFrame = wxDynamicCast(wxTheApp->GetTopWindow(), wxFrame);
wxFrame *pFrame = wxDynamicCast(app->m_mainWnd, wxFrame);
{
// Parse key event and save it at the end of the key sequence.
ZRCola::keyseq_db::keyseq::key_t key;
key.key = e.GetRawKeyCode();
#if defined(__WXMSW__)
// Translate from local keyboard to scan code.
key.key = ::MapVirtualKey(key.key, MAPVK_VK_TO_VSC);
// Translate from scan code to U.S. Keyboard.
static const HKL s_hkl = ::LoadKeyboardLayout(_T("00000409"), 0);
key.key = ::MapVirtualKeyEx(key.key, MAPVK_VSC_TO_VK, s_hkl);
#endif
key.modifiers =
(e.ShiftDown() ? ZRCola::keyseq_db::keyseq::SHIFT : 0) |
(e.ControlDown() ? ZRCola::keyseq_db::keyseq::CTRL : 0) |
@@ -75,13 +96,13 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
ks->chr = 0;
ks->seq_len = n;
memcpy(ks->seq, m_seq.data(), sizeof(ZRCola::keyseq_db::keyseq::key_t)*n);
found = m_ks_db.idxKey.find(*ks, start, end);
found = app->m_ks_db.idxKey.find(*ks, start);
delete ks;
}
if (found) {
// The exact key sequence found.
const ZRCola::keyseq_db::keyseq &ks = m_ks_db.idxKey[start];
const ZRCola::keyseq_db::keyseq &ks = app->m_ks_db.idxKey[start];
m_seq.clear();
if (pFrame && pFrame->GetStatusBar())
@@ -96,8 +117,8 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
event.StopPropagation();
return true;
}
} else if (start < m_ks_db.idxKey.size() &&
ZRCola::keyseq_db::keyseq::CompareSequence(m_seq.data(), m_seq.size(), m_ks_db.idxKey[start].seq, std::min<unsigned __int16>(m_ks_db.idxKey[start].seq_len, m_seq.size())) == 0)
} 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)
{
// The sequence is a partial match. Continue watching.
if (pFrame && pFrame->GetStatusBar())
@@ -113,6 +134,36 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
pFrame->SetStatusText(wxEmptyString);
}
}
} else if (event.GetEventType() == wxEVT_KEY_UP) {
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);
if (pFrame && pFrame->GetStatusBar())
pFrame->SetStatusText(wxEmptyString);
std::vector<char>::size_type count = m_insert_seq.size();
if (count) {
// Zero terminate sequence and parse the Unicode value.
m_insert_seq.push_back(0);
wchar_t chr = strtoul(m_insert_seq.data(), NULL, 16);
if (chr) {
wxObject *obj = event.GetEventObject();
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
// Push text to source control.
((wxTextCtrl*)obj)->WriteText(chr);
}
}
m_insert_seq.clear();
}
m_is_insert = false;
event.StopPropagation();
return true;
}
}
return wxEvtHandler::ProcessEvent(event);

View File

@@ -25,7 +25,6 @@ class wxZRColaKeyHandler;
#pragma once
#include <zrcolaui/keyboard.h>
#include <wx/event.h>
#include <vector>
@@ -41,6 +40,7 @@ public:
virtual bool ProcessEvent(wxEvent& event);
protected:
ZRCola::keyseq_db m_ks_db; ///< Key sequence database
std::vector<ZRCola::keyseq_db::keyseq::key_t> m_seq; ///< Key sequence
bool m_is_insert; ///< Is Insert key pressed?
std::vector<char> m_insert_seq; ///< The Insert char sequence
};

190
ZRCola/zrcolasettings.cpp Normal file
View File

@@ -0,0 +1,190 @@
/*
Copyright 2015-2016 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"
//////////////////////////////////////////////////////////////////////////
// wxZRColaSettings
//////////////////////////////////////////////////////////////////////////
wxZRColaSettings::wxZRColaSettings(wxWindow* parent) :
m_lang_auto(true),
m_lang(ZRCola::langid_t_blank),
wxZRColaSettingsBase(parent)
{
ZRColaApp *app = ((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];
wxString
label(lang.name, lang.name_len),
label_tran(wxGetTranslation(label, wxT("ZRCola-zrcdb")));
m_languages->Insert(label_tran, i);
}
}
void wxZRColaSettings::OnInitDialog(wxInitDialogEvent& event)
{
event.Skip();
// Set state of auto-start according to Startup folder shortcut presence.
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
m_autoStart->SetValue(wxFileExists(linkName));
#else
m_autoStart->SetValue(false);
m_panelAutoStart->Enable(false);
#endif
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;
ZRCola::language_db::indexLang::size_type start;
m_languages->Select(app->m_lang_db.idxLng.find(*(ZRCola::language_db::language*)l, start) ? start : -1);
}
void wxZRColaSettings::OnLangAuto(wxCommandEvent& event)
{
m_languages->Enable(!event.IsChecked());
}
void wxZRColaSettings::OnLangManual(wxCommandEvent& event)
{
m_languages->Enable(event.IsChecked());
}
void wxZRColaSettings::OnApplyButtonClick(wxCommandEvent& event)
{
event.Skip();
#if defined(__WXMSW__)
wxString linkName(wxExpandEnvVars("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ZRCola.lnk"));
if (m_autoStart->IsChecked()) {
// Create the shortcut.
IShellLink *sl;
HRESULT hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&sl);
if (SUCCEEDED(hr)) {
// Setup ZRCola shortcut.
sl->SetPath(wxTheApp->argv[0]);
sl->SetDescription(_("Start ZRCola automatically on logon"));
sl->SetShowCmd(SW_SHOWMINNOACTIVE);
// Query IShellLink for the IPersistFile interface, used for saving the
// shortcut in persistent storage.
IPersistFile *pf;
hr = sl->QueryInterface(IID_IPersistFile, (LPVOID*)&pf);
if (SUCCEEDED(hr)) {
// Save the link by calling IPersistFile::Save.
hr = pf->Save(linkName, TRUE);
pf->Release();
}
sl->Release();
}
} else if (wxFileExists(linkName)) {
// The shortcut already exists. Remove it.
wxRemoveFile(linkName);
}
#endif
if (m_langAuto->GetValue()) {
m_lang_auto = true;
#if defined(__WXMSW__)
// Set update keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), m_lang);
#endif
} else {
m_lang_auto = false;
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
const ZRCola::language_db::language &lang = app->m_lang_db.idxLng[m_languages->GetSelection()];
if (m_lang != lang.id) {
m_lang = lang.id;
// Notify composed text something changed and should re-decompose.
wxCommandEvent event2(wxEVT_COMMAND_TEXT_UPDATED);
app->m_mainWnd->m_panel->m_composed->ProcessWindowEvent(event2);
}
}
}
void wxZRColaSettings::OnOKButtonClick(wxCommandEvent& event)
{
wxZRColaSettings::OnApplyButtonClick(event);
}
//////////////////////////////////////////////////////////////////////////
// wxPersistentZRColaSettings
//////////////////////////////////////////////////////////////////////////
wxPersistentZRColaSettings::wxPersistentZRColaSettings(wxZRColaSettings *wnd) : wxPersistentDialog(wnd)
{
}
void wxPersistentZRColaSettings::Save() const
{
wxPersistentDialog::Save();
const wxZRColaSettings * const wnd = static_cast<const wxZRColaSettings*>(GetWindow());
SaveValue(wxT("langAuto"), wnd->m_lang_auto);
SaveValue(wxT("lang" ), wxString::FromAscii(wnd->m_lang.data, _countof(wnd->m_lang.data)));
}
bool wxPersistentZRColaSettings::Restore()
{
wxZRColaSettings * const wnd = static_cast<wxZRColaSettings*>(GetWindow());
ZRColaApp *app = ((ZRColaApp*)wxTheApp);
wxString lang;
// Restore automatic language detection setting first.
RestoreValue(wxT("langAuto"), &(wnd->m_lang_auto));
if (wnd->m_lang_auto) {
#if defined(__WXMSW__)
// Set keyboard language.
HKL hkl = ::GetKeyboardLayout(0);
ZRCola::LangConvert(LOWORD(hkl), wnd->m_lang);
#endif
} 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
wnd->m_lang = ZRCola::langid_t_blank;
return wxPersistentDialog::Restore();
}

72
ZRCola/zrcolasettings.h Normal file
View File

@@ -0,0 +1,72 @@
/*
Copyright 2015-2016 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 wxZRColaSettings;
class wxPersistentZRColaSettings;
#pragma once
#include "zrcolagui.h"
#include <wxex/persist/dialog.h>
///
/// Configuration dialog
///
class wxZRColaSettings : public wxZRColaSettingsBase
{
public:
wxZRColaSettings(wxWindow* parent);
friend class wxPersistentZRColaSettings; // Allow saving/restoring window state.
protected:
virtual void OnInitDialog(wxInitDialogEvent& event);
virtual void OnLangAuto(wxCommandEvent& event);
virtual void OnLangManual(wxCommandEvent& 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
};
///
/// Supports saving/restoring wxZRColaSettings state
///
class wxPersistentZRColaSettings : public wxPersistentDialog
{
public:
wxPersistentZRColaSettings(wxZRColaSettings *wnd);
virtual void Save() const;
virtual bool Restore();
};
inline wxPersistentObject *wxCreatePersistentObject(wxZRColaSettings *wnd)
{
return new wxPersistentZRColaSettings(wnd);
}

84
ZRCola/zrcolaupdater.cpp Normal file
View File

@@ -0,0 +1,84 @@
/*
Copyright 2015-2016 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"
//////////////////////////////////////////////////////////////////////////
// wxZRColaUpdater
//////////////////////////////////////////////////////////////////////////
wxZRColaUpdater::wxZRColaUpdater(wxWindow* parent) :
m_logLevelOrig(wxLOG_Warning),
m_logOrig(NULL),
m_updater(NULL),
wxZRColaUpdaterBase(parent)
{
// Setup logging.
m_logOrig = wxLog::SetActiveTarget(new wxLogTextCtrl(m_log));
m_logLevelOrig = wxLog::GetLogLevel();
wxLog::SetLogLevel(wxLOG_Info);
// Connect events.
Connect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
// Launch Updater thread.
ZRColaApp *app = (ZRColaApp*)wxTheApp;
m_updater = new wxUpdCheckThread(app->m_locale.GetCanonicalName(), this);
if (m_updater->Run() != wxTHREAD_NO_ERROR) {
wxFAIL_MSG(wxT("Can't create the thread!"));
delete m_updater;
m_updater = NULL;
}
}
wxZRColaUpdater::~wxZRColaUpdater()
{
if (m_updater) {
// Terminate the Updater thread.
m_updater->Delete();
}
// Disconnect events.
Disconnect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
wxLog::SetLogLevel(m_logLevelOrig);
if (m_logOrig) {
// Return logging to previous state.
delete wxLog::SetActiveTarget(m_logOrig);
}
}
void wxZRColaUpdater::OnCheckComplete(wxThreadEvent& event)
{
event.Skip();
m_buttonUpdate->Enable(event.GetInt() == wxUpdCheckThread::wxUpdUpdateAvailable);
}
void wxZRColaUpdater::OnUpdate(wxCommandEvent& event)
{
event.Skip();
if (m_updater)
m_updater->LaunchUpdate();
}

52
ZRCola/zrcolaupdater.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Copyright 2015-2016 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 wxZRColaUpdater;
#pragma once
#include "zrcolagui.h"
#include <Updater/chkthread.h>
#include <wx/log.h>
///
/// ZRCola updater dialog
///
class wxZRColaUpdater : public wxZRColaUpdaterBase
{
public:
wxZRColaUpdater(wxWindow* parent);
virtual ~wxZRColaUpdater();
protected:
void OnCheckComplete(wxThreadEvent& event);
virtual void OnUpdate(wxCommandEvent& event);
protected:
wxLogLevel m_logLevelOrig; ///< Original log level
wxLog *m_logOrig; ///< Original log
wxUpdCheckThread *m_updater; ///< Updater thread
};

View File

@@ -71,8 +71,13 @@
<ResourceCompile Include="ZRColaCompile.rc" />
</ItemGroup>
<ItemGroup>
<POCompile Include="locale\de_DE.po" />
<POCompile Include="locale\ru_RU.po" />
<POCompile Include="locale\sl_SI.po" />
</ItemGroup>
<ItemGroup>
<None Include="locale\ZRColaCompile.pot" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\include\xgettext.targets" />

View File

@@ -46,5 +46,16 @@
<POCompile Include="locale\sl_SI.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\de_DE.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
<POCompile Include="locale\ru_RU.po">
<Filter>Resource Files\Localization</Filter>
</POCompile>
</ItemGroup>
<ItemGroup>
<None Include="locale\ZRColaCompile.pot">
<Filter>Resource Files\Localization</Filter>
</None>
</ItemGroup>
</Project>

View File

@@ -19,6 +19,240 @@
#include "stdafx.h"
using namespace std;
using namespace stdex;
//////////////////////////////////////////////////////////////////////////
// ZRCola::DBSource::character_bank
//////////////////////////////////////////////////////////////////////////
ZRCola::DBSource::character_bank::character_bank() : vector<unique_ptr<ZRCola::DBSource::character> >()
{
resize(0x10000);
}
void ZRCola::DBSource::character_bank::build_related()
{
// Initialize ignore list.
m_ignore.insert(L"letter");
m_ignore.insert(L"modifier");
m_ignore.insert(L"symbol");
m_ignore.insert(L"accent");
m_ignore.insert(L"with");
m_ignore.insert(L"and");
m_ignore.insert(L"capital");
m_ignore.insert(L"small");
m_ignore.insert(L"combining");
SYSTEM_INFO si;
GetSystemInfo(&si);
// Launch workers.
build_related_worker **workers = new build_related_worker*[si.dwNumberOfProcessors];
size_type from = 0, to;
for (DWORD i = 0; i < si.dwNumberOfProcessors; i++) {
to = MulDiv(i + 1, 0x10000, si.dwNumberOfProcessors);
workers[i] = new build_related_worker(this, from, to);
from = to;
}
// Wait for workers.
for (DWORD i = 0; i < si.dwNumberOfProcessors; i++) {
if (workers[i]) {
workers[i]->join();
delete workers[i];
}
}
delete workers; // This line of code sounds horrible, I know.
}
ZRCola::DBSource::character_bank::build_related_worker::build_related_worker(_In_ const character_bank *cb, _In_ size_type from, _In_ size_type to) :
thread_type((HANDLE)_beginthreadex(NULL, 0, process, this, CREATE_SUSPENDED, NULL)),
m_heap(HeapCreate(0, 0, 0)),
m_cb(cb),
m_from(from),
m_to(to)
{
// Now that members of this class are surely initialized, proceed.
ResumeThread(get());
}
ZRCola::DBSource::character_bank::build_related_worker::~build_related_worker()
{
assert(m_heap);
HeapDestroy(m_heap);
}
unsigned int ZRCola::DBSource::character_bank::build_related_worker::process()
{
heap_allocator<wchar_t> al(m_heap);
basic_string<wchar_t, char_traits<wchar_t>, heap_allocator<wchar_t> > rel(al);
set<wstring, less<wstring>, heap_allocator<wstring> > matching(less<wstring>(), al);
for (size_type i = m_from; i < m_to; i++) {
ZRCola::DBSource::character &chr = *(m_cb->at(i).get());
if (&chr == NULL) continue;
rel.clear();
// Remove all unexisting, inactive, or self related characters.
for (wstring::size_type j = chr.rel.length(); j--;) {
wchar_t c = chr.rel[j];
if (m_cb->at(c) && (wchar_t)j != c)
rel += c;
}
// Add all characters that share enought keywords.
for (size_type j = 0, j_end = m_cb->size(); j < j_end; j++) {
if (i == j || rel.find((wchar_t)j) != wstring::npos)
continue;
const ZRCola::DBSource::character &chr2 = *(m_cb->at(j).get());
if (&chr2 == NULL)
continue;
set<wstring>::size_type comparisons = 0;
matching.clear();
for (set<wstring>::const_iterator term = chr.terms.cbegin(), term_end = chr.terms.cend(); term != term_end; ++term) {
// Test for ignored word(s).
if (m_cb->m_ignore.find(*term) != m_cb->m_ignore.cend())
continue;
for (set<wstring>::const_iterator term2 = chr2.terms.cbegin(), term2_end = chr2.terms.cend(); term2 != term2_end; ++term2) {
// Test for ignored word(s).
if (m_cb->m_ignore.find(*term2) != m_cb->m_ignore.cend())
continue;
comparisons++;
if (*term == *term2)
matching.insert(*term);
}
}
if (comparisons) {
// If 1/2 terms match, assume related.
set<wstring>::size_type hits = matching.size();
if (hits*hits*2 >= comparisons)
rel += chr2.chr;
}
}
chr.rel.assign(rel.c_str(), rel.length());
}
return 0;
}
unsigned int __stdcall ZRCola::DBSource::character_bank::build_related_worker::process(_In_ void *param)
{
return ((ZRCola::DBSource::character_bank::build_related_worker*)param)->process();
}
//////////////////////////////////////////////////////////////////////////
// ZRCola::DBSource::character_desc_idx
//////////////////////////////////////////////////////////////////////////
void ZRCola::DBSource::character_desc_idx::parse_keywords(const wchar_t *str, set<wstring> &terms)
{
wxASSERT_MSG(str, wxT("string is NULL"));
while (*str) {
// Skip white space.
for (;;) {
if (*str == 0)
return;
else if (!iswspace(*str))
break;
else
str++;
}
// Get term.
wstring term;
if (*str == L'"') {
const wchar_t *str_end = ++str;
for (;;) {
if (*str_end == 0) {
term.assign(str, str_end);
break;
} else if (*str_end == L'"') {
term.assign(str, str_end);
str_end++;
break;
} else
str_end++;
}
str = str_end;
} else {
const wchar_t *str_end = str + 1;
for (; *str_end && !iswspace(*str_end); str_end++);
term.assign(str, str_end);
str = str_end;
}
if (!term.empty()) {
transform(term.begin(), term.end(), term.begin(), towlower);
terms.insert(term);
}
}
}
void ZRCola::DBSource::character_desc_idx::add_keywords(const set<wstring> &terms, wchar_t chr, size_t sub)
{
for (set<wstring>::const_iterator term = terms.cbegin(), term_end = terms.cend(); term != term_end; ++term) {
if (sub) {
wstring::size_type j_end = term->size();
if (j_end >= sub) {
// Insert all keyword substrings "sub" or more characters long.
for (wstring::size_type i = 0, i_end = j_end - sub; i <= i_end; ++i) {
for (wstring::size_type j = i + sub; j <= j_end; ++j)
add_keyword(term->substr(i, j - i), chr);
}
}
} else {
// Insert exact keyword only.
add_keyword(*term, chr);
}
}
}
void ZRCola::DBSource::character_desc_idx::save(ZRCola::textindex<wchar_t, wchar_t, unsigned __int32> &idx) const
{
idx .clear();
idx.keys .clear();
idx.values.clear();
// Pre-allocate memory.
vector<wchar_t>::size_type size_keys = 0;
vector<wchar_t>::size_type size_values = 0;
for (const_iterator i = cbegin(), i_end = cend(); i != i_end; ++i) {
size_keys += i->first.size();
size_values += i->second.size();
}
idx .reserve(size() );
idx.keys .reserve(size_keys );
idx.values.reserve(size_values);
// Convert the index.
for (const_iterator i = cbegin(), i_end = cend(); i != i_end; ++i) {
ZRCola::mappair_t<unsigned __int32> p = { idx.keys.size(), idx.values.size() };
idx.push_back(p);
idx.keys.insert(idx.keys.end(), i->first.cbegin(), i->first.cend());
idx.values.insert(idx.values.end(), i->second.cbegin(), i->second.cend());
}
}
//////////////////////////////////////////////////////////////////////////
// ZRCola::DBSource
//////////////////////////////////////////////////////////////////////////
ZRCola::DBSource::DBSource()
{
@@ -27,6 +261,12 @@ ZRCola::DBSource::DBSource()
ZRCola::DBSource::~DBSource()
{
if (m_pCharacterGroup1)
m_pCharacterGroup1.Release();
if (m_comCharacterGroup)
m_comCharacterGroup.Release();
if (m_db)
m_db->Close();
@@ -43,7 +283,7 @@ bool ZRCola::DBSource::Open(LPCTSTR filename)
HRESULT hr = ::CoCreateInstance(CLSID_CADOConnection, NULL, CLSCTX_ALL, IID_IADOConnection, (LPVOID*)&m_db);
if (SUCCEEDED(hr)) {
// Open the database.
std::wstring cn;
wstring cn;
cn = L"Driver={Microsoft Access Driver (*.mdb)};";
cn += L"Dbq=";
cn += filename;
@@ -53,6 +293,23 @@ bool ZRCola::DBSource::Open(LPCTSTR filename)
// Database open and ready.
m_filename = filename;
m_locale = _create_locale(LC_ALL, "Slovenian_Slovenia.1250");
wxASSERT_MSG(!m_comCharacterGroup, wxT("ADO command already created"));
// Create ADO command(s).
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADOCommand, NULL, CLSCTX_ALL, IID_IADOCommand, (LPVOID*)&m_comCharacterGroup)));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_ActiveConnection(ATL::CComVariant(m_db))));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandType(adCmdText)));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandText(ATL::CComBSTR(L"SELECT [Znak] FROM [VRS_SkupineZnakov] WHERE [Skupina]=? ORDER BY [Rang] ASC, [Znak] ASC"))));
{
// Create and add command parameters.
ATL::CComPtr<ADOParameters> params;
wxVERIFY(SUCCEEDED(m_comCharacterGroup->get_Parameters(&params)));
wxASSERT_MSG(!m_pCharacterGroup1, wxT("ADO command parameter already created"));
wxVERIFY(SUCCEEDED(m_comCharacterGroup->CreateParameter(ATL::CComBSTR(L"@Skupina"), adVarWChar, adParamInput, 50, ATL::CComVariant(DISP_E_PARAMNOTFOUND, VT_ERROR), &m_pCharacterGroup1)));
wxVERIFY(SUCCEEDED(params->Append(m_pCharacterGroup1)));
}
return true;
} else {
_ftprintf(stderr, wxT("%s: error ZCC0011: Could not open database (0x%x).\n"), (LPCTSTR)filename, hr);
@@ -127,16 +384,19 @@ bool ZRCola::DBSource::GetValue(const ATL::CComPtr<ADOField>& f, int& val) const
}
bool ZRCola::DBSource::GetValue(const ATL::CComPtr<ADOField>& f, std::wstring& val) const
bool ZRCola::DBSource::GetValue(const ATL::CComPtr<ADOField>& f, wstring& val) const
{
wxASSERT_MSG(f, wxT("field is empty"));
ATL::CComVariant v;
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
wxCHECK(SUCCEEDED(v.ChangeType(VT_BSTR)), false);
if (V_VT(&v) != VT_NULL) {
wxCHECK(SUCCEEDED(v.ChangeType(VT_BSTR)), false);
val.reserve(::SysStringLen(V_BSTR(&v)));
val = V_BSTR(&v);
val.reserve(::SysStringLen(V_BSTR(&v)));
val = V_BSTR(&v);
} else
val.clear();
return true;
}
@@ -148,32 +408,35 @@ bool ZRCola::DBSource::GetUnicodeCharacter(const ATL::CComPtr<ADOField>& f, wcha
ATL::CComVariant v;
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
wxCHECK(SUCCEEDED(v.ChangeType(VT_BSTR)), false);
if (V_VT(&v) != VT_NULL) {
wxCHECK(SUCCEEDED(v.ChangeType(VT_BSTR)), false);
// Parse the field. Must be exactly one Unicode code.
UINT i = 0, n = ::SysStringLen(V_BSTR(&v));
chr = 0;
for (; i < n && V_BSTR(&v)[i]; i++) {
if (L'0' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'9') chr = chr*0x10 + (V_BSTR(&v)[i] - L'0');
else if (L'A' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'F') chr = chr*0x10 + (V_BSTR(&v)[i] - L'A' + 10);
else if (L'a' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'f') chr = chr*0x10 + (V_BSTR(&v)[i] - L'a' + 10);
else break;
}
if (i <= 0 && 4 < i) {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0030: Syntax error in \"%.*ls\" field (\"%.*ls\"). Unicode code must be one to four hexadecimal characters long.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
} else if (i != n) {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0031: Syntax error in \"%.*ls\" field (\"%.*ls\"). Extra trailing characters.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
// Parse the field. Must be exactly one Unicode code.
UINT i = 0, n = ::SysStringLen(V_BSTR(&v));
chr = 0;
for (; i < n && V_BSTR(&v)[i]; i++) {
if (L'0' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'9') chr = chr*0x10 + (V_BSTR(&v)[i] - L'0');
else if (L'A' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'F') chr = chr*0x10 + (V_BSTR(&v)[i] - L'A' + 10);
else if (L'a' <= V_BSTR(&v)[i] && V_BSTR(&v)[i] <= L'f') chr = chr*0x10 + (V_BSTR(&v)[i] - L'a' + 10);
else break;
}
if (i <= 0 && 4 < i) {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0030: Syntax error in \"%.*ls\" field (\"%.*ls\"). Unicode code must be one to four hexadecimal characters long.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
} else if (i != n) {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0031: Syntax error in \"%.*ls\" field (\"%.*ls\"). Extra trailing characters.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
} else
chr = 0;
return true;
}
bool ZRCola::DBSource::GetUnicodeString(const ATL::CComPtr<ADOField>& f, std::wstring& str) const
bool ZRCola::DBSource::GetUnicodeString(const ATL::CComPtr<ADOField>& f, wstring& str) const
{
wxASSERT_MSG(f, wxT("field is empty"));
@@ -208,54 +471,6 @@ bool ZRCola::DBSource::GetUnicodeString(const ATL::CComPtr<ADOField>& f, std::ws
}
bool ZRCola::DBSource::GetKeyCode(const ATL::CComPtr<ADOField>& f, ZRCola::DBSource::keyseq::keycode& kc) const
{
wxASSERT_MSG(f, wxT("field is empty"));
ATL::CComVariant v;
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
wxCHECK(SUCCEEDED(v.ChangeType(VT_BSTR)), false);
// Convert to uppercase.
_wcsupr_l(V_BSTR(&v), m_locale);
// Parse the field.
memset(&kc, 0, sizeof(kc));
for (UINT i = 0, n = ::SysStringLen(V_BSTR(&v)); i < n && V_BSTR(&v)[i];) {
// Parse key code.
if (i) {
// Check for "+" separator.
if (V_BSTR(&v)[i] != L'+') {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0070: Syntax error in \"%.*ls\" field (\"%.*ls\"). Key codes must be \"Ctrl+Alt+<key>\" formatted.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
}
i++;
if (i >= n || !V_BSTR(&v)[i]) {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0071: Syntax error in \"%.*ls\" field (\"%.*ls\"). Trailing separator \"+\" found.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
}
}
static const wchar_t str_shift[] = L"SHIFT", str_ctrl[] = L"CTRL", str_alt[] = L"ALT";
if (i + _countof(str_shift) - 1 <= n && wmemcmp(V_BSTR(&v) + i, str_shift, _countof(str_shift) - 1) == 0) {
kc.shift = true;
i += _countof(str_shift) - 1;
} else if (i + _countof(str_ctrl) - 1 <= n && wmemcmp(V_BSTR(&v) + i, str_ctrl, _countof(str_ctrl) - 1) == 0) {
kc.ctrl = true;
i += _countof(str_ctrl) - 1;
} else if (i + _countof(str_alt) - 1 <= n && wmemcmp(V_BSTR(&v) + i, str_alt, _countof(str_alt) - 1) == 0) {
kc.alt = true;
i += _countof(str_alt) - 1;
} else {
kc.key = V_BSTR(&v)[i];
i++;
}
}
return true;
}
bool ZRCola::DBSource::GetLanguage(const ATL::CComPtr<ADOField>& f, ZRCola::langid_t& lang) const
{
wxASSERT_MSG(f, wxT("field is empty"));
@@ -283,9 +498,9 @@ bool ZRCola::DBSource::GetLanguage(const ATL::CComPtr<ADOField>& f, ZRCola::lang
_ftprintf(stderr, wxT("%s: error ZCC0081: Syntax error in \"%.*ls\" field (\"%.*ls\"). Language ID must contain ASCII characters only.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
lang[i] = (char)c;
lang.data[i] = (char)c;
} else
lang[i] = 0;
lang.data[i] = 0;
} else
break;
}
@@ -294,6 +509,43 @@ bool ZRCola::DBSource::GetLanguage(const ATL::CComPtr<ADOField>& f, ZRCola::lang
}
bool ZRCola::DBSource::GetChrCat(const ATL::CComPtr<ADOField>& f, chrcatid_t& cc) const
{
wxASSERT_MSG(f, wxT("field is empty"));
ATL::CComVariant v;
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
if (V_VT(&v) != VT_NULL) {
wxCHECK(SUCCEEDED(v.ChangeType(VT_BSTR)), false);
// Parse the field.
size_t n = wcsnlen(V_BSTR(&v), ::SysStringLen(V_BSTR(&v)));
if (n < 1 || 2 < n) {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0110: Syntax error in \"%.*ls\" field (\"%.*ls\"). Character category ID must be one (1) or two (2) characters long.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
for (size_t i = 0;; i++) {
if (i < sizeof(cc)) {
if (i < n) {
wchar_t c = V_BSTR(&v)[i];
if ((unsigned short)c > 0x7f) {
ATL::CComBSTR fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
_ftprintf(stderr, wxT("%s: error ZCC0111: Syntax error in \"%.*ls\" field (\"%.*ls\"). Character category ID must contain ASCII characters only.\n"), m_filename.c_str(), fieldname.Length(), (BSTR)fieldname, n, V_BSTR(&v));
return false;
}
cc.data[i] = (char)c;
} else
cc.data[i] = 0;
} else
break;
}
} else
memset(cc.data, 0, sizeof(cc));
return true;
}
bool ZRCola::DBSource::SelectTranslations(ATL::CComPtr<ADORecordset> &rs) const
{
@@ -354,9 +606,9 @@ bool ZRCola::DBSource::SelectKeySequences(ATL::CComPtr<ADORecordset> &rs) const
// Open it.
if (FAILED(rs->Open(ATL::CComVariant(
L"SELECT DISTINCT [VRS_KeyCodes].[Znak], [VRS_CharGroup].[Name] AS [CharGroup], [VRS_KeyCodes].[KeyCode], [VRS_KeyCodes].[Shift] "
L"SELECT DISTINCT [VRS_KeyCodes].[Znak], [VRS_CharGroup].[CharGroup], IIF([VRS_CharGroup].[Arg1] IS NOT NULL, [VRS_CharGroup].[Arg1], 0)+IIF([VRS_CharGroup].[Arg2] IS NOT NULL, [VRS_CharGroup].[Arg2], 0)+IIF([VRS_CharGroup].[Arg3] IS NOT NULL, [VRS_CharGroup].[Arg3], 0) AS [Modifiers], IIF([VRS_CharGroup].[Arg4] IS NOT NULL, [VRS_CharGroup].[Arg4], 0) AS [KeyCodePre], [VRS_KeyCodes].[KeyCode], [VRS_KeyCodes].[Shift] "
L"FROM [VRS_KeyCodes] LEFT JOIN [VRS_CharGroup] ON [VRS_CharGroup].[CharGroup]=[VRS_KeyCodes].[CharGroup] "
L"ORDER BY [VRS_CharGroup].[Name], [VRS_KeyCodes].[KeyCode], [VRS_KeyCodes].[Shift], [VRS_KeyCodes].[Znak]"), ATL::CComVariant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
L"ORDER BY [VRS_CharGroup].[CharGroup], [VRS_KeyCodes].[KeyCode], [VRS_KeyCodes].[Shift], [VRS_KeyCodes].[Znak]"), ATL::CComVariant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0050: Error loading key sequences from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
@@ -380,11 +632,18 @@ bool ZRCola::DBSource::GetKeySequence(const ATL::CComPtr<ADORecordset>& rs, ZRCo
wxCHECK(GetUnicodeCharacter(f, ks.chr), false);
}
keyseq::keycode kc1;
int modifiers;
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"CharGroup"), &f)));
wxCHECK(GetKeyCode(f, kc1), false);
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"Modifiers"), &f)));
wxCHECK(GetValue(f, modifiers), false);
}
int keycode1;
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"KeyCodePre"), &f)));
wxCHECK(GetValue(f, keycode1), false);
}
int keycode;
@@ -402,15 +661,24 @@ bool ZRCola::DBSource::GetKeySequence(const ATL::CComPtr<ADORecordset>& rs, ZRCo
}
ks.seq.clear();
if (kc1.key) {
if (keycode1) {
// First key in the sequence is complete.
keyseq::keycode kc1 = {
keyseq::keycode::translate_slen(keycode1),
(modifiers & 0x100) != 0,
(modifiers & 0x200) != 0,
(modifiers & 0x400) != 0 };
ks.seq.push_back(kc1);
keyseq::keycode kc2 = { keycode, shift };
keyseq::keycode kc2 = { keyseq::keycode::translate_slen(keycode), shift };
ks.seq.push_back(kc2);
} else {
// First key in the sequence is only modifier(s).
kc1.key = keycode;
if (shift) kc1.shift = true;
keyseq::keycode kc1 = {
keyseq::keycode::translate_slen(keycode),
shift || (modifiers & 0x100) != 0,
(modifiers & 0x200) != 0,
(modifiers & 0x400) != 0 };
ks.seq.push_back(kc1);
}
@@ -504,3 +772,218 @@ bool ZRCola::DBSource::GetLanguageCharacter(const ATL::CComPtr<ADORecordset>& rs
return true;
}
bool ZRCola::DBSource::SelectCharacterGroups(ATL::CComPtr<ADORecordset>& rs) const
{
// Create a new recordset.
if (rs) rs.Release();
wxCHECK(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)), false);
// Open it.
if (FAILED(rs->Open(ATL::CComVariant(
L"SELECT DISTINCT [id], [Skupina], [opis_en], [Rang] "
L"FROM [VRS_SkupinaZnakov] "
L"ORDER BY [Rang], [opis_en]"), ATL::CComVariant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0090: Error loading character groups from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::GetCharacterGroup(const ATL::CComPtr<ADORecordset>& rs, chrgrp& cg) const
{
wxASSERT_MSG(rs, wxT("recordset is empty"));
ATL::CComPtr<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wstring id;
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"id"), &f)));
wxCHECK(GetValue(f, cg.id), false);
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"Skupina"), &f)));
wxCHECK(GetValue(f, id), false);
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"Rang"), &f)));
wxCHECK(GetValue(f, cg.rank), false);
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"opis_en"), &f)));
wxCHECK(GetValue(f, cg.name), false);
}
// Read character list from database.
wxVERIFY(SUCCEEDED(m_pCharacterGroup1->put_Value(ATL::CComVariant(id.c_str()))));
ATL::CComPtr<ADORecordset> rs_chars;
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs_chars)));
wxVERIFY(SUCCEEDED(rs_chars->put_CursorLocation(adUseClient)));
wxVERIFY(SUCCEEDED(rs_chars->put_CursorType(adOpenForwardOnly)));
wxVERIFY(SUCCEEDED(rs_chars->put_LockType(adLockReadOnly)));
if (FAILED(rs_chars->Open(ATL::CComVariant(m_comCharacterGroup), ATL::CComVariant(DISP_E_PARAMNOTFOUND, VT_ERROR)))) {
_ftprintf(stderr, wxT("%s: error ZCC0100: Error loading character group characters from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
{
cg.chars.clear();
ATL::CComPtr<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs_chars->get_Fields(&flds)));
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"Znak"), &f)));
for (VARIANT_BOOL eof = VARIANT_TRUE; SUCCEEDED(rs_chars->get_EOF(&eof)) && !eof; rs_chars->MoveNext()) {
wchar_t c;
wxCHECK(GetUnicodeCharacter(f, c), false);
cg.chars += c;
}
}
return true;
}
bool ZRCola::DBSource::SelectCharacters(ATL::CComPtr<ADORecordset>& rs) const
{
// Create a new recordset.
if (rs) rs.Release();
wxCHECK(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)), false);
// Open it.
if (FAILED(rs->Open(ATL::CComVariant(
L"SELECT DISTINCT [znak], [opis_en], [klj_bes_en], [kat], [znak_v], [znak_m] "
L"FROM [VRS_CharList] "
L"WHERE "
L"[aktiven]=1 AND " // Active characters only
L"[kat]<>'g' " // Ignore "Other, Control" category!
L"ORDER BY [znak]"), ATL::CComVariant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0120: Error loading characters from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::GetCharacter(const ATL::CComPtr<ADORecordset>& rs, character& chr) const
{
wxASSERT_MSG(rs, wxT("recordset is empty"));
ATL::CComPtr<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wchar_t c;
chr.rel.clear();
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"znak"), &f)));
wxCHECK(GetUnicodeCharacter(f, chr.chr), false);
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"znak_v"), &f)));
wxCHECK(GetUnicodeCharacter(f, c), false);
if (c && c != chr.chr)
chr.rel += c;
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"znak_m"), &f)));
wxCHECK(GetUnicodeCharacter(f, c), false);
if (c && c != chr.chr)
chr.rel += c;
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"opis_en"), &f)));
wxCHECK(GetValue(f, chr.desc), false);
}
ZRCola::DBSource::character_desc_idx::parse_keywords(chr.desc.c_str(), chr.terms);
wstring keywords;
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"klj_bes_en"), &f)));
wxCHECK(GetValue(f, keywords), false);
}
ZRCola::DBSource::character_desc_idx::parse_keywords(keywords.c_str(), chr.terms);
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"kat"), &f)));
wxCHECK(GetChrCat(f, chr.cat), false);
}
return true;
}
bool ZRCola::DBSource::SelectCharacterCategories(ATL::CComPtr<ADORecordset>& rs) const
{
// Create a new recordset.
if (rs) rs.Release();
wxCHECK(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)), false);
// Open it.
if (FAILED(rs->Open(ATL::CComVariant(
L"SELECT DISTINCT [kat], [opis_en], [Rang] "
L"FROM [VRS_CharCategory] "
L"WHERE [kat]<>'g' " // Ignore "Other, Control" category!
L"ORDER BY [Rang], [opis_en]"), ATL::CComVariant(m_db), adOpenStatic, adLockReadOnly, adCmdText)))
{
_ftprintf(stderr, wxT("%s: error ZCC0130: Error loading character categories from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
LogErrors();
return false;
}
return true;
}
bool ZRCola::DBSource::GetCharacterCategory(const ATL::CComPtr<ADORecordset>& rs, chrcat& cc) const
{
wxASSERT_MSG(rs, wxT("recordset is empty"));
ATL::CComPtr<ADOFields> flds;
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
wstring id;
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"kat"), &f)));
wxCHECK(GetChrCat(f, cc.id), false);
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"Rang"), &f)));
wxCHECK(GetValue(f, cc.rank), false);
}
{
ATL::CComPtr<ADOField> f;
wxVERIFY(SUCCEEDED(flds->get_Item(ATL::CComVariant(L"opis_en"), &f)));
wxCHECK(GetValue(f, cc.name), false);
}
return true;
}

View File

@@ -19,10 +19,14 @@
#pragma once
#include <zrcola/character.h>
#include <zrcola/common.h>
#include <atlbase.h>
#include <adoint.h>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>
@@ -39,9 +43,9 @@ namespace ZRCola {
///
class translation {
public:
wchar_t chr; ///< Composed character
std::wstring str; ///< Decomposed string
int rank; ///< Decomposition rank
wchar_t chr; ///< Composed character
std::wstring str; ///< Decomposed string
int rank; ///< Decomposition rank
};
@@ -58,6 +62,20 @@ namespace ZRCola {
bool shift; ///< Shift modifier
bool ctrl; ///< Ctrl modifier
bool alt; ///< Alt modifier
///
/// Translates keycode from Slovenian to English keyboard
///
inline static wchar_t translate_slen(_In_ wchar_t key)
{
switch (key) {
case L'Z': return L'Y';
case L'Y': return L'Z';
case 191: return 189;
case 189: return 191;
default : return key;
}
}
};
public:
@@ -85,6 +103,184 @@ namespace ZRCola {
ZRCola::langid_t lang; ///< Language ID
};
///
/// Character group
///
class chrgrp {
public:
int id; ///< Character group ID
int rank; ///< Character group rank
std::wstring name; ///< Character group name
std::wstring chars; ///< Character group characters
};
///
/// Character
///
class character {
public:
inline character()
{
chr = 0;
cat.data[0] = 0;
cat.data[1] = 0;
}
inline character(_In_ const character &othr) :
chr (othr.chr),
cat (othr.cat),
desc (othr.desc),
terms(othr.terms),
rel (othr.rel)
{
}
inline bool operator==(_In_ const character &othr) const
{
return
chr == othr.chr &&
cat == othr.cat &&
desc == othr.desc &&
terms == othr.terms &&
rel == othr.rel;
}
inline bool operator!=(_In_ const character &othr) const
{
return !operator==(othr);
}
wchar_t chr; ///< Character
ZRCola::chrcatid_t cat; ///< Category ID
std::wstring desc; ///< Character description
std::set<std::wstring> terms; ///< Search terms
std::wstring rel; ///< Related characters
};
///
/// Character bank
///
class character_bank : public std::vector<std::unique_ptr<character> >
{
public:
character_bank();
void build_related();
protected:
class build_related_worker : public std::unique_ptr<void, stdex::CloseHandle_delete<void> >
{
public:
typedef std::unique_ptr<void, stdex::CloseHandle_delete<void> > thread_type;
public:
build_related_worker(_In_ const character_bank *cb, _In_ size_type from, _In_ size_type to);
virtual ~build_related_worker();
inline void join()
{
HANDLE h = get();
if (h)
WaitForSingleObject(h, INFINITE);
}
private:
// This class is non-copyable AND non-movable
build_related_worker(_Inout_ build_related_worker &othr);
build_related_worker(_Inout_ build_related_worker &&othr);
build_related_worker& operator=(_Inout_ build_related_worker &othr);
build_related_worker& operator=(_Inout_ build_related_worker &&othr);
protected:
unsigned int process();
static unsigned int __stdcall process(_In_ void *param);
protected:
const character_bank *m_cb;
size_type m_from, m_to;
HANDLE m_heap;
};
protected:
std::set<std::wstring> m_ignore;
};
///
/// Character description index key comparator
///
struct character_desc_idx_less : public std::binary_function<std::wstring, std::wstring, bool>
{
inline bool operator()(const std::wstring& _Left, const std::wstring& _Right) const
{
size_t
_Left_len = _Left .size(),
_Right_len = _Right.size();
int r = _wcsncoll(_Left.c_str(), _Right.c_str(), std::min<size_t>(_Left_len, _Right_len));
if (r != 0 ) return r < 0;
else if (_Left_len < _Right_len) return true;
return false;
}
};
///
/// Character description index
///
class character_desc_idx : public std::map<std::wstring, std::vector<wchar_t>, character_desc_idx_less>
{
public:
static void parse_keywords(const wchar_t *str, std::set<std::wstring> &terms);
void add_keywords(const std::set<std::wstring> &terms, wchar_t chr, size_t sub = 0);
inline void add_keywords(const wchar_t *str, wchar_t chr, size_t sub = 0)
{
std::set<std::wstring> terms;
parse_keywords(str, terms);
add_keywords(terms, chr, sub);
}
void save(ZRCola::textindex<wchar_t, wchar_t, unsigned __int32> &idx) const;
protected:
inline void add_keyword(const std::wstring &term, wchar_t chr)
{
iterator idx = find(term);
if (idx == end()) {
// New keyword.
insert(std::make_pair(term, std::vector<wchar_t>(1, chr)));
} else {
// Append to existing keyword.
std::vector<wchar_t> &val = idx->second;
for (std::vector<wchar_t>::iterator i = val.begin(), i_end = val.end(); ; ++i) {
if (i == i_end) {
// End-of-values reached. Append character.
val.push_back(chr);
break;
} else if (*i == chr) {
// Character already among the values.
break;
}
}
}
}
};
///
/// Character category
///
class chrcat {
public:
ZRCola::chrcatid_t id; ///> Category ID
int rank; ///< Character category rank
std::wstring name; ///< Character category name
};
public:
DBSource();
virtual ~DBSource();
@@ -138,6 +334,19 @@ namespace ZRCola {
}
///
/// Splits string to individual keywords
///
/// \param[in ] str String
/// \param[out] keywords Array of keywords
///
/// \returns
/// - true when successful
/// - false otherwise
///
static bool GetKeywords(const wchar_t *str, std::vector< std::wstring > &keywords);
///
/// Gets boolean from ZRCola.zrc database
///
@@ -203,19 +412,6 @@ namespace ZRCola {
bool GetUnicodeString(const ATL::CComPtr<ADOField>& f, std::wstring& str) const;
///
/// Gets encoded key from ZRCola.zrc database
///
/// \param[in] f Data field
/// \param[out] kc Output key code
///
/// \returns
/// - true when successful
/// - false otherwise
///
bool GetKeyCode(const ATL::CComPtr<ADOField>& f, keyseq::keycode& kc) const;
///
/// Gets language ID from ZRCola.zrc database
///
@@ -229,6 +425,19 @@ namespace ZRCola {
bool GetLanguage(const ATL::CComPtr<ADOField>& f, langid_t& lang) const;
///
/// Gets character category ID from ZRCola.zrc database
///
/// \param[in] f Data field
/// \param[out] cc Character category
///
/// \returns
/// - true when successful
/// - false otherwise
///
bool GetChrCat(const ATL::CComPtr<ADOField>& f, chrcatid_t& cc) const;
///
/// Returns character translations
///
@@ -328,9 +537,85 @@ namespace ZRCola {
///
bool GetLanguageCharacter(const ATL::CComPtr<ADORecordset>& rs, langchar& lc) const;
///
/// Returns character groups
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectCharacterGroups(ATL::CComPtr<ADORecordset>& rs) const;
///
/// Returns character group data
///
/// \param[in] rs Recordset with results
/// \param[out] cg Character group
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetCharacterGroup(const ATL::CComPtr<ADORecordset>& rs, chrgrp& cg) const;
///
/// Returns characters
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectCharacters(ATL::CComPtr<ADORecordset>& rs) const;
///
/// Returns character data
///
/// \param[in] rs Recordset with results
/// \param[out] chr Character
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetCharacter(const ATL::CComPtr<ADORecordset>& rs, character& chr) const;
///
/// Returns character categories
///
/// \param[out] rs Recordset with results
///
/// \returns
/// - true when query succeeds
/// - false otherwise
///
bool SelectCharacterCategories(ATL::CComPtr<ADORecordset>& rs) const;
///
/// Returns character category data
///
/// \param[in] rs Recordset with results
/// \param[out] cc Character category
///
/// \returns
/// - true when succeeded
/// - false otherwise
///
bool GetCharacterCategory(const ATL::CComPtr<ADORecordset>& rs, chrcat& cc) const;
protected:
std::basic_string<TCHAR> m_filename; ///< Database filename
ATL::CComPtr<ADOConnection> m_db; ///< Database
_locale_t m_locale; ///< Database locale
ATL::CComPtr<ADOCommand> m_comCharacterGroup; ///< ADO Command for GetCharacterGroup subquery
ATL::CComPtr<ADOParameter> m_pCharacterGroup1; ///< \c m_comCharacterGroup parameter
};
};

View File

@@ -0,0 +1,39 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2016-05-13 20:00+0200\n"
"PO-Revision-Date: 2016-04-13 18:11+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: sl_SI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: main.cpp:53
#, fuzzy
msgid "Show this help message"
msgstr "Pokaži to sporočilo pomoči"
#: main.cpp:54
#, fuzzy
msgid "<input file>"
msgstr "<vhodna datoteka>"
#: main.cpp:55
#, fuzzy
msgid "<output file>"
msgstr "<izhodna datoteka>"
#: main.cpp:56
#, fuzzy
msgid "<output POT catalog>"
msgstr "<izhodni katalog POT>"

View File

@@ -0,0 +1,33 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2016-05-13 20:01+0200\n"
"PO-Revision-Date: 2016-05-13 20:01+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.7\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: main.cpp:53
#, fuzzy
msgid "Show this help message"
msgstr "Zeige diesen Hilfstext"
#: main.cpp:54
msgid "<input file>"
msgstr ""
#: main.cpp:55
msgid "<output file>"
msgstr ""
#: main.cpp:56
msgid "<output POT catalog>"
msgstr ""

View File

@@ -0,0 +1,33 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2016-05-13 20:01+0200\n"
"PO-Revision-Date: 2016-05-13 20:01+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
#: main.cpp:53
msgid "Show this help message"
msgstr ""
#: main.cpp:54
msgid "<input file>"
msgstr ""
#: main.cpp:55
msgid "<output file>"
msgstr ""
#: main.cpp:56
msgid "<output POT catalog>"
msgstr ""

View File

@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: ZRColaCompile\n"
"POT-Creation-Date: 2016-04-13 18:11+0200\n"
"PO-Revision-Date: 2016-04-13 18:11+0200\n"
"POT-Creation-Date: 2016-05-13 20:00+0200\n"
"PO-Revision-Date: 2016-05-13 20:00+0200\n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
"Language: sl_SI\n"
@@ -10,25 +10,24 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: _\n"
"X-Poedit-SearchPath-0: .\n"
#: main.cpp:276
#: main.cpp:53
msgid "Show this help message"
msgstr "Pokaži to sporočilo pomoči"
#: main.cpp:277
#: main.cpp:54
msgid "<input file>"
msgstr "<vhodna datoteka>"
#: main.cpp:278
#: main.cpp:55
msgid "<output file>"
msgstr "<izhodna datoteka>"
#: main.cpp:279
#: main.cpp:56
msgid "<output POT catalog>"
msgstr "<izhodni katalog POT>"

View File

@@ -19,228 +19,8 @@
#include "stdafx.h"
///
/// Writes translation database to a stream
///
/// \param[in] stream Output stream
/// \param[in] db Translation database
///
/// \returns The stream \p stream
///
inline std::ostream& operator <<(std::ostream& stream, const ZRCola::translation_db &db)
{
assert(db.idxComp.size() == db.idxDecomp.size());
unsigned __int32 count;
// Write index count.
ZRCola::translation_db::indexComp::size_type trans_count = db.idxComp.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (trans_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)trans_count;
stream.write((const char*)&count, sizeof(count));
// Write composition index.
if (stream.fail()) return stream;
stream.write((const char*)db.idxComp.data(), sizeof(unsigned __int32)*count);
// Write decomposition index.
if (stream.fail()) return stream;
stream.write((const char*)db.idxDecomp.data(), sizeof(unsigned __int32)*count);
// Write data count.
std::vector<unsigned __int16>::size_type data_count = db.data.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (data_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)data_count;
stream.write((const char*)&count, sizeof(count));
// Write data.
if (stream.fail()) return stream;
stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count);
return stream;
}
///
/// Writes key sequence database to a stream
///
/// \param[in] stream Output stream
/// \param[in] db Key sequence database
///
/// \returns The stream \p stream
///
inline std::ostream& operator <<(std::ostream& stream, const ZRCola::keyseq_db &db)
{
assert(db.idxChr.size() == db.idxKey.size());
unsigned __int32 count;
// Write index count.
ZRCola::keyseq_db::indexChr::size_type ks_count = db.idxChr.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (ks_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)ks_count;
stream.write((const char*)&count, sizeof(count));
// Write character index.
if (stream.fail()) return stream;
stream.write((const char*)db.idxChr.data(), sizeof(unsigned __int32)*count);
// Write key index.
if (stream.fail()) return stream;
stream.write((const char*)db.idxKey.data(), sizeof(unsigned __int32)*count);
// Write data count.
std::vector<unsigned __int16>::size_type data_count = db.data.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (data_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)data_count;
stream.write((const char*)&count, sizeof(count));
// Write data.
if (stream.fail()) return stream;
stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count);
return stream;
}
///
/// Writes language database to a stream
///
/// \param[in] stream Output stream
/// \param[in] db Language database
///
/// \returns The stream \p stream
///
inline std::ostream& operator <<(std::ostream& stream, const ZRCola::language_db &db)
{
unsigned __int32 count;
// Write index count.
ZRCola::language_db::indexLang::size_type lang_count = db.idxLng.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (lang_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)lang_count;
stream.write((const char*)&count, sizeof(count));
// Write language index.
if (stream.fail()) return stream;
stream.write((const char*)db.idxLng.data(), sizeof(unsigned __int32)*count);
// Write data count.
std::vector<unsigned __int16>::size_type data_count = db.data.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (data_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)data_count;
stream.write((const char*)&count, sizeof(count));
// Write data.
if (stream.fail()) return stream;
stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count);
return stream;
}
///
/// Writes language character database to a stream
///
/// \param[in] stream Output stream
/// \param[in] db Language character database
///
/// \returns The stream \p stream
///
inline std::ostream& operator <<(std::ostream& stream, const ZRCola::langchar_db &db)
{
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
assert(db.idxChr.size() == db.idxLng.size());
#endif
unsigned __int32 count;
// Write index count.
ZRCola::langchar_db::indexChar::size_type lc_count = db.idxChr.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (lc_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)lc_count;
stream.write((const char*)&count, sizeof(count));
// Write character index.
if (stream.fail()) return stream;
stream.write((const char*)db.idxChr.data(), sizeof(unsigned __int32)*count);
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
// Write language index.
if (stream.fail()) return stream;
stream.write((const char*)db.idxLng.data(), sizeof(unsigned __int32)*count);
#endif
// Write data count.
std::vector<unsigned __int16>::size_type data_count = db.data.size();
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__)
// 4G check
if (data_count > 0xffffffff) {
stream.setstate(std::ios_base::failbit);
return stream;
}
#endif
if (stream.fail()) return stream;
count = (unsigned __int32)data_count;
stream.write((const char*)&count, sizeof(count));
// Write data.
if (stream.fail()) return stream;
stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count);
return stream;
}
using namespace std;
using namespace stdex;
///
@@ -310,7 +90,7 @@ int _tmain(int argc, _TCHAR *argv[])
}
const wxString& filenameOut = parser.GetParam(1);
std::fstream dst((LPCTSTR)filenameOut, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
fstream dst((LPCTSTR)filenameOut, ios_base::out | ios_base::trunc | ios_base::binary);
if (dst.fail()) {
_ftprintf(stderr, wxT("%s: error ZCC0002: Error opening output file.\n"), filenameOut.fn_str());
return 1;
@@ -320,10 +100,10 @@ int _tmain(int argc, _TCHAR *argv[])
// Set of strings to translate.
bool build_pot = parser.GetParamCount() > 2;
std::set<std::wstring> pot;
set<wstring> pot;
// Open file ID.
std::streamoff dst_start = stdex::idrec::open<ZRCola::recordid_t, ZRCola::recordsize_t>(dst, ZRCOLA_DB_ID);
streamoff dst_start = idrec::open<ZRCola::recordid_t, ZRCola::recordsize_t>(dst, ZRCOLA_DB_ID);
{
// Get translations.
@@ -348,10 +128,10 @@ int _tmain(int argc, _TCHAR *argv[])
db.data.push_back(trans.chr);
wxASSERT_MSG((int)0xffff8000 <= trans.rank && trans.rank <= (int)0x00007fff, wxT("transformation rank out of bounds"));
db.data.push_back((unsigned __int16)trans.rank);
std::wstring::size_type n = trans.str.length();
wstring::size_type n = trans.str.length();
wxASSERT_MSG(n <= 0xffff, wxT("transformation string too long"));
db.data.push_back((unsigned __int16)n);
for (std::wstring::size_type i = 0; i < n; i++)
for (wstring::size_type i = 0; i < n; i++)
db.data.push_back(trans.str[i]);
db.idxComp .push_back(idx);
db.idxDecomp.push_back(idx);
@@ -398,10 +178,10 @@ int _tmain(int argc, _TCHAR *argv[])
// Add key sequence to index and data.
unsigned __int32 idx = db.data.size();
db.data.push_back(ks.chr);
std::vector<ZRCola::DBSource::keyseq::keycode>::size_type n = ks.seq.size();
vector<ZRCola::DBSource::keyseq::keycode>::size_type n = ks.seq.size();
wxASSERT_MSG(n <= 0xffff, wxT("key sequence too long"));
db.data.push_back((unsigned __int16)n);
for (std::vector<ZRCola::DBSource::keyseq::keycode>::size_type i = 0; i < n; i++) {
for (vector<ZRCola::DBSource::keyseq::keycode>::size_type i = 0; i < n; i++) {
const ZRCola::DBSource::keyseq::keycode &kc = ks.seq[i];
db.data.push_back(kc.key);
db.data.push_back(
@@ -428,7 +208,7 @@ int _tmain(int argc, _TCHAR *argv[])
&ks2 = db.idxKey[i ];
if (ZRCola::keyseq_db::keyseq::CompareSequence(ks1.seq, ks1.seq_len, ks2.seq, ks2.seq_len) == 0) {
std::wstring seq_str;
wxString seq_str;
ZRCola::keyseq_db::GetSequenceAsText(ks1.seq, ks1.seq_len, seq_str);
_ftprintf(stderr, wxT("%s: warning ZCC0007: Duplicate key sequence (%ls => %04X or %04X). The keyboard behaviour will be unpredictable.\n"), (LPCTSTR)filenameIn.c_str(), seq_str.c_str(), ks1.chr, ks2.chr);
}
@@ -465,12 +245,12 @@ int _tmain(int argc, _TCHAR *argv[])
if (src.GetLanguage(rs, lang)) {
// Add language to index and data.
unsigned __int32 idx = db.data.size();
for (std::wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)lang.id)[i]);
std::wstring::size_type n = lang.name.length();
for (wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)lang.id.data)[i]);
wstring::size_type n = lang.name.length();
wxASSERT_MSG(n <= 0xffff, wxT("language name too long"));
db.data.push_back((unsigned __int16)n);
for (std::wstring::size_type i = 0; i < n; i++)
for (wstring::size_type i = 0; i < n; i++)
db.data.push_back(lang.name[i]);
db.idxLng.push_back(idx);
if (build_pot)
@@ -519,8 +299,8 @@ int _tmain(int argc, _TCHAR *argv[])
// Add language characters to index and data.
unsigned __int32 idx = db.data.size();
db.data.push_back(lc.chr);
for (std::wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)lc.lang)[i]);
for (wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)lc.lang.data)[i]);
db.idxChr.push_back(idx);
#ifdef ZRCOLA_LANGCHAR_LANG_IDX
db.idxLng.push_back(idx);
@@ -549,7 +329,205 @@ int _tmain(int argc, _TCHAR *argv[])
}
}
stdex::idrec::close<ZRCola::recordid_t, ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dst, dst_start);
{
// Get character groups.
ATL::CComPtr<ADORecordset> rs;
if (src.SelectCharacterGroups(rs)) {
size_t count = src.GetRecordsetCount(rs);
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
ZRCola::DBSource::chrgrp cg;
ZRCola::chrgrp_db db;
// Preallocate memory.
db.idxRnk.reserve(count);
db.data .reserve(count*4);
// Parse character groups and build index and data.
while (!ZRCola::DBSource::IsEOF(rs)) {
// Read character group from the database.
if (src.GetCharacterGroup(rs, cg)) {
// Add character group to index and data.
unsigned __int32 idx = db.data.size();
wxASSERT_MSG((int)0xffff8000 <= cg.id && cg.id <= (int)0x00007fff, wxT("character group ID out of bounds"));
db.data.push_back((unsigned __int16)cg.id);
wxASSERT_MSG((int)0xffff8000 <= cg.rank && cg.rank <= (int)0x00007fff, wxT("character group rank out of bounds"));
db.data.push_back((unsigned __int16)cg.rank);
wstring::size_type n_name = cg.name.length();
wxASSERT_MSG(n_name <= 0xffff, wxT("character group name too long"));
db.data.push_back((unsigned __int16)n_name);
wstring::size_type n_char = cg.chars.length();
wxASSERT_MSG(n_char <= 0xffff, wxT("too many character group characters"));
db.data.push_back((unsigned __int16)n_char);
for (wstring::size_type i = 0; i < n_name; i++)
db.data.push_back(cg.name[i]);
for (wstring::size_type i = 0; i < n_char; i++)
db.data.push_back(cg.chars[i]);
db.idxRnk.push_back(idx);
if (build_pot)
pot.insert(cg.name);
} else
has_errors = true;
wxVERIFY(SUCCEEDED(rs->MoveNext()));
}
// Sort indices.
db.idxRnk.sort();
// Write character groups to file.
dst << ZRCola::chrgrp_rec(db);
} else {
_ftprintf(stderr, wxT("%s: error ZCC0015: Error getting character group count from database or too many character groups.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0014: Error getting character groups from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
}
set<ZRCola::chrcatid_t> categories_used;
{
// Get characters.
ATL::CComPtr<ADORecordset> rs;
if (src.SelectCharacters(rs)) {
size_t count = src.GetRecordsetCount(rs);
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
ZRCola::DBSource::character_desc_idx idxChrDsc, idxChrDscSub;
ZRCola::DBSource::character_bank chrs;
// Phase 1: Parse characters and build indexes.
while (!ZRCola::DBSource::IsEOF(rs)) {
// Read character from the database.
unique_ptr<ZRCola::DBSource::character> c(new ZRCola::DBSource::character);
if (src.GetCharacter(rs, *c)) {
const ZRCola::DBSource::character &chr = *c.get();
chrs[chr.chr].swap(c);
} else
has_errors = true;
wxVERIFY(SUCCEEDED(rs->MoveNext()));
}
// Phase 2: Build related character lists.
chrs.build_related();
ZRCola::character_db db;
// Preallocate memory.
db.idxChr.reserve(count);
db.data .reserve(count*4);
// Phase 3: Parse characters and build index and data.
for (size_t i = 0, i_end = chrs.size(); i < i_end; i++) {
const ZRCola::DBSource::character &chr = *(chrs[i].get());
if (&chr == NULL) continue;
// Add character to index and data.
unsigned __int32 idx = db.data.size();
db.data.push_back((unsigned __int16)chr.chr);
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)chr.cat.data)[i]);
wstring::size_type n_desc = chr.desc.length();
wxASSERT_MSG(n_desc <= 0xffff, wxT("character description too long"));
db.data.push_back((unsigned __int16)n_desc);
wstring::size_type n_rel = chr.rel.length();
wxASSERT_MSG(n_rel <= 0xffff, wxT("too many related characters"));
db.data.push_back((unsigned __int16)n_rel);
for (wstring::size_type i = 0; i < n_desc; i++)
db.data.push_back(chr.desc[i]);
for (wstring::size_type i = 0; i < n_rel; i++)
db.data.push_back(chr.rel[i]);
db.idxChr.push_back(idx);
// Add description (and keywords) to index.
idxChrDsc .add_keywords(chr.terms, chr.chr, 0);
idxChrDscSub.add_keywords(chr.terms, chr.chr, 3);
// Mark category used.
categories_used.insert(chr.cat);
}
// Sort indices.
db.idxChr.sort();
// Save text indices.
idxChrDsc .save(db.idxDsc );
idxChrDscSub.save(db.idxDscSub);
// Write characters to file.
dst << ZRCola::character_rec(db);
} else {
_ftprintf(stderr, wxT("%s: error ZCC0017: Error getting character count from database or too many characters.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0016: Error getting characters from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
}
{
// Get character categories.
ATL::CComPtr<ADORecordset> rs;
if (src.SelectCharacterCategories(rs)) {
size_t count = src.GetRecordsetCount(rs);
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
ZRCola::DBSource::chrcat cc;
ZRCola::chrcat_db db;
// Preallocate memory.
db.idxChrCat.reserve(count);
db.idxRnk .reserve(count);
db.data .reserve(count*4);
// Parse character categories and build index and data.
while (!ZRCola::DBSource::IsEOF(rs)) {
// Read character category from the database.
if (src.GetCharacterCategory(rs, cc)) {
if (categories_used.find(cc.id) != categories_used.end()) {
// Add character category to index and data.
unsigned __int32 idx = db.data.size();
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
db.data.push_back(((const unsigned __int16*)cc.id.data)[i]);
wxASSERT_MSG((int)0xffff8000 <= cc.rank && cc.rank <= (int)0x00007fff, wxT("character category rank out of bounds"));
db.data.push_back((unsigned __int16)cc.rank);
wstring::size_type n_name = cc.name.length();
wxASSERT_MSG(n_name <= 0xffff, wxT("character category name too long"));
db.data.push_back((unsigned __int16)n_name);
for (wstring::size_type i = 0; i < n_name; i++)
db.data.push_back(cc.name[i]);
db.idxChrCat.push_back(idx);
db.idxRnk .push_back(idx);
if (build_pot)
pot.insert(cc.name);
} else
_ftprintf(stderr, wxT("%s: warning ZCC0019: Ommiting empty category %ls.\n"), (LPCTSTR)filenameIn.c_str(), (LPCWSTR)cc.name.c_str());
} else
has_errors = true;
wxVERIFY(SUCCEEDED(rs->MoveNext()));
}
// Sort indices.
db.idxChrCat.sort();
db.idxRnk .sort();
// Write character categories to file.
dst << ZRCola::chrcat_rec(db);
} else {
_ftprintf(stderr, wxT("%s: error ZCC0019: Error getting character category count from database or too many character categories.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
} else {
_ftprintf(stderr, wxT("%s: error ZCC0018: Error getting character categories from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
has_errors = true;
}
}
idrec::close<ZRCola::recordid_t, ZRCola::recordsize_t, ZRCOLA_RECORD_ALIGN>(dst, dst_start);
if (dst.fail()) {
_ftprintf(stderr, wxT("%s: error ZCC1000: Writing to output file failed.\n"), (LPCTSTR)filenameOut.c_str());
@@ -558,21 +536,21 @@ int _tmain(int argc, _TCHAR *argv[])
if (!has_errors && build_pot) {
const wxString& filenamePot = parser.GetParam(2);
std::fstream dst((LPCTSTR)filenamePot, std::ios_base::out | std::ios_base::trunc);
fstream dst((LPCTSTR)filenamePot, ios_base::out | ios_base::trunc);
if (dst.good()) {
dst << "msgid \"\"" << std::endl
<< "msgstr \"\"" << std::endl
<< "\"Project-Id-Version: ZRCola.zrcdb\\n\"" << std::endl
<< "\"Language: en\\n\"" << std::endl
<< "\"MIME-Version: 1.0\\n\"" << std::endl
<< "\"Content-Type: text/plain; charset=UTF-8\\n\"" << std::endl
<< "\"Content-Transfer-Encoding: 8bit\\n\"" << std::endl
<< "\"X-Generator: ZRColaCompile " << ZRCOLA_VERSION_STR << "\\n\"" << std::endl;
dst << "msgid \"\"" << endl
<< "msgstr \"\"" << endl
<< "\"Project-Id-Version: ZRCola.zrcdb\\n\"" << endl
<< "\"Language: en\\n\"" << endl
<< "\"MIME-Version: 1.0\\n\"" << endl
<< "\"Content-Type: text/plain; charset=UTF-8\\n\"" << endl
<< "\"Content-Transfer-Encoding: 8bit\\n\"" << endl
<< "\"X-Generator: ZRColaCompile " << ZRCOLA_VERSION_STR << "\\n\"" << endl;
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
for (std::set<std::wstring>::const_iterator i = pot.cbegin(); i != pot.cend(); ++i) {
wstring_convert<codecvt_utf8<wchar_t>> conv;
for (set<wstring>::const_iterator i = pot.cbegin(); i != pot.cend(); ++i) {
// Convert UTF-16 to UTF-8 and escape.
std::string t(conv.to_bytes(*i)), u;
string t(conv.to_bytes(*i)), u;
for (size_t i = 0, n = t.size(); i < n; i++) {
char c = t[i];
switch (c) {
@@ -583,9 +561,9 @@ int _tmain(int argc, _TCHAR *argv[])
default : u += c;
}
}
dst << std::endl
<< "msgid \"" << u << "\"" << std::endl
<< "msgstr \"\"" << std::endl;
dst << endl
<< "msgid \"" << u << "\"" << endl
<< "msgstr \"\"" << endl;
}
if (dst.fail()) {

View File

@@ -26,6 +26,7 @@
#include <zrcola/language.h>
#include <zrcola/translate.h>
#include <zrcolaui/chargroup.h>
#include <zrcolaui/keyboard.h>
#include <wx/app.h>
@@ -41,11 +42,16 @@
#include <initguid.h> // GUID helper to prevent LNK2001 errors (unresolved external symbol IID_IADO...)
#include <adoint.h>
#include <adoid.h>
#include <atlcomcli.h>
#include <tchar.h>
#include <stdlib.h>
#include <algorithm>
#include <codecvt>
#include <cwctype>
#include <fstream>
#include <memory>
#include <set>
#include <vector>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>..\output\$(Platform).$(Configuration)\</OutDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<CompileAsManaged>false</CompileAsManaged>
<BufferSecurityCheck>false</BufferSecurityCheck>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<SmallerTypeCheck>false</SmallerTypeCheck>
</ClCompile>
<Link>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRColaInstall.rc" />
</ItemGroup>
</Project>

Binary file not shown.

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{620D6AC0-C8FF-4185-B820-DB1503ACB95C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallDe</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="De";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="De";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRColaInstall.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{5BD95B95-38B0-4C7D-9471-F99CA1203DF4}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallEn</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="En";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="En";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRColaInstall.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2551B561-5E5B-497E-AE01-11519F91EF19}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallRu</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="Ru";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="Ru";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRColaInstall.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0C2C89C2-C96B-41B6-AA99-7E7741E20F3A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ZRColaInstallSl</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Debug.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\include\Win32.props" />
<Import Project="..\include\Release.props" />
<Import Project="ZRColaInstall.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="Sl";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZRCOLA_INSTALL_LANG="Sl";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZRColaInstall.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

97
ZRColaInstall/main.cpp Normal file
View File

@@ -0,0 +1,97 @@
/*
Copyright 2015-2016 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"
///
/// Main function
///
extern "C" void WinMainCRTStartup()
{
// Load "KERNEL32.DLL".
HMODULE hKernel32 = LoadLibrary(TEXT("KERNEL32.DLL"));
if (!hKernel32)
ExitProcess(1);
// Get IsWow64Process() address.
BOOL (WINAPI *_IsWow64Process)(__in HANDLE hProcess, __out PBOOL Wow64Process) = (BOOL(WINAPI*)(__in HANDLE, __out PBOOL))::GetProcAddress(hKernel32, "IsWow64Process");
BOOL bIs64Bit;
#ifndef _WIN64
// Determine if this is a 32-bit process under Windows-over-Windows64.
if (_IsWow64Process) {
// See what IsWow64Process() says.
if (!_IsWow64Process(::GetCurrentProcess(), &bIs64Bit)) {
// IsWow64Process() returned an error. Assume not 64-bit Windows.
bIs64Bit = FALSE;
}
} else {
// This platform does not have IsWow64Process(). Therefore, this is definitely not 64-bit Windows.
bIs64Bit = FALSE;
}
#else
// This is a running 64-bit process. The Windows must be 64 bit then.
bIs64Bit = TRUE;
#endif
FreeLibrary(hKernel32);
// Get temporary folder path.
static const LPTSTR pszTempFolderDefault = TEXT("");
LPTSTR pszTempFolder;
DWORD dwLength;
if ((dwLength = GetEnvironmentVariable(TEXT("TEMP"), NULL, 0)) != 0 &&
(pszTempFolder = (LPTSTR)LocalAlloc(LMEM_FIXED, (dwLength + 1)*sizeof(TCHAR))) != NULL) // +1 is for trailing backslash when missing!
{
dwLength = ::GetEnvironmentVariable(TEXT("TEMP"), pszTempFolder, dwLength);
if (pszTempFolder[dwLength - 1] != TEXT('\\')) {
// Append trailing backslash.
pszTempFolder[dwLength ] = TEXT('\\');
pszTempFolder[dwLength + 1] = 0;
}
} else
pszTempFolder = pszTempFolderDefault;
// Format msiexec's command line.
LPTSTR pszParams;
DWORD_PTR aArgs[] = {
(DWORD_PTR)TEXT(ZRCOLA_INSTALL_LANG),
(DWORD_PTR)(bIs64Bit ? TEXT("64") : TEXT("32")),
(DWORD_PTR)pszTempFolder,
};
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_FROM_STRING,
TEXT("/i \"http://www.amebis.si/prenos/ZRCola/_latest/ZRCola%1%2.msi\" /l* \"%3ZRCola%1%2.log\""),
0,
0,
(LPTSTR)&pszParams,
1,
(va_list*)aArgs);
// Launch installation.
int iResult = (int)ShellExecute(NULL, NULL, TEXT("msiexec.exe"), pszParams, NULL, SW_SHOWNORMAL) > 32;
// Clean up.
LocalFree(pszParams);
if (pszTempFolder != pszTempFolderDefault) LocalFree(pszTempFolder);
ExitProcess(iResult ? 0 : 2);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

File diff suppressed because one or more lines are too long

20
ZRColaInstall/stdafx.cpp Normal file
View File

@@ -0,0 +1,20 @@
/*
Copyright 2015-2016 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"

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