DropGrid: Clearing value or setting null no longer causes setting focus, fixed painting background in not editable state

git-svn-id: svn://ultimatepp.org/upp/trunk@3363 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
unodgs 2011-04-20 19:18:03 +00:00
parent 05a5e6e242
commit 2c26019500

View file

@ -194,14 +194,15 @@ void DropGrid::Paint(Draw& w)
else
clear.Hide();
//w.DrawRect(sz, SColorPaper());
GridDisplay &disp = display ? *display : list.GetDisplay();
bool hf = HasFocus();
bool isnull = rowid < 0;
Color fg = hf ? SColorHighlightText() : IsEnabled() ? SColorText() : SColorDisabled();
Color bg = !IsEnabled() ? EditField::StyleDefault().disabled //SColorFace
: notnull && isnull ? Blend(SColorPaper, Color(255, 0, 0), /*hf ? 55 :*/ 32)
: hf ? SColorHighlight() : SColorPaper();
Color bg = !IsEnabled() || !IsEditable()
? EditField::StyleDefault().disabled
: notnull && isnull
? Blend(SColorPaper, Color(255, 0, 0), 32)
: hf ? SColorHighlight() : SColorPaper();
const int d = 0;
@ -676,7 +677,6 @@ void DropGrid::ClearValue()
UpdateActionRefresh();
else
UpdateRefresh();
SetFocus();
}
void DropGrid::Reset()