HoverRace  2.0
Public Member Functions | Private Types | Private Attributes | List of all members
HoverRace::Display::PickList< T >::DefaultItem Class Reference

#include <PickList.h>

+ Inheritance diagram for HoverRace::Display::PickList< T >::DefaultItem:

Public Member Functions

 DefaultItem (PickList< T > &pickList, Display &display, size_t idx, const T &value, const std::string &text, bool showIcon, uiLayoutFlags_t layoutFlags=0)
 
 DefaultItem (const DefaultItem &)=delete
 
 DefaultItem (DefaultItem &&)=delete
 
virtual ~DefaultItem ()
 
size_t GetIndex () const
 
const T & GetValue () const
 
DefaultItemoperator= (const DefaultItem &)=delete
 
DefaultItemoperator= (DefaultItem &&)=delete
 
- Public Member Functions inherited from HoverRace::Display::PickListItem
 PickListItem (Display &display, const std::string &text, bool showIcon, uiLayoutFlags_t layoutFlags=0)
 
virtual ~PickListItem ()
 
- Public Member Functions inherited from HoverRace::Display::StateButton
 StateButton (Display &display, const std::string &text, uiLayoutFlags_t layoutFlags=0)
 Constructor for automatically-sized button. More...
 
 StateButton (Display &display, const Vec2 &size, const std::string &text, uiLayoutFlags_t layoutFlags=0)
 Constructor for fixed-sized button. More...
 
virtual ~StateButton ()
 
void FireModelUpdate (int prop) override
 Indicate that a model property has changed. More...
 
bool IsChecked () const
 
void SetChecked (bool checked)
 Set the button state. More...
 
- Public Member Functions inherited from HoverRace::Display::Button
 Button (Display &display, const std::string &text, uiLayoutFlags_t layoutFlags=0)
 Constructor for automatically-sized button. More...
 
 Button (Display &display, const Vec2 &size, const std::string &text, uiLayoutFlags_t layoutFlags=0)
 Constructor for fixed-sized button. More...
 
virtual ~Button ()
 
void AttachView (Display &disp) override
 
BoxGetBackgroundChild () const
 
BaseContainerGetContentsChild () const
 
FillBoxGetHighlightChild () const
 
BoxGetIcon () const
 
BoxGetIconChild () const
 
LabelGetLabelChild () const
 
PictureGetPictureChild () const
 
const std::string & GetText () const
 
Alignment getTextAlignment () const
 
Vec3 Measure () override
 Calculate the size of the component. More...
 
bool OnNavigate (const Control::Nav &nav) override
 
void SetContents (std::shared_ptr< BaseContainer > contents)
 Set a container of widgets to render as the contents of the button. More...
 
