Minor changes to dialog classes

This commit is contained in:
Birunthan Mohanathas 2012-06-16 21:41:17 +03:00
parent 20d3910e91
commit a7a74dda69
4 changed files with 17 additions and 10 deletions

View File

@ -55,7 +55,7 @@ INT_PTR CDialog::OnActivate(WPARAM wParam, LPARAM lParam)
if (wParam) if (wParam)
{ {
c_ActiveDialogWindow = m_Window; c_ActiveDialogWindow = m_Window;
c_ActiveTabWindow = GetActiveTab().GetWindow(); c_ActiveTabWindow = GetActiveWindow();
} }
else else
{ {
@ -65,18 +65,18 @@ INT_PTR CDialog::OnActivate(WPARAM wParam, LPARAM lParam)
return FALSE; 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. ** 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);
} }
/* /*

View File

@ -49,12 +49,15 @@ protected:
CDialog(HWND wnd); CDialog(HWND wnd);
virtual ~CDialog(); virtual ~CDialog();
virtual CTab& GetActiveTab() = 0; virtual HWND GetActiveWindow() { return m_Window; }
INT_PTR OnActivate(WPARAM wParam, LPARAM lParam); INT_PTR OnActivate(WPARAM wParam, LPARAM lParam);
void SetDialogRTL(); void SetDialogRTL(HWND window);
void SetDialogFont(); void SetDialogRTL() { SetDialogRTL(m_Window); }
void SetDialogFont(HWND window);
void SetDialogFont() { SetDialogFont(m_Window); }
HWND m_Window; HWND m_Window;
HFONT m_Font; HFONT m_Font;

View File

@ -44,7 +44,7 @@ public:
static CDialogAbout* c_Dialog; static CDialogAbout* c_Dialog;
protected: protected:
virtual CTab& GetActiveTab(); virtual HWND GetActiveWindow() { return GetActiveTab().GetWindow(); }
private: private:
// Log tab // Log tab
@ -119,6 +119,8 @@ private:
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam); INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
}; };
CTab& GetActiveTab();
CTabLog m_TabLog; CTabLog m_TabLog;
CTabSkins m_TabSkins; CTabSkins m_TabSkins;
CTabPlugins m_TabPlugins; CTabPlugins m_TabPlugins;

View File

@ -42,7 +42,7 @@ public:
static CDialogManage* c_Dialog; static CDialogManage* c_Dialog;
protected: protected:
virtual CTab& GetActiveTab(); virtual HWND GetActiveWindow() { return GetActiveTab().GetWindow(); }
private: private:
// Skins tab // Skins tab
@ -101,6 +101,8 @@ private:
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam); INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
}; };
CTab& GetActiveTab();
CTabSkins m_TabSkins; CTabSkins m_TabSkins;
CTabThemes m_TabThemes; CTabThemes m_TabThemes;
CTabSettings m_TabSettings; CTabSettings m_TabSettings;