29 SetTooltip(
"TestImageControl - Click or Drag 'n drop here to load a new bitmap");
40 g.
DrawText(DEFAULT_TEXT,
"Invalid Bitmap", mRECT);
45 WDL_String fileName, path;
48 [
this](
const WDL_String& fileName,
const WDL_String& path) {
49 if (fileName.GetLength())
50 SetBitmap(fileName.Get());
54 void OnDrop(
const char* str)
override
59 void SetBitmap(
const char* str)
This file contains the base IControl implementation, along with some base classes for specific types ...
User-facing bitmap abstraction that you use to manage bitmap data, independant of draw class/platform...
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.
virtual void DrawFittedBitmap(const IBitmap &bitmap, const IRECT &bounds, const IBlend *pBlend=0)
Draw a bitmap (raster) image to the graphics context, scaling the image to fit the bounds.
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.
virtual void PromptForFile(WDL_String &fileName, WDL_String &path, EFileAction action=EFileAction::Open, const char *ext="", IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0
Create a platform file prompt dialog to choose a path for opening/saving a single file.
virtual IBitmap LoadBitmap(const char *fileNameOrResID, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)
Load a bitmap image from disk or from windows resource.
Control to test drawing bitmaps.
void OnDrop(const char *str) override
Implement to do something when something was drag 'n dropped onto this control.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
Used to manage mouse modifiers i.e.
Used to manage a rectangular area, independent of draw class/platform.