projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implemented fallback for AlphaBlend() for the systems not supporting it
[wxWidgets.git]
/
src
/
univ
/
theme.cpp
diff --git
a/src/univ/theme.cpp
b/src/univ/theme.cpp
index 31f592280a3c0294a90bfe608abb0ea89970ce5b..f20dbf3eb42db1ba8c641469c1d53da2152a1ee8 100644
(file)
--- a/
src/univ/theme.cpp
+++ b/
src/univ/theme.cpp
@@
-6,7
+6,7
@@
// Created: 06.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
// Created: 06.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
-// Licence: wxWindows licen
s
e
+// Licence: wxWindows licen
c
e
///////////////////////////////////////////////////////////////////////////////
// ===========================================================================
///////////////////////////////////////////////////////////////////////////////
// ===========================================================================
@@
-33,6
+33,8
@@
#include "wx/log.h"
#endif // WX_PRECOMP
#include "wx/log.h"
#endif // WX_PRECOMP
+#include "wx/artprov.h"
+
#include "wx/univ/renderer.h"
#include "wx/univ/inphand.h"
#include "wx/univ/theme.h"
#include "wx/univ/renderer.h"
#include "wx/univ/inphand.h"
#include "wx/univ/theme.h"
@@
-64,7
+66,7
@@
wxThemeInfo::wxThemeInfo(Constructor c,
wxThemeInfo *info = ms_allThemes;
while ( info )
{
wxThemeInfo *info = ms_allThemes;
while ( info )
{
- if ( name
== info->name
)
+ if ( name
.CmpNoCase(info->name) == 0
)
{
return info->ctor();
}
{
return info->ctor();
}
@@
-100,28
+102,31
@@
wxThemeInfo::wxThemeInfo(Constructor c,
#if defined(__WXGTK__)
nameDefTheme = _T("gtk");
#elif defined(__WXX11__)
#if defined(__WXGTK__)
nameDefTheme = _T("gtk");
#elif defined(__WXX11__)
- nameDefTheme = _T("
Metal
");
+ nameDefTheme = _T("
win32
");
#else
nameDefTheme = _T("win32");
#endif
}
#else
nameDefTheme = _T("win32");
#endif
}
-
ms_
theme = Create(nameDefTheme);
+
wxTheme *
theme = Create(nameDefTheme);
// fallback to the first one in the list
// fallback to the first one in the list
- if ( !
ms_
theme && ms_allThemes )
+ if ( !theme && ms_allThemes )
{
{
-
ms_
theme = ms_allThemes->ctor();
+ theme = ms_allThemes->ctor();
}
// abort if still nothing
}
// abort if still nothing
- if ( !
ms_
theme )
+ if ( !theme )
{
wxLogError(_("Failed to initialize GUI: no built-in themes found."));
return FALSE;
}
{
wxLogError(_("Failed to initialize GUI: no built-in themes found."));
return FALSE;
}
+ // Set the theme as current.
+ wxTheme::Set(theme);
+
return TRUE;
}
return TRUE;
}
@@
-129,6
+134,16
@@
wxThemeInfo::wxThemeInfo(Constructor c,
{
wxTheme *themeOld = ms_theme;
ms_theme = theme;
{
wxTheme *themeOld = ms_theme;
ms_theme = theme;
+
+ if ( ms_theme )
+ {
+ // automatically start using the art provider of the new theme if it
+ // has one
+ wxArtProvider *art = ms_theme->GetArtProvider();
+ if ( art )
+ wxArtProvider::PushProvider(art);
+ }
+
return themeOld;
}
return themeOld;
}