Modernized code in guisan objects, improved GUI layout
This commit is contained in:
parent
ed31f6849d
commit
ecb56ef5be
94 changed files with 7326 additions and 7347 deletions
130
external/libguisan/include/guisan/inputevent.hpp
vendored
130
external/libguisan/include/guisan/inputevent.hpp
vendored
|
@ -62,79 +62,79 @@
|
|||
|
||||
namespace gcn
|
||||
{
|
||||
/**
|
||||
* Base class for all input events.
|
||||
*
|
||||
* @author Olof Naessén
|
||||
* @since 0.6.0
|
||||
*/
|
||||
class GCN_CORE_DECLSPEC InputEvent: public Event
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Base class for all input events.
|
||||
*
|
||||
* @author Olof Naessén
|
||||
* @since 0.6.0
|
||||
*/
|
||||
class GCN_CORE_DECLSPEC InputEvent : public Event
|
||||
{
|
||||
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.
|
||||
*/
|
||||
InputEvent(Widget* source,
|
||||
bool isShiftPressed,
|
||||
bool isControlPressed,
|
||||
bool isAltPressed,
|
||||
bool isMetaPressed);
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
InputEvent(Widget* source,
|
||||
bool isShiftPressed,
|
||||
bool isControlPressed,
|
||||
bool isAltPressed,
|
||||
bool isMetaPressed);
|
||||
|
||||
/**
|
||||
* Checks whether shift is pressed.
|
||||
*
|
||||
* @return true if shift was pressed at the same time as the key.
|
||||
*/
|
||||
bool isShiftPressed() const;
|
||||
/**
|
||||
* Checks whether shift is pressed.
|
||||
*
|
||||
* @return true if shift was pressed at the same time as the key.
|
||||
*/
|
||||
[[nodiscard]] bool isShiftPressed() const;
|
||||
|
||||
/**
|
||||
* Checks whether control is pressed.
|
||||
*
|
||||
* @return true if control was pressed at the same time as the key.
|
||||
*/
|
||||
bool isControlPressed() const;
|
||||
/**
|
||||
* Checks whether control is pressed.
|
||||
*
|
||||
* @return true if control was pressed at the same time as the key.
|
||||
*/
|
||||
[[nodiscard]] bool isControlPressed() const;
|
||||
|
||||
/**
|
||||
* Checks whether alt is pressed.
|
||||
*
|
||||
* @return true if alt was pressed at the same time as the key.
|
||||
*/
|
||||
bool isAltPressed() const;
|
||||
/**
|
||||
* Checks whether alt is pressed.
|
||||
*
|
||||
* @return true if alt was pressed at the same time as the key.
|
||||
*/
|
||||
[[nodiscard]] bool isAltPressed() const;
|
||||
|
||||
/**
|
||||
* Checks whether meta is pressed.
|
||||
*
|
||||
* @return true if meta was pressed at the same time as the key.
|
||||
*/
|
||||
bool isMetaPressed() const;
|
||||
/**
|
||||
* Checks whether meta is pressed.
|
||||
*
|
||||
* @return true if meta was pressed at the same time as the key.
|
||||
*/
|
||||
[[nodiscard]] bool isMetaPressed() const;
|
||||
|
||||
/**
|
||||
* Marks the event as consumed. How widgets should act on consumed
|
||||
* events are up to the widgets themselves.
|
||||
*/
|
||||
void consume();
|
||||
/**
|
||||
* Marks the event as consumed. How widgets should act on consumed
|
||||
* events are up to the widgets themselves.
|
||||
*/
|
||||
void consume();
|
||||
|
||||
/**
|
||||
* Checks if the input event is consumed.
|
||||
*
|
||||
* @return true if the input event is consumed, false otherwise.
|
||||
*/
|
||||
bool isConsumed() const;
|
||||
/**
|
||||
* Checks if the input event is consumed.
|
||||
*
|
||||
* @return true if the input event is consumed, false otherwise.
|
||||
*/
|
||||
[[nodiscard]] bool isConsumed() const;
|
||||
|
||||
protected:
|
||||
bool mShiftPressed;
|
||||
bool mControlPressed;
|
||||
bool mAltPressed;
|
||||
bool mMetaPressed;
|
||||
bool mIsConsumed;
|
||||
};
|
||||
protected:
|
||||
bool mShiftPressed;
|
||||
bool mControlPressed;
|
||||
bool mAltPressed;
|
||||
bool mMetaPressed;
|
||||
bool mIsConsumed;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // end GCN_INPUTEVENT_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue