1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-13 08:06:32 +01:00

Remove the special PopupFunctor, redo it by other means...

... it was only used, so far, by the scrubber.
This commit is contained in:
Paul Licameli
2017-08-19 07:42:43 -04:00
parent 1e3ab82a01
commit d263eaa97b
5 changed files with 21 additions and 38 deletions

View File

@@ -86,24 +86,6 @@ private:
const audCommandKeyFunction<OBJ> mCommandKeyFunction;
};
// This allows functions to be used either by command manager or by a wxMenu popup,
// but the functions MUST ignore the argument!
template<typename OBJ>
using audCommandPopupFunction = void (OBJ::*)(wxCommandEvent&);
template<typename OBJ>
class PopupFunctor final : public CommandFunctor
{
public:
explicit PopupFunctor(OBJ *This, audCommandPopupFunction<OBJ> pfn)
: mThis{ This }, mCommandPopupFunction{ pfn } {}
void operator () (const CommandContext &context) override
{ wxCommandEvent dummy; (mThis->*mCommandPopupFunction) (dummy); }
private:
OBJ *const mThis;
const audCommandPopupFunction<OBJ> mCommandPopupFunction;
};
template<typename OBJ>
using audCommandListFunction = void (OBJ::*)(int);
@@ -150,11 +132,6 @@ inline CommandFunctorPointer MakeFunctor(OBJ *This,
audCommandKeyFunction<OBJ> pfn)
{ return CommandFunctorPointer{ safenew KeyFunctor<OBJ>{ This, pfn } }; }
template<typename OBJ>
inline CommandFunctorPointer MakeFunctor(OBJ *This,
audCommandPopupFunction<OBJ> pfn)
{ return CommandFunctorPointer{ safenew PopupFunctor<OBJ>{ This, pfn } }; }
template<typename OBJ>
inline CommandFunctorPointer MakeFunctor(OBJ *This,
audCommandListFunction<OBJ> pfn)