Added tableGetSelection to the new Windows Table and hooked it up to package ui's Table.
This commit is contained in:
parent
6b9f1f282f
commit
cab2d93449
|
@ -74,10 +74,12 @@ void tableAutosizeColumns(HWND hwnd, int nColumns)
|
||||||
xpanic("error resizing columns of results list view", GetLastError());
|
xpanic("error resizing columns of results list view", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
// because Go won't let me do C.WPARAM(-1)
|
|
||||||
intptr_t tableSelectedItem(HWND hwnd)
|
intptr_t tableSelectedItem(HWND hwnd)
|
||||||
{
|
{
|
||||||
return (intptr_t) SendMessageW(hwnd, LVM_GETNEXTITEM, (WPARAM) -1, LVNI_SELECTED);
|
intptr_t row;
|
||||||
|
|
||||||
|
SendMessageW(hwnd, tableGetSelection, (WPARAM) (&row), (LPARAM) NULL);
|
||||||
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -72,8 +72,7 @@ func (t *table) Unlock() {
|
||||||
func (t *table) Selected() int {
|
func (t *table) Selected() int {
|
||||||
t.RLock()
|
t.RLock()
|
||||||
defer t.RUnlock()
|
defer t.RUnlock()
|
||||||
//TODO return int(C.tableSelectedItem(t.hwnd))
|
return int(C.tableSelectedItem(t.hwnd))
|
||||||
return -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *table) Select(index int) {
|
func (t *table) Select(index int) {
|
||||||
|
|
|
@ -113,7 +113,9 @@ extern void setTableSubclass(HWND, void *);
|
||||||
extern void gotableSetRowCount(HWND, intptr_t);
|
extern void gotableSetRowCount(HWND, intptr_t);
|
||||||
/* TODO
|
/* TODO
|
||||||
extern void tableAutosizeColumns(HWND, int);
|
extern void tableAutosizeColumns(HWND, int);
|
||||||
|
*/
|
||||||
extern intptr_t tableSelectedItem(HWND);
|
extern intptr_t tableSelectedItem(HWND);
|
||||||
|
/* TODO
|
||||||
extern void tableSelectItem(HWND, intptr_t);
|
extern void tableSelectItem(HWND, intptr_t);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,15 @@ HANDLER(apiHandlers)
|
||||||
setRowCount(t, *rcp);
|
setRowCount(t, *rcp);
|
||||||
*lResult = 0;
|
*lResult = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
case tableGetSelection:
|
||||||
|
rcp = (intptr_t *) wParam;
|
||||||
|
if (rcp != NULL)
|
||||||
|
*rcp = t->selectedRow;
|
||||||
|
rcp = (intptr_t *) lParam;
|
||||||
|
if (rcp != NULL)
|
||||||
|
*rcp = t->selectedColumn;
|
||||||
|
*lResult = 0;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,11 @@ enum {
|
||||||
// wParam - 0
|
// wParam - 0
|
||||||
// lParam - pointer to intptr_t containing new count
|
// lParam - pointer to intptr_t containing new count
|
||||||
tableSetRowCount,
|
tableSetRowCount,
|
||||||
|
// wParam - pointer to intptr_t where selected row will be stored
|
||||||
|
// lParam - pointer to intptr_t where selected column will be stored
|
||||||
|
// both will be -1 for no selection
|
||||||
|
// if either is NULL, that value is not written
|
||||||
|
tableGetSelection,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
Loading…
Reference in New Issue