list_box.hh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef I4_LIST_BOX_HH
  9. #define I4_LIST_BOX_HH
  10. #include "window/window.hh"
  11. #include "memory/array.hh"
  12. #include "menu/menu.hh"
  13. class i4_button_class;
  14. class i4_font_class;
  15. class i4_graphical_style_class;
  16. class i4_deco_window_class;
  17. class i4_list_pull_down_class;
  18. class i4_list_box_class : public i4_menu_class
  19. {
  20. i4_button_class *down;
  21. i4_array<i4_menu_item_class *> entries;
  22. i4_menu_item_class *top;
  23. i4_list_pull_down_class *pull_down;
  24. i4_graphical_style_class *style;
  25. int current;
  26. i4_parent_window_class *root_window;
  27. w32 l,r,t,b;
  28. void set_top(i4_menu_item_class *item);
  29. public:
  30. int get_current() { return current; }
  31. i4_menu_item_class *get_current_item() { return entries[current]; }
  32. i4_list_box_class(w16 width, // height is determined by first item
  33. i4_graphical_style_class *style, // uses normal font if none specified
  34. i4_parent_window_class *root_window);
  35. ~i4_list_box_class();
  36. void add_item(i4_menu_item_class *item);
  37. void set_current_item(int entry_num);
  38. void show(i4_parent_window_class *show_on, i4_coord x, i4_coord y);
  39. void hide();
  40. void receive_event(i4_event *ev);
  41. void note_reaction_sent(i4_menu_item_class *who, // this is who sent it
  42. i4_event_reaction_class *ev, // who it was to
  43. i4_menu_item_class::reaction_type type);
  44. void parent_draw(i4_draw_context_class &context);
  45. char *name() { return "list_box"; }
  46. };
  47. #endif