]> git.eshelyaron.com Git - emacs.git/commitdiff
(add_menu_item): Reset menu item text when changing type to radio button.
authorJason Rumney <jasonr@gnu.org>
Tue, 28 Nov 2000 20:28:02 +0000 (20:28 +0000)
committerJason Rumney <jasonr@gnu.org>
Tue, 28 Nov 2000 20:28:02 +0000 (20:28 +0000)
src/ChangeLog
src/w32menu.c

index 87724fc0c3c0856aeef11bb5f1ad225e1c2022d4..4cb63cb61a644cb728be7ee43876902da8f6751a 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-28  Jason Rumney  <jasonr@gnu.org>
+
+       * w32menu.c (add_menu_item): Reset menu item text when changing
+       type to radio button.
+
 2000-11-28  Gerd Moellmann  <gerd@gnu.org>
 
        * xselect.c (wait_for_property_change): Update copyright.
index f2d97e81536ba4a1fc562e33078580dc2d8ec1da..49052c323088f35825ef740669aa1ef020167c09 100644 (file)
@@ -45,7 +45,7 @@ Boston, MA 02111-1307, USA.  */
 #include "dispextern.h"
 
 #undef HAVE_MULTILINGUAL_MENU
-#undef HAVE_DIALOGS /* NTEMACS_TODO: Implement native dialogs.  */
+#undef HAVE_DIALOGS /* TODO: Implement native dialogs.  */
 
 /******************************************************************/
 /* Definitions copied from lwlib.h */
@@ -2033,7 +2033,10 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
   int return_value;
 
   if (name_is_separator (wv->name))
-    fuFlags = MF_SEPARATOR;
+    {
+      fuFlags = MF_SEPARATOR;
+      out_string = NULL;
+    }
   else 
     {
       if (wv->enabled)
@@ -2057,8 +2060,8 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
          out_string = LocalAlloc (0, strlen (wv->name) + 1);
          strcpy (out_string, wv->name);
 #endif
-          /* NTEMACS_TODO: Why has owner drawing stopped working? */
-         fuFlags = /*MF_OWNERDRAW |*/ MF_DISABLED;
+          /* TODO: Why has owner-draw stopped working? */
+         fuFlags |= /*MF_OWNERDRAW |*/ MF_DISABLED;
        }
 
       /* Draw radio buttons and tickboxes. */
@@ -2077,7 +2080,7 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
     AppendMenu (menu,
                 fuFlags,
                 item != NULL ? (UINT) item : (UINT) wv->call_data,
-                (fuFlags == MF_SEPARATOR) ? NULL: out_string );
+                out_string );
 
   /* This must be done after the menu item is created.  */
   {
@@ -2099,9 +2102,11 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
             /* CheckMenuRadioItem allows us to differentiate TOGGLE and
                RADIO items, but is not available on NT 3.51 and earlier.  */
             info.fMask |= MIIM_TYPE | MIIM_STATE;
-            info.fType = MFT_RADIOCHECK;
+            info.fType = MFT_RADIOCHECK | MFT_STRING;
+            info.dwTypeData = out_string;
             info.fState = wv->selected ? MFS_CHECKED : MFS_UNCHECKED;
           }
+
         set_menu_item_info (menu,
                             item != NULL ? (UINT) item : (UINT) wv->call_data,
                             FALSE, &info);
@@ -2154,7 +2159,7 @@ popup_activated ()
 void
 w32_menu_display_help (HMENU menu, UINT item, UINT flags)
 {
-  int pane = 0; /* NTEMACS_TODO: Set this to pane number.  */
+  int pane = 0; /* TODO: Set this to pane number.  */
 
   HMODULE user32 = GetModuleHandle ("user32.dll");
   FARPROC get_menu_item_info = GetProcAddress (user32, "GetMenuItemInfoA");