2011-04-09 21:08:43 +02:00
|
|
|
/* The MIT License
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010 OTClient, https://github.com/edubart/otclient
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef UIBUTTONSKIN_H
|
|
|
|
#define UIBUTTONSKIN_H
|
|
|
|
|
2011-04-10 17:37:15 +02:00
|
|
|
#include "prerequisites.h"
|
2011-04-09 21:08:43 +02:00
|
|
|
#include "uiconstants.h"
|
|
|
|
#include "uielementskin.h"
|
|
|
|
|
2011-04-11 22:06:03 +02:00
|
|
|
class Font;
|
|
|
|
|
2011-04-09 21:08:43 +02:00
|
|
|
class UIButtonSkin : public UIElementSkin
|
|
|
|
{
|
|
|
|
public:
|
2011-04-10 02:51:35 +02:00
|
|
|
UIButtonSkin(const std::string& name) :
|
|
|
|
UIElementSkin(name, UI::Button) { }
|
2011-04-09 21:08:43 +02:00
|
|
|
|
|
|
|
void load(const YAML::Node& node);
|
|
|
|
void draw(UIElement *element);
|
|
|
|
|
|
|
|
private:
|
|
|
|
ImagePtr m_buttonDownImage;
|
|
|
|
ImagePtr m_buttonHoverImage;
|
2011-04-11 06:08:56 +02:00
|
|
|
Point m_buttonDownTranslate;
|
2011-04-11 22:06:03 +02:00
|
|
|
Font *m_font;
|
|
|
|
Color m_textColor;
|
2011-04-09 21:08:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UIBUTTONSKIN_H
|