changeset 33971:c33b80a45f6a

(add_menu_item): Reset menu item text when changing type to radio button.
author Jason Rumney <jasonr@gnu.org>
date Tue, 28 Nov 2000 20:28:02 +0000
parents 670b73b06a0d
children e5e08f592f90
files src/ChangeLog src/w32menu.c
diffstat 2 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Nov 28 18:02:05 2000 +0000
+++ b/src/ChangeLog	Tue Nov 28 20:28:02 2000 +0000
@@ -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.
--- a/src/w32menu.c	Tue Nov 28 18:02:05 2000 +0000
+++ b/src/w32menu.c	Tue Nov 28 20:28:02 2000 +0000
@@ -45,7 +45,7 @@
 #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 @@
   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 @@
 	  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 @@
     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 @@
             /* 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 @@
 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");