diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2004-11-01 12:20:45 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2004-11-01 12:20:45 +0000 |
commit | 03a693b48abb72239e081a1a583e1e21aa07638f (patch) | |
tree | 69c694db9940c0b9c922ff04dff632b0559bdd23 /lwlib/xlwmenu.c | |
parent | bad49fc7c2a55bd614979cf0e9c59b396ac2beb7 (diff) | |
download | emacs-03a693b48abb72239e081a1a583e1e21aa07638f.tar.gz |
* xlwmenu.c (find_first_selectable, find_next_selectable)
(find_prev_selectable): Rename parameter skip_no_call_data to
skip_titles. Recognize titles as having no call_data and no contents.
(Down, Up): Comment update.
Diffstat (limited to 'lwlib/xlwmenu.c')
-rw-r--r-- | lwlib/xlwmenu.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index 973fc6ec5d5..d4eeeaa3eb4 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -2054,26 +2054,26 @@ Nothing (w, ev, params, num_params) } static widget_value * -find_first_selectable (mw, item, skip_no_call_data) +find_first_selectable (mw, item, skip_titles) XlwMenuWidget mw; widget_value *item; - int skip_no_call_data; + int skip_titles; { widget_value *current = item; enum menu_separator separator; while (lw_separator_p (current->name, &separator, 0) || !current->enabled - || (skip_no_call_data && !current->call_data)) + || (skip_titles && !current->call_data && !current->contents)) if (current->next) current=current->next; else - return NULL; + return NULL; return current; } static widget_value * -find_next_selectable (mw, item, skip_no_call_data) +find_next_selectable (mw, item, skip_titles) XlwMenuWidget mw; widget_value *item; { @@ -2082,7 +2082,7 @@ find_next_selectable (mw, item, skip_no_call_data) while (current->next && (current=current->next) && (lw_separator_p (current->name, &separator, 0) || !current->enabled - || (skip_no_call_data && !current->call_data))) + || (skip_titles && !current->call_data && !current->contents))) ; if (current == item) @@ -2093,7 +2093,8 @@ find_next_selectable (mw, item, skip_no_call_data) while (lw_separator_p (current->name, &separator, 0) || !current->enabled - || (skip_no_call_data && !current->call_data)) + || (skip_titles && !current->call_data + && !current->contents)) { if (current->next) current=current->next; @@ -2108,14 +2109,14 @@ find_next_selectable (mw, item, skip_no_call_data) } static widget_value * -find_prev_selectable (mw, item, skip_no_call_data) +find_prev_selectable (mw, item, skip_titles) XlwMenuWidget mw; widget_value *item; { widget_value *current = item; widget_value *prev = item; - while ((current=find_next_selectable (mw, current, skip_no_call_data)) + while ((current=find_next_selectable (mw, current, skip_titles)) != item) { if (prev == current) @@ -2141,8 +2142,7 @@ Down (w, ev, params, num_params) if (mw->menu.old_depth == mw->menu.top_depth) /* When <down> in the menu-bar is pressed, display the corresponding sub-menu and select the first selectable menu item there. - If this is a popup menu, skip items with zero call data (title of - the popup). */ + If this is a popup menu, skip title item of the popup. */ set_new_state (mw, find_first_selectable (mw, selected_item->contents, @@ -2174,8 +2174,7 @@ Up (w, ev, params, num_params) last selectable item in the list. So we select the first selectable one and find the previous selectable item. Is there a better way? */ - /* If this is a popup menu, skip items with zero call data (title of - the popup). */ + /* If this is a popup menu, skip title item of the popup. */ set_new_state (mw, find_first_selectable (mw, selected_item->contents, |