diff --git a/include/wx/msw/uxtheme.h b/include/wx/msw/uxtheme.h index b081ed2fc5..876744975a 100644 --- a/include/wx/msw/uxtheme.h +++ b/include/wx/msw/uxtheme.h @@ -16,6 +16,145 @@ #include "wx/msw/private.h" // we use GetHwndOf() #include +#if defined(DTPB_WINDOWDC) +// DTPB_WINDOWDC has been added for Vista so it's save to assume that an SDK +// including it has vssym32.h available +#define HAVE_VSSYM32 +#endif + +#if defined(HAVE_VSSYM32) +#include +#else +#include +#endif + +// ---------------------------------------------------------------------------- +// Definitions for legacy Windows SDKs +// ---------------------------------------------------------------------------- +// Some defintions introduced with Windows Vista might be missing in older SDKs +// Missing defintions are added here for compatiblity + +#ifndef VSCLASS_LISTVIEW +#define LISS_NORMAL 1 +#define LISS_HOT 2 +#define LISS_SELECTED 3 +#define LISS_DISABLED 4 +#define LISS_SELECTEDNOTFOCUS 5 +#define LISS_HOTSELECTED 6 +#endif + +#ifndef DTT_TEXTCOLOR +#define DTT_TEXTCOLOR (1UL << 0) // crText has been specified +#define DTT_STATEID (1UL << 8) // IStateId has been specified +#endif + +#ifndef DSS_HIDEPREFIX +#define DSS_HIDEPREFIX 0x0200 +#define DSS_PREFIXONLY 0x0400 +#endif + +#ifndef TMT_FONT +#define TMT_FONT 210 +#endif + +#ifndef HAVE_VSSYM32 +enum EXPANDOBUTTONSTATES { + TDLGEBS_NORMAL = 1, + TDLGEBS_HOVER = 2, + TDLGEBS_PRESSED = 3, + TDLGEBS_EXPANDEDNORMAL = 4, + TDLGEBS_EXPANDEDHOVER = 5, + TDLGEBS_EXPANDEDPRESSED = 6, + TDLGEBS_NORMALDISABLED = 7, + TDLGEBS_EXPANDEDDISABLED = 8, +}; + +enum TASKDIALOGPARTS { + TDLG_PRIMARYPANEL = 1, + TDLG_MAININSTRUCTIONPANE = 2, + TDLG_MAINICON = 3, + TDLG_CONTENTPANE = 4, + TDLG_CONTENTICON = 5, + TDLG_EXPANDEDCONTENT = 6, + TDLG_COMMANDLINKPANE = 7, + TDLG_SECONDARYPANEL = 8, + TDLG_CONTROLPANE = 9, + TDLG_BUTTONSECTION = 10, + TDLG_BUTTONWRAPPER = 11, + TDLG_EXPANDOTEXT = 12, + TDLG_EXPANDOBUTTON = 13, + TDLG_VERIFICATIONTEXT = 14, + TDLG_FOOTNOTEPANE = 15, + TDLG_FOOTNOTEAREA = 16, + TDLG_FOOTNOTESEPARATOR = 17, + TDLG_EXPANDEDFOOTERAREA = 18, + TDLG_PROGRESSBAR = 19, + TDLG_IMAGEALIGNMENT = 20, + TDLG_RADIOBUTTONPANE = 21, +}; + +#define CP_BACKGROUND 2 +#define CP_TRANSPARENTBACKGROUND 3 +#define CP_BORDER 4 +#define CP_READONLY 5 +#define CP_DROPDOWNBUTTONRIGHT 6 +#define CP_DROPDOWNBUTTONLEFT 7 +#define CP_CUEBANNER 8 + +#define RP_BACKGROUND 6 +#define RP_SPLITTER 7 +#define RP_SPLITTERVERT 8 + +enum BORDERSTATES { + CBB_NORMAL = 1, + CBB_HOT = 2, + CBB_FOCUSED = 3, + CBB_DISABLED = 4, +}; + +enum MENUPARTS +{ + MENU_MENUITEM_TMSCHEMA = 1, + MENU_SEPARATOR_TMSCHEMA = 6, + MENU_POPUPBACKGROUND = 9, + MENU_POPUPBORDERS = 10, + MENU_POPUPCHECK = 11, + MENU_POPUPCHECKBACKGROUND = 12, + MENU_POPUPGUTTER = 13, + MENU_POPUPITEM = 14, + MENU_POPUPSEPARATOR = 15, + MENU_POPUPSUBMENU = 16, +}; + +enum POPUPITEMSTATES +{ + MPI_NORMAL = 1, + MPI_HOT = 2, + MPI_DISABLED = 3, + MPI_DISABLEDHOT = 4, +}; + +enum POPUPCHECKBACKGROUNDSTATES +{ + MCB_DISABLED = 1, + MCB_NORMAL = 2, + MCB_BITMAP = 3, +}; + +enum POPUPCHECKSTATES +{ + MC_CHECKMARKNORMAL = 1, + MC_CHECKMARKDISABLED = 2, + MC_BULLETNORMAL = 3, + MC_BULLETDISABLED = 4, +}; + +#endif + +// ---------------------------------------------------------------------------- +// End definitions for legacy Windows SDKs +// ---------------------------------------------------------------------------- + // Amazingly, GetThemeFont() and GetThemeSysFont() functions use LOGFONTA under // XP but LOGFONTW (even in non-Unicode build) under later versions of Windows. // If we declare them as taking LOGFONT below, the code would be able to diff --git a/src/aui/barartmsw.cpp b/src/aui/barartmsw.cpp index b01f5dcdeb..87eb536ce7 100644 --- a/src/aui/barartmsw.cpp +++ b/src/aui/barartmsw.cpp @@ -27,37 +27,6 @@ #if wxUSE_AUI -#define RP_GRIPPER 1 -#define RP_GRIPPERVERT 2 -#define RP_BAND 3 -#define RP_CHEVRON 4 -#define RP_CHEVRONVERT 5 -#define RP_BACKGROUND 6 -#define RP_SPLITTER 7 -#define RP_SPLITTERVERT 8 - -#define CHEVS_NORMAL 1 -#define CHEVS_HOT 2 -#define CHEVS_PRESSED 3 - -#define TP_BUTTON 1 -#define TP_DROPDOWNBUTTON 2 -#define TP_SPLITBUTTON 3 -#define TP_SPLITBUTTONDROPDOWN 4 -#define TP_SEPARATOR 5 -#define TP_SEPARATORVERT 6 -#define TP_DROPDOWNBUTTONGLYPH 7 - -#define TS_NORMAL 1 -#define TS_HOT 2 -#define TS_PRESSED 3 -#define TS_DISABLED 4 -#define TS_CHECKED 5 -#define TS_HOTCHECKED 6 -#define TS_NEARHOT 7 -#define TS_OTHERSIDEHOT 8 - - wxAuiMSWToolBarArt::wxAuiMSWToolBarArt() { if ( wxUxThemeIsActive() ) diff --git a/src/aui/tabartmsw.cpp b/src/aui/tabartmsw.cpp index 477fd1341a..9276070124 100644 --- a/src/aui/tabartmsw.cpp +++ b/src/aui/tabartmsw.cpp @@ -25,40 +25,6 @@ #if wxUSE_AUI -#ifndef CP_DROPDOWNBUTTON - - #define TABP_TABITEM 1 - #define TABP_TABITEMLEFTEDGE 2 - #define TABP_TABITEMRIGHTEDGE 3 - #define TABP_TABITEMBOTHEDGE 4 - #define TABP_TOPTABITEM 5 - #define TABP_TOPTABITEMLEFTEDGE 6 - #define TABP_TOPTABITEMRIGHTEDGE 7 - #define TABP_TOPTABITEMBOTHEDGE 8 - #define TABP_PANE 9 - #define TABP_BODY 10 - #define TABP_AEROWIZARDBODY 11 - - #define TIS_NORMAL 1 - #define TIS_HOT 2 - #define TIS_SELECTED 3 - #define TIS_DISABLED 4 - #define TIS_FOCUSED 5 - - #define TTP_CLOSE 5 - - #define TTCS_NORMAL 1 - #define TTCS_HOT 2 - #define TTCS_PRESSED 3 - - #define SPNP_UPHORZ 3 - #define SPNP_DOWNHORZ 4 - - #define CP_DROPDOWNBUTTON1 1 - - #define WP_CLOSEBUTTON 18 -#endif - wxAuiMSWTabArt::wxAuiMSWTabArt() { m_closeBtnSize = wxDefaultSize; @@ -410,7 +376,7 @@ void wxAuiMSWTabArt::DrawButton(wxDC& dc, break; case wxAUI_BUTTON_WINDOWLIST: themeId = L"Combobox"; - part = CP_DROPDOWNBUTTON1; + part = CP_DROPDOWNBUTTON; break; } diff --git a/src/generic/richtooltipg.cpp b/src/generic/richtooltipg.cpp index 49b393a14d..5ebc1603ef 100644 --- a/src/generic/richtooltipg.cpp +++ b/src/generic/richtooltipg.cpp @@ -48,12 +48,6 @@ #ifdef __WXMSW__ #include "wx/msw/uxtheme.h" - - static const int TTP_BALLOONTITLE = 4; - - static const int TMT_TEXTCOLOR = 3803; - static const int TMT_GRADIENTCOLOR1 = 3810; - static const int TMT_GRADIENTCOLOR2 = 3811; #endif // ---------------------------------------------------------------------------- diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index f8ef711d76..d896566b6f 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -55,19 +55,6 @@ using namespace wxMSWImpl; #if wxUSE_UXTHEME - // no need to include tmschema.h - #ifndef BP_PUSHBUTTON - #define BP_PUSHBUTTON 1 - - #define PBS_NORMAL 1 - #define PBS_HOT 2 - #define PBS_PRESSED 3 - #define PBS_DISABLED 4 - #define PBS_DEFAULTED 5 - - #define TMT_CONTENTMARGINS 3602 - #endif - // provide the necessary declarations ourselves if they're missing from // headers #ifndef BCM_SETIMAGELIST diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index cf16308670..3f23f6b1d8 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -30,21 +30,6 @@ #include "wx/msw/uxtheme.h" -#if wxUSE_UXTHEME - // no need to include tmschema.h - #ifndef BP_PUSHBUTTON - #define BP_PUSHBUTTON 1 - - #define PBS_NORMAL 1 - #define PBS_HOT 2 - #define PBS_PRESSED 3 - #define PBS_DISABLED 4 - #define PBS_DEFAULTED 5 - - #define TMT_CONTENTMARGINS 3602 - #endif -#endif // wxUSE_UXTHEME - #ifndef ODS_NOFOCUSRECT #define ODS_NOFOCUSRECT 0x0200 #endif diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index f8a7098da6..2923f575c7 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -42,77 +42,6 @@ #endif #include "wx/msw/dc.h" -// Change to #if 1 to include tmschema.h for easier testing of theme -// parameters. -#if 0 - #include - #include -#else - //---------------------------------- - #define EP_EDITTEXT 1 - #define ETS_NORMAL 1 - #define ETS_HOT 2 - #define ETS_SELECTED 3 - #define ETS_DISABLED 4 - #define ETS_FOCUSED 5 - #define ETS_READONLY 6 - #define ETS_ASSIST 7 - #define TMT_FILLCOLOR 3802 - #define TMT_TEXTCOLOR 3803 - #define TMT_BORDERCOLOR 3801 - #define TMT_EDGEFILLCOLOR 3808 - #define TMT_BGTYPE 4001 - - #define BT_IMAGEFILE 0 - #define BT_BORDERFILL 1 - - #define CP_DROPDOWNBUTTON 1 - #define CP_BACKGROUND 2 // This and above are Vista and later only - #define CP_TRANSPARENTBACKGROUND 3 - #define CP_BORDER 4 - #define CP_READONLY 5 - #define CP_DROPDOWNBUTTONRIGHT 6 - #define CP_DROPDOWNBUTTONLEFT 7 - #define CP_CUEBANNER 8 - - #define CBXS_NORMAL 1 - #define CBXS_HOT 2 - #define CBXS_PRESSED 3 - #define CBXS_DISABLED 4 - - #define CBXSR_NORMAL 1 - #define CBXSR_HOT 2 - #define CBXSR_PRESSED 3 - #define CBXSR_DISABLED 4 - - #define CBXSL_NORMAL 1 - #define CBXSL_HOT 2 - #define CBXSL_PRESSED 3 - #define CBXSL_DISABLED 4 - - #define CBTBS_NORMAL 1 - #define CBTBS_HOT 2 - #define CBTBS_DISABLED 3 - #define CBTBS_FOCUSED 4 - - #define CBB_NORMAL 1 - #define CBB_HOT 2 - #define CBB_FOCUSED 3 - #define CBB_DISABLED 4 - - #define CBRO_NORMAL 1 - #define CBRO_HOT 2 - #define CBRO_PRESSED 3 - #define CBRO_DISABLED 4 - - #define CBCB_NORMAL 1 - #define CBCB_HOT 2 - #define CBCB_PRESSED 3 - #define CBCB_DISABLED 4 - -#endif - - #define NATIVE_TEXT_INDENT_XP 4 #define NATIVE_TEXT_INDENT_CLASSIC 2 diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 8fbbc9f0c2..f39af0763f 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -143,53 +143,6 @@ inline bool IsGreaterThanStdSize(const wxBitmap& bmp) #include "wx/fontutil.h" #include "wx/msw/private/metrics.h" -#if wxUSE_UXTHEME - -enum MENUPARTS -{ - MENU_MENUITEM_TMSCHEMA = 1, - MENU_SEPARATOR_TMSCHEMA = 6, - MENU_POPUPBACKGROUND = 9, - MENU_POPUPBORDERS = 10, - MENU_POPUPCHECK = 11, - MENU_POPUPCHECKBACKGROUND = 12, - MENU_POPUPGUTTER = 13, - MENU_POPUPITEM = 14, - MENU_POPUPSEPARATOR = 15, - MENU_POPUPSUBMENU = 16, -}; - - -enum POPUPITEMSTATES -{ - MPI_NORMAL = 1, - MPI_HOT = 2, - MPI_DISABLED = 3, - MPI_DISABLEDHOT = 4, -}; - -enum POPUPCHECKBACKGROUNDSTATES -{ - MCB_DISABLED = 1, - MCB_NORMAL = 2, - MCB_BITMAP = 3, -}; - -enum POPUPCHECKSTATES -{ - MC_CHECKMARKNORMAL = 1, - MC_CHECKMARKDISABLED = 2, - MC_BULLETNORMAL = 3, - MC_BULLETDISABLED = 4, -}; - -const int TMT_MENUFONT = 803; -const int TMT_BORDERSIZE = 2403; -const int TMT_CONTENTMARGINS = 3602; -const int TMT_SIZINGMARGINS = 3601; - -#endif // wxUSE_UXTHEME - #endif // wxUSE_OWNER_DRAWN // ---------------------------------------------------------------------------- diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 6a3a650997..fff5432e6d 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -40,93 +40,6 @@ #include "wx/msw/uxtheme.h" #include "wx/dynlib.h" -// tmschema.h is in Win32 Platform SDK and might not be available with earlier -// compilers -#ifndef CP_DROPDOWNBUTTON - #define BP_PUSHBUTTON 1 - #define BP_RADIOBUTTON 2 - #define BP_CHECKBOX 3 - #define RBS_UNCHECKEDNORMAL 1 - #define RBS_CHECKEDNORMAL (RBS_UNCHECKEDNORMAL + 4) - #define RBS_MIXEDNORMAL (RBS_CHECKEDNORMAL + 4) - #define CBS_UNCHECKEDNORMAL 1 - #define CBS_CHECKEDNORMAL (CBS_UNCHECKEDNORMAL + 4) - #define CBS_MIXEDNORMAL (CBS_CHECKEDNORMAL + 4) - - #define PBS_NORMAL 1 - #define PBS_HOT 2 - #define PBS_PRESSED 3 - #define PBS_DISABLED 4 - #define PBS_DEFAULTED 5 - - #define CP_DROPDOWNBUTTON 1 - - #define CBXS_NORMAL 1 - #define CBXS_HOT 2 - #define CBXS_PRESSED 3 - #define CBXS_DISABLED 4 - - #define TVP_GLYPH 2 - - #define GLPS_CLOSED 1 - #define GLPS_OPENED 2 - - #define HP_HEADERITEM 1 - - #define HIS_NORMAL 1 - #define HIS_HOT 2 - #define HIS_PRESSED 3 - - #define TMT_HEIGHT 2417 - - #define HP_HEADERSORTARROW 4 - #define HSAS_SORTEDUP 1 - #define HSAS_SORTEDDOWN 2 - - #define EP_EDITTEXT 1 - #define ETS_NORMAL 1 - #define ETS_HOT 2 - #define ETS_SELECTED 3 - #define ETS_DISABLED 4 - #define ETS_FOCUSED 5 - #define ETS_READONLY 6 - #define ETS_ASSIST 7 - #define TMT_FILLCOLOR 3802 - #define TMT_TEXTCOLOR 3803 - #define TMT_BORDERCOLOR 3801 - #define TMT_EDGEFILLCOLOR 3808 - - #define WP_MINBUTTON 15 - #define WP_MAXBUTTON 17 - #define WP_CLOSEBUTTON 18 - #define WP_RESTOREBUTTON 21 - #define WP_HELPBUTTON 23 - - #define PP_BAR 1 - #define PP_CHUNK 3 - - #define LISS_NORMAL 1 - #define LISS_HOT 2 - #define LISS_SELECTED 3 - #define LISS_DISABLED 4 - #define LISS_SELECTEDNOTFOCUS 5 - #define LISS_HOTSELECTED 6 - - #define LVP_LISTITEM 1 - - #define DTT_TEXTCOLOR (1UL << 0) // crText has been specified - #define DTT_STATEID (1UL << 8) // IStateId has been specified - - #define TDLG_EXPANDOBUTTON 13 - - #define TDLGEBS_NORMAL 1 - #define TDLGEBS_HOVER 2 - #define TDLGEBS_PRESSED 3 - #define TDLGEBS_EXPANDEDNORMAL 4 - #define TDLGEBS_EXPANDEDHOVER 5 - #define TDLGEBS_EXPANDEDPRESSED 6 -#endif - // These Vista+ only types used by DrawThemeTextEx may not be available in older SDK headers typedef int(__stdcall *WXDTT_CALLBACK_PROC)(HDC hdc, const wchar_t * pszText, int cchText, RECT * prc, unsigned int dwFlags, WXLPARAM lParam); diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index d028b60f30..1dc7228864 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -47,13 +47,6 @@ #include "wx/msw/dc.h" #include "wx/msw/private/winstyle.h" -// the values coincide with those in tmschema.h -#define BP_GROUPBOX 4 - -#define GBS_NORMAL 1 - -#define TMT_FONT 210 - // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index a63333f0f8..ead90f0321 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -113,14 +113,6 @@ #if wxUSE_UXTHEME #include "wx/msw/uxtheme.h" - #define EP_EDITTEXT 1 - #define ETS_NORMAL 1 - #define ETS_HOT 2 - #define ETS_SELECTED 3 - #define ETS_DISABLED 4 - #define ETS_FOCUSED 5 - #define ETS_READONLY 6 - #define ETS_ASSIST 7 #endif #if wxUSE_DYNLIB_CLASS