HoverRace  2.0
Classes | Public Member Functions | Private Types | Private Attributes | List of all members
HoverRace::Display::FillBox Class Reference

A colored rectangle, that's all. More...

#include <FillBox.h>

+ Inheritance diagram for HoverRace::Display::FillBox:

Classes

struct  Props
 

Public Member Functions

 FillBox (const Vec2 &size, const Color color, uiLayoutFlags_t layoutFlags=0)
 Constructor. More...
 
 FillBox (double w, double h, const Color color, uiLayoutFlags_t layoutFlags=0)
 Constructor. More...
 
 FillBox (const Vec2 &size, const Color color, double border, const Color borderColor, uiLayoutFlags_t layoutFlags=0)
 Constructor with border. More...
 
 FillBox (double w, double h, const Color color, double border, const Color borderColor, uiLayoutFlags_t layoutFlags=0)
 Constructor with border. More...
 
virtual ~FillBox ()
 
virtual void AttachView (Display &disp)
 
double GetBorder () const
 
const Color GetBorderColor () const
 
const Color GetColor () const
 
void SetBorder (double border)
 Set the border thickness. More...
 
void SetBorderColor (const Color color)
 Set the color of the border. More...
 
void SetColor (const Color color)
 Set the color of the box. More...
 
- Public Member Functions inherited from HoverRace::Display::Box
 Box (const Vec2 &size, uiLayoutFlags_t layoutFlags=0)
 
virtual ~Box ()
 
virtual void AdjustHeight (double h)
 Adjust the height, preserving the preferred aspect ratio. More...
 
virtual void AdjustWidth (double w)
 Adjust the width, preserving the preferred aspect ratio. More...
 
const Vec2GetSize () const
 Retrieve the size of the box. More...
 
virtual Vec3 Measure ()
 Calculate the size of the component. More...
 
void SetSize (const Vec2 &size)
 Set the size of the box. More...
 
void SetSize (double w, double h)
 Convenience function for SetSize(const Vec2&). More...
 
- Public Member Functions inherited from HoverRace::Display::UiViewModel
 UiViewModel (uiLayoutFlags_t layoutFlags=0)
 
virtual ~UiViewModel ()
 
virtual void DropFocus ()
 Force this widget to give up focus, if it is currently focused. More...
 
Vec2 GetAlignedPos (const Vec2 &pos, double w, double h) const
 Retrieve an arbitrary position adjusted by the current alignment. More...
 
Vec2 GetAlignedPos (double w, double h) const
 Retrieve the position adjusted by the current alignment. More...
 
Alignment GetAlignment () const
 Retrieve the alignment of the component. More...
 
focusRelinquishedSignal_tGetFocusRelinquishedSignal ()
 
focusRequestedSignal_tGetFocusRequestedSignal ()
 
uiLayoutFlags_t GetLayoutFlags () const
 Retrieve the layout flags. More...
 
const Vec2GetPos () const
 Get the position of the component. More...
 
const Vec2GetTranslation () const
 Retrieves the position translation. More...
 
bool IsFocused () const
 Check if this widget currently has input focus. More...
 
uiLayoutFlags_t IsLayoutFloating () const
 
uiLayoutFlags_t IsLayoutUnscaled () const
 
virtual bool OnAction ()
 
virtual bool OnMouseMoved (const Vec2 &)
 
virtual bool OnMousePressed (const Control::Mouse::Click &)
 
virtual bool OnMouseReleased (const Control::Mouse::Click &)
 
virtual bool OnMouseScrolled (const Control::Mouse::Scroll &)
 
virtual bool OnNavigate (const Control::Nav &)
 
void RequestFocus ()
 Attempt to hand over the input focus to this widget. More...
 
void SetAlignment (Alignment alignment)
 Set the alignment of the component. More...
 
void SetPos (const Vec2 &pos)
 Set the position of the component. More...
 
void SetPos (double x, double y)
 Convenience function for SetPos(const Vec2&). More...
 
void SetTranslation (const Vec2 &translation)
 Sets the position translation. More...
 
void SetTranslation (double x, double y)
 Convenience function for SetTranslation(const Vec2&). More...
 
virtual bool TryFocus (const Control::Nav &nav=Control::Nav::NEUTRAL)
 Attempts to give this widget focus. More...
 
