mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
ide: Insert clipboard as C string, convert text to C string
git-svn-id: svn://ultimatepp.org/upp/trunk@4995 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
832424d8f0
commit
6ecaedceb1
5 changed files with 23 additions and 0 deletions
|
|
@ -81,6 +81,13 @@ void Ide::InsertText(const String& text)
|
|||
editor.Paste(text.ToWString());
|
||||
}
|
||||
|
||||
void Ide::InsertCString()
|
||||
{
|
||||
String txt = ReadClipboardText();
|
||||
if(txt.GetCount())
|
||||
editor.Paste(AsCString(txt).ToWString());
|
||||
}
|
||||
|
||||
void Ide::InsertMenu(Bar& bar)
|
||||
{
|
||||
if(bar.IsScanKeys())
|
||||
|
|
@ -123,6 +130,7 @@ void Ide::InsertMenu(Bar& bar)
|
|||
bar.Add(s, THISBACK1(InsertText, s));
|
||||
}
|
||||
}
|
||||
bar.Add("Insert clipboard as C string", THISBACK(InsertCString));
|
||||
}
|
||||
|
||||
void Ide::EditorMenu(Bar& bar)
|
||||
|
|
|
|||
|
|
@ -847,6 +847,7 @@ public:
|
|||
void InsertLay(const String& fn);
|
||||
void InsertIml(const String& fn, String classname);
|
||||
void InsertText(const String& text);
|
||||
void InsertCString();
|
||||
void InsertMenu(Bar& bar);
|
||||
void EditorMenu(Bar& bar);
|
||||
|
||||
|
|
@ -870,6 +871,7 @@ public:
|
|||
void TextToAscii();
|
||||
void TextInitCaps();
|
||||
void SwapCase();
|
||||
void ToCString();
|
||||
|
||||
void MacroMenu(Bar& menu);
|
||||
bool HasMacros();
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ KEY(TOLOWER, "To lowercase", 0)
|
|||
KEY(INITCAPS, "Capitalize the first character of words", 0)
|
||||
KEY(SWAPCASE, "Swap case", 0)
|
||||
KEY(TOASCII, "To ASCII", 0)
|
||||
KEY(TOCSTRING, "Convert to C string", 0)
|
||||
|
||||
KEY(DIFF, "Compare with file..", 0)
|
||||
KEY(SVNDIFF, "Show svn history of file..", 0)
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ void Ide::EditSpecial(Bar& menu)
|
|||
.Help("Capitalize the first character of words in selection");
|
||||
menu.Add(AK_SWAPCASE, THISBACK(SwapCase))
|
||||
.Help("Swap the case of letters in selection");
|
||||
menu.Add(AK_TOCSTRING, THISBACK(ToCString))
|
||||
.Help("Convert selection to CString");
|
||||
}
|
||||
|
||||
void Ide::SearchMenu(Bar& menu)
|
||||
|
|
|
|||
|
|
@ -283,6 +283,16 @@ void Ide::SwapCase()
|
|||
AlterText(sSwapCase);
|
||||
}
|
||||
|
||||
static WString sCString(const WString& s)
|
||||
{
|
||||
return AsCString(s.ToString()).ToWString();
|
||||
}
|
||||
|
||||
void Ide::ToCString()
|
||||
{
|
||||
AlterText(sCString);
|
||||
}
|
||||
|
||||
void Ide::Times()
|
||||
{
|
||||
WithStatisticsLayout<TopWindow> statdlg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue