diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2004-07-08 22:05:35 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2004-07-08 22:05:35 +0000 |
commit | e387d5e34a2ae57b0f4d58bb16f844d9b923650e (patch) | |
tree | b4539b5fff33aee94c822bd290741117d6bbbf5d /riscos/menus.c | |
parent | 4d3423003e1af0aca353265f733ab30a9b11bc04 (diff) | |
download | netsurf-e387d5e34a2ae57b0f4d58bb16f844d9b923650e.tar.gz netsurf-e387d5e34a2ae57b0f4d58bb16f844d9b923650e.tar.bz2 |
[project @ 2004-07-08 22:05:35 by rjw]
Lose compiler warnings. Fix for dragging hotlist item to itself failing. Initial work on adding/editing entries.
svn path=/import/netsurf/; revision=1061
Diffstat (limited to 'riscos/menus.c')
-rw-r--r-- | riscos/menus.c | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/riscos/menus.c b/riscos/menus.c index eeb02e913..668e09182 100644 --- a/riscos/menus.c +++ b/riscos/menus.c @@ -280,8 +280,8 @@ wimp_menu *browser_menu = (wimp_menu *) &menu; static wimp_MENU(2) hotlist_new = { { "New" }, 7,2,7,0, 300, 44, 0, { - { 0, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "Folder" } }, - { wimp_MENU_LAST, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "Link" } }, + { wimp_MENU_GIVE_WARNING, (wimp_menu *)1, DEFAULT_FLAGS, { "Folder" } }, + { wimp_MENU_LAST | wimp_MENU_GIVE_WARNING, (wimp_menu *)1, DEFAULT_FLAGS, { "Link" } }, } }; @@ -324,7 +324,7 @@ static wimp_MENU(4) hotlist_save = { static wimp_MENU(5) hotlist_file = { { "Hotlist" }, 7,2,7,0, 300, 44, 0, { - { wimp_MENU_GIVE_WARNING, (wimp_menu *)&hotlist_new, DEFAULT_FLAGS, { "New" } }, + { 0, (wimp_menu *)&hotlist_new, DEFAULT_FLAGS, { "New" } }, { wimp_MENU_GIVE_WARNING, wimp_NO_SUB_MENU, DEFAULT_FLAGS, { "Save" } }, { wimp_MENU_GIVE_WARNING | wimp_MENU_SEPARATE, (wimp_menu *)1, DEFAULT_FLAGS, { "Export" } }, { 0, (wimp_menu *)&hotlist_expand, DEFAULT_FLAGS, { "Expand" } }, @@ -977,6 +977,18 @@ void ro_gui_menu_hotlist_warning(wimp_message_menu_warning *warning) { case 0: /* Hotlist-> */ switch (warning->selection.items[1]) { case 0: /* New-> */ + hotlist_insert = true; + switch (warning->selection.items[2]) { + case 0: /* Folder */ + ro_gui_hotlist_prepare_folder_dialog(false); + error = xwimp_create_sub_menu((wimp_menu *) dialog_folder, + warning->pos.x, warning->pos.y); + break; + case 1: /* Entry */ + ro_gui_hotlist_prepare_entry_dialog(false); + error = xwimp_create_sub_menu((wimp_menu *) dialog_entry, + warning->pos.x, warning->pos.y); + } break; case 2: /* Export-> */ gui_current_save_type = GUI_HOTLIST_EXPORT_HTML; @@ -995,7 +1007,17 @@ void ro_gui_menu_hotlist_warning(wimp_message_menu_warning *warning) { break; case 0: /* Save-> */ break; - case 1: /* Edit title-> */ + case 1: /* Edit-> */ + hotlist_insert = true; + if (ro_gui_hotlist_get_selected(false) == 0) { + ro_gui_hotlist_prepare_folder_dialog(true); + error = xwimp_create_sub_menu((wimp_menu *) dialog_folder, + warning->pos.x, warning->pos.y); + } else { + ro_gui_hotlist_prepare_entry_dialog(true); + error = xwimp_create_sub_menu((wimp_menu *) dialog_entry, + warning->pos.x, warning->pos.y); + } break; } break; @@ -1305,24 +1327,33 @@ void ro_gui_menu_prepare_scale(void) { */ void ro_gui_menu_prepare_hotlist(void) { int selection; + int selection_full; selection = ro_gui_hotlist_get_selected(false); - if (selection == 0) { + selection_full = ro_gui_hotlist_get_selected(true); + + if (selection_full == 0) { hotlist_menu->entries[1].icon_flags |= wimp_ICON_SHADED; hotlist_menu->entries[3].icon_flags |= wimp_ICON_SHADED; - hotlist_select_menu->entries[2].icon_flags |= wimp_ICON_SHADED; - hotlist_select_menu->entries[4].icon_flags |= wimp_ICON_SHADED; } else { hotlist_menu->entries[1].icon_flags &= ~wimp_ICON_SHADED; hotlist_menu->entries[3].icon_flags &= ~wimp_ICON_SHADED; + } + if (selection == 0) { + hotlist_select_menu->entries[2].icon_flags |= wimp_ICON_SHADED; + hotlist_select_menu->entries[4].icon_flags |= wimp_ICON_SHADED; + } else { hotlist_select_menu->entries[2].icon_flags &= ~wimp_ICON_SHADED; hotlist_select_menu->entries[4].icon_flags &= ~wimp_ICON_SHADED; } - if (selection != 1) { + if (selection_full != 1) { hotlist_select_menu->entries[1].icon_flags |= wimp_ICON_SHADED; + } else { + hotlist_select_menu->entries[1].icon_flags &= ~wimp_ICON_SHADED; + } + if (selection != 1) { hotlist_save_menu->entries[0].icon_flags |= wimp_ICON_SHADED; hotlist_save_menu->entries[1].icon_flags |= wimp_ICON_SHADED; } else { - hotlist_select_menu->entries[1].icon_flags &= ~wimp_ICON_SHADED; hotlist_save_menu->entries[0].icon_flags &= ~wimp_ICON_SHADED; hotlist_save_menu->entries[1].icon_flags &= ~wimp_ICON_SHADED; } |