- Public Member Functions inherited from HoverRace::Display::ViewModel
 ViewModel ()
 
virtual ~ViewModel ()
 
ViewGetView () const
 
void PrepareRender ()
 
void Render ()
 
void SetView (std::unique_ptr< View > &&view)
 

Private Types

using SUPER = Box
 

Private Attributes

double border
 
Color borderColor
 
Color color
 

Additional Inherited Members

- Public Types inherited from HoverRace::Display::UiViewModel
enum  Alignment {
  Alignment::NW, Alignment::N, Alignment::NE, Alignment::E,
  Alignment::SE, Alignment::S, Alignment::SW, Alignment::W,
  Alignment::CENTER
}
 Imagine the component pinned to the container with a thumbtack. More...
 
using focusRelinquishedSignal_t = boost::signals2::signal< void(UiViewModel &, const Control::Nav &)>
 
using focusRequestedSignal_t = boost::signals2::signal< void(UiViewModel &)>
 
- Protected Member Functions inherited from HoverRace::Display::UiViewModel
void RelinquishFocus (const Control::Nav &nav)
 Voluntarily give up input focus, passing it on to the next widget. More...
 
void SetFocused (bool focused)
 Set the focused state. More...
 
- Protected Member Functions inherited from HoverRace::Display::ViewModel
template<class T >
void AttachViewDynamic (Display &disp, T *self)
 
virtual void FireModelUpdate (int prop)
 Indicate that a model property has changed. More...
 
virtual void Layout ()
 Adjust the size and position of any child elements. More...
 
void RequestLayout ()
 Indicate that the current layout is out-of-date and needs to be adjusted. More...
 

Detailed Description

A colored rectangle, that's all.

Author
Michael Imamura

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Display::FillBox::FillBox ( const Vec2 size,
const Color  color,
uiLayoutFlags_t  layoutFlags = 0 
)

Constructor.

Parameters
sizeThe size of the box, where x is the width and y is the height.
colorThe color of the box (including alpha).
layoutFlagsOptional layout flags.
HoverRace::Display::FillBox::FillBox ( double  w,
double  h,
const Color  color,
uiLayoutFlags_t  layoutFlags = 0 
)

Constructor.

Parameters
wThe width of the box.
hThe height of the box.
colorThe color of the box (including alpha).
layoutFlagsOptional layout flags.
HoverRace::Display::FillBox::FillBox ( const Vec2 size,
const Color  color,
double  border,
const Color  borderColor,
uiLayoutFlags_t  layoutFlags = 0 
)

Constructor with border.

Parameters
sizeThe size of the box, where x is the width and y is the height.
colorThe color of the box (including alpha).
borderThe border thickness (zero is no border).
borderColorThe border color.
layoutFlagsOptional layout flags.
HoverRace::Display::FillBox::FillBox ( double  w,
double  h,
const Color  color,
double  border,
const Color  borderColor,
uiLayoutFlags_t  layoutFlags = 0 
)

Constructor with border.

Parameters
wThe width of the box.
hThe height of the box.
colorThe color of the box (including alpha).
borderThe border thickness (zero is no border).
borderColorThe border color.
layoutFlagsOptional layout flags.
virtual HoverRace::Display::FillBox::~FillBox ( )
inlinevirtual

Member Function Documentation

virtual void HoverRace::Display::FillBox::AttachView ( Display disp)
inlinevirtual
double HoverRace::Display::FillBox::GetBorder ( ) const
inline
const Color HoverRace::Display::FillBox::GetBorderColor ( ) const
inline
const Color HoverRace::Display::FillBox::GetColor ( ) const
inline
void HoverRace::Display::FillBox::SetBorder ( double  border)

Set the border thickness.

Parameters
borderThe border. May be zero for no border.
void HoverRace::Display::FillBox::SetBorderColor ( const Color  color)

Set the color of the border.

Parameters
colorThe color.
void HoverRace::Display::FillBox::SetColor ( const Color  color)

Set the color of the box.

Parameters
colorThe color (including alpha).

Member Data Documentation

double HoverRace::Display::FillBox::border
private
Color HoverRace::Display::FillBox::borderColor
private
Color HoverRace::Display::FillBox::color
private

The documentation for this class was generated from the following files: