2014-07-15 10:14:49 +03:00
|
|
|
/*
|
|
|
|
* CWindowObject.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
2017-07-13 10:26:03 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../gui/CIntObject.h"
|
2023-08-23 14:07:50 +02:00
|
|
|
#include "../../lib/filesystem/ResourcePath.h"
|
2014-07-15 10:14:49 +03:00
|
|
|
|
2018-10-29 15:12:07 +02:00
|
|
|
class CGStatusBar;
|
|
|
|
|
2018-07-25 00:36:48 +02:00
|
|
|
class CWindowObject : public WindowBase
|
2014-07-15 10:14:49 +03:00
|
|
|
{
|
2023-08-23 14:07:50 +02:00
|
|
|
std::shared_ptr<CPicture> createBg(const ImagePath & imageName, bool playerColored);
|
2014-07-15 10:14:49 +03:00
|
|
|
|
2018-07-25 00:36:48 +02:00
|
|
|
std::vector<std::shared_ptr<CPicture>> shadowParts;
|
|
|
|
|
2014-07-15 10:14:49 +03:00
|
|
|
void setShadow(bool on);
|
|
|
|
|
|
|
|
int options;
|
|
|
|
|
|
|
|
protected:
|
2018-04-07 13:34:11 +02:00
|
|
|
std::shared_ptr<CPicture> background;
|
2014-07-15 10:14:49 +03:00
|
|
|
|
|
|
|
//Used only if RCLICK_POPUP was set
|
2023-06-11 19:38:42 +02:00
|
|
|
bool isPopupWindow() const override;
|
2014-07-15 10:14:49 +03:00
|
|
|
//To display border
|
|
|
|
void updateShadow();
|
2023-08-23 14:07:50 +02:00
|
|
|
void setBackground(const ImagePath & filename);
|
2014-07-15 10:14:49 +03:00
|
|
|
public:
|
|
|
|
enum EOptions
|
|
|
|
{
|
|
|
|
PLAYER_COLORED=1, //background will be player-colored
|
|
|
|
RCLICK_POPUP=2, // window will behave as right-click popup
|
|
|
|
BORDERED=4, // window will have border if current resolution is bigger than size of window
|
|
|
|
SHADOW_DISABLED=8 //this window won't display any shadow
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* options - EOpions enum
|
|
|
|
* imageName - name for background image, can be empty
|
|
|
|
* centerAt - position of window center. Default - center of the screen
|
|
|
|
*/
|
2023-08-23 14:07:50 +02:00
|
|
|
CWindowObject(int options, const ImagePath & imageName, Point centerAt);
|
|
|
|
CWindowObject(int options, const ImagePath & imageName = {});
|
2014-07-15 10:14:49 +03:00
|
|
|
~CWindowObject();
|
2018-04-07 13:34:11 +02:00
|
|
|
|
2023-06-02 15:42:18 +02:00
|
|
|
void showAll(Canvas & to) override;
|
2014-07-15 10:14:49 +03:00
|
|
|
};
|
2018-10-29 15:12:07 +02:00
|
|
|
|
|
|
|
class CStatusbarWindow : public CWindowObject
|
|
|
|
{
|
|
|
|
public:
|
2023-08-23 14:07:50 +02:00
|
|
|
CStatusbarWindow(int options, const ImagePath & imageName, Point centerAt);
|
|
|
|
CStatusbarWindow(int options, const ImagePath & imageName = {});
|
2018-10-29 15:12:07 +02:00
|
|
|
protected:
|
|
|
|
std::shared_ptr<CGStatusBar> statusbar;
|
|
|
|
};
|