| 1224 | } |
| 1225 | |
| 1226 | bool CSaveModifiedItemsDialog::InitializeColumns(void) |
| 1227 | { |
| 1228 | CRect rcList; |
| 1229 | m_list.GetClientRect(&rcList); |
| 1230 | |
| 1231 | int nameWidth = 0; |
| 1232 | int descriptionWidth = 0; |
| 1233 | int lastModifiedWidth = 0; |
| 1234 | |
| 1235 | if(!m_showColumn[eColumn_Description] && !m_showColumn[eColumn_LastModified]) |
| 1236 | { |
| 1237 | nameWidth = rcList.Width(); |
| 1238 | } |
| 1239 | else if(!m_showColumn[eColumn_Description]) |
| 1240 | { |
| 1241 | nameWidth = ::MulDiv(rcList.Width(), 75, 100); |
| 1242 | lastModifiedWidth = rcList.Width() - nameWidth; |
| 1243 | } |
| 1244 | else if(!m_showColumn[eColumn_LastModified]) |
| 1245 | { |
| 1246 | nameWidth = ::MulDiv(rcList.Width(), 35, 100); |
| 1247 | descriptionWidth = rcList.Width() - nameWidth; |
| 1248 | } |
| 1249 | else |
| 1250 | { |
| 1251 | nameWidth = ::MulDiv(rcList.Width(), 30, 100); |
| 1252 | descriptionWidth = ::MulDiv(rcList.Width(), 45, 100); |
| 1253 | lastModifiedWidth = rcList.Width() - (nameWidth + descriptionWidth); |
| 1254 | } |
| 1255 | |
| 1256 | |
| 1257 | LVCOLUMN lvColumn = {0}; |
| 1258 | lvColumn.mask = (LVCF_FMT | LVCF_WIDTH | LVCF_TEXT); |
| 1259 | lvColumn.fmt = LVCFMT_LEFT; |
| 1260 | lvColumn.cx = nameWidth; |
| 1261 | lvColumn.pszText = _T("Name"); |
| 1262 | m_list.InsertColumn(eColumn_Name, &lvColumn); |
| 1263 | |
| 1264 | lvColumn.mask = (LVCF_FMT | LVCF_WIDTH | LVCF_TEXT); |
| 1265 | lvColumn.fmt = LVCFMT_LEFT; |
| 1266 | lvColumn.cx = descriptionWidth; |
| 1267 | lvColumn.pszText = _T("Description"); |
| 1268 | m_list.InsertColumn(eColumn_Description, &lvColumn); |
| 1269 | |
| 1270 | lvColumn.mask = (LVCF_FMT | LVCF_WIDTH | LVCF_TEXT); |
| 1271 | lvColumn.fmt = LVCFMT_LEFT; |
| 1272 | lvColumn.cx = lastModifiedWidth; |
| 1273 | lvColumn.pszText = _T("Last Modified"); |
| 1274 | m_list.InsertColumn(eColumn_LastModified, &lvColumn); |
| 1275 | |
| 1276 | return true; |
| 1277 | } |
| 1278 | |
| 1279 | int CSaveModifiedItemsDialog::AutoHideUnusedColumns(void) |
| 1280 | { |