From dfb9976cc3784a90b77a2e052a0c5bbacb25354c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 10 Sep 2014 16:51:46 +0000 Subject: [PATCH] Simplify and make more flexible wxCompositeWindow::SetForAllParts(). Allow calling any function compatible with the argument type instead of requiring "bool" return type and the exact match of the parameter type, which forced us to define a separate DoSetForAllParts() helper. See #11583. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/compositewin.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/include/wx/compositewin.h b/include/wx/compositewin.h index eeb758a110..ebf631c47c 100644 --- a/include/wx/compositewin.h +++ b/include/wx/compositewin.h @@ -178,20 +178,8 @@ private: event.Skip(); } - template - void SetForAllParts(bool (wxWindowBase::*func)(const T&), const T& arg) - { - DoSetForAllParts(func, arg); - } - - template - void SetForAllParts(bool (wxWindowBase::*func)(T*), T* arg) - { - DoSetForAllParts(func, arg); - } - - template - void DoSetForAllParts(bool (wxWindowBase::*func)(T), T arg) + template + void SetForAllParts(R (wxWindowBase::*func)(TArg), T arg) { // Simply call the setters for all parts of this composite window. const wxWindowList parts = GetCompositeWindowParts();