comparison src/event-msw.c @ 418:e804706bfb8c r21-2-17

Import from CVS: tag r21-2-17
author cvs
date Mon, 13 Aug 2007 11:23:13 +0200
parents 697ef44129c6
children 41dbb7a9d5f2
comparison
equal deleted inserted replaced
417:43a18b32d56e 418:e804706bfb8c
1325 1325
1326 active = select (MAXDESC, &temp_mask, 0, 0, pointer_to_this); 1326 active = select (MAXDESC, &temp_mask, 0, 0, pointer_to_this);
1327 1327
1328 if (active == 0) 1328 if (active == 0)
1329 { 1329 {
1330 assert (!badly_p);
1330 return; /* timeout */ 1331 return; /* timeout */
1331 } 1332 }
1332 else if (active > 0) 1333 else if (active > 0)
1333 { 1334 {
1334 if (FD_ISSET (windows_fd, &temp_mask)) 1335 if (FD_ISSET (windows_fd, &temp_mask))
1923 selection would be canceled if any */ 1924 selection would be canceled if any */
1924 mswindows_enqueue_misc_user_event (mswindows_find_frame (hwnd), 1925 mswindows_enqueue_misc_user_event (mswindows_find_frame (hwnd),
1925 Qcancel_mode_internal, Qnil); 1926 Qcancel_mode_internal, Qnil);
1926 break; 1927 break;
1927 1928
1929 case WM_NOTIFY:
1930 {
1931 LPNMHDR nmhdr = (LPNMHDR)lParam;
1932 int idCtrl = (int)wParam;
1933
1934 if (nmhdr->code == TTN_NEEDTEXT)
1935 {
1928 #ifdef HAVE_TOOLBARS 1936 #ifdef HAVE_TOOLBARS
1929 case WM_NOTIFY: 1937 LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam;
1930 { 1938 Lisp_Object btext;
1931 LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; 1939
1932 Lisp_Object btext;
1933 if (tttext->hdr.code == TTN_NEEDTEXT)
1934 {
1935 /* find out which toolbar */ 1940 /* find out which toolbar */
1936 frame = XFRAME (mswindows_find_frame (hwnd)); 1941 frame = XFRAME (mswindows_find_frame (hwnd));
1937 btext = mswindows_get_toolbar_button_text ( frame, 1942 btext = mswindows_get_toolbar_button_text ( frame,
1938 tttext->hdr.idFrom ); 1943 nmhdr->idFrom );
1939 1944
1940 tttext->lpszText = NULL; 1945 tttext->lpszText = NULL;
1941 tttext->hinst = NULL; 1946 tttext->hinst = NULL;
1942 1947
1943 if (!NILP(btext)) 1948 if (!NILP(btext))
1945 /* I think this is safe since the text will only go away 1950 /* I think this is safe since the text will only go away
1946 when the toolbar does...*/ 1951 when the toolbar does...*/
1947 GET_C_STRING_EXT_DATA_ALLOCA (btext, FORMAT_OS, 1952 GET_C_STRING_EXT_DATA_ALLOCA (btext, FORMAT_OS,
1948 tttext->lpszText); 1953 tttext->lpszText);
1949 } 1954 }
1950 #if 0 1955 #endif
1951 tttext->uFlags |= TTF_DI_SETITEM; 1956 }
1952 #endif 1957 /* handle tree view callbacks */
1953 } 1958 else if (nmhdr->code == TVN_SELCHANGED)
1959 {
1960 NM_TREEVIEW* ptree = (NM_TREEVIEW*)lParam;
1961 frame = XFRAME (mswindows_find_frame (hwnd));
1962 mswindows_handle_gui_wm_command (frame, 0, ptree->itemNew.lParam);
1963 }
1964 /* handle tab control callbacks */
1965 else if (nmhdr->code == TCN_SELCHANGE)
1966 {
1967 TC_ITEM item;
1968 int index = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0);
1969 frame = XFRAME (mswindows_find_frame (hwnd));
1970 SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)index,
1971 (LPARAM)&item);
1972
1973 mswindows_handle_gui_wm_command (frame, 0, item.lParam);
1974 }
1954 } 1975 }
1955 break; 1976 break;
1956 #endif
1957 1977
1958 case WM_PAINT: 1978 case WM_PAINT:
1959 { 1979 {
1960 PAINTSTRUCT paintStruct; 1980 PAINTSTRUCT paintStruct;
1961 1981
2550 { 2570 {
2551 Lisp_Object event, event2; 2571 Lisp_Object event, event2;
2552 2572
2553 mswindows_need_event (1); 2573 mswindows_need_event (1);
2554 2574
2555 event = mswindows_dequeue_dispatch_event (!NILP(mswindows_u_dispatch_event_queue)); 2575 event = mswindows_dequeue_dispatch_event ();
2556 XSETEVENT (event2, emacs_event); 2576 XSETEVENT (event2, emacs_event);
2557 Fcopy_event (event, event2); 2577 Fcopy_event (event, event2);
2558 Fdeallocate_event (event); 2578 Fdeallocate_event (event);
2559 } 2579 }
2560 2580