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:
@@ -41,10 +41,6 @@
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/toolbar.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// for COLOR_* constants
|
||||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
#include "wx/menu.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/toplevel.h"
|
||||
@@ -56,6 +52,7 @@
|
||||
|
||||
#include "wx/univ/scrtimer.h"
|
||||
#include "wx/univ/renderer.h"
|
||||
#include "wx/univ/inpcons.h"
|
||||
#include "wx/univ/inphand.h"
|
||||
#include "wx/univ/colschem.h"
|
||||
#include "wx/univ/theme.h"
|
||||
@@ -152,8 +149,10 @@ public:
|
||||
|
||||
virtual wxRenderer *GetRenderer();
|
||||
virtual wxArtProvider *GetArtProvider();
|
||||
virtual wxInputHandler *GetInputHandler(const wxString& control);
|
||||
virtual wxInputHandler *GetInputHandler(const wxString& control,
|
||||
wxInputConsumer *consumer);
|
||||
virtual wxColourScheme *GetColourScheme();
|
||||
|
||||
private:
|
||||
bool GetOrCreateTheme()
|
||||
{
|
||||
@@ -161,7 +160,7 @@ private:
|
||||
m_win32Theme = wxTheme::Create( wxT("win32") );
|
||||
return m_win32Theme != NULL;
|
||||
}
|
||||
private:
|
||||
|
||||
wxTheme *m_win32Theme;
|
||||
wxMetalRenderer *m_renderer;
|
||||
|
||||
@@ -208,11 +207,12 @@ wxArtProvider *wxMetalTheme::GetArtProvider()
|
||||
return m_win32Theme->GetArtProvider();
|
||||
}
|
||||
|
||||
wxInputHandler *wxMetalTheme::GetInputHandler(const wxString& control)
|
||||
wxInputHandler *wxMetalTheme::GetInputHandler(const wxString& control,
|
||||
wxInputConsumer *consumer)
|
||||
{
|
||||
if ( !GetOrCreateTheme() )
|
||||
return 0;
|
||||
return m_win32Theme->GetInputHandler(control);
|
||||
return m_win32Theme->GetInputHandler(control, consumer);
|
||||
}
|
||||
|
||||
wxColourScheme *wxMetalTheme::GetColourScheme()
|
||||
@@ -227,7 +227,7 @@ wxColourScheme *wxMetalTheme::GetColourScheme()
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxMetalRenderer::wxMetalRenderer(wxRenderer *renderer, wxColourScheme *scheme)
|
||||
: wxDelegateRenderer(renderer)
|
||||
: wxDelegateRenderer(renderer)
|
||||
{
|
||||
// init colours and pens
|
||||
m_penBlack = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_DARK), 0, wxSOLID);
|
||||
|
||||
Reference in New Issue
Block a user