textitem.hh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 __TEXTITEM_HPP_
  9. #define __TEXTITEM_HPP_
  10. #include "menu/menu.hh"
  11. #include "font/font.hh"
  12. #include "window/style.hh"
  13. class i4_text_item_class : public i4_menu_item_class
  14. {
  15. protected :
  16. i4_color_hint_class *color;
  17. i4_font_class *font;
  18. i4_str *text;
  19. w16 pad_lr;
  20. public :
  21. w32 bg_color;
  22. i4_text_item_class(
  23. const i4_const_str &_text,
  24. i4_graphical_style_class *style,
  25. i4_color_hint_class *color_hint=0,
  26. i4_font_class *font=0,
  27. i4_event_reaction_class *press=0,
  28. i4_event_reaction_class *depress=0,
  29. i4_event_reaction_class *activate=0,
  30. i4_event_reaction_class *deactivate=0,
  31. w16 pad_left_right=0,
  32. w16 pad_up_down=0
  33. );
  34. ~i4_text_item_class()
  35. {
  36. delete text;
  37. }
  38. char *name() { return "text_item"; }
  39. virtual void parent_draw(i4_draw_context_class &context);
  40. virtual void receive_event(i4_event *ev);
  41. void change_text(const i4_const_str &new_st);
  42. i4_const_str get_text() { return *text; }
  43. virtual i4_menu_item_class *copy();
  44. } ;
  45. #endif