Focus rosso anche ai bottoni

git-svn-id: svn://10.65.10.50/trunk@338 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-10-10 09:49:34 +00:00
parent 1d0869e9a2
commit 6f9ed0cad2
2 changed files with 24 additions and 12 deletions

@ -103,7 +103,7 @@ HIDDEN void set_creation_args(WIN_CREATION_ARGS *a)
}
}
void xvt_draw_rect(WINDOW win, const RCT&rect, COLOR lt, COLOR rb, short depth)
void xvt_draw_rect(WINDOW win, const RCT& rect, COLOR lt, COLOR rb, short depth)
{
RCT r = rect;
@ -238,7 +238,6 @@ long TControl::handler(WINDOW win, EVENT* ep)
cc->mouse_up();
break;
default:
// dispatch_event(get_parent(win), ep);
dispatch_e_char(get_parent(win), key);
break;
}
@ -633,15 +632,26 @@ void TPush_button::update() const
draw_pressed(FALSE);
if (focused() && id() != DLG_F9)
{
HWND hwnd = (HWND)get_value(_hdc, ATTR_NATIVE_WINDOW);
HDC hdc = GetDC(hwnd);
RECT r;
r.left = _client.left+DEPTH+1;
r.top = _client.top+DEPTH;
r.right = _client.right-DEPTH-1;
r.bottom = _client.bottom-DEPTH;
DrawFocusRect(hdc, &r);
ReleaseDC(hwnd, hdc);
/*
HWND hwnd = (HWND)get_value(_hdc, ATTR_NATIVE_WINDOW);
HDC hdc = GetDC(hwnd);
RECT r;
r.left = _client.left+DEPTH+1;
r.top = _client.top+DEPTH;
r.right = _client.right-DEPTH-1;
r.bottom = _client.bottom-DEPTH;
DrawFocusRect(hdc, &r);
ReleaseDC(hwnd, hdc);
*/
CPEN pen;
pen.width = 1;
pen.pat = PAT_SOLID;
pen.style = P_SOLID;
pen.color = COLOR_RED;
win_set_cpen(_hdc, &pen);
CBRUSH brush = { PAT_HOLLOW, COLOR_WHITE };
win_set_cbrush(_hdc, &brush);
win_draw_rect(_hdc, &_client);
} else
if (disabled() && _picup)
{

@ -471,7 +471,8 @@ if (xiev->v.xi_obj->type == XIT_LIST)
update_rec(_cur_row);
_row_dirty = TRUE;
}
set_focus_cell(_cur_row, _cur_col);
if (!cell_disabled(_cur_row, _cur_col))
set_focus_cell(_cur_row, _cur_col);
_check_enabled = TRUE;
}
break;
@ -604,6 +605,7 @@ break;
case K_F3:
case K_F8:
case K_F9:
case K_F11:
{
_check_enabled = FALSE; // Disable checks
if (!_row_dirty) notify(_cur_row, K_SPACE);