28 #ifndef ABSTRACTBUTTON_H
29 #define ABSTRACTBUTTON_H
51 static const u32 BUTTON_BORDER_COLOR = Drawing::GREY10;
56 static const u32 BUTTON_BACKGROUND_COLOR = Drawing::GREY20;
61 static const u32 BUTTON_COLOR = Drawing::GREY90;
153 m_location = location;
188 m_dimensions = dimensions;
189 Panel::SetDimensions(dimensions.
GetX(), dimensions.
GetY());
202 m_enabled = isEnabled;
259 if(event.m_event.button.button == SDL_BUTTON_WHEELUP ||
260 event.m_event.button.button == SDL_BUTTON_WHEELDOWN)
264 if (event.m_event.type == SDL_MOUSEBUTTONUP)
266 m_justClicked =
true;
267 OnClick(event.m_event.button.button);
270 if (event.m_event.type == SDL_MOUSEBUTTONDOWN)
272 OnPress(event.m_event.button.button);
284 bool PaintClickHighlight(
Drawing& d)
288 m_justClicked =
false;
291 this->Panel::GetDimensions().GetX(), this->Panel::GetDimensions().GetY());
297 virtual void PaintComponentNonClick(Drawing& d);
311 virtual void OnClick(u8 button) = 0;
u32 SetForeground(const u32 color)
Definition: Drawing.h:188
T GetY() const
Definition: Point.tcc:40
void FillRect(int x, int y, int w, int h) const
Definition: Drawing.cpp:115
T GetX() const
Definition: Point.tcc:34