1 /***************************************************************************
4 begin : Thu Sep 20 2001
5 copyright : (C) 2001 by Michael Speck
6 email : kulkanie@gmx.net
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
24 ====================================================================
26 ====================================================================
39 Value
*value
; /* value of item */
40 int type
; /* type as listed above */
41 char *name
; /* name of item -- duplicated */
42 int item_id
; /* id of item (returned as action if ITEM_ACTION) */
43 int x
, y
, w
, h
; /* position and size in screen */
44 int nx
, ny
; /* position where name is drawn */
45 int nalign
; /* align of name: either left-aligned
46 or centered (only if link to another menu) */
47 int vx
, vy
; /* position where value string is drawn right-aligned */
48 int valign
; /* alignment of value string */
49 float alpha
; /* alpha of normal font (which vanishes when selected) */
50 float halpha
; /* alpha of highlight font */
51 int highlighted
; /* keep alpha at 0 (will raise to 255 if not set) */
52 void (*callback
)(); /* if value of item has been modified this functions is called */
53 void *link
; /* menu link */
54 StkFont
*font
, *hfont
; /* if set use these fonts instead of standard font */
55 Hint
*hint
; /* if not NULL this hint is displayed when quick-help's enabled:
56 created by item itself */
57 SDL_Surface
*bkgnd
; /* background surface for item */
61 ====================================================================
64 ====================================================================
66 Item
*item_create_separator( char *name
);
67 Item
*item_create_range( char *name
, char *hint
, int *val_int
, int min
, int max
, int step
);
68 Item
*item_create_switch( char *name
, char *hint
, int *val_int
, char *str_off
, char *str_on
);
69 Item
*item_create_switch_x( char *name
, char *hint
, int *val_int
, char **strings
, int count
);
70 Item
*item_create_key( char *name
, char *hint
, int *val_int
, int *filter
);
71 Item
*item_create_edit( char *name
, char *hint
, char *val_str
, int limit
);
72 Item
*item_create_link( char *name
, char *hint
, void *menu
);
73 Item
*item_create_action( char *name
, char *hint
, int item_id
);
75 ====================================================================
76 Delete item (void pointer for compatiblity when using with list)
77 ====================================================================
79 void item_delete( void *item
);
81 ====================================================================
82 Adjust alignment of name and value strings
83 ====================================================================
85 void item_adjust( Item
*item
);
87 ====================================================================
89 ====================================================================
91 void item_hide( Item
*item
);
92 void item_show( Item
*item
);
94 ====================================================================
96 ====================================================================
98 void item_update_alpha( Item
*item
, int ms
);
100 ====================================================================
101 Check if position's on item.
102 ====================================================================
104 int item_focus( Item
*item
, int x
, int y
);