29 mLabel.SetFormatted(32,
"Select a %s file", extension);
45 g.
DrawText(
IText(14, EVAlign::Middle),
"App is sandboxed... filesystem restricted", mRECT);
51 g.
DrawText(mText, mLabel.Get(), but);
55 g.
DrawText(
IText(DEFAULT_TEXT_SIZE, EAlign::Near),
"Use platform menu", useplat);
72 mSelectedIndex = pItem->GetTag();
73 mSelectedMenu = pMenu;
74 mLabel.Set(pItem->GetText());
89 mUsePlatform = !mUsePlatform;
98 void SetPath(
const char* path)
106 bool mUsePlatform =
true;
bool Contains(const IRECT &rhs) const
Returns true if this IRECT completely contains rhs.
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 a rectangular area, independent of draw class/platform.
virtual void DrawRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f)
Draw a rectangle to the graphics context.
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.
Control to test IDirBrowseControlBase.
Common paths useful for plug-ins.
void SetTooltip(const char *str)
Set a tooltip for the control.
void AttachPopupMenuControl(const IText &text=DEFAULT_TEXT, const IRECT &bounds=IRECT())
Attach a control for pop-up menus, to override platform style menus.
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.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
This file contains the base IControl implementation, along with some base classes for specific types ...
float R
Right side of the rectangle (X + W)
void CreatePopupMenu(IControl &control, IPopupMenu &menu, const IRECT &bounds, int valIdx=0)
Shows a pop up/contextual menu in relation to a rectangular region of the graphics context...
void Draw(IGraphics &g) override
Draw the control to the graphics context.
IText is used to manage font and text/text entry style for a piece of text on the UI...
IDirBrowseControlBase(const IRECT &bounds, const char *extension, bool showFileExtensions=true)
Creates an IDirBrowseControlBase.
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.
IRECT GetFromRight(float amount) const
Get a subrect of this IRECT bounded in X by 'amount' and the right edge.
An abstract IControl base class that you can inherit from in order to make a control that pops up a m...
float L
Left side of the rectangle (X)
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.
IRECT GetPadded(float padding) const
Get a copy of this IRECT with each value padded by padding N.B.
IRECT GetFromBottom(float amount) const
Get a subrect of this IRECT bounded in Y by 'amount' and the bottom edge.
void OnPopupMenuSelection(IPopupMenu *pMenu, int valIdx) override
Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControl::Promp...
float T
Top of the rectangle (Y)
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
float B
Bottom of the rectangle (Y + H)