AbsoluteLayout.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * Update the controls contained by the specified container.
  24. *
  25. * An AbsoluteLayout does nothing to modify the layout of controls.
  26. * It simply calls update() on any control that is dirty.
  27. *
  28. * @param container The container to update.
  29. * @param offset The layout offset.
  30. */
  31. void update(const Container* container, const Vector2& offset);
  32. private:
  33. /*
  34. * Constructor.
  35. */
  36. AbsoluteLayout();
  37. /*
  38. * Constructor.
  39. */
  40. AbsoluteLayout(const AbsoluteLayout& copy);
  41. /*
  42. * Destructor.
  43. */
  44. virtual ~AbsoluteLayout();
  45. /**
  46. * Create an AbsoluteLayout.
  47. *
  48. * @return An AbsoluteLayout object.
  49. */
  50. static AbsoluteLayout* create();
  51. };
  52. }
  53. #endif