AbsoluteLayout.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef ABSOLUTELAYOUT_H_
  2. #define ABSOLUTELAYOUT_H_
  3. #include "Layout.h"
  4. namespace gameplay
  5. {
  6. /**
  7. * Defines a Layout for forms and containers that requires the user
  8. * to specify absolute positions for all contained controls.
  9. */
  10. class AbsoluteLayout : public Layout
  11. {
  12. friend class Form;
  13. friend class Container;
  14. public:
  15. /**
  16. * Get the type of this Layout.
  17. *
  18. * @return Layout::LAYOUT_ABSOLUTE
  19. */
  20. Layout::Type getType();
  21. protected:
  22. /**
  23. * Create an AbsoluteLayout.
  24. *
  25. * @return An AbsoluteLayout object.
  26. */
  27. static AbsoluteLayout* create();
  28. /**
  29. * Update the controls contained by the specified container.
  30. *
  31. * An AbsoluteLayout does nothing to modify the layout of controls.
  32. * It simply calls update() on any control that is dirty.
  33. *
  34. * @param container The container to update.
  35. */
  36. void update(const Container* container, const Vector2& offset);
  37. private:
  38. /*
  39. * Constructor.
  40. */
  41. AbsoluteLayout();
  42. /*
  43. * Constructor.
  44. */
  45. AbsoluteLayout(const AbsoluteLayout& copy);
  46. /*
  47. * Destructor.
  48. */
  49. virtual ~AbsoluteLayout();
  50. };
  51. }
  52. #endif