33 #include <guichan/mouseevent.hpp>
51 m_downImage(down_file),
52 m_hoverImage(hover_file),
64 addActionListener(
this);
77 Color faceColor = getBaseColor();
80 int32_t alpha = getBaseColor().a;
87 faceColor = faceColor - 0x303030;
89 highlightColor = faceColor - 0x303030;
90 highlightColor.a = alpha;
91 shadowColor = faceColor + 0x303030;
92 shadowColor.a = alpha;
99 }
else if(mHasMouse) {
100 faceColor = faceColor + 0x303030;
102 highlightColor = faceColor + 0x303030;
103 highlightColor.a = alpha;
104 shadowColor = faceColor - 0x303030;
105 shadowColor.a = alpha;
111 highlightColor = faceColor + 0x303030;
112 highlightColor.a = alpha;
113 shadowColor = faceColor - 0x303030;
114 shadowColor.a = alpha;
122 graphics->setColor(faceColor);
123 graphics->fillRectangle(Rectangle(1, 1, getDimension().width-1, getHeight() - 1));
125 graphics->setColor(highlightColor);
126 graphics->drawLine(0, 0, getWidth() - 1, 0);
127 graphics->drawLine(0, 1, 0, getHeight() - 1);
129 graphics->setColor(shadowColor);
130 graphics->drawLine(getWidth() - 1, 1, getWidth() - 1, getHeight() - 1);
131 graphics->drawLine(1, getHeight() - 1, getWidth() - 1, getHeight() - 1);
133 graphics->setColor(getForegroundColor());
136 graphics->drawImage(img, xoffset, yoffset);
140 int32_t textY = getHeight() / 2 - getFont()->getHeight() / 2;
141 switch (getAlignment())
146 case Graphics::CENTER:
147 textX = getWidth() / 2;
149 case Graphics::RIGHT:
150 textX = getWidth() - 4;
156 << getAlignment() <<
". Using the default of Graphics::LEFT");
159 graphics->setFont(getFont());
160 if (mCaption.size() > 0) {
162 graphics->drawText(getCaption(), textX + 1,
163 textY + 1, getAlignment());
165 graphics->drawText(getCaption(), textX, textY, getAlignment());
189 if( mCaption.length() > 0 ) {
190 w = std::max(static_cast<int32_t>(getFont()->getWidth(mCaption)+2*mSpacing), w);
191 h = std::max(static_cast<int32_t>(getFont()->getHeight()+2*mSpacing), h);
218 if (toggled &&
m_group !=
"") {
224 if (iter->second->isToggled()) {
225 iter->second->setToggled(
false);
240 if (iter->second ==
this) {
249 m_groupMap.insert( std::pair<std::string, ToggleButton *>(group,
this));
#define FL_WARN(logger, msg)
Helper class to create log strings out from separate parts Usage: LMsg("some text") << variable << "...
Create a Logger instance to communicate with LogManager Logger stores information about the current m...
static FIFE::Logger _log(LM_GUI)