From 2c26019500ced50810608bc0fa86dc940544456b Mon Sep 17 00:00:00 2001 From: unodgs Date: Wed, 20 Apr 2011 19:18:03 +0000 Subject: [PATCH] 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 --- uppsrc/DropGrid/DropGrid.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/uppsrc/DropGrid/DropGrid.cpp b/uppsrc/DropGrid/DropGrid.cpp index bc49acf6a..094a7c48f 100644 --- a/uppsrc/DropGrid/DropGrid.cpp +++ b/uppsrc/DropGrid/DropGrid.cpp @@ -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()