summaryrefslogtreecommitdiff
path: root/support/dktools/WxpqdicFrame.wxc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
committerNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
commit1f457376b478257b88d4a857f5ec1b6155442dd7 (patch)
tree2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/WxpqdicFrame.wxc
parentac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff)
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/WxpqdicFrame.wxc')
-rw-r--r--support/dktools/WxpqdicFrame.wxc71
1 files changed, 53 insertions, 18 deletions
diff --git a/support/dktools/WxpqdicFrame.wxc b/support/dktools/WxpqdicFrame.wxc
index 9b28dae9ab..6597bcb7cf 100644
--- a/support/dktools/WxpqdicFrame.wxc
+++ b/support/dktools/WxpqdicFrame.wxc
@@ -4,7 +4,7 @@ copyright owner = Dirk Krause
copyright year = 2016-xxxx
-license = bsd
+SPDX-License-Identifier: BSD-3-Clause
@@ -140,7 +140,11 @@ class WxpqdicFrame : public Dk4WxFrame
/** Event table for frame.
*/
+#if wxCHECK_VERSION(3,0,0)
+ wxDECLARE_EVENT_TABLE();
+#else
DECLARE_EVENT_TABLE()
+#endif
protected:
@@ -413,6 +417,14 @@ class WxpqdicFrame : public Dk4WxFrame
%% module start
+#include "dk4conf.h"
+
+#ifndef DK4_SIZEOF_WXCHAR
+#ifndef DK4WXCS_H_INCLUDED
+#include "dk4wxcs.h"
+#endif
+#endif
+
#include "wxpqdic.h"
#include "dk4user.h"
#include "dk4enc.h"
@@ -429,13 +441,13 @@ class WxpqdicFrame : public Dk4WxFrame
#include "dk4numco.h"
-#include "exit-program.xpm"
-#include "run-conversion.xpm"
+#include "gui-img/shared/toolbar/exit-program.xpm"
+#include "gui-img/shared/toolbar/run-conversion.xpm"
#include "dk4verswx.h"
#if !defined(__WXMSW__)
-#include "dkicon.xpm"
+#include "gui-img/icons/dkicon.xpm"
#endif
@@ -446,14 +458,23 @@ $!trace-include
/* __CHANGE__ 017: Add further events. */
/* __CHANGE__ 008: Remove OnIdle if no idle processing required. */
-BEGIN_EVENT_TABLE(WxpqdicFrame, wxFrame)
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(WxpqdicFrame,wxFrame)
+#else
+BEGIN_EVENT_TABLE(WxpqdicFrame,wxFrame)
+#endif
EVT_MENU(WxpqdicFrame_View_Update, WxpqdicFrame::OnRun)
EVT_MENU(WxpqdicFrame_Quit, WxpqdicFrame::OnQuit)
EVT_MENU(WxpqdicFrame_Help_About, WxpqdicFrame::OnAbout)
EVT_MENU(WxpqdicFrame_Help_Contents, WxpqdicFrame::OnHelpContents)
EVT_TIMER(WxpqdicFrame_Timer, WxpqdicFrame::OnTimer)
EVT_IDLE(WxpqdicFrame::OnIdle)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -461,6 +482,11 @@ static const wxChar versionNumber[] = { DKT_VERSION_WX };
+#if __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
static const wxCmdLineEntryDesc wxpqdic_cmd_line_entries[] = {
{
wxCMD_LINE_OPTION,
@@ -521,6 +547,9 @@ static const wxCmdLineEntryDesc wxpqdic_cmd_line_entries[] = {
{ wxCMD_LINE_NONE }
};
+#if __GNUC__
+#pragma GCC diagnostic pop
+#endif
/** Key names for preferences.
@@ -644,7 +673,7 @@ WxpqdicFrame::~WxpqdicFrame()
bool
-WxpqdicFrame::CanClose(bool isLast)
+WxpqdicFrame::CanClose(bool WXUNUSED(isLast))
{
bool back = true;
@@ -653,7 +682,7 @@ WxpqdicFrame::CanClose(bool isLast)
void
-WxpqdicFrame::OnQuit(wxCommandEvent & event)
+WxpqdicFrame::OnQuit(wxCommandEvent & WXUNUSED(event))
{
{
wxCriticalSectionLocker lockCsProtect(csProtect);
@@ -678,7 +707,7 @@ WxpqdicFrame::OnQuit(wxCommandEvent & event)
void
-WxpqdicFrame::OnAbout(wxCommandEvent & event)
+WxpqdicFrame::OnAbout(wxCommandEvent & WXUNUSED(event))
{
wxString text(wxT(""));
wxString title(wxT(""));
@@ -727,7 +756,7 @@ WxpqdicFrame::OnAbout(wxCommandEvent & event)
void
-WxpqdicFrame::OnHelpContents(wxCommandEvent & event)
+WxpqdicFrame::OnHelpContents(wxCommandEvent & WXUNUSED(event))
{
DisplayContents();
}
@@ -742,11 +771,14 @@ WxpqdicFrame::OnHelpContents(wxCommandEvent & event)
bool
WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
{
-
+ wxString dummy(wxT(""));
dkChar buf[1024];
char c8b[1024];
dk4_er_t er;
wxChar *pv[] = { NULL, NULL, NULL, NULL, NULL, NULL };
+ wxCStrData hnstrdata = dummy.c_str();
+ wxCStrData qnstrdata = dummy.c_str();
+ wxCStrData unstrdata = dummy.c_str();
const wxChar *cptr;
const size_t szbuf = DK4_SIZEOF(buf,dkChar);
const size_t szc8b = sizeof(c8b);
@@ -798,7 +830,8 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
dk4error_init(&er);
cptr = NULL;
if (parser.Found(wxT_2("h"), &sHostname)) {
- cptr = sHostname.c_str();
+ hnstrdata = sHostname.c_str();
+ cptr = (wxChar const *)hnstrdata;
}
else {
cptr = pv[0];
@@ -827,14 +860,15 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
*/
cptr = NULL;
if (parser.Found(wxT_2("q"), &sQueuename)) {
- cptr = sQueuename.c_str();
+ qnstrdata = sQueuename.c_str();
+ cptr = (wxChar const *)qnstrdata;
}
else {
cptr = pv[2];
}
if (NULL != cptr) {
res = dk4recwx_wxchar_to_char(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
cptr, pAppHelp->GetWxEncoding(), NULL
);
if (0 != res) {
@@ -926,9 +960,10 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
User name is optional, use current user by default.
*/
if (parser.Found(wxT_2("u"), &sUsername)) {
+ unstrdata = sUsername.c_str();
res = dk4recwx_wxchar_to_char(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
- sUsername.c_str(), pAppHelp->GetWxEncoding(), NULL
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
+ (wxChar const *)unstrdata, pAppHelp->GetWxEncoding(), NULL
);
if (0 != res) {
pUsername = dk4str8_dup(c8b, NULL);
@@ -948,7 +983,7 @@ WxpqdicFrame::ConfigureAndCheckNeedToClose(int *perrc)
res = dk4user_get_logname(buf, szbuf, 0, NULL);
if (0 != res) {
res = dk4recode_dk_to_any(
- c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_ASCII)),
+ c8b, szc8b, ((bIsUtf8) ? (DK4_ENCODING_UTF8) : (DK4_ENCODING_PLAIN)),
buf, pAppHelp->GetDkEncoding(), NULL
);
if (0 != res) {
@@ -1177,7 +1212,7 @@ WxpqdicFrame::OnIdle(wxIdleEvent & event)
void
-WxpqdicFrame::OnTimer(wxTimerEvent & event)
+WxpqdicFrame::OnTimer(wxTimerEvent & WXUNUSED(event))
{
bool mustUpdate = false;
$? "+ OnTimer"
@@ -1504,7 +1539,7 @@ WxpqdicFrame::SendRequest(bool force)
void
-WxpqdicFrame::OnRun(wxCommandEvent & event)
+WxpqdicFrame::OnRun(wxCommandEvent & WXUNUSED(event))
{
bool mustUpdate = false;
$? "+ OnRun"