2012-10-05 20:04:12 +00:00
|
|
|
#ifndef _GUIBOX_H_
|
|
|
|
#define _GUIBOX_H_
|
|
|
|
|
2013-04-08 16:52:40 +00:00
|
|
|
#include "../Gui.h"
|
2012-10-05 20:04:12 +00:00
|
|
|
#include "GuiImage.h"
|
|
|
|
#include <string>
|
|
|
|
|
2013-04-08 16:52:40 +00:00
|
|
|
struct GuiBoxData
|
|
|
|
{
|
2012-10-07 22:59:20 +00:00
|
|
|
std::string backgroundPath;
|
|
|
|
bool backgroundTiled;
|
|
|
|
std::string horizontalPath;
|
|
|
|
bool horizontalTiled;
|
|
|
|
std::string verticalPath;
|
|
|
|
bool verticalTiled;
|
|
|
|
std::string cornerPath;
|
|
|
|
};
|
|
|
|
|
2013-04-08 17:40:15 +00:00
|
|
|
class GuiBox : public Gui
|
2012-10-05 20:04:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-04-08 17:40:15 +00:00
|
|
|
GuiBox(Window* window, int offsetX, int offsetY, unsigned int width, unsigned int height);
|
2012-10-05 20:04:12 +00:00
|
|
|
|
2012-10-07 22:59:20 +00:00
|
|
|
void setData(GuiBoxData data);
|
|
|
|
|
2012-10-05 20:04:12 +00:00
|
|
|
void setBackgroundImage(std::string path, bool tiled = true);
|
|
|
|
void setHorizontalImage(std::string path, bool tiled = false);
|
|
|
|
void setVerticalImage(std::string path, bool tiled = false);
|
2012-10-07 21:56:33 +00:00
|
|
|
void setCornerImage(std::string path);
|
2012-10-05 20:04:12 +00:00
|
|
|
|
2012-10-10 13:51:48 +00:00
|
|
|
bool hasBackground();
|
|
|
|
|
2013-04-08 16:52:40 +00:00
|
|
|
void render();
|
2012-10-05 20:04:12 +00:00
|
|
|
|
2013-04-10 17:29:07 +00:00
|
|
|
void init();
|
|
|
|
void deinit();
|
2012-10-05 20:04:12 +00:00
|
|
|
private:
|
2012-10-07 21:56:33 +00:00
|
|
|
GuiImage mBackgroundImage, mHorizontalImage, mVerticalImage, mCornerImage;
|
|
|
|
|
|
|
|
int getHorizontalBorderWidth();
|
|
|
|
int getVerticalBorderWidth();
|
2012-10-05 20:04:12 +00:00
|
|
|
|
|
|
|
unsigned int mWidth, mHeight;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|