29 SetTooltip(
"TestImageControl - Click or Drag 'n drop here to load a new bitmap");
40 g.
DrawText(DEFAULT_TEXT,
"Invalid Bitmap", mRECT);
51 SetBitmap(file.Get());
54 void OnDrop(
const char* str)
override 59 void SetBitmap(
const char* str)
The lowest level base class of an IGraphics control.
Used to manage a rectangular area, independent of draw class/platform.
User-facing bitmap abstraction that you use to manage bitmap data, independant of draw class/platform...
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.
Used to manage mouse modifiers i.e.
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
void SetTooltip(const char *str)
Set a tooltip for the control.
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.
This file contains the base IControl implementation, along with some base classes for specific types ...
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.
virtual void PromptForFile(WDL_String &fileName, WDL_String &path, EFileAction action=EFileAction::Open, const char *extensions=0)=0
Create a platform file prompt dialog to choose a file/directory path for opening/saving a file/direct...
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
The lowest level base class of an IGraphics 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 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 OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
Control to test drawing bitmaps.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnDrop(const char *str) override
Implement to do something when something was drag 'n dropped onto this control.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.