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)
{
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);
}
/*

View File

@ -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;

View File

@ -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;

View File

@ -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;