PolyUIButton.h 715 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * PolyUIButton.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 8/1/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package UI
  10. #pragma once
  11. #include "PolyGlobals.h"
  12. #include "PolyScreenLabel.h"
  13. #include "PolyScreenShape.h"
  14. #include "PolyScreenEntity.h"
  15. #include "PolyUIEvent.h"
  16. #include "PolyUIBox.h"
  17. namespace Polycode {
  18. class _PolyExport UIButton : public ScreenEntity {
  19. public:
  20. UIButton(String text, float width, float height = 26);
  21. ~UIButton();
  22. void handleEvent(Event *event);
  23. void Update();
  24. private:
  25. float labelXPos;
  26. float labelYPos;
  27. UIBox *buttonRect;
  28. UIBox *buttonFocusedRect;
  29. ScreenLabel *buttonLabel;
  30. bool pressedDown;
  31. };
  32. }