Allow constructing wxUxThemeHandle from an HWND too
This is not used used yet, but will be soon for getting theme data of the header control which is part of wxListCtrl but doesn't have any corresponding wxWindow. It's also useful for using null HWND, which must be used with the special "ItemsView" theme when using dark mode.
This commit is contained in:
parent
8d3971ef6b
commit
4b0c691b09
1 changed files with 7 additions and 2 deletions
|
|
@ -169,9 +169,14 @@ WXDLLIMPEXP_CORE bool wxUxThemeIsActive();
|
|||
class wxUxThemeHandle
|
||||
{
|
||||
public:
|
||||
wxUxThemeHandle(const wxWindow *win, const wchar_t *classes)
|
||||
wxUxThemeHandle(HWND hwnd, const wchar_t *classes) :
|
||||
m_hTheme{::OpenThemeData(hwnd, classes)}
|
||||
{
|
||||
}
|
||||
|
||||
wxUxThemeHandle(const wxWindow *win, const wchar_t *classes) :
|
||||
wxUxThemeHandle(GetHwndOf(win), classes)
|
||||
{
|
||||
m_hTheme = (HTHEME)::OpenThemeData(GetHwndOf(win), classes);
|
||||
}
|
||||
|
||||
operator HTHEME() const { return m_hTheme; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue