ultimatepp/uppdev/LineEdit/main.cpp
cxl 4794fcf24c .uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@8283 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2015-03-19 21:52:24 +00:00

28 lines
No EOL
575 B
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
void ShowLen(LineEdit *edit, TopWindow *win)
{
win->Title(AsString(edit->GetLength()));
}
GUI_APP_MAIN
{
LineEdit edit;
edit.ShowSpaces();
auto fn = ConfigFile("data.txt");
edit <<= LoadFile(fn);
TopWindow win;
// win.SetRect(100, 100, 100, 100);
win.Sizeable();
win.Add(edit.HSizePos(20, 20).VSizePos(20, 20));
win.Open();
edit.ShowLineEndings();
edit.ShowCurrentLine(LtCyan());
edit <<= callback2(ShowLen, &edit, &win);
Ctrl::EventLoop();
SaveFile(fn, ~edit);
}
// 156 0x9c "œ"