Attempt to make wxWindows play better with XP themes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-06-02 10:27:03 +00:00
parent 73bab6b44d
commit 85b43fbf7a
17 changed files with 291 additions and 82 deletions

View File

@@ -1000,6 +1000,11 @@ enum wxBorder
// parent is destroyed before the child
#define wxWS_EX_TRANSIENT 0x00000004
// don't paint the window background, we'll assume it will
// be done by a theming engine. This is not yet used but could
// possibly be made to work in the future, at least on Windows
#define wxWS_EX_THEMED_BACKGROUND 0x00000008
// Use this style to add a context-sensitive help to the window (currently for
// Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used)
#define wxFRAME_EX_CONTEXTHELP 0x00000004

View File

@@ -96,6 +96,9 @@ public:
// set the padding between tabs (in pixels)
void SetPadding(const wxSize& padding);
// Windows only: attempts to get colour for UX theme page background
wxColour GetThemeBackgroundColour();
// operations
// ----------
// remove all pages
@@ -112,6 +115,8 @@ public:
// style.
void SetTabSize(const wxSize& sz);
// Windows only: attempts to apply the UX theme page background to this page
void ApplyThemeBackground(wxWindow* window, const wxColour& colour);
// Hit test
int HitTest(const wxPoint& pt, long& flags);

View File

@@ -1034,6 +1034,13 @@
// Recommended setting: 1, set to 0 for a small library size reduction
#define wxUSE_OWNER_DRAWN 1
// Set to 1 to compile MS Windows XP theme engine support
#define wxUSE_UXTHEME 1
// Set to 1 to auto-adapt to MS Windows XP themes where possible
// (notably, wxNotebook pages)
#define wxUSE_UXTHEME_AUTO 1
// ----------------------------------------------------------------------------
// obsolete settings
// ----------------------------------------------------------------------------

View File

@@ -9,6 +9,10 @@
#ifndef _WX_UXTHEME_H_
#define _WX_UXTHEME_H_
#ifdef __GNUG__
#pragma interface "uxtheme.cpp"
#endif
// Use wxModule approach to initialization.
#define WXU_USE_WXMODULE 1
@@ -73,11 +77,11 @@ typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDCONTENTRECT)(WXHTHEME, WX
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDEXTENT)(WXHTHEME, WXHDC, int, int,
const WXURECT *, WXURECT *) ;
typedef enum WXUTHEMESIZE
enum WXUTHEMESIZE
{
WXU_TS_MIN, // minimum size
WXU_TS_TRUE, // size without stretching
WXU_TS_DRAW, // size that theme mgr will use to draw part
WXU_TS_DRAW // size that theme mgr will use to draw part
};
typedef struct tagWXUSIZE
@@ -145,7 +149,7 @@ typedef WXUHRESULT (__stdcall *PFNWXUDRAWTHEMEICON)(WXHTHEME, WXHDC, int, int,
const WXURECT *, WXHIMAGELIST, int) ;
typedef WXUBOOL (__stdcall *PFNWXUISTHEMEPARTDEFINED)(WXHTHEME, int, int) ;
typedef WXUBOOL (__stdcall *PFNWXUISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(WXHTHEME, int, int) ;
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMECOLOR)(WXHTHEME, int, int, int, WXCOLORREF) ;
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMECOLOR)(WXHTHEME, int, int, int, WXCOLORREF*) ;
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEMETRIC)(WXHTHEME, WXHDC, int,
int, int, int *) ;
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMESTRING)(WXHTHEME, int,
@@ -191,7 +195,8 @@ typedef struct _WXUINTLIST
} WXUINTLIST, *PWXUINTLIST;
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEINTLIST)(WXHTHEME, int,
int, int, WXUINTLIST*) ;
typedef enum WXUPROPERTYORIGIN
enum WXUPROPERTYORIGIN
{
WXU_PO_STATE, // property was found in the state section
WXU_PO_PART, // property was found in the part section
@@ -199,6 +204,7 @@ typedef enum WXUPROPERTYORIGIN
WXU_PO_GLOBAL, // property was found in [globals] section
WXU_PO_NOTFOUND // property was not found
};
typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEPROPERTYORIGIN)(WXHTHEME, int,
int, int, enum WXUPROPERTYORIGIN *) ;
typedef WXUHRESULT (__stdcall *PFNWXUSETWINDOWTHEME)(WXHWND, const wchar_t*, const wchar_t *) ;
@@ -241,7 +247,7 @@ typedef WXUHRESULT (__stdcall *PFNWXUGETTHEMEDOCUMENTATIONPROPERTY)(const wchar_
typedef WXUHRESULT (__stdcall *PFNWXUDRAWTHEMEPARENTBACKGROUND)(WXHWND, WXHDC, WXURECT *) ;
typedef WXUHRESULT (__stdcall *PFNWXUENABLETHEMING)(WXUBOOL) ;
class wxUxThemeEngine
class WXDLLEXPORT wxUxThemeEngine
{
private:
wxUxThemeEngine() ;
@@ -256,6 +262,7 @@ private:
public:
static wxUxThemeEngine* wxInitUxThemeEngine() ;
static wxUxThemeEngine* Get() ;
protected:
void ResetFunctionPointers() ;
public:
@@ -308,12 +315,12 @@ public:
PFNWXUENABLETHEMING m_pfnEnableTheming ;
};
extern wxUxThemeEngine* g_pThemeEngine ;
WXDLLEXPORT_DATA(extern wxUxThemeEngine*) g_pThemeEngine ;
BOOL wxCanUseInitThemeEngine() ;
WXDLLEXPORT BOOL wxCanUseInitThemeEngine() ;
#if !defined(WXU_USE_WXMODULE)
BOOL wxUxInitThemeEngine() ;
WXDLLEXPORT BOOL wxUxInitThemeEngine() ;
#endif
#endif