source: golgotha/src/i4/gui/list_box.hh @ 608

Last change on this file since 608 was 80, checked in by Sam Hocevar, 15 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.0 KB
Line 
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
16class i4_button_class;
17class i4_font_class;
18class i4_graphical_style_class;
19class i4_deco_window_class;
20class i4_list_pull_down_class;
21
22class 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
34public:
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
Note: See TracBrowser for help on using the repository browser.