# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1037533890 0 # Node ID c555d06b6c93a453fe7ff72c96f95e6ddd2e9e57 # Parent 76bc6b4e8b791e7937770155cdcdda44133e01db Allow tree-select signal to work on container controls. diff -r 76bc6b4e8b79 -r c555d06b6c93 os2/dw.c --- a/os2/dw.c Thu Nov 14 18:49:20 2002 +0000 +++ b/os2/dw.c Sun Nov 17 11:51:30 2002 +0000 @@ -2067,18 +2067,27 @@ if(pci && pre->fEmphasisMask & CRA_CURSORED && (pci->rc.flRecordAttr & CRA_CURSORED)) { - int (*treeselectfunc)(HWND, HWND, char *, void *, void *) = (int (*)(HWND, HWND, char *, void *, void *))tmp->signalfunction; - - if(lasthcnr == tmp->window && lastitem == (HWND)pci) + if(dw_window_get_data(tmp->window, "_dw_container")) { - lasthcnr = 0; - lastitem = 0; + int (*containerselectfunc)(HWND, char *, void *) = (int (*)(HWND, char *, void *))tmp->signalfunction; + + result = containerselectfunc(tmp->window, pci->rc.pszIcon, tmp->data); } else { - lasthcnr = tmp->window; - lastitem = (HWND)pci; - result = treeselectfunc(tmp->window, (HWND)pci, pci->rc.pszIcon, pci->user, tmp->data); + int (*treeselectfunc)(HWND, HWND, char *, void *, void *) = (int (*)(HWND, HWND, char *, void *, void *))tmp->signalfunction; + + if(lasthcnr == tmp->window && lastitem == (HWND)pci) + { + lasthcnr = 0; + lastitem = 0; + } + else + { + lasthcnr = tmp->window; + lastitem = (HWND)pci; + result = treeselectfunc(tmp->window, (HWND)pci, pci->rc.pszIcon, pci->user, tmp->data); + } } tmp = NULL; } @@ -3794,6 +3803,7 @@ blah->oldproc = WinSubclassWindow(tmp, _TreeProc); WinSetWindowPtr(tmp, QWP_USER, blah); dw_window_set_font(tmp, DefaultFont); + dw_window_set_data(tmp, "_dw_container", (void *)1); return tmp; } diff -r 76bc6b4e8b79 -r c555d06b6c93 win/dw.c --- a/win/dw.c Thu Nov 14 18:49:20 2002 +0000 +++ b/win/dw.c Sun Nov 17 11:51:30 2002 +0000 @@ -1347,6 +1347,38 @@ } } } + else if(strnicmp(tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1)==0) + { + if(tem->hdr.code == LVN_ITEMCHANGED && tmp->message == TVN_SELCHANGED) + { + if(tmp->window == tem->hdr.hwndFrom) + { + LV_ITEM lvi; + int iItem; + + iItem = ListView_GetNextItem(tmp->window, -1, LVNI_FOCUSED); + + memset(&lvi, 0, sizeof(LV_ITEM)); + + if(iItem > -1) + { + int (*containerselectfunc)(HWND, char *, void *) = tmp->signalfunction; + + lvi.iItem = iItem; + lvi.mask = LVIF_PARAM; + + ListView_GetItem(tmp->window, &lvi); + + /* Seems to be having lParam as 1 which really sucks */ + if(lvi.lParam < 100) + lvi.lParam = 0; + + containerselectfunc(tmp->window, (char *)lvi.lParam, tmp->data); + tmp = NULL; + } + } + } + } } } break;