OpenBarnyard
 
Loading...
Searching...
No Matches
AGUI2MenuItem Class Reference

#include <AGUI2Menu.h>

Inheritance diagram for AGUI2MenuItem:
AGUI2Element AGUI2ElementNode AGUI2Button

Public Types

enum  COMMANDRESULT { COMMANDRESULT_NONE , COMMANDRESULT_OK , COMMANDRESULT_CANCEL }
 
- Public Types inherited from AGUI2Element
using t_PostRender = void ( * )()
 

Public Member Functions

 AGUI2MenuItem ()
 
 ~AGUI2MenuItem ()
 
void LinkMenuItemBefore (AGUI2MenuItem &a_rLinkAfter)
 
TBOOL IsEnabled () const
 
TBOOL CanFocus () const
 
AGUI2MenuItemGetNextMenuItem () const
 
AGUI2MenuItemGetPrevMenuItem () const
 
virtual void SetAlpha (TFLOAT a_fAlpha) override
 
virtual void OnFocus ()
 
virtual void OnFocusLost ()
 
virtual void OnUpdate (TFLOAT a_fDeltaTime)
 
virtual COMMANDRESULT OnInputCommand (AGUI2Menu::ACTIONFLAGS &a_rActionFlags)
 
virtual void SetEnabled (TBOOL a_bEnabled)
 
virtual TFLOAT GetFlowVisualOffset ()
 
virtual TFLOAT GetFlowOffset ()
 
- Public Member Functions inherited from AGUI2Element
 AGUI2Element ()
 
virtual ~AGUI2Element ()=default
 
virtual void Tick (TFLOAT a_fDeltaTime)
 
virtual void PreRender ()
 
virtual void Render ()
 
virtual void PostRender ()
 
virtual void GetDimensions (TFLOAT &a_rWidth, TFLOAT &a_rHeight)
 
virtual TFLOAT GetWidth ()
 
virtual TFLOAT GetHeight ()
 
virtual void SetWidth (TFLOAT a_fWidth)
 
virtual void SetHeight (TFLOAT a_fHeight)
 
virtual void SetDimensions (TFLOAT a_fWidth, TFLOAT a_fHeight)
 
virtual void GetMins (TFLOAT &a_fX, TFLOAT &a_fY)
 
virtual void GetMaxs (TFLOAT &a_fX, TFLOAT &a_fY)
 
virtual void SetColour (TUINT32 a_uiColour)
 
virtual void SetShadowAlpha (TFLOAT a_fAlpha)
 
virtual void SetFocus (TBOOL a_bFocused)
 
virtual TBOOL IsPointInside (TFLOAT a_fX, TFLOAT a_fY)
 
void AnchorPos (TFLOAT &a_rX, TFLOAT &a_rY, TFLOAT a_fWidth, TFLOAT a_fHeight)
 
void PivotPos (TFLOAT &a_rX, TFLOAT &a_rY, TFLOAT a_fWidth, TFLOAT a_fHeight)
 
void GetScreenTransform (AGUI2Transform &a_rOutTransform)
 
void GetInvScreenTransform (AGUI2Transform &a_rOutTransform)
 
void Show ()
 
void Hide ()
 
void SetInFront ()
 
void SetRenderBeforeChildren ()
 
TBOOL HasFlags (TUINT32 a_uiFlags) const
 
TBOOL IsVisible () const
 
TBOOL IsFocused () const
 
TBOOL ShouldRenderBeforeChildren ()
 
TBOOL IsInFront () const
 
TFLOAT GetAlpha () const
 
void AddChildTail (AGUI2Element &a_rElement)
 
void AddChildHead (AGUI2Element &a_rElement)
 
void SetTranslation (TFLOAT a_fX, TFLOAT a_fY)
 
void SetTranslation (const Toshi::TVector2 &a_rTranslation)
 
void SetTransform (TFLOAT a_fX, TFLOAT a_fY, float a_fRotAngle=0.0f)
 
