| 233 | // Button Command Handlers |
| 234 | #define MAX_FILENAME_BUFFER 4096 |
| 235 | void TableFileFilter::OnBtnAddLevel() { |
| 236 | // TODO: Add your control notification handler code here |
| 237 | char title[] = "Add Level Files"; |
| 238 | char filename_buffer[MAX_FILENAME_BUFFER + 1]; |
| 239 | CString path; |
| 240 | |
| 241 | CString filter = "Outrage Level Files (*.d3l)|*.d3l|All Files (*.*)|*.*||"; |
| 242 | CFileDialog dlg_open(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, |
| 243 | filter.GetBuffer(0), this); |
| 244 | |
| 245 | memset(filename_buffer, '\0', MAX_FILENAME_BUFFER); |
| 246 | |
| 247 | dlg_open.m_ofn.lpstrTitle = title; |
| 248 | dlg_open.m_ofn.lpstrFileTitle = NULL; |
| 249 | dlg_open.m_ofn.lpstrFile = filename_buffer; |
| 250 | dlg_open.m_ofn.nMaxFile = MAX_FILENAME_BUFFER; |
| 251 | |
| 252 | if (dlg_open.DoModal() == IDCANCEL) { |
| 253 | return; |
| 254 | } |
| 255 | |
| 256 | CWaitCursor wc; |
| 257 | |
| 258 | // iterate through and add selected level filenames. |
| 259 | POSITION pos; |
| 260 | pos = dlg_open.GetStartPosition(); |
| 261 | while (pos != NULL) { |
| 262 | path = dlg_open.GetNextPathName(pos); |
| 263 | |
| 264 | if (!m_PageList.AddLevelFilename(path.GetBuffer(0))) { |
| 265 | // MessageBox("Error: Could not add level!\n","Add Level Error!"); |
| 266 | // m_PageList.ClearList(); |
| 267 | // return; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | m_PageList.SetTitleString(); |
| 272 | } |
| 273 | |
| 274 | void TableFileFilter::OnBtnAddPage() { |
| 275 | // TODO: Add your control notification handler code here |
nothing calls this directly
no test coverage detected