X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fevent-msw.c;h=45e77ee71115aa44e276272840f6e037e3c243aa;hb=83672a528db7fe9cace421905b7efd06c11b7c98;hp=404236698179ef96b0b5fc6137800dc897459a83;hpb=28a3fa29bc0bd9a124b6e3379e82d62e815c22a2;p=chise%2Fxemacs-chise.git diff --git a/src/event-msw.c b/src/event-msw.c index 4042366..45e77ee 100644 --- a/src/event-msw.c +++ b/src/event-msw.c @@ -72,6 +72,10 @@ typedef unsigned int SOCKET; #include #include +#if defined (__CYGWIN32__) && !defined (CYGWIN_VERSION_DLL_MAJOR) +typedef NMHDR *LPNMHDR; +#endif + #ifdef HAVE_MENUBARS #define ADJR_MENUFLAG TRUE #else @@ -1327,6 +1331,7 @@ mswindows_need_event (int badly_p) if (active == 0) { + assert (!badly_p); return; /* timeout */ } else if (active > 0) @@ -1925,17 +1930,20 @@ mswindows_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) Qcancel_mode_internal, Qnil); break; -#ifdef HAVE_TOOLBARS case WM_NOTIFY: { - LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; - Lisp_Object btext; - if (tttext->hdr.code == TTN_NEEDTEXT) + LPNMHDR nmhdr = (LPNMHDR)lParam; + + if (nmhdr->code == TTN_NEEDTEXT) { +#ifdef HAVE_TOOLBARS + LPTOOLTIPTEXT tttext = (LPTOOLTIPTEXT)lParam; + Lisp_Object btext; + /* find out which toolbar */ frame = XFRAME (mswindows_find_frame (hwnd)); btext = mswindows_get_toolbar_button_text ( frame, - tttext->hdr.idFrom ); + nmhdr->idFrom ); tttext->lpszText = NULL; tttext->hinst = NULL; @@ -1947,13 +1955,30 @@ mswindows_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) GET_C_STRING_EXT_DATA_ALLOCA (btext, FORMAT_OS, tttext->lpszText); } -#if 0 - tttext->uFlags |= TTF_DI_SETITEM; #endif - } + } + /* handle tree view callbacks */ + else if (nmhdr->code == TVN_SELCHANGED) + { + NM_TREEVIEW* ptree = (NM_TREEVIEW*)lParam; + frame = XFRAME (mswindows_find_frame (hwnd)); + mswindows_handle_gui_wm_command (frame, 0, ptree->itemNew.lParam); + } + /* handle tab control callbacks */ + else if (nmhdr->code == TCN_SELCHANGE) + { + TC_ITEM item; + int index = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0); + frame = XFRAME (mswindows_find_frame (hwnd)); + + item.mask = TCIF_PARAM; + SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)index, + (LPARAM)&item); + + mswindows_handle_gui_wm_command (frame, 0, item.lParam); + } } break; -#endif case WM_PAINT: { @@ -2552,7 +2577,7 @@ emacs_mswindows_next_event (struct Lisp_Event *emacs_event) mswindows_need_event (1); - event = mswindows_dequeue_dispatch_event (!NILP(mswindows_u_dispatch_event_queue)); + event = mswindows_dequeue_dispatch_event (); XSETEVENT (event2, emacs_event); Fcopy_event (event, event2); Fdeallocate_event (event);