Stored the HIMAGELIST in the tableData struct. Now to store the HTHEME too...

This commit is contained in:
Pietro Gagliardi 2014-08-25 13:54:15 -04:00
parent 6e9ef7e2a6
commit 3b703fc241
1 changed files with 8 additions and 4 deletions

View File

@ -33,12 +33,13 @@ struct tableData {
static void tableSetCheckboxImageList(HWND hwnd, struct tableData *t) static void tableSetCheckboxImageList(HWND hwnd, struct tableData *t)
{ {
HIMAGELIST checkboxImageList; HIMAGELIST old;
checkboxImageList = makeCheckboxImageList(hwnd); old = t->checkboxImageList;
if (SendMessageW(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM) (checkboxImageList)) == (LRESULT) NULL) t->checkboxImageList = makeCheckboxImageList(hwnd);
if (SendMessageW(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM) (t->checkboxImageList)) == (LRESULT) NULL)
;//TODO xpanic("error setting image list", GetLastError()); ;//TODO xpanic("error setting image list", GetLastError());
// TODO free old one here if any/different // TODO free old one here if any
// thanks to Jonathan Potter (http://stackoverflow.com/questions/25354448/why-do-my-owner-data-list-view-state-images-come-up-as-blank-on-windows-xp) // thanks to Jonathan Potter (http://stackoverflow.com/questions/25354448/why-do-my-owner-data-list-view-state-images-come-up-as-blank-on-windows-xp)
if (SendMessageW(hwnd, LVM_SETCALLBACKMASK, LVIS_STATEIMAGEMASK, 0) == FALSE) if (SendMessageW(hwnd, LVM_SETCALLBACKMASK, LVIS_STATEIMAGEMASK, 0) == FALSE)
xpanic("error marking state image list as application-managed", GetLastError()); xpanic("error marking state image list as application-managed", GetLastError());
@ -88,6 +89,9 @@ static LRESULT CALLBACK tableSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
case msgTableMakeInitialImageList: case msgTableMakeInitialImageList:
tableSetCheckboxImageList(hwnd, t); tableSetCheckboxImageList(hwnd, t);
return 0; return 0;
case WM_THEMECHANGED:
tableSetCheckboxImageList(hwnd, t);
return (*fv_DefSubclassProc)(hwnd, uMsg, wParam, lParam);
// see table.autoresize() in table_windows.go for the column autosize policy // see table.autoresize() in table_windows.go for the column autosize policy
case WM_NOTIFY: // from the contained header control case WM_NOTIFY: // from the contained header control
if (nmhdr->code == HDN_BEGINTRACK) if (nmhdr->code == HDN_BEGINTRACK)