|
wavelength 1.0.0
|
One control of a front-end panel, such as a label, a button, or a list. More...
#include <uicomponent.h>


Public Types | |
| enum | State { kStateNormal = 0 , kStateSelected = 1 , kStateDisabled = 2 } |
| The state a component shows, the values of mState and the index UIStyle selects with. More... | |
Public Member Functions | |
| 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 void | SetShowing (bool bShowing) |
| Show or hide the component. | |
| virtual const char * | Text () const |
| Report the text the component shows. | |
| virtual void | SetText (const char *pszText) |
| Replace the text the component shows. | |
| virtual int | GetState () const |
| Report the state the component shows. | |
| virtual void | SetState (int nState, bool bForce) |
| Change 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. | |
| virtual void | Print (PrnStream &stream)=0 |
| Write a description of the component. | |
| 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 void | Init (DataArray *pConfig) |
| Read the parameters of the flash a button shows when it is chosen. | |
Protected Attributes | |
| const char * | mName |
| int | mShowing |
| int | mState |
Static Protected Attributes | |
| 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. | |
One control of a front-end panel, such as a label, a button, or a list.
The RTTI records the class as deriving from MsgSink. The class itself is abstract, and no vtable of its own is emitted. A panel creates each component from one entry of its script description through the factory UIManager registered for the entry's type (label_comp, button_comp, lrbutton_comp, list_comp, and text_entry_comp). Index 1 of the entry is the component's name.
A component reports a state that selects the material and the font of its UIStyle. The panel moves the focus between its components with Focus() and Unfocus(). Messages reach a component through Dispatch(), which offers navigation messages to the focused panel of the current screen first.
| enum UIComponent::State |
The state a component shows, the values of mState and the index UIStyle selects with.
| Enumerator | |
|---|---|
| kStateNormal | The component does not have the focus. |
| kStateSelected | The component has the focus. |
| kStateDisabled | The component cannot be chosen. |
|
inlineexplicit |
Construct a showing component in the normal state.
Inline. Each derived constructor expands it.
| pData | The script description. Index 1 is the name. |
|
static |
Read the parameters of the flash a button shows when it is chosen.
The button_select section of the configuration provides num_flashes, frames_selected, and frames_normal. Without the section the defaults remain.
| pConfig | The ui section of the configuration. |
|
overridevirtual |
Offer a message to the focused panel of the current screen, then handle it here.
A message that is neither a controller button nor a keyboard key goes first to the panel UIManager::FocusPanel() reports. The component handles the message when the panel does not.
| pMsg | The message. |
Reimplemented from MsgSink.
|
overridevirtual |
Handle a message sent to the component.
The base routine asks the message for its type and handles nothing.
| pMsg | The message. |
Implements MsgSink.
Reimplemented in UIList, and UITextEntry.
|
inlinevirtual |
Report whether the component is showing.
|
inlinevirtual |
|
virtual |
Report the text the component shows.
Reimplemented in UIButton, UILabel, and UITextEntry.
|
virtual |
Replace the text the component shows.
The base routine does nothing.
| pszText | The text. |
Reimplemented in UIButton, UILabel, and UITextEntry.
|
inlinevirtual |
Report the state the component shows.
|
inlinevirtual |
Change the state the component shows.
| nState | One of State. |
| bForce | Apply the state even when it does not change. The base routine ignores it. |
Reimplemented in LRButton, UIButton, UILabel, and UITextEntry.
|
inlinevirtual |
React to the panel giving the component the focus.
The base routine does nothing.
|
inlinevirtual |
|
inlinevirtual |
Advance the component to a time.
The base routine does nothing.
| fTime | The front-end time in milliseconds. |
Reimplemented in LRButton, UIButton, and UITextEntry.
|
pure virtual |
Write a description of the component.
| stream | The stream to write to. |
Implemented in UIButton, UILabel, UIList, and UITextEntry.
|
inline |
|
inline |
|
protected |
The name, a symbol.
|
protected |
Whether the component shows.
|
protected |
One of State.
|
staticprotected |
Number of times a chosen button flashes before it reports the choice.
|
staticprotected |
Milliseconds of each flash a chosen button spends in the selected state.
|
staticprotected |
Milliseconds of each flash a chosen button spends in the normal state.