| 80 | } |
| 81 | |
| 82 | void CPropTreeItemFileEdit::OnInsertFile() { |
| 83 | CFileDialog dlg(TRUE); |
| 84 | dlg.m_ofn.Flags |= OFN_FILEMUSTEXIST; |
| 85 | |
| 86 | int startSel, endSel; |
| 87 | GetSel(startSel, endSel); |
| 88 | |
| 89 | if( dlg.DoModal()== IDOK) { |
| 90 | |
| 91 | idStr currentText = (char*)GetItemValue(); |
| 92 | idStr newText = currentText.Left(startSel) + currentText.Right(currentText.Length() - endSel); |
| 93 | |
| 94 | idStr filename = fileSystem->OSPathToRelativePath(dlg.m_ofn.lpstrFile); |
| 95 | filename.BackSlashesToSlashes(); |
| 96 | |
| 97 | |
| 98 | newText.Insert(filename, startSel); |
| 99 | |
| 100 | SetItemValue((LPARAM)newText.c_str()); |
| 101 | m_pProp->RefreshItems(this); |
| 102 | |
| 103 | m_pProp->SendNotify(PTN_ITEMCHANGED, this); |
| 104 | |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | void CPropTreeItemFileEdit::OnEditUndo() { |
| 109 | Undo(); |
nothing calls this directly
no test coverage detected