Implemented mouse hot-tracking for checkboxes. Clicking and dragging is still an issue, but :S
This commit is contained in:
parent
2ddafc8230
commit
3d87f8c5ce
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue