diff 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
line wrap: on
line diff
--- a/src/event-msw.c	Mon Aug 13 11:22:24 2007 +0200
+++ b/src/event-msw.c	Mon Aug 13 11:23:13 2007 +0200
@@ -1327,6 +1327,7 @@
       
       if (active == 0)
 	{
+	  assert (!badly_p);
 	  return;		/* timeout */
 	}
       else if (active > 0)
@@ -1925,17 +1926,21 @@
 				       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;
+      int idCtrl = (int)wParam;
+
+      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 +1952,28 @@
 	      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));
+	  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 +2572,7 @@
 
   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);