X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d69225772ad1ff3952a3ee74055dc93f85c13812..1b97b23d5fb645dc33f1ea4c35d7bd8aee69794d:/src/univ/themes/metal.cpp?ds=sidebyside diff --git a/src/univ/themes/metal.cpp b/src/univ/themes/metal.cpp index 68ccc97db4..af2b79fd60 100644 --- a/src/univ/themes/metal.cpp +++ b/src/univ/themes/metal.cpp @@ -1,4 +1,5 @@ -// Name: univ/themes/metal.cpp +/////////////////////////////////////////////////////////////////////////////// +// Name: src/univ/themes/metal.cpp // Purpose: wxUniversal theme implementing Win32-like LNF // Author: Vadim Zeitlin, Robert Roebling // Modified by: @@ -23,6 +24,10 @@ #pragma hdrstop #endif +#include "wx/univ/theme.h" + +#if wxUSE_THEME_METAL + #ifndef WX_PRECOMP #include "wx/timer.h" #include "wx/intl.h" @@ -40,24 +45,20 @@ #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" #endif // WX_PRECOMP #include "wx/notebook.h" #include "wx/spinbutt.h" -#include "wx/settings.h" -#include "wx/menu.h" #include "wx/artprov.h" -#include "wx/toplevel.h" #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" // wxMetalRenderer: draw the GUI elements in Metal style // ---------------------------------------------------------------------------- @@ -141,8 +142,6 @@ private: // wxMetalTheme // ---------------------------------------------------------------------------- -WX_DEFINE_ARRAY_PTR(wxInputHandler *, wxArrayHandlers); - class wxMetalTheme : public wxTheme { public: @@ -151,8 +150,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() { @@ -160,7 +161,7 @@ private: m_win32Theme = wxTheme::Create( wxT("win32") ); return m_win32Theme != NULL; } -private: + wxTheme *m_win32Theme; wxMetalRenderer *m_renderer; @@ -207,11 +208,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() @@ -226,7 +228,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); @@ -592,3 +594,5 @@ void wxMetalRenderer::DrawMetal(wxDC &dc, const wxRect &rect ) dc.DrawRectangle( rect.x, y, rect.width, 1 ); } } + +#endif // wxUSE_THEME_METAL