Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
160:76bc6b4e8b79 | 161:c555d06b6c93 |
---|---|
2065 { | 2065 { |
2066 PCNRITEM pci = (PCNRITEM)pre->pRecord; | 2066 PCNRITEM pci = (PCNRITEM)pre->pRecord; |
2067 | 2067 |
2068 if(pci && pre->fEmphasisMask & CRA_CURSORED && (pci->rc.flRecordAttr & CRA_CURSORED)) | 2068 if(pci && pre->fEmphasisMask & CRA_CURSORED && (pci->rc.flRecordAttr & CRA_CURSORED)) |
2069 { | 2069 { |
2070 int (*treeselectfunc)(HWND, HWND, char *, void *, void *) = (int (*)(HWND, HWND, char *, void *, void *))tmp->signalfunction; | 2070 if(dw_window_get_data(tmp->window, "_dw_container")) |
2071 | |
2072 if(lasthcnr == tmp->window && lastitem == (HWND)pci) | |
2073 { | 2071 { |
2074 lasthcnr = 0; | 2072 int (*containerselectfunc)(HWND, char *, void *) = (int (*)(HWND, char *, void *))tmp->signalfunction; |
2075 lastitem = 0; | 2073 |
2074 result = containerselectfunc(tmp->window, pci->rc.pszIcon, tmp->data); | |
2076 } | 2075 } |
2077 else | 2076 else |
2078 { | 2077 { |
2079 lasthcnr = tmp->window; | 2078 int (*treeselectfunc)(HWND, HWND, char *, void *, void *) = (int (*)(HWND, HWND, char *, void *, void *))tmp->signalfunction; |
2080 lastitem = (HWND)pci; | 2079 |
2081 result = treeselectfunc(tmp->window, (HWND)pci, pci->rc.pszIcon, pci->user, tmp->data); | 2080 if(lasthcnr == tmp->window && lastitem == (HWND)pci) |
2081 { | |
2082 lasthcnr = 0; | |
2083 lastitem = 0; | |
2084 } | |
2085 else | |
2086 { | |
2087 lasthcnr = tmp->window; | |
2088 lastitem = (HWND)pci; | |
2089 result = treeselectfunc(tmp->window, (HWND)pci, pci->rc.pszIcon, pci->user, tmp->data); | |
2090 } | |
2082 } | 2091 } |
2083 tmp = NULL; | 2092 tmp = NULL; |
2084 } | 2093 } |
2085 } | 2094 } |
2086 } | 2095 } |
3792 NULL, | 3801 NULL, |
3793 NULL); | 3802 NULL); |
3794 blah->oldproc = WinSubclassWindow(tmp, _TreeProc); | 3803 blah->oldproc = WinSubclassWindow(tmp, _TreeProc); |
3795 WinSetWindowPtr(tmp, QWP_USER, blah); | 3804 WinSetWindowPtr(tmp, QWP_USER, blah); |
3796 dw_window_set_font(tmp, DefaultFont); | 3805 dw_window_set_font(tmp, DefaultFont); |
3806 dw_window_set_data(tmp, "_dw_container", (void *)1); | |
3797 return tmp; | 3807 return tmp; |
3798 } | 3808 } |
3799 | 3809 |
3800 /* | 3810 /* |
3801 * Create a tree object to be packed. | 3811 * Create a tree object to be packed. |