/* _______ __ __ __ ______ __ __ _______ __ __
* / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\
* / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / /
* / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / /
* / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / /
* /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ /
* \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/
*
* Copyright (c) 2004, 2005, 2006, 2007 Olof Naessén and Per Larsson
*
* Js_./
* Per Larsson a.k.a finalman _RqZ{a<^_aa
* Olof Naessén a.k.a jansem/yakslem _asww7!uY`> )\a//
* _Qhm`] _f "'c 1!5m
* Visit: http://guichan.darkbits.org )Qk
ws?a-?' ._/L #'
* binary forms, with or without )4d[#7r, . ' )d`)[
* modification, are permitted provided _Q-5'5W..j/?' -?!\)cam'
* that the following conditions are met: j<. a J@\
* this list of conditions and the j(]1u
#include
#include "guisan/basiccontainer.hpp"
#include "guisan/mouselistener.hpp"
#include "guisan/platform.hpp"
namespace gcn
{
class Label;
class TabbedArea;
/**
* A simple tab widget used as the default tab in the TabbedArea widget.
*/
class GCN_CORE_DECLSPEC Tab :
public BasicContainer,
public MouseListener
{
public:
/**
* Constructor.
*/
Tab();
/**
* Destructor.
*/
virtual ~Tab();
/**
* Adjusts the tab size to fit the label.
*/
void adjustSize();
/**
* Sets the tabbed area the tab should be a part of.
*
* @param tabbedArea The tabbed area the tab should be a part of.
*/
void setTabbedArea(TabbedArea* tabbedArea);
/**
* Gets the tabbed are the tab is a part of.
*
* @return The tabbed are the tab is a part of.
*/
[[nodiscard]] TabbedArea* getTabbedArea() const;
/**
* Sets the caption of the tab.
*
* @param caption The caption of the tab.
*/
void setCaption(const std::string& caption);
/**
* Gets the caption of the tab.
*
* @return The caption of the tab.
*/
[[nodiscard]] const std::string& getCaption() const;
// Inherited from Widget
void draw(Graphics* graphics) override;
void drawBorder(Graphics* graphics) override;
// Inherited from MouseListener
void mouseEntered(MouseEvent& mouseEvent) override;
void mouseExited(MouseEvent& mouseEvent) override;
protected:
Label* mLabel;
TabbedArea* mTabbedArea{};
std::string mCaption;
bool mHasMouse;
};
}
#endif // end GCN_TABBEDAREA_HPP