CWindowObject.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * CWindowObject.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../gui/CIntObject.h"
  12. class CGStatusBar;
  13. class CWindowObject : public WindowBase
  14. {
  15. std::shared_ptr<CPicture> createBg(std::string imageName, bool playerColored);
  16. std::vector<std::shared_ptr<CPicture>> shadowParts;
  17. void setShadow(bool on);
  18. int options;
  19. protected:
  20. std::shared_ptr<CPicture> background;
  21. //Used only if RCLICK_POPUP was set
  22. bool isPopupWindow() const override;
  23. //To display border
  24. void updateShadow();
  25. void setBackground(std::string filename);
  26. public:
  27. enum EOptions
  28. {
  29. PLAYER_COLORED=1, //background will be player-colored
  30. RCLICK_POPUP=2, // window will behave as right-click popup
  31. BORDERED=4, // window will have border if current resolution is bigger than size of window
  32. SHADOW_DISABLED=8 //this window won't display any shadow
  33. };
  34. /*
  35. * options - EOpions enum
  36. * imageName - name for background image, can be empty
  37. * centerAt - position of window center. Default - center of the screen
  38. */
  39. CWindowObject(int options, std::string imageName, Point centerAt);
  40. CWindowObject(int options, std::string imageName = "");
  41. ~CWindowObject();
  42. void showAll(Canvas & to) override;
  43. };
  44. class CStatusbarWindow : public CWindowObject
  45. {
  46. public:
  47. CStatusbarWindow(int options, std::string imageName, Point centerAt);
  48. CStatusbarWindow(int options, std::string imageName = "");
  49. protected:
  50. std::shared_ptr<CGStatusBar> statusbar;
  51. };