From: <kr_...@us...> - 2003-03-30 22:50:06
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv21313/src/cbits/Win32 Modified Files: Frame.c Window.c Log Message: bugfixes Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Frame.c 30 Mar 2003 18:49:07 -0000 1.4 --- Frame.c 30 Mar 2003 22:50:00 -0000 1.5 *************** *** 88,92 **** return DefWindowProc (hWnd, uMsg, wParam, lParam); else ! return DefFrameProc (hWnd, pData->hClientWnd, uMsg, wParam, lParam); }; --- 88,92 ---- return DefWindowProc (hWnd, uMsg, wParam, lParam); else ! return DefFrameProc (hWnd, pData ? pData->hClientWnd : NULL, uMsg, wParam, lParam); }; *************** *** 94,98 **** { LRESULT result = HFrameSharedFunction(2, hWnd, uMsg, wParam, lParam); ! FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); switch (uMsg) --- 94,98 ---- { LRESULT result = HFrameSharedFunction(2, hWnd, uMsg, wParam, lParam); ! FrameData *pData = (FrameData *) GetWindowLong(hWnd,GWL_USERDATA); switch (uMsg) *************** *** 220,224 **** if (s && *s) { ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) --- 220,224 ---- if (s && *s) { ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) *************** *** 237,241 **** } else ! SetWindowText(ghWndFrame, s); free(s); --- 237,241 ---- } else ! SetWindowText(ghWndFrame, s ? s : ""); free(s); Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Window.c 30 Mar 2003 18:49:07 -0000 1.18 --- Window.c 30 Mar 2003 22:50:00 -0000 1.19 *************** *** 724,728 **** nTextLen = strlen(s); ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) --- 724,728 ---- nTextLen = strlen(s); ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) *************** *** 741,745 **** } else ! SetWindowText(ghWndFrame, s); } break; --- 741,745 ---- } else ! SetWindowText(ghWndFrame, s ? s : ""); } break; *************** *** 749,753 **** case WM_DESTROY: pFrameData->hClientWnd = NULL; ! SetWindowText(ghWndFrame, pFrameData->lpszAppName); break; } --- 749,753 ---- case WM_DESTROY: pFrameData->hClientWnd = NULL; ! SetWindowText(ghWndFrame, pFrameData->lpszAppName ? pFrameData->lpszAppName : ""); break; } *************** *** 786,790 **** nTextLen = strlen(s); ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) --- 786,790 ---- nTextLen = strlen(s); ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) *************** *** 803,807 **** } else ! SetWindowText(ghWndFrame, s); } break; --- 803,807 ---- } else ! SetWindowText(ghWndFrame, s ? s : ""); } break; *************** *** 812,824 **** nTextLen = GetWindowTextLength(hWnd); ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); ! strcpy(title, pFrameData->lpszAppName); ! strcat(title, " - ["); ! GetWindowText(hWnd, title+strlen(title), nTextLen+1); ! strcat(title, "]"); ! SetWindowText(ghWndFrame, title); ! ! free(title); if (hWnd == (HWND) lParam) --- 812,845 ---- nTextLen = GetWindowTextLength(hWnd); ! if (pFrameData->lpszAppName && *pFrameData->lpszAppName) ! { ! if (nTextLen > 0) ! { ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); ! if (title) ! { ! strcpy(title, pFrameData->lpszAppName); ! strcat(title, " - ["); ! GetWindowText(hWnd, title+strlen(title), nTextLen+1); ! strcat(title, "]"); ! SetWindowText(ghWndFrame, title); ! } ! ! free(title); ! } ! else ! SetWindowText(ghWndFrame, pFrameData->lpszAppName); ! } ! else ! { ! title = malloc(nTextLen+1); ! if (title) ! { ! GetWindowText(hWnd, title, nTextLen+1); ! SetWindowText(ghWndFrame, title); ! } ! free(title); ! } if (hWnd == (HWND) lParam) *************** *** 830,834 **** break; case WM_DESTROY: ! SetWindowText(ghWndFrame, pFrameData->lpszAppName); SendMessage(pFrameData->hClientWnd, WM_MDIREFRESHMENU, 0, 0); DrawMenuBar(ghWndFrame); --- 851,855 ---- break; case WM_DESTROY: ! SetWindowText(ghWndFrame, pFrameData->lpszAppName ? pFrameData->lpszAppName : ""); SendMessage(pFrameData->hClientWnd, WM_MDIREFRESHMENU, 0, 0); DrawMenuBar(ghWndFrame); |