77 #include "render/graphics.h"
102 "scrollbuttons_pressed.xml"
108 const std::string &skin) :
119 mUpButtonScrollAmount(10),
120 mDownButtonScrollAmount(10),
121 mLeftButtonScrollAmount(10),
122 mRightButtonScrollAmount(10),
123 mHorizontalMarkerDragOffset(0),
124 mVerticalMarkerDragOffset(0),
135 mUpButtonPressed(false),
136 mDownButtonPressed(false),
137 mLeftButtonPressed(false),
138 mRightButtonPressed(false),
139 mIsVerticalMarkerDragged(false),
140 mIsHorizontalMarkerDragged(false),
166 for (
int i = 0; i < 2; i ++)
193 for (
int f = 0; f < 9; f ++)
203 if (skinName.empty())
204 skinName =
"scroll_background.xml";
205 if (
theme !=
nullptr)
209 "scroll_background.xml",
218 "scroll_highlighted.xml",
223 "scroll_vbackground.xml",
228 "scroll_hbackground.xml",
234 for (
int i = 0; i < 2; i ++)
236 Skin *skin =
nullptr;
237 if (
theme !=
nullptr)
249 if (rect.
grid[f] !=
nullptr)
250 rect.
grid[f]->incRef();
265 if (
theme !=
nullptr)
288 if (content !=
nullptr)
328 for (
int a = 0; a < 9; a++)
385 const bool redraw = graphics->
getRedraw();
527 logger->
log(
"ScrollArea::drawButton unknown dir: "
540 if (image !=
nullptr)
550 if (image !=
nullptr)
763 if (content !=
nullptr)
765 const unsigned int frameSize = 2 *
mFrameSize;
778 const int x =
event.getX();
779 const int y =
event.getY();
870 int dx =
mClickX -
event.getX();
871 int dy =
mClickY -
event.getY();
874 int dx =
event.getX() -
mClickX;
875 int dy =
event.getY() -
mClickY;
878 if ((dx < 20 && dx > 0) || (dx > -20 && dx < 0))
881 if ((dy < 20 && dy > 0) || (dy > -20 && dy < 0))
884 if (abs(dx) > abs(dy))
940 if ((barDim.
height - length) > 0)
942 const int pos =
event.getY() - barDim.
y
945 / (barDim.
height - length));
958 if ((barDim.
width - length) > 0)
960 const int pos =
event.getX() - barDim.
x
963 / (barDim.
width - length));
978 return Rect(0, 0, 0, 0);
998 return Rect(0, 0, 0, 0);
1018 return Rect(0, 0, 0, 0);
1044 if (content !=
nullptr)
1060 if (length > height)
1064 pos = ((height - length) *
mVScroll) / maxV;
1076 return Rect(0, 0, 0, 0);
1102 if (content !=
nullptr)
1104 const int w3 = content->
getWidth();
1123 pos = ((width - length) *
mHScroll) / maxH;
1138 return Rect(0, 0, 0, 0);
1147 return Rect(0, 0, 0, 0);
1166 return Rect(0, 0, 0, 0);
1175 return Rect(0, 0, 0, 0);
1193 if (widget !=
nullptr)
1256 else if (hScroll < 0)
1271 if (content ==
nullptr)
1288 if (content ==
nullptr)
1311 if (widget != content || (content ==
nullptr))
1391 if (content ==
nullptr)
virtual void safeDrawChildren(Graphics *const graphics)
void showWidgetPart(Widget *const widget, const Rect &area)
void add(Widget *const widget)
virtual void drawChildren(Graphics *const graphics)
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
virtual void drawTileCollection(const ImageCollection *const vertCol)=0
virtual void calcPattern(ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const =0
virtual void finalize(ImageCollection *const col)
virtual void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect)=0
virtual void drawPattern(const Image *const image, const int x, const int y, const int w, const int h)=0
ClipRect & getTopClip() const
virtual void drawImageRect(const int x, const int y, const int w, const int h, const ImageRect &imgRect)=0
void setRedraw(const bool n)
void removeDragged(const Widget *const widget)
void log(const char *const log_text,...)
MouseButtonT getButton() const
int getOption(const std::string &name) const
const ImageRect & getBorder() const
void unload(Skin *const skin)
static std::string getThemePath()
static void unloadRect(const ImageRect &rect, const int start, const int end)
Skin * load(const std::string &filename, const std::string &filename2, const bool full, const std::string &defaultPath)
void loadRect(ImageRect &image, const std::string &name, const std::string &name2, const int start, const int end)
float getMinimumOpacity() const
void void calcTileCollection(ImageCollection *restrict const vertCol, const Image *restrict const image, int x, int y) restrict2 override final
std::string toString(T const &value)
converts any type to a string
#define BLOCK_START(name)