[w3m-dev 03458] Re: mouse menu

* display.c (displayBuffer): nTab2 -> nTab, mouse_menu
* fm.h (nTab2): deleted
	(MouseMenuMap): added
	(MouseMenu): added
	(LIMIT_MOUSE_MENU): added
* func.c (initMouseMenu): delete mouse_menu_map initialization
		conv_from_system
		mouse_menu->width
* main.c (main): mouse_menu->in_action = FALSE
	(posTab): check mouse_menu
	(mouse_menu_action): add y arg
		mouse_menu_width check
	(process_mouse): nTab2 -> nTab, mouse_menu
	(nTabLine): deleted
	(calcTabPos): check mouse_menu
* menu.c (mainMn): x, y
	(selMn): mouse_menu check
	(tabMn): mosue_menu check
* proto.h (nTabLine): deleted
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2002-11-22 15:43:13 +00:00
parent 4da0ac0fb9
commit 82901953d3
7 changed files with 136 additions and 67 deletions

37
menu.c
View File

@@ -1,4 +1,4 @@
/* $Id: menu.c,v 1.18 2002/11/15 15:36:48 ukai Exp $ */
/* $Id: menu.c,v 1.19 2002/11/22 15:43:14 ukai Exp $ */
/*
* w3m menu.c
*/
@@ -1252,6 +1252,8 @@ mainMn(void)
Menu *menu = &MainMenu;
char *data;
int n;
int x = Currentbuf->cursorX + Currentbuf->rootX,
y = Currentbuf->cursorY + Currentbuf->rootY;
data = searchKeyData();
if (data != NULL) {
@@ -1260,8 +1262,13 @@ mainMn(void)
return;
menu = w3mMenuList[n].menu;
}
popupMenu(Currentbuf->cursorX + Currentbuf->rootX,
Currentbuf->cursorY + Currentbuf->rootY, menu);
#ifdef USE_MOUSE
if (mouse_menu && mouse_menu->in_action) {
x = mouse_menu->cursorX - FRAME_WIDTH - 1;
y = mouse_menu->cursorY;
}
#endif
popupMenu(x, y, menu);
}
/* --- MainMenu (END) --- */
@@ -1271,8 +1278,16 @@ mainMn(void)
void
selMn(void)
{
popupMenu(Currentbuf->cursorX + Currentbuf->rootX,
Currentbuf->cursorY + Currentbuf->rootY, &SelectMenu);
int x = Currentbuf->cursorX + Currentbuf->rootX,
y = Currentbuf->cursorY + Currentbuf->rootY;
#ifdef USE_MOUSE
if (mouse_menu && mouse_menu->in_action) {
x = mouse_menu->cursorX - FRAME_WIDTH - 1;
y = mouse_menu->cursorY;
}
#endif
popupMenu(x, y, &SelectMenu);
}
static void
@@ -1408,8 +1423,16 @@ smDelBuf(char c)
void
tabMn(void)
{
popupMenu(Currentbuf->cursorX + Currentbuf->rootX,
Currentbuf->cursorY + Currentbuf->rootY, &SelTabMenu);
int x = Currentbuf->cursorX + Currentbuf->rootX,
y = Currentbuf->cursorY + Currentbuf->rootY;
#ifdef USE_MOUSE
if (mouse_menu && mouse_menu->in_action) {
x = mouse_menu->cursorX - FRAME_WIDTH - 1;
y = mouse_menu->cursorY;
}
#endif
popupMenu(x, y, &SelTabMenu);
}
static void