summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2008-10-21 18:04:27 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2008-10-21 18:04:27 +0000
commit5624bf590ded22d8b2d85753fd189b7e6c6443ea (patch)
treec479d63fc77a28350dc2c393390723f6f8faed5d /amiga/gui.c
parent8f5266e61e3a06f6f6703f0d127e411dec0b41d4 (diff)
downloadnetsurf-5624bf590ded22d8b2d85753fd189b7e6c6443ea.tar.gz
netsurf-5624bf590ded22d8b2d85753fd189b7e6c6443ea.tar.bz2
Initial context menus. Five possible options (copy link to clipboard, download link,
show object, save object and select file for upload), only one implemented at the moment. Menu structure/strings need some thought and tidy-up (with object and URL options in their own sub-menus?) svn path=/trunk/netsurf/; revision=5612
Diffstat (limited to 'amiga/gui.c')
-rwxr-xr-xamiga/gui.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index dfd7496b4..6295dc154 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -66,6 +66,8 @@
#include "amiga/arexx.h"
#include "amiga/hotlist.h"
#include "amiga/history.h"
+#include "amiga/context_menu.h"
+#include "amiga/cookies.h"
#ifdef WITH_HUBBUB
#include <hubbub/hubbub.h>
@@ -145,6 +147,7 @@ void ami_scroller_hook(struct Hook *,Object *,struct IntuiMessage *);
uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved);
void ami_do_redraw(struct gui_window_2 *g);
void ami_init_mouse_pointers(void);
+void ami_switch_tab(struct gui_window_2 *gwin,bool redraw);
#ifdef WITH_HUBBUB
static void *myrealloc(void *ptr, size_t len, void *pw);
#endif
@@ -566,6 +569,10 @@ void ami_handle_msg(void)
browser_window_mouse_click(gwin->bw,BROWSER_MOUSE_PRESS_2 | gwin->key_state,x,y);
gwin->mouse_state=BROWSER_MOUSE_PRESS_2;
break;
+
+ case MENUDOWN:
+ ami_context_menu_show(gwin,x,y);
+ break;
}
}
@@ -2569,12 +2576,14 @@ void gui_create_form_select_menu(struct browser_window *bw,
struct form_option *opt = control->data.select.items;
ULONG i = 0;
+ if(gwin->shared->objects[OID_MENU]) DisposeObject(gwin->shared->objects[OID_MENU]);
+
gwin->shared->popuphook.h_Entry = ami_popup_hook;
gwin->shared->popuphook.h_Data = gwin;
gwin->shared->control = control;
- gwin->shared->objects[OID_MENU] = PMMENU(messages_get("NetSurf")),
+ gwin->shared->objects[OID_MENU] = PMMENU(ami_utf8_easy(control->name)),
PMA_MenuHandler, &gwin->shared->popuphook,End;
while(opt)
@@ -2634,8 +2643,6 @@ uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved)
browser_window_form_select(gwin->shared->bw,gwin->shared->control,itemid);
}
-// DisposeObject(gwin->objects[OID_MENU]);
-
return itemid;
}