17 #ifndef DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
18 #define DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
20 #include "EventHandlers.hpp"
21 #include "StandaloneWindow.hpp"
22 #include "SubWidget.hpp"
38 template <
class ImageType>
58 void setImage(
const ImageType& image);
83 template <
class ImageType>
92 virtual void imageButtonClicked(
ImageBaseButton* imageButton,
int button) = 0;
96 explicit ImageBaseButton(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageDown);
97 explicit ImageBaseButton(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageHover,
const ImageType& imageDown);
101 void setCallback(
Callback* callback) noexcept;
110 PrivateData*
const pData;
129 template <
class ImageType>
138 virtual void imageKnobDragStarted(
ImageBaseKnob* imageKnob) = 0;
139 virtual void imageKnobDragFinished(
ImageBaseKnob* imageKnob) = 0;
140 virtual void imageKnobValueChanged(
ImageBaseKnob* imageKnob,
float value) = 0;
143 explicit ImageBaseKnob(
Widget* parentWidget,
const ImageType& image, Orientation orientation = Vertical) noexcept;
148 void setCallback(
Callback* callback) noexcept;
149 void setImageLayerCount(uint count) noexcept;
150 void setRotationAngle(
int angle);
151 bool setValue(
float value,
bool sendCallback =
false) noexcept override;
161 PrivateData* const pData;
170 template <class ImageType>
179 virtual void imageSliderDragFinished(
ImageBaseSlider* imageSlider) = 0;
180 virtual void imageSliderValueChanged(
ImageBaseSlider* imageSlider,
float value) = 0;
186 float getValue() const noexcept;
187 void setValue(
float value,
bool sendCallback = false) noexcept;
188 void setDefault(
float def) noexcept;
190 void setStartPos(const
Point<
int>& startPos) noexcept;
191 void setStartPos(
int x,
int y) noexcept;
192 void setEndPos(const
Point<
int>& endPos) noexcept;
193 void setEndPos(
int x,
int y) noexcept;
195 void setInverted(
bool inverted) noexcept;
196 void setRange(
float min,
float max) noexcept;
197 void setStep(
float step) noexcept;
199 void setCallback(
Callback* callback) noexcept;
208 PrivateData* const pData;
221 template <
class ImageType>
229 virtual void imageSwitchClicked(
ImageBaseSwitch* imageSwitch,
bool down) = 0;
232 explicit ImageBaseSwitch(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageDown) noexcept;
237 bool isDown() const noexcept;
238 void setDown(
bool down) noexcept;
240 void setCallback(
Callback* callback) noexcept;
248 PrivateData* const pData;
257 #endif // DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
void onDisplay() override
Definition: ImageBaseWidgets.hpp:130
void setImage(const ImageType &image)
Definition: ImageBaseWidgets.hpp:171
Definition: Window.hpp:50
bool onScroll(const ScrollEvent &) override
bool onMouse(const MouseEvent &) override
bool onMouse(const MouseEvent &) override
ImageBaseAboutWindow(Window &transientParentWindow, const ImageType &image=ImageType())
bool onKeyboard(const KeyboardEvent &) override
Definition: ImageBaseWidgets.hpp:39
Definition: ImageBaseWidgets.hpp:134
void onDisplay() override
Definition: StandaloneWindow.hpp:27
bool onMotion(const MotionEvent &) override
Definition: Geometry.hpp:40
Definition: ImageBaseWidgets.hpp:225
Definition: ImageBaseWidgets.hpp:222
Definition: EventHandlers.hpp:92
Definition: ImageBaseWidgets.hpp:174