Dropped checkboxImageList. This is the first of a multi-part commit stream becasue when I tried doing it alll at once the program broke in utterly mysterious ways.

This commit is contained in:
Pietro Gagliardi 2014-08-25 11:41:37 -04:00
parent 3b5e8f5e7d
commit fe01ebbbcd
4 changed files with 7 additions and 12 deletions

View File

@ -260,16 +260,14 @@ static HIMAGELIST newCheckboxImageList(HWND hwnddc, void (*sizefunc)(HDC, int *,
return il; return il;
} }
HIMAGELIST checkboxImageList = NULL; HIMAGELIST makeCheckboxImageList(HWND hwnddc)
void makeCheckboxImageList(HWND hwnddc)
{ {
if (theme == NULL) // try to open the theme if (theme == NULL) // try to open the theme
openTheme(hwnddc); openTheme(hwnddc);
if (theme != NULL) { // use the theme if (theme != NULL) { // use the theme
checkboxImageList = newCheckboxImageList(hwnddc, themeSize, themeImage); return newCheckboxImageList(hwnddc, themeSize, themeImage);
return; return;
} }
// couldn't open; fall back // couldn't open; fall back
checkboxImageList = newCheckboxImageList(hwnddc, dfcSize, dfcImage); return newCheckboxImageList(hwnddc, dfcSize, dfcImage);
} }

View File

@ -139,6 +139,9 @@ void tableAutosizeColumns(HWND hwnd, int nColumns)
void tableSetCheckboxImageList(HWND hwnd) void tableSetCheckboxImageList(HWND hwnd)
{ {
HIMAGELIST checkboxImageList;
checkboxImageList = makeCheckboxImageList(hwnd);
if (SendMessageW(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM) checkboxImageList) == (LRESULT) NULL) if (SendMessageW(hwnd, LVM_SETIMAGELIST, LVSIL_STATE, (LPARAM) 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/different

View File

@ -133,11 +133,6 @@ static LRESULT CALLBACK msgwinproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
if (sharedWndProc(hwnd, uMsg, wParam, lParam, &shared)) if (sharedWndProc(hwnd, uMsg, wParam, lParam, &shared))
return shared; return shared;
switch (uMsg) { switch (uMsg) {
case WM_CREATE:
// initial
makeCheckboxImageList(hwnd);
return 0;
// TODO respond to WM_THEMECHANGED
case msgRequest: case msgRequest:
// in modal? // in modal?
if (!queueIfModal((void *) lParam)) if (!queueIfModal((void *) lParam))

View File

@ -144,8 +144,7 @@ enum {
checkboxStatePushed = 1 << 2, checkboxStatePushed = 1 << 2,
checkboxnStates = 1 << 3, checkboxnStates = 1 << 3,
}; };
extern HIMAGELIST checkboxImageList; extern HIMAGELIST makeCheckboxImageList(HWND);
extern void makeCheckboxImageList(HWND);
// dialog_windows.c // dialog_windows.c
extern WCHAR *openFile(void); extern WCHAR *openFile(void);