From ba4bfc54145a4e0c14bb8e6a45522d6c67b51029 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 17 Sep 2015 14:37:19 +0200 Subject: [PATCH 1/3] Implement wxRenderer::DrawItemSelectionRect() better for wxMSW Use "LISTVIEW" theme element for drawing the selection rectangle for more native appearance. See #16414. --- src/msw/renderer.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 19ce59ff75..c08ff3f14d 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -103,6 +103,14 @@ #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 #endif #if defined(__WXWINCE__) @@ -283,6 +291,11 @@ public: m_rendererNative.DrawPushButton(win, dc, rect, flags); } + virtual void DrawItemSelectionRect(wxWindow *win, + wxDC& dc, + const wxRect& rect, + int flags = 0); + virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, @@ -836,6 +849,38 @@ wxRendererXP::DrawTitleBarBitmap(wxWindow *win, DoDrawButtonLike(hTheme, part, dc, rect, flags); } +void +wxRendererXP::DrawItemSelectionRect(wxWindow *win, + wxDC& dc, + const wxRect& rect, + int flags) +{ + wxUxThemeHandle hTheme(win, L"LISTVIEW"); + + int itemState = LISS_NORMAL; + if ( flags & wxCONTROL_SELECTED ) + itemState = LISS_SELECTED; + if ( !(flags & wxCONTROL_FOCUSED) ) + itemState = LISS_SELECTEDNOTFOCUS; + if ( flags & wxCONTROL_DISABLED ) + itemState |= LISS_DISABLED; + + wxUxThemeEngine* const te = wxUxThemeEngine::Get(); + if ( te->IsThemePartDefined(hTheme, LVP_LISTITEM, itemState) ) + { + RECT rc; + wxCopyRectToRECT(rect, rc); + if ( te->IsThemeBackgroundPartiallyTransparent(hTheme, LVP_LISTITEM, itemState) ) + te->DrawThemeParentBackground(GetHwndOf(win), GetHdcOf(dc.GetTempHDC()), &rc); + + te->DrawThemeBackground(hTheme, GetHdcOf(dc.GetTempHDC()), LVP_LISTITEM, itemState, &rc, 0); + } + else + { + m_rendererNative.DrawItemSelectionRect(win, dc, rect, flags); + } +} + // Uses the theme to draw the border and fill for something like a wxTextCtrl void wxRendererXP::DrawTextCtrl(wxWindow* win, wxDC& dc, From b7a89f8746b8861712b4e066aaeca4f93083afea Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 17 Sep 2015 14:38:03 +0200 Subject: [PATCH 2/3] Add wxRendererNative::DrawItemText() for list-like controls Add a new method that should be used for drawing the elements of list-like controls (i.e. wx{List,Tree,DataView}Ctrl and similar). Implement it for wxMSW natively and provide a straightforward generic fallback for the other ports. See #16414. --- docs/changes.txt | 1 + include/wx/msw/uxtheme.h | 23 ++++++++++++++ include/wx/renderer.h | 16 ++++++++++ interface/wx/renderer.h | 23 ++++++++++++++ samples/render/render.cpp | 12 +++++++ src/generic/renderg.cpp | 47 ++++++++++++++++++++++++++++ src/msw/renderer.cpp | 66 +++++++++++++++++++++++++++++++++++++++ src/msw/uxtheme.cpp | 1 + 8 files changed, 189 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index e9f5597b1f..60173464f4 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -97,6 +97,7 @@ All (GUI): - Add support for sorting wxDataViewCtrl by multiple columns (Trigve). - Allow dropping data on wxDataViewCtrl background (Laurent Poujoulat). - Add wxRendererNative::DrawGauge() (Tobias Taschner). +- Add wxRendererNative::DrawItemText() (Tobias Taschner). - Add wxHtmlWindow::SetDefaultHTMLCursor() (Jeff A. Marr). - Add default ctor and Create() to wxContextHelpButton (Hanmac). - Send events when toggling wxPropertyGrid nodes from keyboard (Armel Asselin). diff --git a/include/wx/msw/uxtheme.h b/include/wx/msw/uxtheme.h index 5c4eae981d..f15973e305 100644 --- a/include/wx/msw/uxtheme.h +++ b/include/wx/msw/uxtheme.h @@ -84,10 +84,32 @@ private: wxDECLARE_NO_COPY_CLASS(wxUxThemeFont); }; +typedef int(__stdcall *DTT_CALLBACK_PROC)(HDC hdc, const wchar_t * pszText, int cchText, RECT * prc, unsigned int dwFlags, WXLPARAM lParam); + +typedef struct _DTTOPTS +{ + DWORD dwSize; + DWORD dwFlags; + COLORREF crText; + COLORREF crBorder; + COLORREF crShadow; + int iTextShadowType; + POINT ptShadowOffset; + int iBorderSize; + int iFontPropId; + int iColorPropId; + int iStateId; + BOOL fApplyOverlay; + int iGlowSize; + DTT_CALLBACK_PROC pfnDrawTextCallback; + WXLPARAM lParam; +} DTTOPTS, *PDTTOPTS; + typedef HTHEME (__stdcall *PFNWXUOPENTHEMEDATA)(HWND, const wchar_t *); typedef HRESULT (__stdcall *PFNWXUCLOSETHEMEDATA)(HTHEME); typedef HRESULT (__stdcall *PFNWXUDRAWTHEMEBACKGROUND)(HTHEME, HDC, int, int, const RECT *, const RECT *); typedef HRESULT (__stdcall *PFNWXUDRAWTHEMETEXT)(HTHEME, HDC, int, int, const wchar_t *, int, DWORD, DWORD, const RECT *); +typedef HRESULT (__stdcall *PFNWXUDRAWTHEMETEXTEX)(HTHEME, HDC, int, int, const wchar_t *, int, DWORD, RECT *, const DTTOPTS *); typedef HRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDCONTENTRECT)(HTHEME, HDC, int, int, const RECT *, RECT *); typedef HRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDEXTENT)(HTHEME, HDC, int, int, const RECT *, RECT *); typedef HRESULT (__stdcall *PFNWXUGETTHEMEPARTSIZE)(HTHEME, HDC, int, int, const RECT *, /* enum */ THEMESIZE, SIZE *); @@ -161,6 +183,7 @@ public: wxUX_THEME_DECLARE(PFNWXUCLOSETHEMEDATA, CloseThemeData) wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEBACKGROUND, DrawThemeBackground) wxUX_THEME_DECLARE(PFNWXUDRAWTHEMETEXT, DrawThemeText) + wxUX_THEME_DECLARE(PFNWXUDRAWTHEMETEXTEX, DrawThemeTextEx) wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDCONTENTRECT, GetThemeBackgroundContentRect) wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDEXTENT, GetThemeBackgroundExtent) wxUX_THEME_DECLARE(PFNWXUGETTHEMEPARTSIZE, GetThemePartSize) diff --git a/include/wx/renderer.h b/include/wx/renderer.h index 3dede7aa0f..173ae122f9 100644 --- a/include/wx/renderer.h +++ b/include/wx/renderer.h @@ -329,6 +329,14 @@ public: int max, int flags = 0) = 0; + // Draw text using the appropriate color for normal and selected states. + virtual void DrawItemText(wxWindow* win, + wxDC& dc, + const wxString& text, + const wxRect& rect, + int align = wxALIGN_LEFT | wxALIGN_TOP, + int flags = 0) = 0; + // geometry functions // ------------------ @@ -515,6 +523,14 @@ public: int flags = 0) { m_rendererNative.DrawGauge(win, dc, rect, value, max, flags); } + virtual void DrawItemText(wxWindow* win, + wxDC& dc, + const wxString& text, + const wxRect& rect, + int align = wxALIGN_LEFT | wxALIGN_TOP, + int flags = 0) + { m_rendererNative.DrawItemText(win, dc, text, rect, align, flags); } + virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) { return m_rendererNative.GetSplitterParams(win); } diff --git a/interface/wx/renderer.h b/interface/wx/renderer.h index c33f532e0a..37eb17b260 100644 --- a/interface/wx/renderer.h +++ b/interface/wx/renderer.h @@ -405,10 +405,33 @@ public: (otherwise the selection rectangle is e.g. often grey and not blue). This may be ignored by the renderer or deduced by the code directly from the @a win. + + @see DrawItemText() */ virtual void DrawItemSelectionRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; + + /** + Draw item text in the correct color based on selection status. + + Background of the text should be painted with DrawItemSelectionRect(). + + The supported @a flags are @c wxCONTROL_SELECTED for items + which are selected. + @c wxCONTROL_FOCUSED may be used to indicate if the control has the focus. + @c wxCONTROL_DISABLED may be used to indicate if the control is disabled. + + @since 3.1.0 + @see DrawItemSelectionRect() + */ + virtual void DrawItemText(wxWindow* win, + wxDC& dc, + const wxString& text, + const wxRect& rect, + int align = wxALIGN_LEFT | wxALIGN_TOP, + int flags = 0) = 0; + /** Draw a blank push button that looks very similar to wxButton. diff --git a/samples/render/render.cpp b/samples/render/render.cpp index 08500f87c6..f0623855fc 100644 --- a/samples/render/render.cpp +++ b/samples/render/render.cpp @@ -276,6 +276,18 @@ private: wxRect(x2, y, widthGauge, heightGauge), 25, 100, m_flags); y += lineHeight + heightGauge; + + const wxCoord heightListItem = 48; + const wxCoord widthListItem = 260; + + dc.DrawText("DrawItemSelectionRect()", x1, y); + wxRendererNative::GetDefault().DrawItemSelectionRect(this, dc, + wxRect(x2, y, widthListItem, heightListItem), m_flags | wxCONTROL_SELECTED); + + wxRendererNative::GetDefault().DrawItemText(this, dc, "DrawItemText()", + wxRect(x2, y, widthListItem, heightListItem).Inflate(-2, -2), m_align, m_flags | wxCONTROL_SELECTED); + + y += lineHeight + heightListItem; } int m_flags; diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index 5519784724..74578c9aed 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -138,6 +138,13 @@ public: virtual void DrawGauge(wxWindow* win, wxDC& dc, const wxRect& rect, int value, int max, int flags = 0) wxOVERRIDE; + virtual void DrawItemText(wxWindow* win, + wxDC& dc, + const wxString& text, + const wxRect& rect, + int align = wxALIGN_LEFT | wxALIGN_TOP, + int flags = 0) wxOVERRIDE; + virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) wxOVERRIDE; virtual wxRendererVersion GetVersion() const wxOVERRIDE @@ -832,6 +839,46 @@ void wxRendererGeneric::DrawGauge(wxWindow* win, dc.DrawRectangle(progRect); } +void +wxRendererGeneric::DrawItemText(wxWindow* win, + wxDC& dc, + const wxString& text, + const wxRect& rect, + int align, + int flags) +{ + // Determine text color + wxColour textColour; + if ( flags & wxCONTROL_SELECTED ) + { + if ( flags & wxCONTROL_FOCUSED ) + { + textColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); + } + else // !focused + { + textColour = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT); + } + } + else if ( flags & wxCONTROL_DISABLED ) + { + textColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT); + } + else // enabled but not selected + { + textColour = win->GetForegroundColour(); + } + + const wxString paintText = wxControl::Ellipsize(text, dc, + wxELLIPSIZE_END, + rect.GetWidth()); + + // Draw text + dc.SetTextForeground(textColour); + dc.SetTextBackground(wxTransparentColour); + dc.DrawLabel(paintText, rect, align); +} + // ---------------------------------------------------------------------------- // A module to allow cleanup of generic renderer. // ---------------------------------------------------------------------------- diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index c08ff3f14d..2e9eb80a80 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -111,6 +111,9 @@ #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 #endif #if defined(__WXWINCE__) @@ -323,6 +326,12 @@ public: int max, int flags = 0); + virtual void DrawItemText(wxWindow* win, + wxDC& dc, + const wxString& text, + const wxRect& rect, + int align = wxALIGN_LEFT | wxALIGN_TOP, + int flags = 0); virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win); @@ -881,6 +890,63 @@ wxRendererXP::DrawItemSelectionRect(wxWindow *win, } } +void wxRendererXP::DrawItemText(wxWindow* win, + wxDC& dc, + const wxString& text, + const wxRect& rect, + int align, + int flags) +{ + wxUxThemeHandle hTheme(win, L"LISTVIEW"); + + int itemState = LISS_NORMAL; + if ( flags & wxCONTROL_SELECTED ) + itemState = LISS_SELECTED; + if ( !(flags & wxCONTROL_FOCUSED) ) + itemState = LISS_SELECTEDNOTFOCUS; + if ( flags & wxCONTROL_DISABLED ) + itemState |= LISS_DISABLED; + + wxUxThemeEngine* te = wxUxThemeEngine::Get(); + if ( te->IsThemePartDefined(hTheme, LVP_LISTITEM, itemState) ) + { + RECT rc; + wxCopyRectToRECT(rect, rc); + + DTTOPTS textOpts; + textOpts.dwSize = sizeof(textOpts); + textOpts.dwFlags = DTT_STATEID; + textOpts.iStateId = itemState; + if (flags & wxCONTROL_DISABLED) + { + textOpts.dwFlags |= DTT_TEXTCOLOR; + textOpts.crText = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT).GetPixel(); + } + + DWORD textFlags = DT_NOPREFIX | DT_END_ELLIPSIS; + if ( align & wxALIGN_CENTER ) + textFlags |= DT_CENTER; + else if ( align & wxALIGN_RIGHT ) + textFlags |= DT_RIGHT; + else + textFlags |= DT_LEFT; + + if ( align & wxALIGN_BOTTOM ) + textFlags |= DT_BOTTOM; + else if ( align & wxALIGN_CENTER_VERTICAL ) + textFlags |= DT_VCENTER; + else + textFlags |= DT_TOP; + + te->DrawThemeTextEx(hTheme, dc.GetHDC(), LVP_LISTITEM, itemState, + text.wchar_str(), -1, textFlags, &rc, &textOpts); + } + else + { + m_rendererNative.DrawItemText(win, dc, text, rect, align, flags); + } +} + // Uses the theme to draw the border and fill for something like a wxTextCtrl void wxRendererXP::DrawTextCtrl(wxWindow* win, wxDC& dc, diff --git a/src/msw/uxtheme.cpp b/src/msw/uxtheme.cpp index a67c9635e4..1b29e14f77 100644 --- a/src/msw/uxtheme.cpp +++ b/src/msw/uxtheme.cpp @@ -124,6 +124,7 @@ bool wxUxThemeEngine::Initialize() RESOLVE_UXTHEME_FUNCTION(PFNWXUCLOSETHEMEDATA, CloseThemeData); RESOLVE_UXTHEME_FUNCTION(PFNWXUDRAWTHEMEBACKGROUND, DrawThemeBackground); RESOLVE_UXTHEME_FUNCTION(PFNWXUDRAWTHEMETEXT, DrawThemeText); + RESOLVE_UXTHEME_FUNCTION(PFNWXUDRAWTHEMETEXTEX, DrawThemeTextEx); RESOLVE_UXTHEME_FUNCTION(PFNWXUGETTHEMEBACKGROUNDCONTENTRECT, GetThemeBackgroundContentRect); RESOLVE_UXTHEME_FUNCTION(PFNWXUGETTHEMEBACKGROUNDEXTENT, GetThemeBackgroundExtent); RESOLVE_UXTHEME_FUNCTION(PFNWXUGETTHEMEPARTSIZE, GetThemePartSize); From 2fff3cd29fe353c196dbc523f4ce319e4dc71599 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 17 Sep 2015 14:46:27 +0200 Subject: [PATCH 3/3] Add wxSystemThemedControl and use it in wxMSW wxSystemThemedControl allows to use the "system theme" (i.e. the theme used by the system applications such as file manager and which can, surprisingly, be different from the default one). Currently it is only implemented for wxMSW and does nothing under the other platforms. Use wxSystemThemedControl for wxDataViewCtrl, wxListCtrl and, optionally, if wxTR_TWIST_BUTTONS style is specified, wxTreeCtrl to give them more native appearance under MSW. Closes #16414. --- Makefile.in | 33 +++++++++++++++ build/bakefiles/files.bkl | 2 + build/files | 2 + build/msw/makefile.bcc | 16 +++++++ build/msw/makefile.gcc | 16 +++++++ build/msw/makefile.vc | 16 +++++++ build/msw/wx_core.vcxproj | 3 ++ build/msw/wx_core.vcxproj.filters | 6 +++ build/msw/wx_vc7_core.vcproj | 6 +++ build/msw/wx_vc8_core.vcproj | 8 ++++ build/msw/wx_vc9_core.vcproj | 8 ++++ docs/changes.txt | 1 + include/wx/dataview.h | 3 +- include/wx/generic/dataview.h | 2 + include/wx/listbase.h | 3 +- include/wx/systhemectrl.h | 66 +++++++++++++++++++++++++++++ include/wx/treectrl.h | 3 +- interface/wx/dataview.h | 5 +++ interface/wx/listctrl.h | 4 ++ interface/wx/systhemectrl.h | 70 +++++++++++++++++++++++++++++++ interface/wx/treectrl.h | 6 +-- src/common/datavcmn.cpp | 18 ++++++-- src/generic/datavgen.cpp | 10 +++++ src/msw/listctrl.cpp | 2 + src/msw/systhemectrl.cpp | 35 ++++++++++++++++ src/msw/treectrl.cpp | 13 ++---- 26 files changed, 337 insertions(+), 20 deletions(-) create mode 100644 include/wx/systhemectrl.h create mode 100644 interface/wx/systhemectrl.h create mode 100644 src/msw/systhemectrl.cpp diff --git a/Makefile.in b/Makefile.in index 2901e1a93d..2cb5017f60 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4278,6 +4278,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/xpmdecod.h \ wx/xpmhand.h \ wx/xrc/xmlreshandler.h \ + wx/systhemectrl.h \ $(LOWLEVEL_HDR) \ $(GUI_CORE_HEADERS) \ $(ADVANCED_HDR) \ @@ -5905,6 +5906,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS = \ monodll_msw_textentry.o \ monodll_msw_tglbtn.o \ monodll_treectrl.o \ + monodll_systhemectrl.o \ monodll_msw_checklst.o \ monodll_msw_fdrepdlg.o \ monodll_msw_fontdlg.o @@ -6065,6 +6067,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS = \ monodll_msw_textentry.o \ monodll_msw_tglbtn.o \ monodll_treectrl.o \ + monodll_systhemectrl.o \ monodll_dirdlgg.o \ monodll_generic_fdrepdlg.o \ monodll_filedlgg.o \ @@ -8277,6 +8280,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_1 = \ monolib_msw_textentry.o \ monolib_msw_tglbtn.o \ monolib_treectrl.o \ + monolib_systhemectrl.o \ monolib_msw_checklst.o \ monolib_msw_fdrepdlg.o \ monolib_msw_fontdlg.o @@ -8437,6 +8441,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS_1 = \ monolib_msw_textentry.o \ monolib_msw_tglbtn.o \ monolib_treectrl.o \ + monolib_systhemectrl.o \ monolib_dirdlgg.o \ monolib_generic_fdrepdlg.o \ monolib_filedlgg.o \ @@ -10801,6 +10806,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_2 = \ coredll_msw_textentry.o \ coredll_msw_tglbtn.o \ coredll_treectrl.o \ + coredll_systhemectrl.o \ coredll_msw_checklst.o \ coredll_msw_fdrepdlg.o \ coredll_msw_fontdlg.o @@ -10961,6 +10967,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS_2 = \ coredll_msw_textentry.o \ coredll_msw_tglbtn.o \ coredll_treectrl.o \ + coredll_systhemectrl.o \ coredll_dirdlgg.o \ coredll_generic_fdrepdlg.o \ coredll_filedlgg.o \ @@ -12580,6 +12587,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_3 = \ corelib_msw_textentry.o \ corelib_msw_tglbtn.o \ corelib_treectrl.o \ + corelib_systhemectrl.o \ corelib_msw_checklst.o \ corelib_msw_fdrepdlg.o \ corelib_msw_fontdlg.o @@ -12740,6 +12748,7 @@ COND_TOOLKIT_WINCE___GUI_SRC_OBJECTS_3 = \ corelib_msw_textentry.o \ corelib_msw_tglbtn.o \ corelib_treectrl.o \ + corelib_systhemectrl.o \ corelib_dirdlgg.o \ corelib_generic_fdrepdlg.o \ corelib_filedlgg.o \ @@ -21776,6 +21785,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monodll_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monodll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp @@ -27695,6 +27710,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monolib_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@monolib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp @@ -33719,6 +33740,12 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@coredll_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@coredll_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@coredll_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@coredll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp @@ -38123,6 +38150,12 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@corelib_treectrl.o: $(srcdir)/src/msw/treectrl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/treectrl.cpp +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@corelib_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@corelib_systhemectrl.o: $(srcdir)/src/msw/systhemectrl.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/systhemectrl.cpp + @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@corelib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 89e579c58a..840133ddb2 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -1193,6 +1193,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/xpmdecod.h wx/xpmhand.h wx/xrc/xmlreshandler.h + wx/systhemectrl.h @@ -1992,6 +1993,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/msw/textentry.cpp src/msw/tglbtn.cpp src/msw/treectrl.cpp + src/msw/systhemectrl.cpp wx/generic/clrpickerg.h diff --git a/build/files b/build/files index fe6889aa60..ff9515b6ce 100644 --- a/build/files +++ b/build/files @@ -759,6 +759,7 @@ GUI_CMN_HDR = wx/statbox.h wx/stattext.h wx/statusbr.h + wx/systhemectrl.h wx/taskbarbutton.h wx/testing.h wx/textcompleter.h @@ -1630,6 +1631,7 @@ MSW_SRC = src/msw/statusbar.cpp src/msw/statline.cpp src/msw/stattext.cpp + src/msw/systhemectrl.cpp src/msw/taskbarbutton.cpp src/msw/toolbar.cpp src/msw/textctrl.cpp diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index bdf04b22ea..510f0e3490 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -1884,6 +1884,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_textentry.obj \ $(OBJS)\monodll_msw_tglbtn.obj \ $(OBJS)\monodll_treectrl.obj \ + $(OBJS)\monodll_systhemectrl.obj \ $(OBJS)\monodll_msw_checklst.obj \ $(OBJS)\monodll_msw_fdrepdlg.obj \ $(OBJS)\monodll_fontdlg.obj \ @@ -2702,6 +2703,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_textentry.obj \ $(OBJS)\monolib_msw_tglbtn.obj \ $(OBJS)\monolib_treectrl.obj \ + $(OBJS)\monolib_systhemectrl.obj \ $(OBJS)\monolib_msw_checklst.obj \ $(OBJS)\monolib_msw_fdrepdlg.obj \ $(OBJS)\monolib_fontdlg.obj \ @@ -3394,6 +3396,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_textentry.obj \ $(OBJS)\coredll_msw_tglbtn.obj \ $(OBJS)\coredll_treectrl.obj \ + $(OBJS)\coredll_systhemectrl.obj \ $(OBJS)\coredll_msw_checklst.obj \ $(OBJS)\coredll_msw_fdrepdlg.obj \ $(OBJS)\coredll_fontdlg.obj \ @@ -3959,6 +3962,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_textentry.obj \ $(OBJS)\corelib_msw_tglbtn.obj \ $(OBJS)\corelib_treectrl.obj \ + $(OBJS)\corelib_systhemectrl.obj \ $(OBJS)\corelib_msw_checklst.obj \ $(OBJS)\corelib_msw_fdrepdlg.obj \ $(OBJS)\corelib_fontdlg.obj \ @@ -6852,6 +6856,9 @@ $(OBJS)\monodll_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\monodll_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\monodll_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\monodll_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\checklst.cpp @@ -9351,6 +9358,9 @@ $(OBJS)\monolib_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\monolib_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\monolib_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\monolib_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\checklst.cpp @@ -12258,6 +12268,9 @@ $(OBJS)\coredll_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\coredll_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\coredll_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\coredll_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\checklst.cpp @@ -13719,6 +13732,9 @@ $(OBJS)\corelib_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\corelib_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\corelib_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\corelib_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\checklst.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index 72a3c195d6..b3e780ac95 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -1903,6 +1903,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_textentry.o \ $(OBJS)\monodll_msw_tglbtn.o \ $(OBJS)\monodll_treectrl.o \ + $(OBJS)\monodll_systhemectrl.o \ $(OBJS)\monodll_msw_checklst.o \ $(OBJS)\monodll_msw_fdrepdlg.o \ $(OBJS)\monodll_fontdlg.o \ @@ -2727,6 +2728,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_textentry.o \ $(OBJS)\monolib_msw_tglbtn.o \ $(OBJS)\monolib_treectrl.o \ + $(OBJS)\monolib_systhemectrl.o \ $(OBJS)\monolib_msw_checklst.o \ $(OBJS)\monolib_msw_fdrepdlg.o \ $(OBJS)\monolib_fontdlg.o \ @@ -3435,6 +3437,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_textentry.o \ $(OBJS)\coredll_msw_tglbtn.o \ $(OBJS)\coredll_treectrl.o \ + $(OBJS)\coredll_systhemectrl.o \ $(OBJS)\coredll_msw_checklst.o \ $(OBJS)\coredll_msw_fdrepdlg.o \ $(OBJS)\coredll_fontdlg.o \ @@ -4008,6 +4011,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_textentry.o \ $(OBJS)\corelib_msw_tglbtn.o \ $(OBJS)\corelib_treectrl.o \ + $(OBJS)\corelib_systhemectrl.o \ $(OBJS)\corelib_msw_checklst.o \ $(OBJS)\corelib_msw_fdrepdlg.o \ $(OBJS)\corelib_fontdlg.o \ @@ -7027,6 +7031,9 @@ $(OBJS)\monodll_msw_tglbtn.o: ../../src/msw/tglbtn.cpp $(OBJS)\monodll_treectrl.o: ../../src/msw/treectrl.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monodll_systhemectrl.o: ../../src/msw/systhemectrl.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monodll_msw_checklst.o: ../../src/msw/checklst.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -9526,6 +9533,9 @@ $(OBJS)\monolib_msw_tglbtn.o: ../../src/msw/tglbtn.cpp $(OBJS)\monolib_treectrl.o: ../../src/msw/treectrl.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\monolib_systhemectrl.o: ../../src/msw/systhemectrl.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\monolib_msw_checklst.o: ../../src/msw/checklst.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -12433,6 +12443,9 @@ $(OBJS)\coredll_msw_tglbtn.o: ../../src/msw/tglbtn.cpp $(OBJS)\coredll_treectrl.o: ../../src/msw/treectrl.cpp $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\coredll_systhemectrl.o: ../../src/msw/systhemectrl.cpp + $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\coredll_msw_checklst.o: ../../src/msw/checklst.cpp $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< @@ -13894,6 +13907,9 @@ $(OBJS)\corelib_msw_tglbtn.o: ../../src/msw/tglbtn.cpp $(OBJS)\corelib_treectrl.o: ../../src/msw/treectrl.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\corelib_systhemectrl.o: ../../src/msw/systhemectrl.cpp + $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\corelib_msw_checklst.o: ../../src/msw/checklst.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index dd52e808a8..3c0e7a5c64 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -2184,6 +2184,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_textentry.obj \ $(OBJS)\monodll_msw_tglbtn.obj \ $(OBJS)\monodll_treectrl.obj \ + $(OBJS)\monodll_systhemectrl.obj \ $(OBJS)\monodll_msw_checklst.obj \ $(OBJS)\monodll_msw_fdrepdlg.obj \ $(OBJS)\monodll_fontdlg.obj \ @@ -3008,6 +3009,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_textentry.obj \ $(OBJS)\monolib_msw_tglbtn.obj \ $(OBJS)\monolib_treectrl.obj \ + $(OBJS)\monolib_systhemectrl.obj \ $(OBJS)\monolib_msw_checklst.obj \ $(OBJS)\monolib_msw_fdrepdlg.obj \ $(OBJS)\monolib_fontdlg.obj \ @@ -3766,6 +3768,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_textentry.obj \ $(OBJS)\coredll_msw_tglbtn.obj \ $(OBJS)\coredll_treectrl.obj \ + $(OBJS)\coredll_systhemectrl.obj \ $(OBJS)\coredll_msw_checklst.obj \ $(OBJS)\coredll_msw_fdrepdlg.obj \ $(OBJS)\coredll_fontdlg.obj \ @@ -4337,6 +4340,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_textentry.obj \ $(OBJS)\corelib_msw_tglbtn.obj \ $(OBJS)\corelib_treectrl.obj \ + $(OBJS)\corelib_systhemectrl.obj \ $(OBJS)\corelib_msw_checklst.obj \ $(OBJS)\corelib_msw_fdrepdlg.obj \ $(OBJS)\corelib_fontdlg.obj \ @@ -7544,6 +7548,9 @@ $(OBJS)\monodll_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\monodll_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\monodll_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\monodll_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\checklst.cpp @@ -10043,6 +10050,9 @@ $(OBJS)\monolib_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\monolib_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\monolib_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\monolib_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\checklst.cpp @@ -12950,6 +12960,9 @@ $(OBJS)\coredll_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\coredll_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\coredll_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\coredll_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\checklst.cpp @@ -14411,6 +14424,9 @@ $(OBJS)\corelib_msw_tglbtn.obj: ..\..\src\msw\tglbtn.cpp $(OBJS)\corelib_treectrl.obj: ..\..\src\msw\treectrl.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\treectrl.cpp +$(OBJS)\corelib_systhemectrl.obj: ..\..\src\msw\systhemectrl.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\systhemectrl.cpp + $(OBJS)\corelib_msw_checklst.obj: ..\..\src\msw\checklst.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\checklst.cpp diff --git a/build/msw/wx_core.vcxproj b/build/msw/wx_core.vcxproj index 4758299466..3f76dde06c 100644 --- a/build/msw/wx_core.vcxproj +++ b/build/msw/wx_core.vcxproj @@ -1004,6 +1004,7 @@ + @@ -1012,6 +1013,7 @@ true true + @@ -1372,6 +1374,7 @@ + diff --git a/build/msw/wx_core.vcxproj.filters b/build/msw/wx_core.vcxproj.filters index 454a1293ea..d4aefef7b0 100644 --- a/build/msw/wx_core.vcxproj.filters +++ b/build/msw/wx_core.vcxproj.filters @@ -840,6 +840,9 @@ MSW Sources + + MSW Sources + MSW Sources @@ -1807,6 +1810,9 @@ Common Headers + + Common Headers + Common Headers diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index c51b675233..c2536df2b1 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -991,6 +991,9 @@ + + @@ -2576,6 +2579,9 @@ + + diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index b94b2016b0..ea1cf3cf49 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -1726,6 +1726,10 @@ RelativePath="..\..\src\msw\statusbar.cpp" > + + @@ -3936,6 +3940,10 @@ RelativePath="..\..\include\wx\stc\stc.h" > + + diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 5d2bdfc321..ed41ad6fd7 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -1722,6 +1722,10 @@ RelativePath="..\..\src\msw\statusbar.cpp" > + + @@ -3932,6 +3936,10 @@ RelativePath="..\..\include\wx\stc\stc.h" > + + diff --git a/docs/changes.txt b/docs/changes.txt index 60173464f4..ec3c6aa02d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -171,6 +171,7 @@ wxMSW: - Avoid bogus assert after calling wxDatePickerCtrl::SetRange(). - Add solution file for building with MSVS 2014 (Peter Tissen). - Correct wxGetOsDescription() for Windows 10 (Tobias Taschner). +- Make wxListCtrl &c appearance more native on modern systems (Tobias Taschner). - Don't send wxActivateEvent for minimized windows (bzcdr). wxOSX/Cocoa: diff --git a/include/wx/dataview.h b/include/wx/dataview.h index bf5554f951..8364cdbd78 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -26,6 +26,7 @@ #include "wx/vector.h" #include "wx/dataobj.h" #include "wx/withimages.h" +#include "wx/systhemectrl.h" class WXDLLIMPEXP_FWD_CORE wxImageList; @@ -513,7 +514,7 @@ private: #define wxDV_ROW_LINES 0x0010 // alternating colour in rows #define wxDV_VARIABLE_LINE_HEIGHT 0x0020 // variable line height -class WXDLLIMPEXP_ADV wxDataViewCtrlBase: public wxControl +class WXDLLIMPEXP_ADV wxDataViewCtrlBase: public wxSystemThemedControl { public: wxDataViewCtrlBase(); diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index a0f5edc425..c4ec501229 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -220,6 +220,8 @@ protected: // Reset all columns currently used for sorting. void ResetAllSortColumns(); + virtual void DoEnableSystemTheme(bool enable, wxWindow* window) wxOVERRIDE; + public: // utility functions not part of the API // returns the "best" width for the idx-th column diff --git a/include/wx/listbase.h b/include/wx/listbase.h index dba43ffa44..13f4bb8ec6 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -16,6 +16,7 @@ #include "wx/gdicmn.h" #include "wx/event.h" #include "wx/control.h" +#include "wx/systhemectrl.h" class WXDLLIMPEXP_FWD_CORE wxImageList; @@ -377,7 +378,7 @@ private: // the real control class but is just used for implementation convenience. We // should define the public class functions as pure virtual here in the future // however. -class WXDLLIMPEXP_CORE wxListCtrlBase : public wxControl +class WXDLLIMPEXP_CORE wxListCtrlBase : public wxSystemThemedControl { public: wxListCtrlBase() { } diff --git a/include/wx/systhemectrl.h b/include/wx/systhemectrl.h new file mode 100644 index 0000000000..597288e166 --- /dev/null +++ b/include/wx/systhemectrl.h @@ -0,0 +1,66 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/systhemectrl.h +// Purpose: Class to make controls appear in the systems theme +// Author: Tobias Taschner +// Created: 2014-08-14 +// Copyright: (c) 2014 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_SYSTHEMECTRL_H +#define _WX_SYSTHEMECTRL_H + +#include "wx/defs.h" + +class WXDLLIMPEXP_FWD_CORE wxWindow; + +class WXDLLIMPEXP_CORE wxSystemThemedControlBase +{ +public: + wxSystemThemedControlBase() { } + + virtual ~wxSystemThemedControlBase() { } + +protected: + // This method is virtual and can be overridden, e.g. composite controls do + // it to enable the system theme for all of their parts. + virtual void DoEnableSystemTheme(bool enable, wxWindow* window); + + wxDECLARE_NO_COPY_CLASS(wxSystemThemedControlBase); +}; + +// This class used CRTP, i.e. it should be instantiated for the real base class +// and inherited from. +template +class wxSystemThemedControl : public C, + public wxSystemThemedControlBase +{ +public: + wxSystemThemedControl() { } + + void EnableSystemTheme(bool enable = true) + { + DoEnableSystemTheme(enable, this); + } + +protected: + wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxSystemThemedControl, C); +}; + +// Only __WXMSW__ has a non-trivial implementation currently. +#ifdef __WXMSW__ + #define wxHAS_SYSTEM_THEMED_CONTROL +#endif + +#ifndef wxHAS_SYSTEM_THEMED_CONTROL + +inline void +wxSystemThemedControlBase::DoEnableSystemTheme(bool WXUNUSED(enable), + wxWindow* WXUNUSED(window)) +{ + // Nothing to do. +} + +#endif // !wxHAS_SYSTEM_THEMED_CONTROL + +#endif // _WX_SYSTHEMECTRL_H diff --git a/include/wx/treectrl.h b/include/wx/treectrl.h index 2a958abac3..5e7dfa9731 100644 --- a/include/wx/treectrl.h +++ b/include/wx/treectrl.h @@ -22,6 +22,7 @@ #include "wx/control.h" #include "wx/treebase.h" #include "wx/textctrl.h" // wxTextCtrl::ms_classinfo used through wxCLASSINFO macro +#include "wx/systhemectrl.h" class WXDLLIMPEXP_FWD_CORE wxImageList; @@ -33,7 +34,7 @@ class WXDLLIMPEXP_FWD_CORE wxImageList; // wxTreeCtrlBase // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxTreeCtrlBase : public wxControl +class WXDLLIMPEXP_CORE wxTreeCtrlBase : public wxSystemThemedControl { public: wxTreeCtrlBase(); diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 1892e60740..957c1de05e 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -907,6 +907,11 @@ wxEventType wxEVT_DATAVIEW_ITEM_DROP; you need to handle any mouse events not covered by the ones above, consider using a custom renderer for the cells that must handle them. + @note Under wxMSW this control uses wxSystemThemedControl for an explorer + style appearance by default since wxWidgets 3.1.0. If this is not desired, + you can call wxSystemThemedControl::EnableSystemTheme with @c false + argument to disable this. + @library{wxadv} @category{ctrl,dvc} @appearance{dataviewctrl} diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 5b825d8021..34d4a17449 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -258,6 +258,10 @@ enum Processes a @c wxEVT_LIST_CACHE_HINT event type. @endEventTable + @note Under wxMSW this control uses wxSystemThemedControl for an explorer + style appearance by default since wxWidgets 3.1.0. If this is not desired, + you can call wxSystemThemedControl::EnableSystemTheme with @c false + argument to disable this. @library{wxcore} @category{ctrl} diff --git a/interface/wx/systhemectrl.h b/interface/wx/systhemectrl.h new file mode 100644 index 0000000000..c8fc4d8f88 --- /dev/null +++ b/interface/wx/systhemectrl.h @@ -0,0 +1,70 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/systhemectrl.h +// Purpose: Documentation for wxSystemThemedControl +// Author: Tobias Taschner +// Created: 2014-08-15 +// Copyright: (c) 2014 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +/** + A helper class making it possible to use system theme for any control. + + Under MSW, there an alternative theme available for the list and list-like + controls since Windows Vista. This theme us used by Windows Explorer list + and tree view and so is arguably more familiar to the users than the standard + appearance of these controls. + + This class is used in wxWidgets to enable this system theme in wxTreeCtrl, + wxListCtrl and wxDataViewCtrl and thus give them the same, familiar look. + It can also be used as a helper for implementing custom controls with the same + appearance. Notice that when using this class it is especially important + to use wxRendererNative::DrawItemSelectionRect() and + wxRendererNative::DrawItemText() to draw the control items to ensure that + they appear correctly under all platforms and Windows versions. + + The following example shows implementation of a system theme enabled wxVListBox: + @code + #include + + class MyListCtrl : public wxSystemThemedControl + { + public: + MyListCtrl(wxWindow* parent) + { + + ... + + EnableSystemTheme(); + } + + void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const wxOVERRIDE + { + wxRendererNative::GetDefault().DrawItemText(this, dc, "Item #x", rect); + } + }; + @endcode + + On non-MSW platforms this class currently does nothing but is still + available, so that it can be used in portable code without any conditional + compilation directives. + + @category{miscwnd} + + @see wxTreeCtrl, wxListCtrl, wxDataViewCtrl, wxRendererNative + + @since 3.1.0 +*/ +template +class wxSystemThemedControl : public C +{ +public: + /// Trival default constructor. + wxSystemThemedControl(); + + /** + This method may be called to disable the system theme of controls + using it by default. + */ + void EnableSystemTheme(bool enable = true); +}; diff --git a/interface/wx/treectrl.h b/interface/wx/treectrl.h index d1b8f9eaaa..c119aca425 100644 --- a/interface/wx/treectrl.h +++ b/interface/wx/treectrl.h @@ -32,10 +32,8 @@ Selects alternative style of @c +/@c - buttons and shows rotating ("twisting") arrows instead. Currently this style is only implemented under Microsoft Windows Vista and later Windows versions and is ignored - under the other platforms. Notice that under Vista this style results - in the same appearance as used by the tree control in Explorer and - other built-in programs and so using it may be preferable to the - default style. + under the other platforms as enabling it is equivalent to using + wxSystemThemedControl::EnableSystemTheme(). @style{wxTR_NO_LINES} Use this style to hide vertical level connectors. @style{wxTR_FULL_ROW_HIGHLIGHT} diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index ec94efc43d..536e7ae2ea 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -29,6 +29,7 @@ #include "wx/spinctrl.h" #include "wx/choice.h" #include "wx/imaglist.h" +#include "wx/renderer.h" const char wxDataViewCtrlNameStr[] = "dataviewCtrl"; @@ -974,7 +975,7 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, int xoffset, wxRect rect, wxDC *dc, - int WXUNUSED(state)) + int state) { wxRect rectText = rect; rectText.x += xoffset; @@ -994,9 +995,20 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, ); } + int flags = 0; + if ( state & wxDATAVIEW_CELL_SELECTED ) + flags |= wxCONTROL_SELECTED | wxCONTROL_FOCUSED; + if ( !GetOwner()->GetOwner()->IsEnabled() ) + flags |= wxCONTROL_DISABLED; + // get the alignment to use - dc->DrawLabel(ellipsizedText.empty() ? text : ellipsizedText, - rectText, GetEffectiveAlignment()); + wxRendererNative::Get().DrawItemText( + GetOwner()->GetOwner(), + *dc, + ellipsizedText.empty() ? text : ellipsizedText, + rectText, + GetEffectiveAlignment(), + flags); } void wxDataViewCustomRendererBase::SetEnabled(bool enabled) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index c5bb710690..1fcad8eb24 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4659,6 +4659,8 @@ bool wxDataViewCtrl::Create(wxWindow *parent, sizer->Add( m_clientArea, 1, wxGROW ); SetSizer( sizer ); + EnableSystemTheme(); + return true; } @@ -5419,6 +5421,14 @@ void wxDataViewCtrl::ToggleSortByColumn(int column) m_headerArea->ToggleSortByColumn(column); } +void wxDataViewCtrl::DoEnableSystemTheme(bool enable, wxWindow* window) +{ + wxSystemThemedControl::DoEnableSystemTheme(enable, window); + wxSystemThemedControl::DoEnableSystemTheme(enable, m_clientArea); + if ( m_headerArea ) + wxSystemThemedControl::DoEnableSystemTheme(enable, m_headerArea); +} + #endif // !wxUSE_GENERICDATAVIEWCTRL #endif // wxUSE_DATAVIEWCTRL diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 29f9986bf0..5e27d051cb 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -267,6 +267,8 @@ bool wxListCtrl::Create(wxWindow *parent, if ( !MSWCreateControl(WC_LISTVIEW, wxEmptyString, pos, size) ) return false; + EnableSystemTheme(); + // explicitly say that we want to use Unicode because otherwise we get ANSI // versions of _some_ messages (notably LVN_GETDISPINFOA) wxSetCCUnicodeFormat(GetHwnd()); diff --git a/src/msw/systhemectrl.cpp b/src/msw/systhemectrl.cpp new file mode 100644 index 0000000000..c705b05e00 --- /dev/null +++ b/src/msw/systhemectrl.cpp @@ -0,0 +1,35 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/msw/systhemectrl.cpp +// Purpose: wxMSW implementation of wxSystemThemedControl +// Author: Tobias Taschner +// Created: 2015-09-15 +// Copyright: (c) 2015 wxWidgets development team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/systhemectrl.h" + +#include "wx/msw/private.h" +#include "wx/msw/uxtheme.h" + +#ifdef wxHAS_SYSTEM_THEMED_CONTROL + +void wxSystemThemedControlBase::DoEnableSystemTheme(bool enable, wxWindow* window) +{ + if ( wxGetWinVersion() >= wxWinVersion_Vista ) + { + if ( wxUxThemeEngine *te = wxUxThemeEngine::GetIfActive() ) + { + const wchar_t* const sysThemeId = enable ? L"EXPLORER" : NULL; + te->SetWindowTheme(GetHwndOf(window), sysThemeId, NULL); + } + } +} + +#endif // wxHAS_SYSTEM_THEMED_CONTROL diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 3112e1eb93..49591b2d65 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -783,16 +783,9 @@ bool wxTreeCtrl::Create(wxWindow *parent, if ( m_windowStyle & wxTR_TWIST_BUTTONS ) { - // Under Vista and later Explorer uses rotating ("twist") buttons - // instead of the default "+/-" ones so apply its theme to the tree - // control to implement this style. - if ( wxGetWinVersion() >= wxWinVersion_Vista ) - { - if ( wxUxThemeEngine *theme = wxUxThemeEngine::GetIfActive() ) - { - theme->SetWindowTheme(GetHwnd(), L"EXPLORER", NULL); - } - } + // The Vista+ system theme uses rotating ("twist") buttons, so we map + // this style to it. + EnableSystemTheme(); } return true;