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"
28 template <
class ImageType>
35 void setImage(
const ImageType& image);
50 template <
class ImageType>
59 virtual void imageButtonClicked(
ImageBaseButton* imageButton,
int button) = 0;
63 explicit ImageBaseButton(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageDown);
64 explicit ImageBaseButton(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageHover,
const ImageType& imageDown);
68 void setCallback(
Callback* callback) noexcept;
77 PrivateData*
const pData;
84 template <
class ImageType>
97 virtual void imageKnobDragStarted(
ImageBaseKnob* imageKnob) = 0;
98 virtual void imageKnobDragFinished(
ImageBaseKnob* imageKnob) = 0;
99 virtual void imageKnobValueChanged(
ImageBaseKnob* imageKnob,
float value) = 0;
102 explicit ImageBaseKnob(
Widget* parentWidget,
const ImageType& image, Orientation orientation = Vertical) noexcept;
107 float getValue() const noexcept;
109 void setDefault(
float def) noexcept;
110 void setRange(
float min,
float max) noexcept;
111 void setStep(
float step) noexcept;
112 void setValue(
float value,
bool sendCallback = false) noexcept;
113 void setUsingLogScale(
bool yesNo) noexcept;
115 void setCallback(
Callback* callback) noexcept;
116 void setOrientation(Orientation orientation) noexcept;
117 void setRotationAngle(
int angle);
119 void setImageLayerCount(uint count) noexcept;
129 PrivateData* const pData;
138 template <class ImageType>
147 virtual void imageSliderDragFinished(
ImageBaseSlider* imageSlider) = 0;
148 virtual void imageSliderValueChanged(
ImageBaseSlider* imageSlider,
float value) = 0;
154 float getValue() const noexcept;
155 void setValue(
float value,
bool sendCallback = false) noexcept;
156 void setDefault(
float def) noexcept;
158 void setStartPos(const
Point<
int>& startPos) noexcept;
159 void setStartPos(
int x,
int y) noexcept;
160 void setEndPos(const
Point<
int>& endPos) noexcept;
161 void setEndPos(
int x,
int y) noexcept;
163 void setInverted(
bool inverted) noexcept;
164 void setRange(
float min,
float max) noexcept;
165 void setStep(
float step) noexcept;
167 void setCallback(
Callback* callback) noexcept;
176 PrivateData* const pData;
189 template <
class ImageType>
197 virtual void imageSwitchClicked(
ImageBaseSwitch* imageSwitch,
bool down) = 0;
200 explicit ImageBaseSwitch(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageDown) noexcept;
205 bool isDown() const noexcept;
206 void setDown(
bool down) noexcept;
208 void setCallback(
Callback* callback) noexcept;
216 PrivateData* const pData;
225 #endif // DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
void onDisplay() override
Definition: ImageBaseWidgets.hpp:85
Definition: ImageBaseWidgets.hpp:139
Definition: Window.hpp:50
bool onScroll(const ScrollEvent &) override
bool onMouse(const MouseEvent &) override
bool onMouse(const MouseEvent &) override
bool onKeyboard(const KeyboardEvent &) override
Definition: ImageBaseWidgets.hpp:29
Definition: ImageBaseWidgets.hpp:93
void onDisplay() override
Definition: StandaloneWindow.hpp:27
bool onMotion(const MotionEvent &) override
Definition: Geometry.hpp:40
Definition: ImageBaseWidgets.hpp:193
Definition: ImageBaseWidgets.hpp:190
Definition: ImageBaseWidgets.hpp:142