[Tuxracer-checkins] CVS: tuxracer/src listbox.c,1.4,1.5 listbox.h,1.3,1.4
Status: Beta
Brought to you by:
jfpatry
From: Jasmin P. <jf...@us...> - 2000-09-30 17:16:58
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv15445 Modified Files: listbox.c listbox.h Log Message: - Added listbox_goto_next_item, listbox_goto_prev_item Index: listbox.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/listbox.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** listbox.c 2000/09/25 23:47:32 1.4 --- listbox.c 2000/09/30 17:16:55 1.5 *************** *** 171,174 **** --- 171,215 ---- + /*---------------------------------------------------------------------------*/ + /*! + Advances to the next item in the list. Returns true if successful, or + false if the current item (before the change) is the last item + \author jfpatry + \date Created: 2000-09-30 + \date Modified: 2000-09-30 + */ + bool_t listbox_goto_next_item( listbox_t *listbox ) + { + check_assertion( listbox != NULL, "listbox is NULL" ); + + if ( listbox->cur_item == get_list_tail( listbox->item_list ) ) { + return False; + } + + listbox_arrow_click_cb( listbox->down_button, (void*) listbox ); + return True; + } + + + + /*---------------------------------------------------------------------------*/ + /*! + Moves to the previous item in the list. Returns true if successful, or + false if the current item (before then change) is the first item. + \author jfpatry + \date Created: 2000-09-30 + \date Modified: 2000-09-30 + */ + bool_t listbox_goto_prev_item( listbox_t *listbox ) + { + check_assertion( listbox != NULL, "listbox is NULL" ); + + if ( listbox->cur_item == get_list_head( listbox->item_list ) ) { + return False; + } + + listbox_arrow_click_cb( listbox->up_button, (void*) listbox ); + return True; + } /*---------------------------------------------------------------------------*/ Index: listbox.h =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/listbox.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** listbox.h 2000/09/25 14:30:37 1.3 --- listbox.h 2000/09/30 17:16:55 1.4 *************** *** 47,50 **** --- 47,52 ---- list_elem_t listbox_get_current_item( listbox_t *listbox ); void listbox_set_current_item( listbox_t *listbox, list_elem_t elem); + bool_t listbox_goto_next_item( listbox_t *listbox ); + bool_t listbox_goto_prev_item( listbox_t *listbox ); void listbox_set_position( listbox_t *listbox, point2d_t pos ); scalar_t listbox_get_width( listbox_t *listbox ); |