void SetFixedWidth (double width)
 Enable auto-sizing on the height only (i.e. More...
 
void SetIcon (std::shared_ptr< Box > icon)
 Set the optional icon to appear on the button, in addition to the text. More...
 
void SetText (const std::string &text)
 
void SetTextAlignment (Alignment textAlignment)
 Sets the alignment of the text within the button. More...
 
void SetTexture (std::shared_ptr< Res< Texture >> image)
 Set the background image. More...
 
std::shared_ptr< BoxShareIcon () const
 
std::shared_ptr< Res< Texture > > ShareTexture () const
 
- Public Member Functions inherited from HoverRace::Display::ClickRegion
 ClickRegion (Display &display, uiLayoutFlags_t layoutFlags=0)
 Constructor for automatically-sized button. More...
 
 ClickRegion (Display &display, const Vec2 &size, uiLayoutFlags_t layoutFlags=0)
 Constructor for fixed-sized button. More...
 
virtual ~ClickRegion ()
 
void AttachView (Display &disp) override
 
clickedSignal_tGetClickedSignal ()
 
const Vec2GetSize ()
 Retrieve the size of the button. More...
 
bool IsAutoSize () const
 Check if automatic sizing is enabled. More...
 
bool IsEnabled () const
 Check if the widget is enabled. More...
 
Vec3 Measure () override
 Calculate the size of the component. More...
 
bool OnAction () override
 
bool OnMouseMoved (const Vec2 &pos) override
 
bool OnMousePressed (const Control::Mouse::Click &click) override
 
bool OnMouseReleased (const Control::Mouse::Click &click) override
 
void SetAutoSize ()
 Enable automatic sizing. More...
 
void SetEnabled (bool enabled)
 
void SetSize (const Vec2 &size)
 Set the button to a fixed size. More...
 
void SetSize (double w, double h)
 Convenience function for SetSize(const Vec2&). More...
 
bool TryFocus (const Control::Nav &nav=Control::Nav::NEUTRAL) override
 Attempts to give this widget focus. 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 OnMouseScrolled (const Control::Mouse::Scroll &)
 
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...
 
- 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 = PickListItem
 

Private Attributes

boost::signals2::scoped_connection clickedConn
 
const size_t idx
 
PickList< T > & pickList
 
const T value
 

Additional Inherited Members

- Public Types inherited from HoverRace::Display::ClickRegion
using clickedSignal_t = boost::signals2::signal< void(ClickRegion &)>
 
- 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::StateButton
void SetStateIcon (bool enabled, bool checked, std::shared_ptr< Box > icon)
 Sets the icon for a button state. More...
 
void UpdateIcon ()
 Update the button's icon based on the current state. More...
 
- Protected Member Functions inherited from HoverRace::Display::Button
void Layout () override
 Adjust the size and position of any child elements. More...
 
- Protected Member Functions inherited from HoverRace::Display::ClickRegion
virtual void FireClickedSignal ()
 
bool IsPressed () const
 
virtual void OnMouseDrag (const Vec2 &relPos)
 Handle when the mouse is dragged over the widget. More...
 
void RequestSizing ()
 Indicate that the size of the button may have changed, when auto-sizing is enabled. More...
 
Vec2 ScreenPosToRel (const Vec2 &pos)
 Convert screen coordinates to relative (widget) coordinates. More...
 
void SetPressed (bool pressed)
 
bool TestHit (const Vec2 &pos)
 Check if the coordinates of an event are within the bounds of this component. More...
 
- 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)
 
void RequestLayout ()
 Indicate that the current layout is out-of-date and needs to be adjusted. More...
 
- Protected Attributes inherited from HoverRace::Display::ClickRegion
Displaydisplay
 

Member Typedef Documentation

template<class T>
using HoverRace::Display::PickList< T >::DefaultItem::SUPER = PickListItem
private

Constructor & Destructor Documentation

template<class T>
HoverRace::Display::PickList< T >::DefaultItem::DefaultItem ( PickList< T > &  pickList,
Display display,
size_t  idx,
const T &  value,
const std::string &  text,
bool  showIcon,
uiLayoutFlags_t  layoutFlags = 0 
)
inline
template<class T>
HoverRace::Display::PickList< T >::DefaultItem::DefaultItem ( const DefaultItem )
delete
template<class T>
HoverRace::Display::PickList< T >::DefaultItem::DefaultItem ( DefaultItem &&  )
delete
template<class T>
virtual HoverRace::Display::PickList< T >::DefaultItem::~DefaultItem ( )
inlinevirtual

Member Function Documentation

template<class T>
size_t HoverRace::Display::PickList< T >::DefaultItem::GetIndex ( ) const
inline
template<class T>
const T& HoverRace::Display::PickList< T >::DefaultItem::GetValue ( ) const
inline
template<class T>
DefaultItem& HoverRace::Display::PickList< T >::DefaultItem::operator= ( const DefaultItem )
delete
template<class T>
DefaultItem& HoverRace::Display::PickList< T >::DefaultItem::operator= ( DefaultItem &&  )
delete

Member Data Documentation

template<class T>
boost::signals2::scoped_connection HoverRace::Display::PickList< T >::DefaultItem::clickedConn
private
template<class T>
const size_t HoverRace::Display::PickList< T >::DefaultItem::idx
private
template<class T>
PickList<T>& HoverRace::Display::PickList< T >::DefaultItem::pickList
private
template<class T>
const T HoverRace::Display::PickList< T >::DefaultItem::value
private

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