Modal.h 691 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #ifndef GWEN_CONTROLS_MODAL_H
  3. #define GWEN_CONTROLS_MODAL_H
  4. #include "Gwen/Controls/Base.h"
  5. #include "Gwen/Gwen.h"
  6. #include "Gwen/Skin.h"
  7. namespace Gwen
  8. {
  9. namespace ControlsInternal
  10. {
  11. class Modal : public Controls::Base
  12. {
  13. GWEN_CONTROL_INLINE( Modal, Controls::Base )
  14. {
  15. SetKeyboardInputEnabled( true );
  16. SetMouseInputEnabled( true );
  17. SetShouldDrawBackground( true );
  18. }
  19. virtual void Layout( Skin::Base* /*skin*/ )
  20. {
  21. SetBounds( 0, 0, GetCanvas()->Width(), GetCanvas()->Height() );
  22. }
  23. virtual void Render( Skin::Base* skin )
  24. {
  25. if ( !ShouldDrawBackground() ) return;
  26. skin->DrawModalControl( this );
  27. }
  28. };
  29. }
  30. }
  31. #endif