diff --git a/uppsrc/ide/Insert.cpp b/uppsrc/ide/Insert.cpp index d81af263f..67439fec9 100644 --- a/uppsrc/ide/Insert.cpp +++ b/uppsrc/ide/Insert.cpp @@ -97,12 +97,15 @@ void Ide::InsertCString() editor.Paste(AsCString(txt).ToWString()); } -void Ide::InsertFilePath() +void Ide::InsertFilePath(bool c) { String path = SelectFileOpen("All files\t*.*"); path.Replace("\\", "/"); - if(path.GetCount()) + if(path.GetCount()) { + if(c) + path = AsCString(path); editor.Paste(path.ToWString()); + } } void Ide::InsertMenu(Bar& bar) @@ -148,7 +151,8 @@ void Ide::InsertMenu(Bar& bar) } } bar.Add("Insert clipboard as C string", THISBACK(InsertCString)); - bar.Add("Insert file path..", THISBACK(InsertFilePath)); + bar.Add("Insert file path..", THISBACK1(InsertFilePath, false)); + bar.Add("Insert file path as C string..", THISBACK1(InsertFilePath, true)); } void Ide::InsertAdvanced(Bar& bar) diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index 9f7d8c856..fa99317d7 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -848,7 +848,7 @@ public: void InsertIml(const String& fn, String classname); void InsertText(const String& text); void InsertCString(); - void InsertFilePath(); + void InsertFilePath(bool c); void InsertMenu(Bar& bar); void InsertAdvanced(Bar& bar); void EditorMenu(Bar& bar);