void SetAnchor (AGUI2ATTACHMENT a_eAnchor)
 
void SetPivot (AGUI2ATTACHMENT a_ePivot)
 
void SetAttachment (AGUI2ATTACHMENT a_eAnchor, AGUI2ATTACHMENT a_ePivot)
 
t_PostRender SetPostRenderCallback (t_PostRender a_cbNewCallback)
 
AGUI2TransformGetTransform ()
 
AGUI2ElementChildBegin () const
 
AGUI2ElementChildRBegin () const
 
AGUI2ElementGetNextChild (AGUI2Element *a_pCurrentChild)
 
AGUI2ElementGetPrevChild (AGUI2Element *a_pCurrentChild)
 
void RemoveSelf ()
 
void LinkChildBefore (AGUI2Element &a_rNewChildren, AGUI2Element &a_rInsertAfter)
 
- Public Member Functions inherited from AGUI2ElementNode
 AGUI2ElementNode ()
 
virtual ~AGUI2ElementNode ()
 
void Unlink ()
 
void LinkAfter (AGUI2ElementNode &a_rNode)
 
void LinkBefore (AGUI2ElementNode &a_rNode)
 
TBOOL IsLinked () const
 
AGUI2ElementNodeGetNext () const
 
AGUI2ElementNodeGetPrev () const
 

Friends

class AGUI2Menu
 

Additional Inherited Members

- Public Attributes inherited from AGUI2ElementNode
friend AGUI2Element
 
- Static Public Attributes inherited from AGUI2Element
static TUINT32 s_uiVisibilityMask = 0xFFFFFFFF
 
- Protected Attributes inherited from AGUI2Element
AGUI2Elementm_pParent
 
AGUI2Transform m_oTransform
 
AGUI2ElementNode m_Children
 
AGUI2ATTACHMENT m_eAnchor
 
AGUI2ATTACHMENT m_ePivot
 
TFLOAT m_fWidth
 
TFLOAT m_fHeight
 
TUINT32 m_uiColour
 
TUINT32 m_eFlags
 
t_PostRender m_cbPostRender
 
TUINT32 m_uiVisibilityMask
 
- Protected Attributes inherited from AGUI2ElementNode
AGUI2ElementNodem_pNext
 
AGUI2ElementNodem_pPrev
 

Detailed Description

Definition at line 86 of file AGUI2Menu.h.

Member Enumeration Documentation

◆ COMMANDRESULT

Enumerator
COMMANDRESULT_NONE 
COMMANDRESULT_OK 
COMMANDRESULT_CANCEL 

Definition at line 91 of file AGUI2Menu.h.

Constructor & Destructor Documentation

◆ AGUI2MenuItem()

AGUI2MenuItem::AGUI2MenuItem ( )

Definition at line 12 of file AGUI2MenuItem.cpp.

13{
14 m_pNextMenuItem = this;
15 m_pPrevMenuItem = this;
16 m_bEnabled = TTRUE;
17}
#define TTRUE
Definition Typedefs.h:25

◆ ~AGUI2MenuItem()

AGUI2MenuItem::~AGUI2MenuItem ( )

Definition at line 19 of file AGUI2MenuItem.cpp.

20{
21}

Member Function Documentation

◆ CanFocus()

TBOOL AGUI2MenuItem::CanFocus ( ) const
inline

Definition at line 106 of file AGUI2Menu.h.

106{ return IsEnabled() && IsVisible(); }
TBOOL IsVisible() const
TBOOL IsEnabled() const
Definition AGUI2Menu.h:105

◆ GetFlowOffset()

TFLOAT AGUI2MenuItem::GetFlowOffset ( )
virtual

Reimplemented in AGUI2Button.

Definition at line 63 of file AGUI2MenuItem.cpp.

64{
65 return 0.0f;
66}

◆ GetFlowVisualOffset()

