|
wavelength 1.0.0
|
Button with a left and a right arrow that the directional buttons press. More...
#include <lrbutton.h>


Public Types | |
| enum | Arrow { kArrowLeft = 0 , kArrowRight = 1 } |
| The arrows, the values SetArrowShowing() takes. More... | |
| 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... | |
Public Member Functions | |
| LRButton (DataArray *pData, const char *pszPanel) | |
| Construct a button from its script description. | |
| ~LRButton () override | |
| Destroy the button. | |
| bool | DispatchPriv (Message *pMsg) override |
| Handle a controller button, or pass any other message to UIComponent. | |
| void | SetShowing (bool bShowing) override |
| Show or hide the button and both arrows. | |
| void | SetState (int nState, bool bForce) override |
| Change the state of the button and give both arrows the material of the arrow style. | |
| void | Unfocus () override |
| Stop a flash that runs and return to the state from before it. | |
| void | Poll (float fTime) override |
| Advance the flashes of the button and of the pressed arrow to a time. | |
| void | StartFlash (float fTime, int nFlashes, int nSelectedState, int nNormalState, float fSelectedMs, float fNormalMs) override |
| Start a flash between two states. | |
| void | SetArrowShowing (int nArrow, bool bShowing) |
| Show or hide one arrow. | |
| bool | HandleSelect (JoypadInputMsg *pMsg) |
| Choose the button with the cross button, or press an arrow with left or right. | |
| Public Member Functions inherited from UIButton | |
| UIButton (DataArray *pData, const char *pszPanel) | |
| Construct a button from its script description. | |
| ~UIButton () override | |
| Destroy the button. | |
| bool | DispatchPriv (Message *pMsg) override |
| Handle a controller button, or pass any other message to UIComponent. | |
| void | SetShowing (bool bShowing) override |
| Show or hide the button, its text, and its mesh. | |
| 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 mesh and the text the material and the font the style lists for it. | |
| void | Unfocus () override |
| Stop a flash that runs and return to the state from before it. | |
| void | Poll (float fTime) override |
| Advance the flash to a time, and send the UIComponentSelectMsg once it ends. | |
| void | Print (PrnStream &stream) override |
| Write the name, the visibility, the state, and the flash. | |
| void | SetStyle (UIStyle *pStyle) |
| Replace the style and apply the current state again. | |
| bool | HandleSelect (JoypadInputMsg *pMsg) |
| Start the flash when the cross button goes down. | |
| UIStyle * | GetStyle () 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. | |
| 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 button from its script description. | |
| Static Public Member Functions inherited from UIButton | |
| static UIComponent * | New (DataArray *pData, const char *pszPanel) |
| Create a button 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 | |
| Protected Attributes inherited from UIButton | |
| int | mFlashDone |
| float | mFlashStart |
| float | mFlashPeriod |
| float | mSelectedMs |
| float | mNormalMs |
| float | mFlashEnd |
| int | mNormalState |
| int | mSelectedState |
| int | mRevertState |
| RndMesh * | mMesh |
| RndText * | mText |
| UIStyle * | mStyle |
| 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. | |
Button with a left and a right arrow that the directional buttons press.
The RTTI records the class as deriving from UIButton. The object is 0x54 bytes and its vtable is at 0x003d2310. Beyond the button's own description, index 3 is the base of the object names, which must be present, and index 4 is the style of the arrows. The arrows are the meshes <panel>_<base>_left.mesh and <panel>_<base>_right.mesh.
Pressing left or right on a button with that arrow sends a UIComponentSelectStartMsg, flashes the arrow once, and then sends a UIComponentSelectMsg. The button itself does not flash.
| enum LRButton::Arrow |
The arrows, the values SetArrowShowing() takes.
| Enumerator | |
|---|---|
| kArrowLeft | The left arrow. |
| kArrowRight | The right arrow. |
| LRButton::LRButton | ( | DataArray * | pData, |
| const char * | pszPanel ) |
Construct a button from its script description.
| pData | The script description. |
| pszPanel | The name of the panel the button belongs to. |
|
override |
Destroy the button.
|
inlinestatic |
Create a button from its script description.
UIManager::Init() registers the routine for the component type lrbutton_comp.
| pData | The script description. |
| pszPanel | The name of the panel the button belongs to. |
|
overridevirtual |
Handle a controller button, or pass any other message to UIComponent.
| pMsg | The message. |
Implements MsgSink.
|
overridevirtual |
Show or hide the button and both arrows.
| bShowing | Whether the button shows. |
Reimplemented from UIComponent.
|
overridevirtual |
Change the state of the button and give both arrows the material of the arrow style.
| nState | One of UIComponent::State. |
| bForce | Apply the state even when it does not change. |
Reimplemented from UIComponent.
|
overridevirtual |
Stop a flash that runs and return to the state from before it.
Reimplemented from UIComponent.
|
overridevirtual |
Advance the flashes of the button and of the pressed arrow to a time.
Once the arrow's flash ends, the button sends a UIComponentSelectMsg.
| fTime | The front-end time in milliseconds. |
Reimplemented from UIComponent.
|
overridevirtual |
Start a flash between two states.
The override does nothing beyond UIButton::StartFlash().
| fTime | The front-end time in milliseconds. |
| nFlashes | The number of flashes. |
| nSelectedState | The state of the selected phase. |
| nNormalState | The state of the normal phase. |
| fSelectedMs | The length of the selected phase. |
| fNormalMs | The length of the normal phase. |
Reimplemented from UIButton.
| void LRButton::SetArrowShowing | ( | int | nArrow, |
| bool | bShowing ) |
Show or hide one arrow.
The arrow must exist.
| nArrow | One of Arrow. |
| bShowing | Whether the arrow shows. |
| bool LRButton::HandleSelect | ( | JoypadInputMsg * | pMsg | ) |
Choose the button with the cross button, or press an arrow with left or right.
| pMsg | The message of the button. |