1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifndef I4_LIST_BOX_HH
|
---|
10 | #define I4_LIST_BOX_HH
|
---|
11 |
|
---|
12 | #include "window/window.hh"
|
---|
13 | #include "memory/array.hh"
|
---|
14 | #include "menu/menu.hh"
|
---|
15 |
|
---|
16 | class i4_button_class;
|
---|
17 | class i4_font_class;
|
---|
18 | class i4_graphical_style_class;
|
---|
19 | class i4_deco_window_class;
|
---|
20 | class i4_list_pull_down_class;
|
---|
21 |
|
---|
22 | class i4_list_box_class : public i4_menu_class
|
---|
23 | {
|
---|
24 | i4_button_class *down;
|
---|
25 | i4_array<i4_menu_item_class *> entries;
|
---|
26 | i4_menu_item_class *top;
|
---|
27 | i4_list_pull_down_class *pull_down;
|
---|
28 | i4_graphical_style_class *style;
|
---|
29 | int current;
|
---|
30 | i4_parent_window_class *root_window;
|
---|
31 | w32 l,r,t,b;
|
---|
32 | void set_top(i4_menu_item_class *item);
|
---|
33 |
|
---|
34 | public:
|
---|
35 | int get_current() { return current; }
|
---|
36 | i4_menu_item_class *get_current_item() { return entries[current]; }
|
---|
37 | i4_list_box_class(w16 width, // height is determined by first item
|
---|
38 | i4_graphical_style_class *style, // uses normal font if none specified
|
---|
39 | i4_parent_window_class *root_window);
|
---|
40 | ~i4_list_box_class();
|
---|
41 |
|
---|
42 | void add_item(i4_menu_item_class *item);
|
---|
43 | void set_current_item(int entry_num);
|
---|
44 |
|
---|
45 | void show(i4_parent_window_class *show_on, i4_coord x, i4_coord y);
|
---|
46 | void hide();
|
---|
47 | void receive_event(i4_event *ev);
|
---|
48 | void note_reaction_sent(i4_menu_item_class *who, // this is who sent it
|
---|
49 | i4_event_reaction_class *ev, // who it was to
|
---|
50 | i4_menu_item_class::reaction_type type);
|
---|
51 |
|
---|
52 | void parent_draw(i4_draw_context_class &context);
|
---|
53 |
|
---|
54 | char *name() { return "list_box"; }
|
---|
55 | };
|
---|
56 |
|
---|
57 |
|
---|
58 | #endif
|
---|