TFLOAT AGUI2MenuItem::GetFlowVisualOffset ( )
virtual

Reimplemented in AGUI2Button.

Definition at line 58 of file AGUI2MenuItem.cpp.

59{
60 return 0.0f;
61}

◆ GetNextMenuItem()

AGUI2MenuItem * AGUI2MenuItem::GetNextMenuItem ( ) const
inline

Definition at line 108 of file AGUI2Menu.h.

108{ return m_pNextMenuItem; }

◆ GetPrevMenuItem()

AGUI2MenuItem * AGUI2MenuItem::GetPrevMenuItem ( ) const
inline

Definition at line 109 of file AGUI2Menu.h.

109{ return m_pPrevMenuItem; }

◆ IsEnabled()

TBOOL AGUI2MenuItem::IsEnabled ( ) const
inline

Definition at line 105 of file AGUI2Menu.h.

105{ return m_bEnabled; }

◆ LinkMenuItemBefore()

void AGUI2MenuItem::LinkMenuItemBefore ( AGUI2MenuItem & a_rLinkAfter)

Definition at line 68 of file AGUI2MenuItem.cpp.

69{
70 m_pPrevMenuItem = &a_rLinkAfter;
71 m_pNextMenuItem = a_rLinkAfter.m_pNextMenuItem;
72 a_rLinkAfter.m_pNextMenuItem = this;
73 m_pNextMenuItem->m_pPrevMenuItem = this;
74}

◆ OnFocus()

void AGUI2MenuItem::OnFocus ( )
virtual

Reimplemented in AGUI2Button.

Definition at line 33 of file AGUI2MenuItem.cpp.

34{
35}

◆ OnFocusLost()

void AGUI2MenuItem::OnFocusLost ( )
virtual

Reimplemented in AGUI2Button.

Definition at line 37 of file AGUI2MenuItem.cpp.

38{
39}

◆ OnInputCommand()

AGUI2MenuItem::COMMANDRESULT AGUI2MenuItem::OnInputCommand ( AGUI2Menu::ACTIONFLAGS & a_rActionFlags)
virtual

Definition at line 45 of file AGUI2MenuItem.cpp.

46{
47 if ( a_rActionFlags & AGUI2Menu::ACTIONFLAGS_CANCEL )
49
51}
@ ACTIONFLAGS_OK
Definition AGUI2Menu.h:19
@ ACTIONFLAGS_CANCEL
Definition AGUI2Menu.h:20

◆ OnUpdate()

void AGUI2MenuItem::OnUpdate ( TFLOAT a_fDeltaTime)
virtual

Definition at line 41 of file AGUI2MenuItem.cpp.

42{
43}

◆ SetAlpha()

void AGUI2MenuItem::SetAlpha ( TFLOAT a_fAlpha)
overridevirtual

Reimplemented from AGUI2Element.

Reimplemented in AGUI2Button.

Definition at line 23 of file AGUI2MenuItem.cpp.

24{
25 for ( AGUI2Element* it = ChildRBegin(); it != TNULL; it = GetPrevChild( it ) )
26 {
27 it->SetAlpha( a_fAlpha );
28 }
29
30 AGUI2Element::SetAlpha( a_fAlpha );
31}
#define TNULL
Definition Typedefs.h:23
AGUI2Element * GetPrevChild(AGUI2Element *a_pCurrentChild)
AGUI2Element * ChildRBegin() const
virtual void SetAlpha(TFLOAT a_fAlpha)

◆ SetEnabled()

void AGUI2MenuItem::SetEnabled ( TBOOL a_bEnabled)
virtual

Reimplemented in AGUI2Button.

Definition at line 53 of file AGUI2MenuItem.cpp.

54{
55 m_bEnabled = a_bEnabled;
56}

Friends And Related Symbol Documentation

◆ AGUI2Menu

friend class AGUI2Menu
friend

Definition at line 89 of file AGUI2Menu.h.


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