From 22be76bec565dba3268b8796274c06ff02c162b7 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 31 May 2016 14:54:15 +0200 Subject: [PATCH] New character request is now dialog based (closes #13) --- ZRCola/ZRCola.fbp | 653 +++++++++++++++++++++++++++++++++- ZRCola/ZRCola.vcxproj | 2 + ZRCola/ZRCola.vcxproj.filters | 6 + ZRCola/locale/ZRCola.pot | 72 +++- ZRCola/locale/de_DE.po | 56 ++- ZRCola/locale/ru_RU.po | 55 ++- ZRCola/locale/sl_SI.po | 66 +++- ZRCola/stdafx.h | 4 +- ZRCola/zrcolachrreq.cpp | 101 ++++++ ZRCola/zrcolachrreq.h | 65 ++++ ZRCola/zrcolafrm.cpp | 9 +- ZRCola/zrcolafrm.h | 2 + ZRCola/zrcolagui.cpp | 80 ++++- ZRCola/zrcolagui.h | 29 ++ ZRCola/zrcolakeyhndlr.h | 2 + lib/wxExtend | 2 +- output/locale/.gitignore | 2 +- 17 files changed, 1174 insertions(+), 32 deletions(-) create mode 100644 ZRCola/zrcolachrreq.cpp create mode 100644 ZRCola/zrcolachrreq.h diff --git a/ZRCola/ZRCola.fbp b/ZRCola/ZRCola.fbp index e2e07b2..346ea2b 100644 --- a/ZRCola/ZRCola.fbp +++ b/ZRCola/ZRCola.fbp @@ -5535,10 +5535,10 @@ 5 - wxEXPAND - 1 + wxALL|wxEXPAND + 0 - 10 + 0 protected 0 @@ -6130,5 +6130,652 @@ + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + wxZRColaCharRequestBase + + + wxDEFAULT_DIALOG_STYLE + + Request a New Character + + + ZRColaCharRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerContent + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 40 + + wxID_ANY + Character + + sbSizerCharacter + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Enter the &character you would like to request: + + 0 + + + 0 + + 1 + m_characterLbl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + 400 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + 00 ZRCola,90,90,20,70,0 + 0 + 0 + wxID_ANY + + 0 + + 20 + + 0 + + 1 + m_character + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Decomposed character to request + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Please, use the decomposed form. You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste it from the Decomposed window. + + 0 + + + 0 + + 1 + m_characterNote + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + 400 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 60 + + wxID_ANY + Context + + sbSizerContext + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + The &context, examples or short description why and where the character is required: + + 0 + + + 0 + + 1 + m_contextLbl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + 400 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + 00 ZRCola,90,90,16,70,0 + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_context + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_MULTILINE + + 0 + Additional notes for character request + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor. Your e-mail application might not display all the characters correctly, but we'll encode the necessarry information so the Editor will be able to read it correctly. + + 0 + + + 0 + + 1 + m_note + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + 400 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + protected + 0 + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizerButtons + protected + + + + + + OnOKButtonClick + + + + + + diff --git a/ZRCola/ZRCola.vcxproj b/ZRCola/ZRCola.vcxproj index ab326ef..fa63ddb 100644 --- a/ZRCola/ZRCola.vcxproj +++ b/ZRCola/ZRCola.vcxproj @@ -84,6 +84,7 @@ + @@ -98,6 +99,7 @@ + diff --git a/ZRCola/ZRCola.vcxproj.filters b/ZRCola/ZRCola.vcxproj.filters index 1e259b0..a37ca06 100644 --- a/ZRCola/ZRCola.vcxproj.filters +++ b/ZRCola/ZRCola.vcxproj.filters @@ -55,6 +55,9 @@ Source Files + + Source Files + @@ -93,6 +96,9 @@ Header Files + + Header Files + diff --git a/ZRCola/locale/ZRCola.pot b/ZRCola/locale/ZRCola.pot index 1814a9f..8115ff3 100644 --- a/ZRCola/locale/ZRCola.pot +++ b/ZRCola/locale/ZRCola.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: ZRCola\n" -"POT-Creation-Date: 2016-05-31 08:45+0200\n" +"POT-Creation-Date: 2016-05-31 14:24+0200\n" "PO-Revision-Date: 2016-05-13 15:52+0200\n" "Last-Translator: Simon Rozman \n" "Language-Team: Amebis, d. o. o., Kamnik \n" @@ -32,6 +32,11 @@ msgstr "© 2004-%s ZRC SAZU" msgid "ZRCola" msgstr "ZRCola" +#: zrcolachrreq.cpp:49 zrcolagui.h:353 +#, fuzzy +msgid "Request a New Character" +msgstr "Zahtevaj nov znak" + #: zrcolafrm.cpp:104 #, fuzzy msgid "" @@ -55,11 +60,6 @@ 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" @@ -477,17 +477,25 @@ msgid "www.zrc-sazu.si" msgstr "www.zrc-sazu.si" #: zrcolagui.cpp:855 +#, 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:" #: zrcolagui.cpp:859 +#, fuzzy 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 #, fuzzy @@ -504,6 +512,58 @@ msgstr "&Posodobi" msgid "&Close" msgstr "&Zapri" +#: zrcolagui.cpp:953 +#, fuzzy +msgid "Character" +msgstr "Znak" + +#: zrcolagui.cpp:955 +#, fuzzy +msgid "Enter the &character you would like to request:" +msgstr "Vpišite &znak, ki ga želite zahtevati:" + +#: zrcolagui.cpp:961 +#, fuzzy +msgid "Decomposed character to request" +msgstr "Razstavljen znak, ki ga zahtevate" + +#: zrcolagui.cpp:965 +#, fuzzy +msgid "" +"Please, use the decomposed form.\n" +"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste " +"it from the Decomposed window." +msgstr "" +"Uporabite razstavljeno obliko.\n" +"Za vnos znaka lahko uporavite ZRColine bližnjice na tipkovnici ali kopirate " +"in prilepite iz okna z razstavljenim besedilom." + +#: zrcolagui.cpp:973 +#, fuzzy +msgid "Context" +msgstr "Kontekst" + +#: zrcolagui.cpp:975 +#, fuzzy +msgid "" +"The &context, examples or short description why and where the character is " +"required:" +msgstr "&Kontekst, primeri oz. kratek opis zakaj in kje potrebujete novi znak:" + +#: zrcolagui.cpp:981 +#, fuzzy +msgid "Additional notes for character request" +msgstr "Dodatne opombe za zahtevo znaka" + +#: zrcolagui.cpp:988 +msgid "" +"After clicking OK button, your e-mail application should open allowing you " +"to submit the new character request to ZRCola Editor.\n" +"Your e-mail application might not display all the characters correctly, but " +"we'll encode the necessarry information so the Editor will be able to read " +"it correctly." +msgstr "" + #: zrcolakeyhndlr.cpp:44 #, fuzzy msgid "" diff --git a/ZRCola/locale/de_DE.po b/ZRCola/locale/de_DE.po index 76b30e0..7e4cf08 100644 --- a/ZRCola/locale/de_DE.po +++ b/ZRCola/locale/de_DE.po @@ -1,8 +1,8 @@ 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" +"POT-Creation-Date: 2016-05-31 14:26+0200\n" +"PO-Revision-Date: 2016-05-31 14:26+0200\n" "Last-Translator: Simon Rozman \n" "Language-Team: Amebis, d. o. o., Kamnik \n" "Language: de_DE\n" @@ -29,6 +29,10 @@ msgstr "" msgid "ZRCola" msgstr "ZRCola:." +#: zrcolachrreq.cpp:49 zrcolagui.h:353 +msgid "Request a New Character" +msgstr "" + #: zrcolafrm.cpp:104 msgid "" "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality " @@ -46,10 +50,6 @@ msgid "" "will not be available." msgstr "" -#: zrcolafrm.cpp:341 -msgid "http://zrcola-2.amebis.si/en/contact/" -msgstr "" - #: zrcolagui.cpp:36 msgid "E&xit" msgstr "" @@ -429,6 +429,50 @@ msgstr "Kann Benutzer-Konfigurationsdatei nicht aktualisieren." msgid "&Close" msgstr "&Schließen" +#: zrcolagui.cpp:953 +#, fuzzy +msgid "Character" +msgstr "Eingabe eines Zeichenstils" + +#: zrcolagui.cpp:955 +msgid "Enter the &character you would like to request:" +msgstr "" + +#: zrcolagui.cpp:961 +msgid "Decomposed character to request" +msgstr "" + +#: zrcolagui.cpp:965 +msgid "" +"Please, use the decomposed form.\n" +"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste " +"it from the Decomposed window." +msgstr "" + +#: zrcolagui.cpp:973 +#, fuzzy +msgid "Context" +msgstr "Konnte den Kontext auf dem überlagerten Fenster nicht initialisieren." + +#: zrcolagui.cpp:975 +msgid "" +"The &context, examples or short description why and where the character is " +"required:" +msgstr "" + +#: zrcolagui.cpp:981 +msgid "Additional notes for character request" +msgstr "" + +#: zrcolagui.cpp:988 +msgid "" +"After clicking OK button, your e-mail application should open allowing you " +"to submit the new character request to ZRCola Editor.\n" +"Your e-mail application might not display all the characters correctly, but " +"we'll encode the necessarry information so the Editor will be able to read " +"it correctly." +msgstr "" + #: zrcolakeyhndlr.cpp:44 msgid "" "INS key is pressed. Type the Unicode code of desired character now (up to " diff --git a/ZRCola/locale/ru_RU.po b/ZRCola/locale/ru_RU.po index 0de73f7..0a4a6ce 100644 --- a/ZRCola/locale/ru_RU.po +++ b/ZRCola/locale/ru_RU.po @@ -1,8 +1,8 @@ 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" +"POT-Creation-Date: 2016-05-31 14:26+0200\n" +"PO-Revision-Date: 2016-05-31 14:26+0200\n" "Last-Translator: Simon Rozman \n" "Language-Team: Amebis, d. o. o., Kamnik \n" "Language: ru_RU\n" @@ -30,6 +30,10 @@ msgstr "" msgid "ZRCola" msgstr "ZRCola:." +#: zrcolachrreq.cpp:49 zrcolagui.h:353 +msgid "Request a New Character" +msgstr "" + #: zrcolafrm.cpp:104 msgid "" "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality " @@ -46,10 +50,6 @@ msgid "" "will not be available." msgstr "" -#: zrcolafrm.cpp:341 -msgid "http://zrcola-2.amebis.si/en/contact/" -msgstr "" - #: zrcolagui.cpp:36 msgid "E&xit" msgstr "" @@ -405,6 +405,49 @@ msgstr "" msgid "&Close" msgstr "" +#: zrcolagui.cpp:953 +#, fuzzy +msgid "Character" +msgstr "Skupine &znakov" + +#: zrcolagui.cpp:955 +msgid "Enter the &character you would like to request:" +msgstr "" + +#: zrcolagui.cpp:961 +msgid "Decomposed character to request" +msgstr "" + +#: zrcolagui.cpp:965 +msgid "" +"Please, use the decomposed form.\n" +"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste " +"it from the Decomposed window." +msgstr "" + +#: zrcolagui.cpp:973 +msgid "Context" +msgstr "" + +#: zrcolagui.cpp:975 +msgid "" +"The &context, examples or short description why and where the character is " +"required:" +msgstr "" + +#: zrcolagui.cpp:981 +msgid "Additional notes for character request" +msgstr "" + +#: zrcolagui.cpp:988 +msgid "" +"After clicking OK button, your e-mail application should open allowing you " +"to submit the new character request to ZRCola Editor.\n" +"Your e-mail application might not display all the characters correctly, but " +"we'll encode the necessarry information so the Editor will be able to read " +"it correctly." +msgstr "" + #: zrcolakeyhndlr.cpp:44 msgid "" "INS key is pressed. Type the Unicode code of desired character now (up to " diff --git a/ZRCola/locale/sl_SI.po b/ZRCola/locale/sl_SI.po index 10e6de9..96f014b 100644 --- a/ZRCola/locale/sl_SI.po +++ b/ZRCola/locale/sl_SI.po @@ -1,8 +1,8 @@ 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" +"POT-Creation-Date: 2016-05-31 14:24+0200\n" +"PO-Revision-Date: 2016-05-31 14:26+0200\n" "Last-Translator: Simon Rozman \n" "Language-Team: Amebis, d. o. o., Kamnik \n" "Language: sl_SI\n" @@ -29,6 +29,10 @@ msgstr "© 2004-%s ZRC SAZU" msgid "ZRCola" msgstr "ZRCola" +#: zrcolachrreq.cpp:49 zrcolagui.h:353 +msgid "Request a New Character" +msgstr "Zahtevaj nov znak" + #: zrcolafrm.cpp:104 msgid "" "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality " @@ -49,10 +53,6 @@ msgstr "" "ZRColine bližnjice na tipkovnici Win+F6 ni mogoče registrirati. Nekaj " "funkcionalnosti ne bo na voljo." -#: zrcolafrm.cpp:341 -msgid "http://zrcola-2.amebis.si/en/contact/" -msgstr "http://zrcola-2.amebis.si/contact/" - #: zrcolagui.cpp:36 msgid "E&xit" msgstr "I&zhod" @@ -421,6 +421,57 @@ msgstr "&Posodobi" msgid "&Close" msgstr "&Zapri" +#: zrcolagui.cpp:953 +msgid "Character" +msgstr "Znak" + +#: zrcolagui.cpp:955 +msgid "Enter the &character you would like to request:" +msgstr "Vpišite &znak, ki ga želite zahtevati:" + +#: zrcolagui.cpp:961 +msgid "Decomposed character to request" +msgstr "Razstavljen znak, ki ga zahtevate" + +# Please use a double && for final "&" character +#: zrcolagui.cpp:965 +msgid "" +"Please, use the decomposed form.\n" +"You can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste " +"it from the Decomposed window." +msgstr "" +"Uporabite razstavljeno obliko.\n" +"Za vnos znaka lahko uporavite ZRColine bližnjice na tipkovnici ali kopirate " +"in prilepite iz okna z razstavljenim besedilom." + +#: zrcolagui.cpp:973 +msgid "Context" +msgstr "Kontekst" + +#: zrcolagui.cpp:975 +msgid "" +"The &context, examples or short description why and where the character is " +"required:" +msgstr "&Kontekst, primeri oz. kratek opis zakaj in kje potrebujete novi znak:" + +#: zrcolagui.cpp:981 +msgid "Additional notes for character request" +msgstr "Dodatne opombe za zahtevo znaka" + +#: zrcolagui.cpp:988 +msgid "" +"After clicking OK button, your e-mail application should open allowing you " +"to submit the new character request to ZRCola Editor.\n" +"Your e-mail application might not display all the characters correctly, but " +"we'll encode the necessarry information so the Editor will be able to read " +"it correctly." +msgstr "" +"Ko boste kliknili gumb V redu, se bo odprl vaš program za e-pošto, s katerim " +"boste lahko oddali zahtevo za novi znak uredniku ZRCole.\n" +"Vaš e-poštni program mogoče ne bo prikazal vseh znakov pravilno, toda mi " +"bomo vse potrebne podatke ustrezno kodirali, da jih bo urednik lahko " +"pravilno prebral." + #: zrcolakeyhndlr.cpp:44 msgid "" "INS key is pressed. Type the Unicode code of desired character now (up to " @@ -708,6 +759,9 @@ msgstr "Vnašalni sistem za jezikoslovno rabo" #~ msgid "Welcome to wxWidgets!" #~ msgstr "Dobrodošli v wxWidgets!" +#~ msgid "http://zrcola-2.amebis.si/en/contact/" +#~ msgstr "http://zrcola-2.amebis.si/contact/" + #~ msgid "" #~ "ZRCola v%s\n" #~ "Copyright 2015-%s Amebis" diff --git a/ZRCola/stdafx.h b/ZRCola/stdafx.h index a817c2d..e79f933 100644 --- a/ZRCola/stdafx.h +++ b/ZRCola/stdafx.h @@ -22,8 +22,9 @@ #include "../include/zrcola.h" #include "zrcolaabout.h" #include "zrcolaapp.h" -#include "zrcolachrgrid.h" #include "zrcolachrcatpnl.h" +#include "zrcolachrgrid.h" +#include "zrcolachrreq.h" #include "zrcolacomppnl.h" #include "zrcolafrm.h" #include "zrcolakeyhndlr.h" @@ -33,6 +34,7 @@ #include #include +#include #include #include diff --git a/ZRCola/zrcolachrreq.cpp b/ZRCola/zrcolachrreq.cpp new file mode 100644 index 0000000..5e7259e --- /dev/null +++ b/ZRCola/zrcolachrreq.cpp @@ -0,0 +1,101 @@ +/* + 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 . +*/ + +#include "stdafx.h" + + +////////////////////////////////////////////////////////////////////////// +// wxZRColaCharRequest +////////////////////////////////////////////////////////////////////////// + +wxZRColaCharRequest::wxZRColaCharRequest(wxWindow* parent) : wxZRColaCharRequestBase(parent) +{ + m_character->PushEventHandler(new wxZRColaKeyHandler()); + m_context->PushEventHandler(new wxZRColaKeyHandler()); +} + + +wxZRColaCharRequest::~wxZRColaCharRequest() +{ + m_context->PopEventHandler(true); + m_character->PopEventHandler(true); +} + + +void wxZRColaCharRequest::OnOKButtonClick(wxCommandEvent& event) +{ + event.Skip(); + + const wxString chr = m_character->GetValue(); + const wxString ctx = m_context->GetValue(); + wxString body; + + body += _("Character") + wxT(": "); + for (size_t i = 0, i_end = chr.Length(); i < i_end; i++) { + if (chr[i] < 0x7f) + body += chr[i]; + else + body += wxString::Format(wxT("(U+%04X)"), chr[i]); + } + body += wxT('\n'); + if (!ctx.IsEmpty()) { + body += _("Context") + wxT(": "); + body += ctx; + body += wxT('\n'); + } + + wxLaunchDefaultBrowser(wxString::Format(wxT("mailto:janos.jezovnik@zrc-sazu.si&subject=%s&body=%s"), + wxURLEncode(wxString((wxString(wxT("[ZRCola] ")) + _("Request a New Character")).ToUTF8())), + wxURLEncode(body.ToUTF8()) + )); +} + + +////////////////////////////////////////////////////////////////////////// +// wxPersistentZRColaCharRequest +////////////////////////////////////////////////////////////////////////// + +wxPersistentZRColaCharRequest::wxPersistentZRColaCharRequest(wxZRColaCharRequest *wnd) : wxPersistentDialog(wnd) +{ +} + + +void wxPersistentZRColaCharRequest::Save() const +{ + wxPersistentDialog::Save(); + + const wxZRColaCharRequest * const wnd = static_cast(GetWindow()); + + SaveValue(wxT("character"), wnd->m_character->GetValue()); + SaveValue(wxT("context"), wnd->m_context->GetValue()); +} + + +bool wxPersistentZRColaCharRequest::Restore() +{ + wxZRColaCharRequest * const wnd = static_cast(GetWindow()); + + wxString str; + if (RestoreValue(wxT("character"), &str)) + wnd->m_character->SetValue(str); + if (RestoreValue(wxT("context"), &str)) + wnd->m_context->SetValue(str); + + return wxPersistentDialog::Restore(); +} diff --git a/ZRCola/zrcolachrreq.h b/ZRCola/zrcolachrreq.h new file mode 100644 index 0000000..f23d4ed --- /dev/null +++ b/ZRCola/zrcolachrreq.h @@ -0,0 +1,65 @@ +/* + 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 . +*/ + +/// +/// Forward declarations +/// +class wxZRColaCharRequest; + + +#pragma once + +#include "zrcolagui.h" +#include "zrcolakeyhndlr.h" + + +/// +/// ZRCola New Character Request dialog +/// +class wxZRColaCharRequest : public wxZRColaCharRequestBase +{ +public: + wxZRColaCharRequest(wxWindow* parent); + virtual ~wxZRColaCharRequest(); + + friend class wxPersistentZRColaCharRequest; // Allow saving/restoring window state. + +protected: + virtual void OnOKButtonClick(wxCommandEvent& event); +}; + + + +/// +/// Supports saving/restoring wxZRColaCharRequest state +/// +class wxPersistentZRColaCharRequest : public wxPersistentDialog +{ +public: + wxPersistentZRColaCharRequest(wxZRColaCharRequest *wnd); + + virtual void Save() const; + virtual bool Restore(); +}; + + +inline wxPersistentObject *wxCreatePersistentObject(wxZRColaCharRequest *wnd) +{ + return new wxPersistentZRColaCharRequest(wnd); +} diff --git a/ZRCola/zrcolafrm.cpp b/ZRCola/zrcolafrm.cpp index f4c5426..c008ca6 100644 --- a/ZRCola/zrcolafrm.cpp +++ b/ZRCola/zrcolafrm.cpp @@ -59,6 +59,7 @@ wxZRColaFrame::wxZRColaFrame() : m_hWndSource(NULL), m_chrSelect(NULL), m_settings(NULL), + m_chrReq(NULL), wxZRColaFrameBase(NULL) { { @@ -96,6 +97,9 @@ wxZRColaFrame::wxZRColaFrame() : m_chrSelect = new wxZRColaCharSelect(this); wxPersistentRegisterAndRestore(m_chrSelect); + m_chrReq = new wxZRColaCharRequest(this); + wxPersistentRegisterAndRestore(m_chrReq); + // Set focus. m_panel->m_decomposed->SetFocus(); @@ -150,6 +154,9 @@ wxZRColaFrame::~wxZRColaFrame() UnregisterHotKey(wxZRColaHKID_INVOKE_DECOMPOSE); UnregisterHotKey(wxZRColaHKID_INVOKE_COMPOSE); + if (m_chrReq) + delete m_chrReq; + if (m_chrSelect) delete m_chrSelect; @@ -338,7 +345,7 @@ void wxZRColaFrame::OnPanelCharacterCatalogFocus(wxCommandEvent& event) void wxZRColaFrame::OnHelpReqChar(wxCommandEvent& event) { - wxLaunchDefaultBrowser(_("http://zrcola-2.amebis.si/en/contact/")); + m_chrReq->ShowModal(); } diff --git a/ZRCola/zrcolafrm.h b/ZRCola/zrcolafrm.h index 6f60edb..23fe89a 100644 --- a/ZRCola/zrcolafrm.h +++ b/ZRCola/zrcolafrm.h @@ -27,6 +27,7 @@ class wxZRColaFrame; #include "zrcolagui.h" #include "zrcolachrslct.h" +#include "zrcolachrreq.h" #include "zrcolasettings.h" #include #include @@ -118,6 +119,7 @@ protected: 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 + wxZRColaCharRequest *m_chrReq; ///< Request a New Character dialog wxZRColaSettings *m_settings; ///< Configuration dialog }; diff --git a/ZRCola/zrcolagui.cpp b/ZRCola/zrcolagui.cpp index 87ba069..ddec1f0 100644 --- a/ZRCola/zrcolagui.cpp +++ b/ZRCola/zrcolagui.cpp @@ -850,7 +850,7 @@ wxZRColaAboutBase::wxZRColaAboutBase( wxWindow* parent, wxWindowID id, const wxS bSizerText->Add( m_hyperlink, 0, wxALL|wxEXPAND, 5 ); - bSizerText->Add( 0, 10, 1, wxEXPAND, 5 ); + bSizerText->Add( 0, 0, 0, wxALL|wxEXPAND, 5 ); m_staticTextDeclaration = new wxStaticText( this, wxID_ANY, _("Texts made using ZRCola have to include in the colophon, foreword, footnote or some other appropriate part of the publication the note below:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDeclaration->Wrap( 400 ); @@ -941,3 +941,81 @@ wxZRColaUpdaterBase::~wxZRColaUpdaterBase() m_buttonUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaUpdaterBase::OnUpdate ), NULL, this ); } + +wxZRColaCharRequestBase::wxZRColaCharRequestBase( 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* sbSizerCharacter; + sbSizerCharacter = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Character") ), wxVERTICAL ); + + m_characterLbl = new wxStaticText( sbSizerCharacter->GetStaticBox(), wxID_ANY, _("Enter the &character you would like to request:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_characterLbl->Wrap( 400 ); + sbSizerCharacter->Add( m_characterLbl, 0, wxALL|wxEXPAND, 5 ); + + m_character = new wxTextCtrl( sbSizerCharacter->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_character->SetMaxLength( 20 ); + m_character->SetFont( wxFont( 20, 70, 90, 90, false, wxT("00 ZRCola") ) ); + m_character->SetToolTip( _("Decomposed character to request") ); + + sbSizerCharacter->Add( m_character, 0, wxALL|wxEXPAND, 5 ); + + m_characterNote = new wxStaticText( sbSizerCharacter->GetStaticBox(), wxID_ANY, _("Please, use the decomposed form.\nYou can use ZRCola keyboard shortcuts to enter the character or Copy&&Paste it from the Decomposed window."), wxDefaultPosition, wxDefaultSize, 0 ); + m_characterNote->Wrap( 400 ); + sbSizerCharacter->Add( m_characterNote, 0, wxALL|wxEXPAND, 5 ); + + + bSizerContent->Add( sbSizerCharacter, 40, wxALL|wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizerContext; + sbSizerContext = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Context") ), wxVERTICAL ); + + m_contextLbl = new wxStaticText( sbSizerContext->GetStaticBox(), wxID_ANY, _("The &context, examples or short description why and where the character is required:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_contextLbl->Wrap( 400 ); + sbSizerContext->Add( m_contextLbl, 0, wxALL|wxEXPAND, 5 ); + + m_context = new wxTextCtrl( sbSizerContext->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); + m_context->SetFont( wxFont( 16, 70, 90, 90, false, wxT("00 ZRCola") ) ); + m_context->SetToolTip( _("Additional notes for character request") ); + + sbSizerContext->Add( m_context, 1, wxALL|wxEXPAND, 5 ); + + + bSizerContent->Add( sbSizerContext, 60, wxALL|wxEXPAND, 5 ); + + m_note = new wxStaticText( this, wxID_ANY, _("After clicking OK button, your e-mail application should open allowing you to submit the new character request to ZRCola Editor.\nYour e-mail application might not display all the characters correctly, but we'll encode the necessarry information so the Editor will be able to read it correctly."), wxDefaultPosition, wxDefaultSize, 0 ); + m_note->Wrap( 400 ); + bSizerContent->Add( m_note, 0, 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_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 + m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaCharRequestBase::OnOKButtonClick ), NULL, this ); +} + +wxZRColaCharRequestBase::~wxZRColaCharRequestBase() +{ + // Disconnect Events + m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( wxZRColaCharRequestBase::OnOKButtonClick ), NULL, this ); + +} diff --git a/ZRCola/zrcolagui.h b/ZRCola/zrcolagui.h index 3cea586..26c20e4 100644 --- a/ZRCola/zrcolagui.h +++ b/ZRCola/zrcolagui.h @@ -326,4 +326,33 @@ class wxZRColaUpdaterBase : public wxDialog }; +/////////////////////////////////////////////////////////////////////////////// +/// Class wxZRColaCharRequestBase +/////////////////////////////////////////////////////////////////////////////// +class wxZRColaCharRequestBase : public wxDialog +{ + private: + + protected: + wxStaticText* m_characterLbl; + wxTextCtrl* m_character; + wxStaticText* m_characterNote; + wxStaticText* m_contextLbl; + wxTextCtrl* m_context; + wxStaticText* m_note; + wxStdDialogButtonSizer* m_sdbSizerButtons; + wxButton* m_sdbSizerButtonsOK; + wxButton* m_sdbSizerButtonsCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + wxZRColaCharRequestBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Request a New Character"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("ZRColaCharRequest") ); + ~wxZRColaCharRequestBase(); + +}; + #endif //__ZRCOLAGUI_H__ diff --git a/ZRCola/zrcolakeyhndlr.h b/ZRCola/zrcolakeyhndlr.h index 7b8347b..1781a2a 100644 --- a/ZRCola/zrcolakeyhndlr.h +++ b/ZRCola/zrcolakeyhndlr.h @@ -25,6 +25,8 @@ class wxZRColaKeyHandler; #pragma once +#include + #include #include diff --git a/lib/wxExtend b/lib/wxExtend index e25bce4..c21aa27 160000 --- a/lib/wxExtend +++ b/lib/wxExtend @@ -1 +1 @@ -Subproject commit e25bce487b192b3c19d08247fbeb0817beb7ccc9 +Subproject commit c21aa27e623ba9b8e5b3cabbae1f3593154e433f diff --git a/output/locale/.gitignore b/output/locale/.gitignore index b63bd1b..bd6f355 100644 --- a/output/locale/.gitignore +++ b/output/locale/.gitignore @@ -1,5 +1,5 @@ */libZRColaUI.mo -*/wxExtend12.mo +*/wxExtend13.mo */Updater10.mo */ZRCola.mo */ZRColaCompile.mo