17 #ifndef DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
18 #define DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
20 #include "StandaloneWindow.hpp"
21 #include "SubWidget.hpp"
27 template <
class ImageType>
34 void setImage(
const ImageType& image);
49 template <
class ImageType>
57 virtual void imageButtonClicked(
ImageBaseButton* imageButton,
int button) = 0;
61 explicit ImageBaseButton(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageDown);
62 explicit ImageBaseButton(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageHover,
const ImageType& imageDown);
66 void setCallback(
Callback* callback) noexcept;
75 PrivateData*
const pData;
82 template <
class ImageType>
95 virtual void imageKnobDragStarted(
ImageBaseKnob* imageKnob) = 0;
96 virtual void imageKnobDragFinished(
ImageBaseKnob* imageKnob) = 0;
97 virtual void imageKnobValueChanged(
ImageBaseKnob* imageKnob,
float value) = 0;
100 explicit ImageBaseKnob(
Widget* parentWidget,
const ImageType& image, Orientation orientation = Vertical) noexcept;
105 float getValue() const noexcept;
107 void setDefault(
float def) noexcept;
108 void setRange(
float min,
float max) noexcept;
109 void setStep(
float step) noexcept;
110 void setValue(
float value,
bool sendCallback = false) noexcept;
111 void setUsingLogScale(
bool yesNo) noexcept;
113 void setCallback(
Callback* callback) noexcept;
114 void setOrientation(Orientation orientation) noexcept;
115 void setRotationAngle(
int angle);
117 void setImageLayerCount(uint count) noexcept;
127 PrivateData* const pData;
136 template <class ImageType>
145 virtual void imageSliderDragFinished(
ImageBaseSlider* imageSlider) = 0;
146 virtual void imageSliderValueChanged(
ImageBaseSlider* imageSlider,
float value) = 0;
152 float getValue() const noexcept;
153 void setValue(
float value,
bool sendCallback = false) noexcept;
154 void setDefault(
float def) noexcept;
156 void setStartPos(const
Point<
int>& startPos) noexcept;
157 void setStartPos(
int x,
int y) noexcept;
158 void setEndPos(const
Point<
int>& endPos) noexcept;
159 void setEndPos(
int x,
int y) noexcept;
161 void setInverted(
bool inverted) noexcept;
162 void setRange(
float min,
float max) noexcept;
163 void setStep(
float step) noexcept;
165 void setCallback(
Callback* callback) noexcept;
174 PrivateData* const pData;
187 template <
class ImageType>
195 virtual void imageSwitchClicked(
ImageBaseSwitch* imageSwitch,
bool down) = 0;
198 explicit ImageBaseSwitch(
Widget* parentWidget,
const ImageType& imageNormal,
const ImageType& imageDown) noexcept;
203 bool isDown() const noexcept;
204 void setDown(
bool down) noexcept;
206 void setCallback(
Callback* callback) noexcept;
214 PrivateData* const pData;
223 #endif // DGL_IMAGE_BASE_WIDGETS_HPP_INCLUDED
void onDisplay() override
Definition: ImageBaseWidgets.hpp:83
Definition: ImageBaseWidgets.hpp:137
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:28
Definition: ImageBaseWidgets.hpp:91
void onDisplay() override
Definition: StandaloneWindow.hpp:27
bool onMotion(const MotionEvent &) override
Definition: Geometry.hpp:40
Definition: ImageBaseWidgets.hpp:191
Definition: ImageBaseWidgets.hpp:188
Definition: ImageBaseWidgets.hpp:140