5#include <fifechan/widgets/bargraph.hpp>
7#include <fifechan/exception.hpp>
8#include <fifechan/graphics.hpp>
13 BarGraph::BarGraph() =
default;
15 BarGraph::BarGraph(
int x,
int y,
int w,
int h) :
m_rec(
Rectangle(x, y, w, h)) { }
92 ((
getSelectionMode() & Widget::SelectionMode::Background) == Widget::SelectionMode::Background)) {
105 if (active && (
getSelectionMode() & Widget::SelectionMode::Border) == Widget::SelectionMode::Border) {
void draw(Graphics *graphics) override
Draws this widget.
void setBarHeight(int h)
Sets the height of the bar.
void setBarWidth(int w)
Sets the width of the bar.
bool m_opaque
m_opaque is true if the graph is opaque, false otherwise.
void setBarPosition(int x, int y)
Sets the position of the bar.
void setBarSize(int w, int h)
Sets the size of the bar.
Rectangle m_rec
m_rec is the rectangle that represents the bar.
void setBarY(int y)
Sets the y position of the bar.
void setBarX(int x)
Sets the x position of the bar.
void setOpaque(bool opaque)
Sets the opacity of the graph.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual void setColor(Color const &color)=0
Sets the color to use when drawing.
virtual void fillRectangle(Rectangle const &rectangle)=0
Draws a filled rectangle.
Represents a 2D coordinate (X, Y).
Represents a rectangular area (X, Y, Width, Height).