/*************************************************************************** * Copyright (C) 2001-2008 by Józef Starosczyk * * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License * * (version 2) as published by the Free Software Foundation; * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "stdafx.h" #include "ch.h" #include "resource.h" #include "OptionsDlg.h" #include "BufferSizeDlg.h" #include "ShortcutsDlg.h" #include "RecentDlg.h" #include #include "structs.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif bool COptionsDlg::m_bLock=false; ///////////////////////////////////////////////////////////////////////////// // COptionsDlg dialog COptionsDlg::COptionsDlg(CWnd* pParent /*=NULL*/) :ictranslate::CLanguageDialog(COptionsDlg::IDD, pParent, &m_bLock) { } void COptionsDlg::DoDataExchange(CDataExchange* pDX) { CLanguageDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_PROPERTIES_LIST, m_ctlProperties); } BEGIN_MESSAGE_MAP(COptionsDlg, ictranslate::CLanguageDialog) ON_BN_CLICKED(IDC_APPLY_BUTTON, OnApplyButton) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // COptionsDlg message handlers // properties handling macros #define PROP_SEPARATOR(text)\ m_ctlProperties.AddString(text) #define PROP_BOOL(text, value)\ m_ctlProperties.AddString(text, ID_PROPERTY_COMBO_LIST, IDS_BOOLTEXT_STRING, (value)) #define PROP_UINT(text, value)\ do\ {\ const size_t stBufferSize = 16;\ wchar_t szBuffer[stBufferSize];\ m_ctlProperties.AddString(text, ID_PROPERTY_TEXT, _itot(boost::numeric_cast((value)), szBuffer, stBufferSize), 0);\ }\ while(false) #define PROP_COMBO(text, prop_text, value)\ m_ctlProperties.AddString(text, ID_PROPERTY_COMBO_LIST, prop_text, boost::numeric_cast((value))) #define PROP_DIR(text, prop_text, value)\ m_ctlProperties.AddString(text, ID_PROPERTY_DIR, (value)+CString(GetResManager().LoadString(prop_text)), 0) #define PROP_PATH(text, prop_text, value)\ m_ctlProperties.AddString(text, ID_PROPERTY_PATH, (value)+CString(GetResManager().LoadString(prop_text)), 0) #define PROP_CUSTOM_UINT(text, value, callback, param)\ do\ {\ const size_t stBufferSize = 16;\ wchar_t szBuffer[stBufferSize];\ m_ctlProperties.AddString(text, ID_PROPERTY_CUSTOM, CString(_itot(boost::numeric_cast((value)), szBuffer, stBufferSize)), callback, this, param, 0);\ }\ while(false) #define SKIP_SEPARATOR(pos)\ pos++ BOOL COptionsDlg::OnInitDialog() { CLanguageDialog::OnInitDialog(); AddResizableControl(IDC_PROPERTIES_LIST, 0.0, 0.0, 1.0, 1.0); AddResizableControl(IDOK, 1.0, 1.0, 0.0, 0.0); AddResizableControl(IDCANCEL, 1.0, 1.0, 0.0, 0.0); AddResizableControl(IDC_APPLY_BUTTON, 1.0, 1.0, 0.0, 0.0); AddResizableControl(IDHELP, 1.0, 1.0, 0.0, 0.0); InitializeResizableControls(); m_ctlProperties.Init(); // copy shortcut and recent paths chcore::TConfig& rConfig = GetConfig(); m_cvRecent.clear(); GetPropValue(rConfig, m_cvRecent); m_cvShortcuts.clear(); GetPropValue(rConfig, m_cvShortcuts); GetResManager().Scan(GetApp().ExpandPath(_T("\\Langs\\")), &m_vld); // some attributes m_ctlProperties.SetBkColor(RGB(255, 255, 255)); m_ctlProperties.SetTextColor(RGB(80, 80, 80)); m_ctlProperties.SetTextHighlightColor(RGB(80,80,80)); m_ctlProperties.SetHighlightColor(RGB(200, 200, 200)); m_ctlProperties.SetPropertyBkColor(RGB(255,255,255)); m_ctlProperties.SetPropertyTextColor(RGB(0,0,0)); m_ctlProperties.SetLineStyle(RGB(74,109,132), PS_SOLID); FillPropertyList(); return TRUE; } void CustomPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex) { COptionsDlg* pDlg=static_cast(lpParam); chcore::TBufferSizes tBufferSizes(pDlg->GetBoolProp(iIndex - iParam - 1), pDlg->GetUintProp(iIndex - iParam + 5), pDlg->GetUintProp(iIndex - iParam), pDlg->GetUintProp(iIndex - iParam + 1), pDlg->GetUintProp(iIndex - iParam + 2), pDlg->GetUintProp(iIndex - iParam + 3), pDlg->GetUintProp(iIndex - iParam + 4)); CBufferSizeDlg dlg(&tBufferSizes, (chcore::TBufferSizes::EBufferType)iParam); if (dlg.DoModal() == IDOK) { tBufferSizes = dlg.GetBufferSizes(); PROPERTYITEM* pItem; TCHAR xx[32]; pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam-1)); pItem->nPropertySelected=(tBufferSizes.IsOnlyDefault() ? 1 : 0); pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam)); pItem->csProperties.SetAt(0, _itot(tBufferSizes.GetDefaultSize(), xx, 10)); pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam+1)); pItem->csProperties.SetAt(0, _itot(tBufferSizes.GetOneDiskSize(), xx, 10)); pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam+2)); pItem->csProperties.SetAt(0, _itot(tBufferSizes.GetTwoDisksSize(), xx, 10)); pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam+3)); pItem->csProperties.SetAt(0, _itot(tBufferSizes.GetCDSize(), xx, 10)); pItem = (PROPERTYITEM*) pList->GetAt(pList->FindIndex(iIndex - iParam + 4)); pItem->csProperties.SetAt(0, _itot(tBufferSizes.GetLANSize(), xx, 10)); pItem = (PROPERTYITEM*) pList->GetAt(pList->FindIndex(iIndex - iParam + 5)); pItem->csProperties.SetAt(0, _itot(tBufferSizes.GetBufferCount(), xx, 10)); } } void ShortcutsPropertyCallbackProc(LPVOID lpParam, int /*iParam*/, CPtrList* pList, int iIndex) { COptionsDlg* pDlg=static_cast(lpParam); CShortcutsDlg dlg; dlg.m_cvShortcuts = pDlg->m_cvShortcuts; dlg.m_pcvRecent=&pDlg->m_cvRecent; if (dlg.DoModal() == IDOK) { // restore shortcuts to pDlg->cvShortcuts pDlg->m_cvShortcuts = dlg.m_cvShortcuts; // property list TCHAR szBuf[32]; PROPERTYITEM* pItem; pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex)); pItem->csProperties.SetAt(0, _ui64tot(pDlg->m_cvShortcuts.size(), szBuf, 10)); } } void RecentPropertyCallbackProc(LPVOID lpParam, int /*iParam*/, CPtrList* pList, int iIndex) { COptionsDlg* pDlg=static_cast(lpParam); CRecentDlg dlg; dlg.m_cvRecent = pDlg->m_cvRecent; if (dlg.DoModal() == IDOK) { // restore pDlg->m_cvRecent = dlg.m_cvRecent; // property list TCHAR szBuf[32]; PROPERTYITEM* pItem; pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex)); pItem->csProperties.SetAt(0, _ui64tot(pDlg->m_cvRecent.size(), szBuf, 10)); } } void COptionsDlg::OnOK() { // kill focuses m_ctlProperties.HideControls(); ApplyProperties(); SendClosingNotify(); CLanguageDialog::OnOK(); } void COptionsDlg::FillPropertyList() { CString strPath; // load settings PROP_SEPARATOR(IDS_PROGRAM_STRING); PROP_BOOL(IDS_CLIPBOARDMONITORING_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_CLIPBOARDINTERVAL_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_AUTORUNPROGRAM_STRING, GetPropValue(GetConfig())); PROP_COMBO(IDS_CFG_CHECK_FOR_UPDATES_FREQUENCY, IDS_UPDATE_FREQUENCIES, GetPropValue(GetConfig())); PROP_COMBO(IDS_CFG_UPDATECHANNEL, IDS_CFGUPDATECHANNELITEMS_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_AUTOSHUTDOWN_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_SHUTDOWNTIME_STRING, GetPropValue(GetConfig())); PROP_COMBO(IDS_FORCESHUTDOWN_STRING, IDS_FORCESHUTDOWNVALUES_STRING, GetPropValue(GetConfig()) ? 1 : 0); PROP_UINT(IDS_AUTOSAVEINTERVAL_STRING, GetPropValue(GetConfig())); PROP_COMBO(IDS_CFGPRIORITYCLASS_STRING, IDS_CFGPRIORITYCLASSITEMS_STRING, PriorityClassToIndex(boost::numeric_cast(GetPropValue(GetConfig())))); PROP_DIR(IDS_TEMPFOLDER_STRING, IDS_TEMPFOLDERCHOOSE_STRING, strPath); // lang CString strLangs; size_t stIndex=0; for (vector::iterator it=m_vld.begin();it != m_vld.end();++it) { strLangs+=(*it).GetLangName(); strLangs+=_T("!"); if (_tcsicmp((*it).GetFilename(true), GetResManager().m_ld.GetFilename(true)) == 0) stIndex = it - m_vld.begin(); } strLangs.TrimRight(_T('!')); PROP_COMBO(IDS_LANGUAGE_STRING, strLangs, stIndex); ///////////////// PROP_SEPARATOR(IDS_STATUSWINDOW_STRING); PROP_UINT(IDS_REFRESHSTATUSINTERVAL_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_STATUSAUTOREMOVE_STRING, GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_MINIVIEW_STRING); PROP_BOOL(IDS_SHOWFILENAMES_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_SHOWSINGLETASKS_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_MINIVIEWREFRESHINTERVAL_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_MINIVIEWSHOWAFTERSTART_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_MINIVIEWAUTOHIDE_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_MINIVIEWSMOOTHPROGRESS_STRING, GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_CFGFOLDERDIALOG_STRING); PROP_BOOL(IDS_CFGFDEXTVIEW_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_CFGFDWIDTH_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_CFGFDHEIGHT_STRING, GetPropValue(GetConfig())); PROP_COMBO(IDS_CFGFDSHORTCUTS_STRING, IDS_CFGFDSHORTCUTSSTYLES_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGFDIGNOREDIALOGS_STRING, GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_CFGSHELL_STRING); PROP_BOOL(IDS_CFGSHCOPY_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHMOVE_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHCMSPECIAL_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHPASTE_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHPASTESPECIAL_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHCOPYTO_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHMOVETO_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHCMTOSPECIAL_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHSHOWFREESPACE_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHSHOWICONS_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGSHINTERCEPTDRAG_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGINTERCEPTKEYACTION_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_CFGINTERCEPTCONTEXTMENU_STRING, GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_DIALOGS_SHOW_HIDE_STRING); PROP_COMBO(IDS_SHELLEXT_REGISTER_SHOWHIDE_STRING, MakeCompoundString(IDS_ALWAYS_SHOW_STRING, 3, _T("!")), GetPropValue(GetConfig())); PROP_COMBO(IDS_SHELLEXT_VERSIONMISMATCH_SHOWHIDE_STRING, MakeCompoundString(IDS_ALWAYS_SHOW_STRING, 3, _T("!")), GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_PROCESSINGTHREAD_STRING); PROP_BOOL(IDS_SETDESTATTRIB_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_SETDESTTIME_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_PROTECTROFILES_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_LIMITOPERATIONS_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_READSIZEBEFOREBLOCK_STRING, GetPropValue(GetConfig())); PROP_COMBO(IDS_DEFAULTPRIORITY_STRING, MakeCompoundString(IDS_PRIORITY0_STRING, 7, _T("!")), PriorityToIndex(boost::numeric_cast(GetPropValue(GetConfig())))); PROP_BOOL(IDS_CFGDISABLEPRIORITYBOOST_STRING, GetPropValue(GetConfig())); PROP_BOOL(IDS_DELETEAFTERFINISHED_STRING, GetPropValue(GetConfig())); // Buffer PROP_SEPARATOR(IDS_OPTIONSBUFFER_STRING); PROP_BOOL(IDS_AUTODETECTBUFFERSIZE_STRING, GetPropValue(GetConfig())); PROP_CUSTOM_UINT(IDS_DEFAULTBUFFERSIZE_STRING, GetPropValue(GetConfig()), &CustomPropertyCallbackProc, 0); PROP_CUSTOM_UINT(IDS_ONEDISKBUFFERSIZE_STRING, GetPropValue(GetConfig()), &CustomPropertyCallbackProc, 1); PROP_CUSTOM_UINT(IDS_TWODISKSBUFFERSIZE_STRING, GetPropValue(GetConfig()), &CustomPropertyCallbackProc, 2); PROP_CUSTOM_UINT(IDS_CDBUFFERSIZE_STRING, GetPropValue(GetConfig()), &CustomPropertyCallbackProc, 3); PROP_CUSTOM_UINT(IDS_LANBUFFERSIZE_STRING, GetPropValue(GetConfig()), &CustomPropertyCallbackProc, 4); PROP_BOOL(IDS_USENOBUFFERING_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_LARGEFILESMINSIZE_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_BUFFER_QUEUE_DEPTH, GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_CFGLOGFILE_STRING); PROP_BOOL(IDS_CFGENABLELOGGING_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_CFGMAXLIMIT_STRING, GetPropValue(GetConfig())); PROP_COMBO(IDS_CFGLOGLEVEL, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); // Sounds PROP_SEPARATOR(IDS_SOUNDS_STRING); PROP_BOOL(IDS_PLAYSOUNDS_STRING, GetPropValue(GetConfig())); PROP_PATH(IDS_SOUNDONERROR_STRING, IDS_SOUNDSWAVFILTER_STRING, GetPropValue(GetConfig())); PROP_PATH(IDS_SOUNDONFINISH_STRING, IDS_SOUNDSWAVFILTER_STRING, GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_CFGSHORTCUTS_STRING); PROP_CUSTOM_UINT(IDS_CFGSCCOUNT_STRING, m_cvShortcuts.size(), &ShortcutsPropertyCallbackProc, 0); PROP_SEPARATOR(IDS_CFGRECENT_STRING); PROP_CUSTOM_UINT(IDS_CFGRPCOUNT_STRING, m_cvRecent.size(), &RecentPropertyCallbackProc, 0); } void COptionsDlg::ApplyProperties() { // counter int iPosition=0; chcore::TConfig& rConfig = GetConfig(); rConfig.DelayNotifications(); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetIndexProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, IndexToPriorityClass(GetIndexProp(iPosition++))); // language PCTSTR pszSrc=m_vld.at(GetIndexProp(iPosition++)).GetFilename(true); if (_tcsnicmp(pszSrc, GetApp().GetProgramPath(), _tcslen(GetApp().GetProgramPath())) == 0) { // replace the first part of path with TCHAR szData[_MAX_PATH]; _sntprintf(szData, _MAX_PATH, _T("%s"), pszSrc+_tcslen(GetApp().GetProgramPath())); SetPropValue(rConfig, szData); } else SetPropValue(rConfig, pszSrc); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetIndexProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetIndexProp(iPosition++)); SetPropValue(rConfig, GetIndexProp(iPosition++)); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, IndexToPriority(GetIndexProp(iPosition++))); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); // Buffer SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); // log file SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); SetPropValue(rConfig, GetIndexProp(iPosition++)); // Sounds SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetStringProp(iPosition++)); SetPropValue(rConfig, GetStringProp(iPosition++)); // shortcuts & recent paths SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, m_cvShortcuts); SKIP_SEPARATOR(iPosition); SetPropValue(rConfig, m_cvRecent); rConfig.ResumeNotifications(); rConfig.Write(); } void COptionsDlg::OnCancel() { SendClosingNotify(); CLanguageDialog::OnCancel(); } void COptionsDlg::SendClosingNotify() { GetParent()->PostMessage(WM_CONFIGNOTIFY); } CString COptionsDlg::MakeCompoundString(UINT uiBase, int iCount, LPCTSTR lpszSeparator) { assert(lpszSeparator); if(!lpszSeparator) return _T(""); CString strText = GetResManager().LoadString(uiBase + 0); for(int i = 1; i < iCount; i++) { strText += lpszSeparator; strText += GetResManager().LoadString(uiBase + i); } return strText; } bool COptionsDlg::GetBoolProp(int iPosition) { int iSel = 0; m_ctlProperties.GetProperty(iPosition, &iSel); return iSel != 0; } UINT COptionsDlg::GetUintProp(int iPosition) { CString strValue; m_ctlProperties.GetProperty(iPosition, &strValue); return _ttoi(strValue); } CString COptionsDlg::GetStringProp(int iPosition) { CString strValue; m_ctlProperties.GetProperty(iPosition, &strValue); return strValue; } int COptionsDlg::GetIndexProp(int iPosition) { int iSel = 0; m_ctlProperties.GetProperty(iPosition, &iSel); return iSel; } void COptionsDlg::OnApplyButton() { // kill focuses m_ctlProperties.HideControls(); ApplyProperties(); } void COptionsDlg::OnLanguageChanged() { m_ctlProperties.Reinit(); // set attributes m_ctlProperties.SetBkColor(RGB(255, 255, 255)); m_ctlProperties.SetTextColor(RGB(80, 80, 80)); m_ctlProperties.SetTextHighlightColor(RGB(80,80,80)); m_ctlProperties.SetHighlightColor(RGB(200, 200, 200)); m_ctlProperties.SetPropertyBkColor(RGB(255,255,255)); m_ctlProperties.SetPropertyTextColor(RGB(0,0,0)); m_ctlProperties.SetLineStyle(RGB(74,109,132), PS_SOLID); FillPropertyList(); }