divider.hh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 __DIVIDER_HH
  9. #define __DIVIDER_HH
  10. #include "window/window.hh"
  11. #include "device/device.hh"
  12. class i4_graphical_style_class;
  13. class i4_divider_class : public i4_parent_window_class
  14. {
  15. i4_event_handler_reference_class<i4_window_class> w1,w2;
  16. i4_bool split_up_down;
  17. i4_graphical_style_class *style;
  18. int split_value, min1, min2;
  19. i4_bool dragging, w_attached, h_attached;
  20. void get_drag_area(int &x1, int &y1, int &x2, int &y2);
  21. virtual void reparent(i4_image_class *draw_area, i4_parent_window_class *parent);
  22. public:
  23. void resize(w16 new_width, w16 new_height);
  24. i4_divider_class(int w, int h, // -1 uses parent w or height
  25. i4_bool split_up_down,
  26. int split_x_or_y, // -1 splits the middle
  27. i4_window_class *window1,
  28. i4_window_class *window2,
  29. i4_graphical_style_class *style,
  30. int window1_min_size=1,
  31. int window2_min_size=1);
  32. void parent_draw(i4_draw_context_class &context);
  33. void receive_event(i4_event *ev);
  34. char *name() { return "divider"; }
  35. };
  36. #endif