mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-01 11:14:55 +00:00
Include widget.h.
(single_submenu): Return int. Some cleanup. (set_frame_menubar): Call x_set_menu_resources_from_menu_face.
This commit is contained in:
parent
823ba8d8b3
commit
f61a541bca
@ -1,3 +1,12 @@
|
|||||||
|
2001-03-22 Gerd Moellmann <gerd@gnu.org>
|
||||||
|
|
||||||
|
* xfaces.c (xm_set_menu_resources_from_menu_face): Remove
|
||||||
|
#ifndef LESSTIF_VERSION.
|
||||||
|
|
||||||
|
* xmenu.c: Include widget.h.
|
||||||
|
(single_submenu): Return int. Some cleanup.
|
||||||
|
(set_frame_menubar): Call x_set_menu_resources_from_menu_face.
|
||||||
|
|
||||||
2001-03-21 Gerd Moellmann <gerd@gnu.org>
|
2001-03-21 Gerd Moellmann <gerd@gnu.org>
|
||||||
|
|
||||||
* xterm.c (x_update_window_end): Handle overwritten mouse face
|
* xterm.c (x_update_window_end): Handle overwritten mouse face
|
||||||
|
72
src/xmenu.c
72
src/xmenu.c
@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */
|
|||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "blockinput.h"
|
#include "blockinput.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
#include "widget.h"
|
||||||
|
|
||||||
#ifdef MSDOS
|
#ifdef MSDOS
|
||||||
#include "msdos.h"
|
#include "msdos.h"
|
||||||
@ -123,12 +124,16 @@ void popup_get_selection ();
|
|||||||
static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
|
static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
|
||||||
Lisp_Object, Lisp_Object, Lisp_Object,
|
Lisp_Object, Lisp_Object, Lisp_Object,
|
||||||
Lisp_Object, Lisp_Object));
|
Lisp_Object, Lisp_Object));
|
||||||
static Lisp_Object xmenu_show ();
|
static int update_frame_menubar P_ ((struct frame *));
|
||||||
static void keymap_panes ();
|
static Lisp_Object xmenu_show P_ ((struct frame *, int, int, int, int,
|
||||||
static void single_keymap_panes ();
|
Lisp_Object, char **));
|
||||||
static void single_menu_item ();
|
static void keymap_panes P_ ((Lisp_Object *, int, int));
|
||||||
static void list_of_panes ();
|
static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
|
||||||
static void list_of_items ();
|
int, int));
|
||||||
|
static void single_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object *,
|
||||||
|
int, int, int *));
|
||||||
|
static void list_of_panes P_ ((Lisp_Object));
|
||||||
|
static void list_of_items P_ ((Lisp_Object));
|
||||||
|
|
||||||
/* This holds a Lisp vector that holds the results of decoding
|
/* This holds a Lisp vector that holds the results of decoding
|
||||||
the keymaps or alist-of-alists that specify a menu.
|
the keymaps or alist-of-alists that specify a menu.
|
||||||
@ -1539,55 +1544,42 @@ single_submenu (item_key, item_name, maps)
|
|||||||
|
|
||||||
return first_wv;
|
return first_wv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern void EmacsFrameSetCharSize ();
|
/* Recompute all the widgets of frame F, when the menu bar has been
|
||||||
|
changed. Value is non-zero if widgets were updated. */
|
||||||
|
|
||||||
/* Recompute all the widgets of frame F, when the menu bar
|
static int
|
||||||
has been changed. */
|
|
||||||
|
|
||||||
static void
|
|
||||||
update_frame_menubar (f)
|
update_frame_menubar (f)
|
||||||
FRAME_PTR f;
|
FRAME_PTR f;
|
||||||
{
|
{
|
||||||
struct x_output *x = f->output_data.x;
|
struct x_output *x = f->output_data.x;
|
||||||
int columns, rows;
|
int columns, rows;
|
||||||
int menubar_changed;
|
|
||||||
|
|
||||||
/* We assume the menubar contents has changed if the global flag is set,
|
if (!x->menubar_widget || XtIsManaged (x->menubar_widget))
|
||||||
or if the current buffer has changed, or if the menubar has never
|
return 0;
|
||||||
been updated before.
|
|
||||||
*/
|
|
||||||
menubar_changed = (x->menubar_widget
|
|
||||||
&& !XtIsManaged (x->menubar_widget));
|
|
||||||
|
|
||||||
if (! (menubar_changed))
|
|
||||||
return;
|
|
||||||
|
|
||||||
BLOCK_INPUT;
|
BLOCK_INPUT;
|
||||||
/* Save the size of the frame because the pane widget doesn't accept to
|
/* Save the size of the frame because the pane widget doesn't accept
|
||||||
resize itself. So force it. */
|
to resize itself. So force it. */
|
||||||
columns = f->width;
|
columns = f->width;
|
||||||
rows = f->height;
|
rows = f->height;
|
||||||
|
|
||||||
/* Do the voodoo which means "I'm changing lots of things, don't try to
|
/* Do the voodoo which means "I'm changing lots of things, don't try
|
||||||
refigure sizes until I'm done." */
|
to refigure sizes until I'm done." */
|
||||||
lw_refigure_widget (x->column_widget, False);
|
lw_refigure_widget (x->column_widget, False);
|
||||||
|
|
||||||
/* the order in which children are managed is the top to
|
/* The order in which children are managed is the top to bottom
|
||||||
bottom order in which they are displayed in the paned window.
|
order in which they are displayed in the paned window. First,
|
||||||
First, remove the text-area widget.
|
remove the text-area widget. */
|
||||||
*/
|
|
||||||
XtUnmanageChild (x->edit_widget);
|
XtUnmanageChild (x->edit_widget);
|
||||||
|
|
||||||
/* remove the menubar that is there now, and put up the menubar that
|
/* Remove the menubar that is there now, and put up the menubar that
|
||||||
should be there.
|
should be there. */
|
||||||
*/
|
XtManageChild (x->menubar_widget);
|
||||||
if (menubar_changed)
|
XtMapWidget (x->menubar_widget);
|
||||||
{
|
XtVaSetValues (x->menubar_widget, XtNmappedWhenManaged, 1, NULL);
|
||||||
XtManageChild (x->menubar_widget);
|
|
||||||
XtMapWidget (x->menubar_widget);
|
|
||||||
XtVaSetValues (x->menubar_widget, XtNmappedWhenManaged, 1, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Re-manage the text-area widget, and then thrash the sizes. */
|
/* Re-manage the text-area widget, and then thrash the sizes. */
|
||||||
XtManageChild (x->edit_widget);
|
XtManageChild (x->edit_widget);
|
||||||
@ -1597,6 +1589,7 @@ update_frame_menubar (f)
|
|||||||
/* Force the pane widget to resize itself with the right values. */
|
/* Force the pane widget to resize itself with the right values. */
|
||||||
EmacsFrameSetCharSize (x->edit_widget, columns, rows);
|
EmacsFrameSetCharSize (x->edit_widget, columns, rows);
|
||||||
UNBLOCK_INPUT;
|
UNBLOCK_INPUT;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the contents of the menubar widgets of frame F.
|
/* Set the contents of the menubar widgets of frame F.
|
||||||
@ -1842,7 +1835,8 @@ set_frame_menubar (f, first_time, deep_p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free_menubar_widget_value_tree (first_wv);
|
free_menubar_widget_value_tree (first_wv);
|
||||||
update_frame_menubar (f);
|
if (!update_frame_menubar (f))
|
||||||
|
x_set_menu_resources_from_menu_face (f, menubar_widget);
|
||||||
|
|
||||||
UNBLOCK_INPUT;
|
UNBLOCK_INPUT;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user