/[emacs]/emacs/src/w32menu.c
ViewVC logotype

Diff of /emacs/src/w32menu.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.45 by jasonr, Sun Nov 18 21:58:26 2001 UTC revision 1.46 by jasonr, Wed Nov 28 20:31:43 2001 UTC
# Line 140  void set_frame_menubar (); Line 140  void set_frame_menubar ();
140  static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,  static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
141                                  Lisp_Object, Lisp_Object, Lisp_Object,                                  Lisp_Object, Lisp_Object, Lisp_Object,
142                                  Lisp_Object, Lisp_Object));                                  Lisp_Object, Lisp_Object));
143    #ifdef HAVE_DIALOGS
144  static Lisp_Object w32_dialog_show ();  static Lisp_Object w32_dialog_show ();
145    #endif
146  static Lisp_Object w32_menu_show ();  static Lisp_Object w32_menu_show ();
147    
148  static void keymap_panes ();  static void keymap_panes ();
# Line 2075  add_menu_item (HMENU menu, widget_value Line 2077  add_menu_item (HMENU menu, widget_value
2077        else        else
2078          out_string = wv->name;          out_string = wv->name;
2079    
2080        if (wv->title || wv->call_data == 0)        if (wv->title)
2081          {          {
2082  #if 0  /* no GC while popup menu is active */  #if 0  /* no GC while popup menu is active */
2083            out_string = LocalAlloc (0, strlen (wv->name) + 1);            out_string = LocalAlloc (0, strlen (wv->name) + 1);
# Line 2083  add_menu_item (HMENU menu, widget_value Line 2085  add_menu_item (HMENU menu, widget_value
2085  #endif  #endif
2086            fuFlags = MF_OWNERDRAW | MF_DISABLED;            fuFlags = MF_OWNERDRAW | MF_DISABLED;
2087          }          }
2088          else if (wv->call_data == 0)
2089            fuFlags |= MF_DISABLED;
2090    
2091        /* Draw radio buttons and tickboxes. */        /* Draw radio buttons and tickboxes. */
2092        else if (wv->selected && (wv->button_type == BUTTON_TYPE_TOGGLE ||        else if (wv->selected && (wv->button_type == BUTTON_TYPE_TOGGLE ||
2093                                  wv->button_type == BUTTON_TYPE_RADIO))                                  wv->button_type == BUTTON_TYPE_RADIO))
# Line 2178  popup_activated () Line 2183  popup_activated ()
2183  void  void
2184  w32_menu_display_help (HMENU menu, UINT item, UINT flags)  w32_menu_display_help (HMENU menu, UINT item, UINT flags)
2185  {  {
   int pane = 0; /* TODO: Set this to pane number.  */  
   
2186    HMODULE user32 = GetModuleHandle ("user32.dll");    HMODULE user32 = GetModuleHandle ("user32.dll");
2187    FARPROC get_menu_item_info = GetProcAddress (user32, "GetMenuItemInfoA");    FARPROC get_menu_item_info = GetProcAddress (user32, "GetMenuItemInfoA");
2188    
2189    if (get_menu_item_info)    if (get_menu_item_info)
2190      {      {
       extern Lisp_Object Qmenu_item;  
       Lisp_Object *first_item;  
       Lisp_Object pane_name;  
       Lisp_Object menu_object;  
2191        MENUITEMINFO info;        MENUITEMINFO info;
2192          struct frame *f = x_window_to_frame (&one_w32_display_info, owner);
2193          Lisp_Object frame, help;
2194    
2195        bzero (&info, sizeof (info));        bzero (&info, sizeof (info));
2196        info.cbSize = sizeof (info);        info.cbSize = sizeof (info);
2197        info.fMask = MIIM_DATA;        info.fMask = MIIM_DATA;
2198        get_menu_item_info (menu, item, FALSE, &info);        get_menu_item_info (menu, item, FALSE, &info);
2199    
2200        first_item = XVECTOR (menu_items)->contents;        help = info.dwItemData ? build_string ((char *)info.dwItemData) : Qnil;
       if (EQ (first_item[0], Qt))  
         pane_name = first_item[MENU_ITEMS_PANE_NAME];  
       else if (EQ (first_item[0], Qquote))  
         /* This shouldn't happen, see w32_menu_show.  */  
         pane_name = empty_string;  
       else  
         pane_name = first_item[MENU_ITEMS_ITEM_NAME];  
2201    
2202        /* (menu-item MENU-NAME PANE-NUMBER)  */        /* Store the help echo in the keyboard buffer as the X toolkit
2203        menu_object = Fcons (Qmenu_item,           version does, rather than directly showing it. This seems to
2204                             Fcons (pane_name,           solve the GC problems that were present when we based the
2205                                    Fcons (make_number (pane), Qnil)));           Windows code on the non-toolkit version.  */
2206          if (f)
2207        show_help_echo (info.dwItemData ?          {
2208                        build_string ((char *) info.dwItemData) : Qnil,            XSETFRAME (frame, f);
2209                        Qnil, menu_object, make_number (item), 1);            kbd_buffer_store_help_event (frame, help);
2210            }
2211          else
2212            /* X version has a loop through frames here, which doesn't
2213               appear to do anything, unless it has some side effect.  */
2214            show_help_echo (help, Qnil, Qnil, Qnil, 1);
2215      }      }
2216  }  }
2217    

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26