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
This commit is contained in:
@@ -178,20 +178,8 @@ private:
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T, class TArg, class R>
|
||||||
void SetForAllParts(bool (wxWindowBase::*func)(const T&), const T& arg)
|
void SetForAllParts(R (wxWindowBase::*func)(TArg), T arg)
|
||||||
{
|
|
||||||
DoSetForAllParts<const T&>(func, arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
void SetForAllParts(bool (wxWindowBase::*func)(T*), T* arg)
|
|
||||||
{
|
|
||||||
DoSetForAllParts<T*>(func, arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
void DoSetForAllParts(bool (wxWindowBase::*func)(T), T arg)
|
|
||||||
{
|
{
|
||||||
// Simply call the setters for all parts of this composite window.
|
// Simply call the setters for all parts of this composite window.
|
||||||
const wxWindowList parts = GetCompositeWindowParts();
|
const wxWindowList parts = GetCompositeWindowParts();
|
||||||
|
|||||||
Reference in New Issue
Block a user