00001
00002
00003
00004
00005
00006 #include "stdafx.h"
00007 #include "FdmApp.h"
00008 #include "Prg_SkinsPage.h"
00009
00010 #ifdef _DEBUG
00011 #define new DEBUG_NEW
00012 #undef THIS_FILE
00013 static char THIS_FILE[] = __FILE__;
00014 #endif
00015
00016 IMPLEMENT_DYNCREATE(CPrg_SkinsPage, CPropertyPage)
00017
00018 CPrg_SkinsPage::CPrg_SkinsPage() : CPropertyPage(CPrg_SkinsPage::IDD)
00019 {
00020 m_psp.dwFlags |= PSP_USETITLE;
00021 m_psp.pszTitle = LS (L_SKINS);
00022 }
00023
00024 CPrg_SkinsPage::~CPrg_SkinsPage()
00025 {
00026 }
00027
00028 void CPrg_SkinsPage::DoDataExchange(CDataExchange* pDX)
00029 {
00030 CPropertyPage::DoDataExchange(pDX);
00031
00032 DDX_Control(pDX, IDC_SKIN, m_wndSkins);
00033
00034 }
00035
00036 BEGIN_MESSAGE_MAP(CPrg_SkinsPage, CPropertyPage)
00037
00038 ON_WM_HELPINFO()
00039
00040 END_MESSAGE_MAP()
00041
00042 BOOL CPrg_SkinsPage::OnInitDialog()
00043 {
00044 CPropertyPage::OnInitDialog();
00045
00046 m_wndSkins.AddString (LS (L_NEWSTYLE));
00047 for (int i = 0; i < _SkinMgr.get_Count (); i++)
00048 {
00049 CString str = _SkinMgr.get_Skin (i)->strName;
00050 if (str.CompareNoCase ("Old Style") == 0)
00051 str = LS (L_OLDSTYLE);
00052 m_wndSkins.AddString (str);
00053 }
00054 m_wndSkins.SetCurSel (_SkinMgr.get_Current ()+1);
00055
00056 DWORD dw = _App.Skin_Flags ();
00057 CheckDlgButton (IDC_ALLOWICONS, dw & SM_ALLOWICONS ? BST_CHECKED : BST_UNCHECKED);
00058 CheckDlgButton (IDC_ALLOWBITMAPS, dw & SM_ALLOWBITMAPS ? BST_CHECKED : BST_UNCHECKED);
00059
00060 ApplyLanguage ();
00061
00062 return TRUE;
00063 }
00064
00065 void CPrg_SkinsPage::ApplyLanguage()
00066 {
00067 fsDlgLngInfo lnginfo [] = {
00068 fsDlgLngInfo (IDC__SKIN, L_SKIN),
00069 fsDlgLngInfo (IDC_ALLOWBITMAPS, L_SKIN_ALLOWBITMAPS),
00070 fsDlgLngInfo (IDC_ALLOWICONS, L_SKIN_ALLOWICONS),
00071 fsDlgLngInfo (IDC__AFTERRESTART, L_AFTERRESTART),
00072 };
00073
00074 _LngMgr.ApplyLanguage (this, lnginfo, sizeof (lnginfo) / sizeof (fsDlgLngInfo));
00075 }
00076
00077 BOOL CPrg_SkinsPage::OnApply()
00078 {
00079 CString str;
00080 m_wndSkins.GetLBText (m_wndSkins.GetCurSel (), str);
00081
00082 if (str == LS (L_OLDSTYLE))
00083 str = "Old Style";
00084 else if (str == LS (L_NEWSTYLE))
00085 str = "";
00086
00087 _App.Skin_Current (str);
00088
00089 DWORD dw = 0;
00090 if (IsDlgButtonChecked (IDC_ALLOWICONS) == BST_CHECKED)
00091 dw |= SM_ALLOWICONS;
00092 if (IsDlgButtonChecked (IDC_ALLOWBITMAPS) == BST_CHECKED)
00093 dw |= SM_ALLOWBITMAPS;
00094 _App.Skin_Flags (dw);
00095
00096 return CPropertyPage::OnApply();
00097 }
00098
00099 BOOL CPrg_SkinsPage::OnHelpInfo(HELPINFO* pHelpInfo)
00100 {
00101 return FALSE;
00102 }