NvTweakEnumUI< T > Class Template Reference

A templated subclass of NvTweakVarUI specifically for handling one entry of an NvTweakEnum list/array passed into the tweakbar -- i.e., one button in a radio button group, or one menu item in a popup menu. More...

#include <NvTweakBar.h>

Inheritance diagram for NvTweakEnumUI< T >:

NvTweakVarUI< T > NvTweakVarUIProxyBase NvUIProxy NvUIElement

List of all members.

Public Member Functions

 NvTweakEnumUI (NvTweakVar< T > &tvar, T eval, NvUIElement *el, uint32_t actionCode=0)
 A cached value passed in via an NvTweakEnum entry.
virtual NvUIEventResponse HandleEvent (const NvGestureEvent &ev, NvUST timeUST, NvUIElement *hasFocus)
 We override HandleEvent so that if there is a reaction by the proxied UI widget, we can replace the value inside the NvUIReaction with our cached value, and allow the rest of the reaction process to occur as normal.
virtual NvUIEventResponse HandleReaction (const NvUIReaction &react)
 We override HandleReaction so that when there is an NvUIReaction passing through the system containing a real value, we can set our state to be 0 or 1 (active or pressed) based on whether our cached value matches the value of the NvTweakVar we're bound to.

Protected Attributes

m_enumval


Detailed Description

template<class T>
class NvTweakEnumUI< T >

A templated subclass of NvTweakVarUI specifically for handling one entry of an NvTweakEnum list/array passed into the tweakbar -- i.e., one button in a radio button group, or one menu item in a popup menu.

Each NvTweakVarUI element is responsible for setting its stored enum value on the linked NvTweakVar when the UI element is selected.


Constructor & Destructor Documentation

template<class T >
NvTweakEnumUI< T >::NvTweakEnumUI ( NvTweakVar< T > &  tvar,
eval,
NvUIElement el,
uint32_t  actionCode = 0 
) [inline]

A cached value passed in via an NvTweakEnum entry.

Will be used to set our linked NvTweakVar to a specific value during an appropriate HandleReaction. Normal constructor. Takes the referenced NvTweakVar, the enumerant value we represent, the individual UI element that acts as our proxy for user interaction in a radio group or popup menu, and an optional override of the action code for the variable and UI.


Member Function Documentation

template<class T >
virtual NvUIEventResponse NvTweakEnumUI< T >::HandleReaction ( const NvUIReaction react  )  [virtual]

We override HandleReaction so that when there is an NvUIReaction passing through the system containing a real value, we can set our state to be 0 or 1 (active or pressed) based on whether our cached value matches the value of the NvTweakVar we're bound to.

This is so radio buttons and menu items update their visual state to match outside changes to the NvTweakVar's value (such as from key input).

Reimplemented from NvTweakVarUI< T >.


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