Index: src/ch/ShortcutsDlg.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -r9352ed0c4fe447a36bc728640c307be6d41455fd --- src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/ShortcutsDlg.cpp (.../ShortcutsDlg.cpp) (revision 9352ed0c4fe447a36bc728640c307be6d41455fd) @@ -20,6 +20,7 @@ #include "ch.h" #include "ShortcutsDlg.h" #include "dialogs.h" +#include "shortcuts.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -72,6 +73,28 @@ { CLanguageDialog::OnInitDialog(); + AddResizableControl(IDC_001_STATIC, 0, 0, 1, 0); + AddResizableControl(IDC_SHORTCUT_LIST, 0, 0, 1, 1); + AddResizableControl(IDC_UP_BUTTON, 1, 0, 0, 0); + AddResizableControl(IDC_DOWN_BUTTON, 1, 0, 0, 0); + + AddResizableControl(IDC_004_STATIC, 0, 1, 1, 0); + AddResizableControl(IDC_002_STATIC, 0, 1, 0, 0); + AddResizableControl(IDC_003_STATIC, 0, 1, 0, 0); + + AddResizableControl(IDC_NAME_EDIT, 0, 1, 1, 0); + AddResizableControl(IDC_PATH_COMBOBOXEX, 0, 1, 1, 0); + AddResizableControl(IDC_BROWSE_BUTTON, 1, 1, 0, 0); + + AddResizableControl(IDC_ADD_BUTTON, 0, 1, 0, 0); + AddResizableControl(IDC_CHANGE_BUTTON, 0, 1, 0, 0); + AddResizableControl(IDC_DELETE_BUTTON, 0, 1, 0, 0); + AddResizableControl(IDOK, 1, 1, 0, 0); + AddResizableControl(IDCANCEL, 1, 1, 0, 0); + AddResizableControl(IDC_HELP_BUTTON, 1, 1, 0, 0); + + InitializeResizableControls(); + // system image list SHFILEINFO sfi; m_himl = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), @@ -86,13 +109,13 @@ COMBOBOXEXITEM cbi; cbi.mask=CBEIF_IMAGE | CBEIF_TEXT; - for (int i=0;i<(int)m_pcvRecent->size();i++) + for(size_t stIndex = 0; stIndex < m_pcvRecent->size(); ++stIndex) { - cbi.iItem=i; - cbi.pszText=m_pcvRecent->at(i); - sfi.iIcon=-1; + cbi.iItem = stIndex; + cbi.pszText = m_pcvRecent->at(stIndex); + sfi.iIcon = -1; SHGetFileInfo(cbi.pszText, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON); - cbi.iImage=sfi.iIcon; + cbi.iImage = sfi.iIcon; m_ctlPath.InsertItem(&cbi); } @@ -102,25 +125,25 @@ lvc.mask=LVCF_SUBITEM | LVCF_WIDTH | LVCF_TEXT; lvc.iSubItem=-1; lvc.cx=100; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_SHORTCUTNAME_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_SHORTCUTNAME_STRING); m_ctlShortcuts.InsertColumn(0, &lvc); lvc.iSubItem=0; lvc.cx=200; - lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_SHORTCUTPATH_STRING); + lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_SHORTCUTPATH_STRING); m_ctlShortcuts.InsertColumn(1, &lvc); // modify list style m_ctlShortcuts.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_INFOTIP | LVS_EX_UNDERLINEHOT); // update shortcut list CShortcut sc; - for (int i=0;i<(int)m_cvShortcuts.size();i++) + for(size_t stIndex = 0; stIndex < m_cvShortcuts.size(); ++stIndex) { - sc=CString(m_cvShortcuts.at(i)); - sfi.iIcon=-1; + sc = CString(m_cvShortcuts.at(stIndex)); + sfi.iIcon = -1; SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); - m_ctlShortcuts.InsertItem(i, sc.m_strName, sfi.iIcon); - m_ctlShortcuts.SetItem(i, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + m_ctlShortcuts.InsertItem(boost::numeric_cast(stIndex), sc.m_strName, sfi.iIcon); + m_ctlShortcuts.SetItem(boost::numeric_cast(stIndex), 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); } return TRUE; @@ -131,7 +154,7 @@ NM_LISTVIEW* plv = (NM_LISTVIEW*)pNMHDR; // current selection - if (plv->iItem >= 0 && plv->iItem < (int)m_cvShortcuts.size()) + if (plv->iItem >= 0 && plv->iItem < boost::numeric_cast(m_cvShortcuts.size())) { CShortcut sc(CString(m_cvShortcuts.at(plv->iItem))); m_strName=sc.m_strName; @@ -225,8 +248,8 @@ SHFILEINFO sfi; sfi.iIcon=-1; SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); - m_ctlShortcuts.InsertItem(m_cvShortcuts.size()-1, sc.m_strName, sfi.iIcon); - m_ctlShortcuts.SetItem(m_cvShortcuts.size()-1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + m_ctlShortcuts.InsertItem(boost::numeric_cast(m_cvShortcuts.size() - 1), sc.m_strName, sfi.iIcon); + m_ctlShortcuts.SetItem(boost::numeric_cast(m_cvShortcuts.size() - 1), 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); } void CShortcutsDlg::OnChangeButton() @@ -277,7 +300,7 @@ void CShortcutsDlg::OnBrowseButton() { CString strPath; - if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + if (BrowseForFolder(GetResManager().LoadString(IDS_BROWSE_STRING), &strPath)) SetComboPath(strPath); }