Implemented mouse hot-tracking for checkboxes. Clicking and dragging is still an issue, but :S

This commit is contained in:
Pietro Gagliardi 2014-11-20 18:25:14 -05:00
parent 2ddafc8230
commit 3d87f8c5ce
1 changed files with 3 additions and 9 deletions

View File

@ -324,14 +324,10 @@ static void track(struct table *t, LPARAM lParam)
BOOL prev; BOOL prev;
intptr_t prevrow, prevcolumn; intptr_t prevrow, prevcolumn;
// TODO limit all this to if a checkbox is being hovered over
lParamToRowColumn(t, lParam, &row, &column);
prev = t->lastmouse; prev = t->lastmouse;
prevrow = t->lastmouseRow; prevrow = t->lastmouseRow;
prevcolumn = t->lastmouseColumn; prevcolumn = t->lastmouseColumn;
t->lastmouse = TRUE; t->lastmouse = lParamInCheckbox(t, lParam, &(t->lastmouseRow), &(t->lastmouseColumn));
t->lastmouseRow = row;
t->lastmouseColumn = column;
if (prev) if (prev)
if (prevrow != row || prevcolumn != column) if (prevrow != row || prevcolumn != column)
redrawRow(t, prevrow); redrawRow(t, prevrow);
@ -746,11 +742,9 @@ static void drawItem(struct table *t, HDC dc, intptr_t i, LONG y, LONG height, R
if (i == t->mouseDownRow && j == t->mouseDownColumn) if (i == t->mouseDownRow && j == t->mouseDownColumn)
c = RGB(0, 0, 255); c = RGB(0, 0, 255);
} else if (t->lastmouse) { } else if (t->lastmouse) {
/*TODO pt.x = t->lastmouseX - t->hpos; // because t->lastmouseX is in client coordinates if (i == t->lastmouseRow && j == t->lastmouseColumn)
pt.y = t->lastmouseY; // ...but so are the vertical coordinates of rsel
if (PtInRect(&rsel, pt) != 0)
c = RGB(0, 255, 0); c = RGB(0, 255, 0);
*/ } }
if (SetDCBrushColor(dc, c) == CLR_INVALID) if (SetDCBrushColor(dc, c) == CLR_INVALID)
abort(); abort();
} }