PolyUIWindow.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * PolyUIWindow.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 7/30/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package UI
  10. #pragma once
  11. #include "PolyGlobals.h"
  12. #include "PolyScreenShape.h"
  13. #include "PolyScreenLabel.h"
  14. #include "PolyScreenEntity.h"
  15. #include "PolyUIEvent.h"
  16. #include "PolyUIImageButton.h"
  17. #include "PolyFont.h"
  18. #include "PolyScreenEvent.h"
  19. #include "PolyUIBox.h"
  20. namespace Polycode {
  21. class _PolyExport UIWindow : public ScreenEntity {
  22. public:
  23. UIWindow(String windowName, float width, float height);
  24. ~UIWindow();
  25. void showWindow();
  26. void hideWindow();
  27. void onKeyDown(TAUKey key, wchar_t charCode);
  28. virtual void onClose(){}
  29. void onLoseFocus();
  30. void setWindowSize(float w, float h);
  31. void onMouseDown(float x, float y);
  32. virtual void handleEvent(Event *event);
  33. float padding;
  34. float topPadding;
  35. bool closeOnEscape;
  36. protected:
  37. Font *font;
  38. Tween *windowTween;
  39. UIImageButton *closeBtn;
  40. UIBox *windowRect;
  41. ScreenShape *titlebarRect;
  42. };
  43. }