Modernized code in guisan objects, improved GUI layout

This commit is contained in:
Dimitris Panokostas 2020-05-15 00:27:51 +02:00
parent ed31f6849d
commit ecb56ef5be
94 changed files with 7326 additions and 7347 deletions

View file

@ -62,117 +62,116 @@
namespace gcn
{
class Gui;
class Widget;
class Gui;
class Widget;
/**
* Represents a mouse event.
*
* @author Olof Naessén
* @since 0.6.0
*/
class GCN_CORE_DECLSPEC MouseEvent: public InputEvent
{
public:
/**
* Represents a mouse event.
*
* @author Olof Naessén
* @since 0.6.0
*/
class GCN_CORE_DECLSPEC MouseEvent : public InputEvent
{
public:
/**
* Constructor.
*
* @param source the source widget of the event.
* @param isShiftPressed true if shift is pressed, false otherwise.
* @param isControlPressed true if control is pressed, false otherwise.
* @param isAltPressed true if alt is pressed, false otherwise.
* @param isMetaPressed true if meta is pressed, false otherwise.
* @param the type of the event.
* @param button the button of the event.
* @param the x coordinate of the event relative to the source widget.
* @param the y coordinate of the event relative the source widget.
*/
MouseEvent(Widget* source,
bool isShiftPressed,
bool isControlPressed,
bool isAltPressed,
bool isMetaPressed,
unsigned int type,
unsigned int button,
int x,
int y,
int clickCount);
/**
* Constructor.
*
* @param source the source widget of the event.
* @param isShiftPressed true if shift is pressed, false otherwise.
* @param isControlPressed true if control is pressed, false otherwise.
* @param isAltPressed true if alt is pressed, false otherwise.
* @param isMetaPressed true if meta is pressed, false otherwise.
* @param the type of the event.
* @param button the button of the event.
* @param the x coordinate of the event relative to the source widget.
* @param the y coordinate of the event relative the source widget.
*/
MouseEvent(Widget* source,
bool isShiftPressed,
bool isControlPressed,
bool isAltPressed,
bool isMetaPressed,
unsigned int type,
unsigned int button,
int x,
int y,
int clickCount);
/**
* Gets the button of the mouse event.
*
* @return the button of the mouse event.
*/
unsigned int getButton() const;
/**
* Gets the button of the mouse event.
*
* @return the button of the mouse event.
*/
[[nodiscard]] unsigned int getButton() const;
/**
* Gets the x coordinate of the mouse event. The coordinate is relative to
* the source Widget.
*
* @return the x coordinate of the mouse event.
*/
int getX() const;
/**
* Gets the x coordinate of the mouse event. The coordinate is relative to
* the source Widget.
*
* @return the x coordinate of the mouse event.
*/
[[nodiscard]] int getX() const;
/**
* Gets the y coordinate of the mouse event. The coordinate is relative to
* the source Widget.
*
* @return the y coordinate of the mouse event.
*/
int getY() const;
/**
* Gets the y coordinate of the mouse event. The coordinate is relative to
* the source Widget.
*
* @return the y coordinate of the mouse event.
*/
[[nodiscard]] int getY() const;
/**
* Gets the click count.
*
* @return the click count of the mouse event.
*/
int getClickCount() const;
/**
* Gets the click count.
*
* @return the click count of the mouse event.
*/
[[nodiscard]] int getClickCount() const;
/**
* Gets the type of the event.
*
* @return the type of the event.
*/
unsigned int getType() const;
/**
* Gets the type of the event.
*
* @return the type of the event.
*/
[[nodiscard]] unsigned int getType() const;
/**
* Mouse event types.
*/
enum
{
MOVED = 0,
PRESSED,
RELEASED,
WHEEL_MOVED_DOWN,
WHEEL_MOVED_UP,
CLICKED,
ENTERED,
EXITED,
DRAGGED
/**
* Mouse event types.
*/
enum
{
MOVED = 0,
PRESSED,
RELEASED,
WHEEL_MOVED_DOWN,
WHEEL_MOVED_UP,
CLICKED,
ENTERED,
EXITED,
DRAGGED
};
};
/**
* Mouse button types.
*/
enum
{
EMPTY = 0,
LEFT,
RIGHT,
MIDDLE
};
/**
* Mouse button types.
*/
enum
{
EMPTY = 0,
LEFT,
RIGHT,
MIDDLE
};
protected:
unsigned int mType;
unsigned int mButton;
int mX;
int mY;
int mClickCount;
protected:
unsigned int mType;
unsigned int mButton;
int mX;
int mY;
int mClickCount;
friend class Gui;
};
friend class Gui;
};
}
#endif // GCN_MOUSEEVENT_HPP