From 9321c6bdfc559db6cf436d4ea88198983ce59846 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 2 Oct 2015 14:53:55 +0200 Subject: 6.12 --- wx+/app_main.h | 2 +- wx+/bitmap_button.h | 2 +- wx+/choice_enum.h | 2 +- wx+/context_menu.h | 2 +- wx+/dc.h | 4 +- wx+/file_drop.h | 2 +- wx+/font_size.h | 10 ++-- wx+/graph.cpp | 2 +- wx+/graph.h | 2 +- wx+/grid.cpp | 4 +- wx+/grid.h | 2 +- wx+/image_resources.cpp | 2 +- wx+/image_resources.h | 2 +- wx+/image_tools.cpp | 2 +- wx+/image_tools.h | 2 +- wx+/key_event.h | 118 ------------------------------------------------ wx+/no_flicker.h | 2 +- wx+/popup_dlg.cpp | 4 +- wx+/popup_dlg.h | 2 +- wx+/rtl.h | 2 +- wx+/std_button_layout.h | 2 +- wx+/string_conv.h | 2 +- wx+/timespan.h | 2 +- wx+/toggle_button.h | 2 +- wx+/tooltip.cpp | 2 +- wx+/tooltip.h | 2 +- wx+/zlib_wrap.cpp | 6 +-- wx+/zlib_wrap.h | 2 +- 28 files changed, 36 insertions(+), 154 deletions(-) delete mode 100644 wx+/key_event.h (limited to 'wx+') diff --git a/wx+/app_main.h b/wx+/app_main.h index a13a122d..b97a25ef 100644 --- a/wx+/app_main.h +++ b/wx+/app_main.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/bitmap_button.h b/wx+/bitmap_button.h index 14476324..6c186926 100644 --- a/wx+/bitmap_button.h +++ b/wx+/bitmap_button.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/choice_enum.h b/wx+/choice_enum.h index 57718158..6a795d4a 100644 --- a/wx+/choice_enum.h +++ b/wx+/choice_enum.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/context_menu.h b/wx+/context_menu.h index a498c429..2ae85162 100644 --- a/wx+/context_menu.h +++ b/wx+/context_menu.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/dc.h b/wx+/dc.h index b2f5b584..0d3c1cb8 100644 --- a/wx+/dc.h +++ b/wx+/dc.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** @@ -84,7 +84,7 @@ private: #ifndef wxALWAYS_NATIVE_DOUBLE_BUFFER -#error we need this one! + #error we need this one! #endif #if wxALWAYS_NATIVE_DOUBLE_BUFFER diff --git a/wx+/file_drop.h b/wx+/file_drop.h index 55772a03..664b4387 100644 --- a/wx+/file_drop.h +++ b/wx+/file_drop.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/font_size.h b/wx+/font_size.h index 4639d194..c1ea47cd 100644 --- a/wx+/font_size.h +++ b/wx+/font_size.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** @@ -10,10 +10,10 @@ #include #include #ifdef ZEN_WIN -#include -#include -#include //TEXT_MAININSTRUCTION -#include //TMT_COLOR + #include + #include + #include //TEXT_MAININSTRUCTION + #include //TMT_COLOR #endif namespace zen diff --git a/wx+/graph.cpp b/wx+/graph.cpp index 67f8e354..cc844144 100644 --- a/wx+/graph.cpp +++ b/wx+/graph.cpp @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/graph.h b/wx+/graph.h index 00b0b469..34c7ab3c 100644 --- a/wx+/graph.h +++ b/wx+/graph.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/grid.cpp b/wx+/grid.cpp index de50d4c6..377510ae 100644 --- a/wx+/grid.cpp +++ b/wx+/grid.cpp @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** @@ -20,7 +20,7 @@ #include "dc.h" #ifdef ZEN_LINUX -#include + #include #endif using namespace zen; diff --git a/wx+/grid.h b/wx+/grid.h index 1ac75aa5..76ee383a 100644 --- a/wx+/grid.h +++ b/wx+/grid.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/image_resources.cpp b/wx+/image_resources.cpp index 062ad88c..a76a2822 100644 --- a/wx+/image_resources.cpp +++ b/wx+/image_resources.cpp @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/image_resources.h b/wx+/image_resources.h index b16544ac..8d7c9b49 100644 --- a/wx+/image_resources.h +++ b/wx+/image_resources.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/image_tools.cpp b/wx+/image_tools.cpp index b1732032..c6be3852 100644 --- a/wx+/image_tools.cpp +++ b/wx+/image_tools.cpp @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/image_tools.h b/wx+/image_tools.h index d3a20a45..cb8da60b 100644 --- a/wx+/image_tools.h +++ b/wx+/image_tools.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/key_event.h b/wx+/key_event.h deleted file mode 100644 index aa094b4a..00000000 --- a/wx+/key_event.h +++ /dev/null @@ -1,118 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * -// ************************************************************************** - -#ifndef KEY_EVENT_H_086130871086708354674 -#define KEY_EVENT_H_086130871086708354674 - -#include -#include -#include -#include -#include - -namespace zen -{ -//wxWidgets provides no elegant way to register shortcut keys scoped for dialog windows -// => enable dialog-specific local key events! - -//setup in wxDialog-derived class' constructor, e.g.: -// setupLocalKeyEvents(*this, [this](wxKeyEvent& event){ this->onLocalKeyEvent(event); }); -// -// => redirects local key events to: -// void MyDlg::onLocalKeyEvent(wxKeyEvent& event); -void setupLocalKeyEvents(wxWindow& wnd, const std::function& callback); //callback held during life time of "wnd"! - - - - - - - -//pretty much the same like "bool wxWindowBase::IsDescendant(wxWindowBase* child) const" but without the obvious misnomer -inline -bool isComponentOf(const wxWindow* child, const wxWindow* top) -{ - for (const wxWindow* wnd = child; wnd != nullptr; wnd = wnd->GetParent()) - if (wnd == top) - return true; - return false; -} - - -namespace impl -{ -inline -const wxTopLevelWindow* getTopLevelWindow(const wxWindow* child) -{ - for (const wxWindow* wnd = child; wnd != nullptr; wnd = wnd->GetParent()) - if (auto tlw = dynamic_cast(wnd)) - return tlw; - return nullptr; -} - - -class LokalKeyEventHandler : public wxWindow //private wxEvtHandler -{ -public: - LokalKeyEventHandler(wxWindow& parent, const std::function& callback) : wxWindow(&parent, wxID_ANY), //use a dummy child window to bind instance life time to parent - parent_(parent), - callback_(callback), - processingCallback(false) - { - Hide(); //this is just a dummy window so that its parent can have ownership - Disable(); // - - //register global hotkeys (without needing explicit menu entry) - wxTheApp->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(LokalKeyEventHandler::onGlobalKeyEvent), nullptr, this); - wxTheApp->Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(LokalKeyEventHandler::onGlobalKeyEvent), nullptr, this); //capture direction keys - } - - ~LokalKeyEventHandler() - { - //important! event source wxTheApp lives longer than this instance -> disconnect! - wxTheApp->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(LokalKeyEventHandler::onGlobalKeyEvent), nullptr, this); - wxTheApp->Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(LokalKeyEventHandler::onGlobalKeyEvent), nullptr, this); - } - -private: - void onGlobalKeyEvent(wxKeyEvent& event) - { - const wxWindow* focus = wxWindow::FindFocus(); - const wxTopLevelWindow* tlw = getTopLevelWindow(&parent_); - - //avoid recursion!!! -> this ugly construct seems to be the only (portable) way to avoid re-entrancy - //recursion may happen in multiple situations: e.g. modal dialogs, Grid::ProcessEvent()! - if (processingCallback || - !isComponentOf(focus, &parent_) || - !parent_.IsEnabled() || //only handle if window is in use and no modal dialog is shown: - !tlw || !const_cast(tlw)->IsActive()) //thanks to wxWidgets non-portability we need both checks: - //IsEnabled() is sufficient for Windows, IsActive() is needed on OS X since it does NOT disable the parent when showing a modal dialog - { - event.Skip(); - return; - } - processingCallback = true; - ZEN_ON_SCOPE_EXIT(processingCallback = false;) - - callback_(event); - } - - wxWindow& parent_; - const std::function callback_; - bool processingCallback; -}; -} - - -inline -void setupLocalKeyEvents(wxWindow& wnd, const std::function& callback) -{ - new impl::LokalKeyEventHandler(wnd, callback); //ownership passed to "wnd"! -} - -} - -#endif //KEY_EVENT_H_086130871086708354674 diff --git a/wx+/no_flicker.h b/wx+/no_flicker.h index c5b0d238..fb0585ca 100644 --- a/wx+/no_flicker.h +++ b/wx+/no_flicker.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/popup_dlg.cpp b/wx+/popup_dlg.cpp index ff0bf125..480021eb 100644 --- a/wx+/popup_dlg.cpp +++ b/wx+/popup_dlg.cpp @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** @@ -12,7 +12,7 @@ #include "popup_dlg_generated.h" #ifdef ZEN_WIN -#include + #include #endif using namespace zen; diff --git a/wx+/popup_dlg.h b/wx+/popup_dlg.h index ab988702..eef7ab79 100644 --- a/wx+/popup_dlg.h +++ b/wx+/popup_dlg.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/rtl.h b/wx+/rtl.h index 0ec84524..5f1c9321 100644 --- a/wx+/rtl.h +++ b/wx+/rtl.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/std_button_layout.h b/wx+/std_button_layout.h index b5e30472..f497de2c 100644 --- a/wx+/std_button_layout.h +++ b/wx+/std_button_layout.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/string_conv.h b/wx+/string_conv.h index e9150223..229a9825 100644 --- a/wx+/string_conv.h +++ b/wx+/string_conv.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/timespan.h b/wx+/timespan.h index 28c9e673..09469ccb 100644 --- a/wx+/timespan.h +++ b/wx+/timespan.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/toggle_button.h b/wx+/toggle_button.h index e532d9d8..faa72f66 100644 --- a/wx+/toggle_button.h +++ b/wx+/toggle_button.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/tooltip.cpp b/wx+/tooltip.cpp index d4bcf302..91298db4 100644 --- a/wx+/tooltip.cpp +++ b/wx+/tooltip.cpp @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/tooltip.h b/wx+/tooltip.h index 7f58ff27..d4236186 100644 --- a/wx+/tooltip.h +++ b/wx+/tooltip.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** diff --git a/wx+/zlib_wrap.cpp b/wx+/zlib_wrap.cpp index eccf8698..d25c2c3e 100644 --- a/wx+/zlib_wrap.cpp +++ b/wx+/zlib_wrap.cpp @@ -1,14 +1,14 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** #include "zlib_wrap.h" #ifdef ZEN_WIN -#include //not really a "nice" place to look for a stable solution + #include //not really a "nice" place to look for a stable solution #elif defined ZEN_LINUX || defined ZEN_MAC -#include //let's pray this is the same version wxWidgets is linking against! + #include //let's pray this is the same version wxWidgets is linking against! #endif using namespace zen; diff --git a/wx+/zlib_wrap.h b/wx+/zlib_wrap.h index c271276f..815d8361 100644 --- a/wx+/zlib_wrap.h +++ b/wx+/zlib_wrap.h @@ -1,6 +1,6 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -- cgit