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,6 +39,22 @@
|
||||
#include "wx/univ/inphand.h"
|
||||
#include "wx/univ/colschem.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStdCheckboxInputHandler: handles the mouse events for the check and radio
|
||||
// boxes (handling the keyboard input is simple, but its handling differs a
|
||||
// lot between GTK and MSW, so a new class should be derived for this)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxStdCheckboxInputHandler : public wxStdInputHandler
|
||||
{
|
||||
public:
|
||||
wxStdCheckboxInputHandler(wxInputHandler *inphand);
|
||||
|
||||
// we have to override this one as wxStdButtonInputHandler version works
|
||||
// only with the buttons
|
||||
virtual bool HandleActivation(wxInputConsumer *consumer, bool activated);
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
@@ -323,12 +339,20 @@ bool wxCheckBox::PerformAction(const wxControlAction& action,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxInputHandler *wxCheckBox::CreateStdInputHandler(wxInputHandler *handlerDef)
|
||||
{
|
||||
static wxStdCheckboxInputHandler s_handler(handlerDef);
|
||||
|
||||
return &s_handler;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStdCheckboxInputHandler
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxStdCheckboxInputHandler::wxStdCheckboxInputHandler(wxInputHandler *inphand)
|
||||
: wxStdButtonInputHandler(inphand)
|
||||
wxStdCheckboxInputHandler::wxStdCheckboxInputHandler(wxInputHandler *def)
|
||||
: wxStdInputHandler(wxButton::GetStdInputHandler(def))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user