comparison os2/dw.c @ 1322:3f1ac800bf65

Initial fix for being able to do container string comparisons instead of pointer on all platforms. Improved on the GTK2 change earlier... where it would do both comparisons with string enabled.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 06 Nov 2011 12:13:13 +0000
parents 3475887f9445
children 552da4dea7d1
comparison
equal deleted inserted replaced
1321:7630404386be 1322:3f1ac800bf65
8143 */ 8143 */
8144 void API dw_container_cursor(HWND handle, char *text) 8144 void API dw_container_cursor(HWND handle, char *text)
8145 { 8145 {
8146 RECTL viewport, item; 8146 RECTL viewport, item;
8147 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 8147 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
8148 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
8148 8149
8149 while(pCore) 8150 while(pCore)
8150 { 8151 {
8151 if((char *)pCore->pszIcon == text) 8152 if((textcomp && pCore->pszIcon && strcmp(pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text))
8152 { 8153 {
8153 QUERYRECORDRECT qrr; 8154 QUERYRECORDRECT qrr;
8154 int scrollpixels = 0, midway; 8155 int scrollpixels = 0, midway;
8155 8156
8156 qrr.cb = sizeof(QUERYRECORDRECT); 8157 qrr.cb = sizeof(QUERYRECORDRECT);
8180 * text: Text usually returned by dw_container_query(). 8181 * text: Text usually returned by dw_container_query().
8181 */ 8182 */
8182 void API dw_container_delete_row(HWND handle, char *text) 8183 void API dw_container_delete_row(HWND handle, char *text)
8183 { 8184 {
8184 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 8185 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
8186 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
8185 8187
8186 while(pCore) 8188 while(pCore)
8187 { 8189 {
8188 if((char *)pCore->pszIcon == text) 8190 if((textcomp && pCore->pszIcon && strcmp(pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text))
8189 { 8191 {
8190 WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE)); 8192 WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE));
8191 return; 8193 return;
8192 } 8194 }
8193 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 8195 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));