Same fix as r45172 for classes/iconimage:
[AROS-Contrib.git] / Games / lbreakout2 / gui / gui_list.h
blobb3f9e92dfacc7b49795c6cde9cbf55792c2842e0
1 /***************************************************************************
2 gui_list.h - description
3 -------------------
4 begin : Wed Oct 16 2002
5 copyright : (C) 2002 by Michael Speck
6 email : kulkanie@gmx.net
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef __GUI_LIST_H
19 #define __GUI_LIST_H
21 /* select types */
22 enum {
23 GUI_LIST_MULTI_SELECT = -1,
24 GUI_LIST_NO_SELECT,
25 GUI_LIST_SINGLE_SELECT
29 ====================================================================
30 Create a listbox that may have multiple columns which cannot be
31 scrolled however.
32 'gap': gap between items and frame
33 'columns': the item width is determined by available_width/columns
34 'item_height': the number of rows is unlimited and this is the
35 height of an item
36 'scrollbar_width' : if > 0 a vertical scrollbar is provided
37 'render_item': The scrollbar value (0 if none) tells which row
38 is the first displayed and
39 render_item(row,column,buffer) is called to
40 obtain the graphic for each visible item.
41 If 'render_item' returns False the item is not
42 displayed.
43 'select_type': no, single, multi select
44 ====================================================================
46 GuiWidget* gui_list_create(
47 GuiWidget *parent, int x, int y, int width, int height,
48 void (*user_event_handler)(GuiWidget*,GuiEvent*),
49 int gap, int columns, int item_height,
50 int scrollbar_width, int (*render_item)(int,int,SDL_Surface*),
51 int select_type );
54 ====================================================================
55 Set item count of list and update it even if item count hasn't
56 changed. This function is used to tell the list that it
57 contents has changed and needs to be redrawn. All selections
58 are cleared by this function.
59 ====================================================================
61 void gui_list_update( GuiWidget *list, int count );
63 ====================================================================
64 Handle a listbox selection and update listbox.
65 If 'select' is 1 the item is selected, if it's 0 the item
66 is unselected, -1 means to toggle the value.
67 If SINGLE_SELECT toggeling the current selection keeps selection.
68 ====================================================================
70 void gui_list_select(
71 GuiWidget *list, int column, int row, int select );
74 ====================================================================
75 Display passed row as first one or jump to end if 'row' is -1 .
76 ====================================================================
78 void gui_list_goto( GuiWidget *list, int row );
80 #endif