ide: Insert file path as C string #738

git-svn-id: svn://ultimatepp.org/upp/trunk@7306 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-23 07:54:27 +00:00
parent d2f363c9dd
commit eba30bb9b2
2 changed files with 8 additions and 4 deletions

View file

@ -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)

View file

@ -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);