butbox.hh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 __BUTBOX_HPP_
  9. #define __BUTBOX_HPP_
  10. #include "window/window.hh"
  11. #include "gui/button.hh"
  12. class i4_button_box_class : public i4_menu_item_parent_class
  13. {
  14. i4_event_handler_class *receiver;
  15. i4_button_class *current_down;
  16. i4_bool require_one_down;
  17. void expand_if_needed();
  18. // I made this private so you have to call add_button
  19. virtual void add_child(i4_coord x, i4_coord y, i4_window_class *child);
  20. public:
  21. char *name() { return "button_box"; }
  22. i4_button_box_class(i4_event_handler_class *receiver,
  23. i4_bool require_one_down=i4_T);
  24. void parent_draw(i4_draw_context_class &context);
  25. virtual void add_button(i4_coord x, i4_coord y, i4_button_class *child);
  26. virtual void note_reaction_sent(i4_menu_item_class *who, // this is who sent it
  27. i4_event_reaction_class *ev, // who it was to
  28. i4_menu_item_class::reaction_type type);
  29. void push_button(i4_button_class *which, i4_bool send_event);
  30. // arranges child windows from left to right then down, also enlarges self to
  31. // fit this arrangement order
  32. virtual void arrange_right_down();
  33. // arranges child windows from top to bottom then right, also enlarges self to
  34. // fit this arrangement order
  35. virtual void arrange_down_right();
  36. } ;
  37. #endif