MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / OnInsertFile

Method OnInsertFile

neo/tools/common/PropTree/PropTreeItemFileEdit.cpp:82–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void 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
108void CPropTreeItemFileEdit::OnEditUndo() {
109 Undo();

Callers

nothing calls this directly

Calls 9

LeftMethod · 0.80
RefreshItemsMethod · 0.80
SendNotifyMethod · 0.80
DoModalMethod · 0.45
RightMethod · 0.45
LengthMethod · 0.45
OSPathToRelativePathMethod · 0.45
InsertMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected