wavelength 1.0.0
Loading...
Searching...
No Matches
UILabel Class Reference

Component that shows a line of text. More...

#include <uilabel.h>

Inheritance diagram for UILabel:
Collaboration diagram for UILabel:

Public Member Functions

 UILabel (DataArray *pData, const char *pszPanel)
 Construct a label from its script description.
 ~UILabel () override
 Destroy the label.
void SetShowing (bool bShowing) override
 Show or hide the label and its text object.
const char * Text () const override
 Report the text of the text object.
void SetText (const char *pszText) override
 Replace the text of the text object.
void SetState (int nState, bool bForce) override
 Change the state and give the text object the font the style lists for it.
void Print (PrnStream &stream) override
 Write the name, the visibility, and the name of the text object.
void SetStyle (UIStyle *pStyle)
 Replace the style and give the text object the font of the current state.
RndText * GetText () const
Public Member Functions inherited from UIComponent
 UIComponent (DataArray *pData)
 Construct a showing component in the normal state.
bool Dispatch (Message *pMsg) override
 Offer a message to the focused panel of the current screen, then handle it here.
bool DispatchPriv (Message *pMsg) override
 Handle a message sent to the component.
virtual bool IsShowing () const
 Report whether the component is showing.
virtual int GetState () const
 Report the state the component shows.
virtual void Focus ()
 React to the panel giving the component the focus.
virtual void Unfocus ()
 React to the panel taking the focus away.
virtual void Poll (float fTime)
 Advance the component to a time.
const char * GetName () const
int GetShowing () const
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the pool heaps under the tag "MsgSink".
void operator delete (void *pBlock)
 Return a sink to the pool heaps.
virtual ~MsgSink ()
void * operator new (size_t size)
 Allocate from the main heap under the name MsgSink.
void operator delete (void *mem)
 Return memory to its heap.
virtual ~MsgSink ()
 Destroy the sink.

Static Public Member Functions

static UIComponent * New (DataArray *pData, const char *pszPanel)
 Create a label from its script description.
Static Public Member Functions inherited from UIComponent
static void Init (DataArray *pConfig)
 Read the parameters of the flash a button shows when it is chosen.

Additional Inherited Members

Public Types inherited from UIComponent
enum  State { kStateNormal = 0 , kStateSelected = 1 , kStateDisabled = 2 }
 The state a component shows, the values of mState and the index UIStyle selects with. More...
Protected Attributes inherited from UIComponent
const char * mName
int mShowing
int mState
Static Protected Attributes inherited from UIComponent
static int sNumFlashes
 Number of times a chosen button flashes before it reports the choice.
static float sSelectedMs
 Milliseconds of each flash a chosen button spends in the selected state.
static float sNormalMs
 Milliseconds of each flash a chosen button spends in the normal state.

Detailed Description

Component that shows a line of text.

The RTTI records the class as deriving from UIComponent. The object is 0x18 bytes and its vtable is at 0x003d2410. The panel description provides the name at index 1, optionally the base of the text object's name at index 2, and optionally a style at index 3. The text object is <panel>_<base>.txt, with the name standing in for a missing base. The style selects the font of each state.

Constructor & Destructor Documentation

◆ UILabel()

UILabel::UILabel ( DataArray * pData,
const char * pszPanel )

Construct a label from its script description.

Parameters
pDataThe script description.
pszPanelThe name of the panel the label belongs to.
Ghidra address:
NTSC-U/C: 0x00203e20
Ghidra address:
PAL: 0x0020cbd8

◆ ~UILabel()

UILabel::~UILabel ( )
inlineoverride

Destroy the label.

Ghidra address:
NTSC-U/C: 0x003773e8
Ghidra address:
PAL: 0x003e5b18

Member Function Documentation

◆ New()

UIComponent * UILabel::New ( DataArray * pData,
const char * pszPanel )
inlinestatic

Create a label from its script description.

UIManager::Init() registers the routine for the component type label_comp.

Parameters
pDataThe script description.
pszPanelThe name of the panel the label belongs to.
Returns
The new label.
Ghidra address:
NTSC-U/C: 0x00377398
Ghidra address:
PAL: 0x003e5ac8

◆ SetShowing()

void UILabel::SetShowing ( bool bShowing)
overridevirtual

Show or hide the label and its text object.

The text object must exist.

Parameters
bShowingWhether the label shows.
Ghidra address:
NTSC-U/C: 0x00203f80
Ghidra address:
PAL: 0x0020cd38

Reimplemented from UIComponent.

◆ Text()

const char * UILabel::Text ( ) const
overridevirtual

Report the text of the text object.

The text object must exist.

Returns
The text as it was last set.
Ghidra address:
NTSC-U/C: 0x00203fb8
Ghidra address:
PAL: 0x0020cd70

Reimplemented from UIComponent.

◆ SetText()

void UILabel::SetText ( const char * pszText)
overridevirtual

Replace the text of the text object.

The text object must exist.

Parameters
pszTextThe text.
Ghidra address:
NTSC-U/C: 0x00203fc8
Ghidra address:
PAL: 0x0020cd80

Reimplemented from UIComponent.

◆ SetState()

void UILabel::SetState ( int nState,
bool bForce )
overridevirtual

Change the state and give the text object the font the style lists for it.

The style must exist when the text object does.

Parameters
nStateOne of UIComponent::State.
bForceApply the state even when it does not change.
Ghidra address:
NTSC-U/C: 0x00204060
Ghidra address:
PAL: 0x0020ce18

Reimplemented from UIComponent.

◆ Print()

void UILabel::Print ( PrnStream & stream)
overridevirtual

Write the name, the visibility, and the name of the text object.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x002040f0
Ghidra address:
PAL: 0x0020cea8

Implements UIComponent.

◆ SetStyle()

void UILabel::SetStyle ( UIStyle * pStyle)

Replace the style and give the text object the font of the current state.

Parameters
pStyleThe style.
Ghidra address:
NTSC-U/C: 0x00203ff8
Ghidra address:
PAL: 0x0020cdb0

◆ GetText()

RndText * UILabel::GetText ( ) const
inline
Returns
The text object, or null when the file has no text object of that name.

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