seperate.hh 1.8 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 I4_SEPERATOR_HH
  9. #define I4_SEPERATOR_HH
  10. #include "menu/menuitem.hh"
  11. class i4_seperator_line_class : public i4_menu_item_class
  12. {
  13. w16 lr,ud;
  14. i4_graphical_style_class *style;
  15. i4_color bg;
  16. public:
  17. i4_seperator_line_class(i4_graphical_style_class *style,
  18. i4_color background,
  19. w16 left_right_space,
  20. w16 up_down_space)
  21. : i4_menu_item_class(0,0, 0,0),
  22. style(style),
  23. lr(left_right_space),
  24. ud(up_down_space),
  25. bg(background)
  26. {
  27. w32 l,r,t,b;
  28. style->get_in_deco_size(l,t,r,b);
  29. resize(lr*2, t+b+ud*2);
  30. }
  31. void reparent(i4_image_class *draw_area, i4_parent_window_class *parent)
  32. {
  33. i4_menu_item_class::reparent(draw_area, parent);
  34. if (parent && draw_area)
  35. {
  36. w32 l,r,t,b;
  37. style->get_in_deco_size(l,t,r,b);
  38. resize(parent->width()-lr*2, t+b+ud*2);
  39. }
  40. }
  41. void draw(i4_draw_context_class &context)
  42. {
  43. style->deco_neutral_fill(local_image, 0,0, width()-1, height()-1, context);
  44. style->draw_in_deco(local_image, 0, ud, width()-1, height()-1-ud,
  45. i4_F, context);
  46. }
  47. i4_menu_item_class *copy() { return new i4_seperator_line_class(style, bg, lr, ud); }
  48. char *name() { return "seperator_line"; }
  49. };
  50. #endif