Many changes for wxInputHandler creation mainly related to:
1. Allow the theme to create only the input handlers it customizes instead of forcing it to always create a handler even if the standard one is used: wxTheme::GetInputHandler() now takes wxInputConsumer to make this possible 2. Prefer delegation to inheritance when creating customized input handlers, almost all (except for wxStdScrollbarInputHandler) standard handler classes are now private, use wxClassName::GetStdInputHandler() to retrieve the standard handler for any class or polymorphic DoGetStdInputHandler() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,7 +39,7 @@ class WXDLLEXPORT wxInputConsumer
|
||||
{
|
||||
public:
|
||||
wxInputConsumer() { m_inputHandler = NULL; }
|
||||
virtual ~wxInputConsumer() {}
|
||||
virtual ~wxInputConsumer() { }
|
||||
|
||||
// get the input handler
|
||||
wxInputHandler *GetInputHandler() const { return m_inputHandler; }
|
||||
@@ -60,6 +60,19 @@ public:
|
||||
// get the window to work with (usually the class wxInputConsumer was mixed into)
|
||||
virtual wxWindow *GetInputWindow() const = 0;
|
||||
|
||||
// this function must be implemented in any classes process input (i.e. not
|
||||
// static controls) to create the standard input handler for the concrete
|
||||
// class deriving from this mix-in
|
||||
//
|
||||
// the parameter is the default input handler which should receive all
|
||||
// unprocessed input (i.e. typically handlerDef is passed to
|
||||
// wxStdInputHandler ctor) or it may be NULL
|
||||
//
|
||||
// the returned pointer will not be deleted by caller so it must either
|
||||
// point to a static object or be deleted on program termination
|
||||
virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef);
|
||||
|
||||
|
||||
protected:
|
||||
// event handlers
|
||||
void OnMouse(wxMouseEvent& event);
|
||||
@@ -68,10 +81,12 @@ protected:
|
||||
void OnFocus(wxFocusEvent& event);
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
|
||||
// create input handler by name
|
||||
// create input handler by name, fall back to GetStdInputHandler() if
|
||||
// the current theme doesn't define any specific handler of this type
|
||||
void CreateInputHandler(const wxString& inphandler);
|
||||
|
||||
// input processor (never deleted, the theme deletes it itself)
|
||||
private:
|
||||
// the input processor (we never delete it)
|
||||
wxInputHandler *m_inputHandler;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user