CtrlLib: EditField ReadOnly Ctrl+C fix, DocEdit: NoEofLine, Display: Background fix

git-svn-id: svn://ultimatepp.org/upp/trunk@2325 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-04-18 17:15:12 +00:00
parent 9d869c01ab
commit 403b29e499
4 changed files with 16 additions and 7 deletions

View file

@ -152,7 +152,8 @@ void DocEdit::Paint(Draw& w) {
w.DrawRect(0, -sb, sz.cx, 1, bg);
w.DrawRect(0, 0, 1, sz.cy, bg);
w.DrawRect(sz.cx - 1, 0, 1, sz.cy, bg);
w.DrawRect(1, y++, cx, 1, SColorShadow);
if(eofline)
w.DrawRect(1, y++, cx, 1, SColorShadow);
if(y < sz.cy)
w.DrawRect(1, y, cx, sz.cy - y, bg);
DrawTiles(w, DropCaret(), CtrlImg::checkers());
@ -499,6 +500,7 @@ DocEdit::DocEdit()
sb.SetLine(8);
sb.WhenScroll = THISBACK(Scroll);
InsertLines(0, 1);
eofline = true;
}
DocEdit::~DocEdit() {}

View file

@ -828,7 +828,7 @@ bool EditField::Key(dword key, int rep)
return true;
}
if(!IsEditable())
return false;
return MenuBar::Scan(WhenBar, key);
switch(key) {
case K_BACKSPACE:
case K_SHIFT|K_BACKSPACE:

View file

@ -387,7 +387,7 @@ protected:
CharFilter filter;
ScrollBar sb;
int cx;
bool updownleave;
bool updownleave, eofline;
struct Fmt {
FontInfo fi;
@ -424,6 +424,8 @@ public:
DocEdit& NoUpDownLeave() { return UpDownLeave(false); }
bool IsUpDownLeave() const { return updownleave; }
DocEdit& SetScrollBarStyle(const ScrollBar::Style& s) { sb.SetStyle(s); return *this; }
DocEdit& EofLine(bool b = true) { eofline = b; return *this; }
DocEdit& NoEofLine() { return EofLine(false); }
typedef DocEdit CLASSNAME;

View file

@ -66,7 +66,8 @@ void Display::PaintBackground(Draw& w, const Rect& r, const Value& q,
void Display::Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
{
StdDisplay().Paint(w, r, q, ink, paper, style);
PaintBackground(w, r, q, ink, paper, style);
Single<StdDisplayClass>().Paint0(w, r, q, ink, paper, style);
}
Size Display::RatioSize(const Value& q, int cx, int cy) const {
@ -80,7 +81,7 @@ Size Display::GetStdSize(const Value& q) const
void StdDisplayClass::Paint0(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword s) const {
LLOG("Display::Paint0: " << q << " ink:" << ink << " paper:" << paper);
LLOG("StdDisplay::Paint0: " << q << " ink:" << ink << " paper:" << paper);
WString txt;
Font font = StdFont();
int a = align;
@ -126,7 +127,7 @@ void StdDisplayClass::Paint0(Draw& w, const Rect& r, const Value& q,
void StdDisplayClass::Paint(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword s) const {
LLOG("Display::Paint: " << q << " ink:" << ink << " paper:" << paper);
LLOG("StdDisplay::Paint: " << q << " ink:" << ink << " paper:" << paper);
PaintBackground(w, r, q, ink, paper, s);
Paint0(w, r, q, ink, paper, s);
}
@ -158,7 +159,11 @@ Display::Display() {}
Display::~Display() {}
const Display& GLOBAL_V_INIT(StdDisplayClass, StdDisplay)
const Display& StdDisplay()
{
return Single<StdDisplayClass>();
}
const Display& GLOBAL_VP_INIT(StdDisplayClass, StdCenterDisplay, (ALIGN_CENTER))
const Display& GLOBAL_VP_INIT(StdDisplayClass, StdRightDisplay, (ALIGN_RIGHT))