Mercurial > dwindows
diff os2/dw.c @ 161:c555d06b6c93
Allow tree-select signal to work on container controls.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 17 Nov 2002 11:51:30 +0000 |
parents | 76bc6b4e8b79 |
children | fb2987817924 |
line wrap: on
line diff
--- 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; }