5#ifndef INCLUDE_FIFECHAN_WIDGETS_WINDOW_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_WINDOW_HPP_
10#include "fifechan/mouselistener.hpp"
11#include "fifechan/platform.hpp"
12#include "fifechan/widgets/container.hpp"
21 class FIFEGUI_API Window :
public Container,
public MouseListener
32 explicit Window(std::string
const & caption);
36 Window(Window
const &) =
delete;
37 Window& operator=(Window
const &) =
delete;
38 Window(Window&&) =
delete;
39 Window& operator=(Window&&) =
delete;
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
Alignment
Alignments for text drawing.
Represents a mouse event.
Represents a rectangular area (X, Y, Width, Height).
void mousePressed(MouseEvent &mouseEvent) override
Called when a mouse button has been pressed on the widget area.
void adjustSize() override
Adjust the size of the container after layout computations.
bool mMoved
True if the window is being moved, false otherwise.
bool mMovable
True if the window is movable, false otherwise.
unsigned int getTitleBarHeight() const
Gets the title bar height.
unsigned int mTitleBarHeight
Holds the title bar height of the window.
void setMovable(bool movable)
Sets the window to be movable or not.
void setTitleBarHeight(unsigned int height)
Sets the title bar height.
void setAlignment(Graphics::Alignment alignment)
Sets the alignment of the caption.
unsigned int getInnerBorderSize() const
Get the size of the inner border (pixels).
Graphics::Alignment mAlignment
Holds the alignment of the caption.
std::string mCaption
Holds the caption of the window.
bool isMovable() const
Checks if the window is movable.
Rectangle getChildrenArea() override
Gets the area of the widget occupied by the widget's children.
void mouseReleased(MouseEvent &mouseEvent) override
Called when a mouse button has been released on the widget area.
void mouseDragged(MouseEvent &mouseEvent) override
Called when the mouse has moved and the mouse has previously been pressed on the widget.
bool isOpaque() const override
Checks if the window is opaque.
int mDragOffsetX
Holds a drag offset as an x coordinate where the drag of the window started if the window is being dr...
void setInnerBorderSize(unsigned int border)
Set the size of the inner border (pixels).
virtual void drawInnerBorder(Graphics *graphics)
Draw the inner border (override to customize appearance).
void draw(Graphics *graphics) override
Draws the widget.
unsigned int mInnerBorderSize
Holds the size of the inner border.
std::string const & getCaption() const
Gets the caption of the window.
void setCaption(std::string const &caption)
Sets the caption of the window.
Graphics::Alignment getAlignment() const
Gets the alignment of the caption.
int mDragOffsetY
Holds a drag offset as an y coordinate where the drag of the window started if the window is being dr...
void setOpaque(bool opaque) override
Sets the window to be opaque or not.