diff --git a/Library/Dialog.cpp b/Library/Dialog.cpp index f471ebb9..4d74c8dc 100644 --- a/Library/Dialog.cpp +++ b/Library/Dialog.cpp @@ -55,7 +55,7 @@ INT_PTR CDialog::OnActivate(WPARAM wParam, LPARAM lParam) if (wParam) { c_ActiveDialogWindow = m_Window; - c_ActiveTabWindow = GetActiveTab().GetWindow(); + c_ActiveTabWindow = GetActiveWindow(); } else { @@ -65,18 +65,18 @@ INT_PTR CDialog::OnActivate(WPARAM wParam, LPARAM lParam) return FALSE; } -void CDialog::SetDialogRTL() +void CDialog::SetDialogRTL(HWND window) { - SetWindowLongPtr(m_Window, GWL_EXSTYLE, GetWindowLongPtr(m_Window, GWL_EXSTYLE) | WS_EX_LAYOUTRTL); + SetWindowLongPtr(window, GWL_EXSTYLE, GetWindowLongPtr(window, GWL_EXSTYLE) | WS_EX_LAYOUTRTL); } /* ** Sets dialog font to UI font. ** */ -void CDialog::SetDialogFont() +void CDialog::SetDialogFont(HWND window) { - EnumChildWindows(m_Window, SetFontProc, (WPARAM)m_Font); + EnumChildWindows(window, SetFontProc, (WPARAM)m_Font); } /* diff --git a/Library/Dialog.h b/Library/Dialog.h index 2bb9104f..4f227e8e 100644 --- a/Library/Dialog.h +++ b/Library/Dialog.h @@ -49,12 +49,15 @@ protected: CDialog(HWND wnd); virtual ~CDialog(); - virtual CTab& GetActiveTab() = 0; + virtual HWND GetActiveWindow() { return m_Window; } INT_PTR OnActivate(WPARAM wParam, LPARAM lParam); - void SetDialogRTL(); - void SetDialogFont(); + void SetDialogRTL(HWND window); + void SetDialogRTL() { SetDialogRTL(m_Window); } + + void SetDialogFont(HWND window); + void SetDialogFont() { SetDialogFont(m_Window); } HWND m_Window; HFONT m_Font; diff --git a/Library/DialogAbout.h b/Library/DialogAbout.h index 23e7c251..c44fe8e0 100644 --- a/Library/DialogAbout.h +++ b/Library/DialogAbout.h @@ -44,7 +44,7 @@ public: static CDialogAbout* c_Dialog; protected: - virtual CTab& GetActiveTab(); + virtual HWND GetActiveWindow() { return GetActiveTab().GetWindow(); } private: // Log tab @@ -119,6 +119,8 @@ private: INT_PTR OnCommand(WPARAM wParam, LPARAM lParam); }; + CTab& GetActiveTab(); + CTabLog m_TabLog; CTabSkins m_TabSkins; CTabPlugins m_TabPlugins; diff --git a/Library/DialogManage.h b/Library/DialogManage.h index 70a5fc08..e8459d27 100644 --- a/Library/DialogManage.h +++ b/Library/DialogManage.h @@ -42,7 +42,7 @@ public: static CDialogManage* c_Dialog; protected: - virtual CTab& GetActiveTab(); + virtual HWND GetActiveWindow() { return GetActiveTab().GetWindow(); } private: // Skins tab @@ -101,6 +101,8 @@ private: INT_PTR OnCommand(WPARAM wParam, LPARAM lParam); }; + CTab& GetActiveTab(); + CTabSkins m_TabSkins; CTabThemes m_TabThemes; CTabSettings m_TabSettings;