comparison win/dw.c @ 1132:6d618dcff792

Check that the return code isn't TRUE before passing to handlers on Windows. The -1 check was causing the handlers to not be called when they should be.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 06 Sep 2011 14:47:39 +0000
parents 5d27b8562c6f
children e24e5a13ff2c
comparison
equal deleted inserted replaced
1131:5d27b8562c6f 1132:6d618dcff792
2194 { 2194 {
2195 GetClassName( hWnd, tmpbuf, 99 ); 2195 GetClassName( hWnd, tmpbuf, 99 );
2196 if ( strnicmp(tmpbuf, FRAMECLASSNAME, strlen(FRAMECLASSNAME)+1 ) == 0 ) 2196 if ( strnicmp(tmpbuf, FRAMECLASSNAME, strlen(FRAMECLASSNAME)+1 ) == 0 )
2197 { 2197 {
2198 int value = _HandleScroller(hWnd, bar, (int)HIWORD(mp1), (int)LOWORD(mp1)); 2198 int value = _HandleScroller(hWnd, bar, (int)HIWORD(mp1), (int)LOWORD(mp1));
2199 #ifndef SCROLLBOX_DEBUG
2200 /*
2201 * now we have the position we need to scroll the client window
2202 * and set the scrollbar to the specified position
2203 */
2204 _dw_log( "After _HandleScroller: Got scroll for scrollbox: %d Handle %x hWnd %x\n", value,handle, hWnd );
2205 if(value > -1)
2206 {
2207 char lasterror[257];
2208 SetScrollPos(hWnd, bar, value, TRUE);
2209 FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT), lasterror, 256, NULL);
2210 _dw_log( "Error from setscrollpos: %s", lasterror );
2211 // dw_scrollbar_set_pos(handle, value);
2212 }
2213 #endif
2214 } 2199 }
2215 } 2200 }
2216 } 2201 }
2217 break; 2202 break;
2218 case WM_GETMINMAXINFO: 2203 case WM_GETMINMAXINFO:
2815 } 2800 }
2816 break; 2801 break;
2817 } 2802 }
2818 } 2803 }
2819 2804
2820 if(ret == -1) 2805 if(ret != TRUE)
2821 { 2806 {
2822 if(!pOldProc) 2807 if(!pOldProc)
2823 return DefWindowProc(hWnd, msg, mp1, mp2); 2808 return DefWindowProc(hWnd, msg, mp1, mp2);
2824 return CallWindowProc(pOldProc, hWnd, msg, mp1, mp2); 2809 return CallWindowProc(pOldProc, hWnd, msg, mp1, mp2);
2825 } 2810 }