28 SetTooltip(
"TestDragAndDropControl - Drag 'n drop here and see what is dropped");
39 g.
DrawText(DEFAULT_TEXT, mPaths[0].c_str(), r);
40 for (
int i = 1; i < mPaths.size(); i++)
43 g.
DrawText(DEFAULT_TEXT, mPaths[i].c_str(), r);
47 g.
DrawText(DEFAULT_TEXT,
"Drop files here", mRECT);
50 void OnDrop(
const char* str)
override
53 mPaths.emplace_back(std::string(str));
60 for (
auto path : paths)
62 mPaths.emplace_back(std::string(path));
68 std::vector<std::string> mPaths;
This file contains the base IControl implementation, along with some base classes for specific types ...
The lowest level base class of an IGraphics control.
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
IControl * SetTooltip(const char *str)
Set a tooltip for the control.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
The lowest level base class of an IGraphics context.
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
virtual void DrawDottedRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted rectangle to the graphics context.
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Control to test dropping single and multiple files.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnDropMultiple(const std::vector< const char * > &paths) override
Implement to handle multiple items drag 'n dropped onto this control.
void OnDrop(const char *str) override
Implement to do something when something was drag 'n dropped onto this control.
Used to manage a rectangular area, independent of draw class/platform.
IRECT GetFromTop(float amount) const
Get a subrect of this IRECT bounded in Y by the top edge and 'amount'.