"Fixed" the other Windows Table problem. Now to implement selection and fix the fonts...

This commit is contained in:
Pietro Gagliardi 2015-02-18 03:40:47 -05:00
parent 9f8ae40516
commit 8730cbf1c4
3 changed files with 4 additions and 2 deletions

View File

@ -90,7 +90,6 @@ func tableGetCell(data unsafe.Pointer, tnm *C.tableNM) C.LRESULT {
t.RLock()
defer t.RUnlock()
d := reflect.Indirect(reflect.ValueOf(t.data))
fmt.Printf("%#v\n", *tnm)
datum := d.Index(int(tnm.row)).Field(int(tnm.column))
switch {
case datum.Type() == reflect.TypeOf((*image.RGBA)(nil)):

View File

@ -166,7 +166,6 @@ static void draw(struct table *t, HDC dc, RECT cliprect, RECT client)
p.xoff = SendMessageW(t->header, HDM_GETBITMAPMARGIN, 0, 0);
p.y = client.top;
printf("%d %d\n", t->vscrollpos, t->count);
for (i = t->vscrollpos; i < t->count; i++) {
p.row = i;
p.x = client.left - t->hscrollpos;

View File

@ -19,6 +19,10 @@ static void scrollto(struct table *t, int which, struct scrollParams *p, intptr_
pos = 0;
if (pos > p->length - p->pagesize)
pos = p->length - p->pagesize;
// TODO this shouldn't have been necessary but alas
// TODO the logic is really intended for the whole y origin thing in the scrollbar series; fix that
if (pos < 0)
pos = 0;
// we don't want to scroll the header
if (GetClientRect(t->hwnd, &scrollArea) == 0)