Hasty Badger
Small UI library (a branch of Turbo Badger)
|
TBSelectItemViewer is the viewer for items provided by TBSelectItemSource. More...
#include <tb_select_item.h>
Public Member Functions | |
void | SetSource (TBSelectItemSource *source) |
Set the source which should provide the items for this viewer. More... | |
TBSelectItemSource * | GetSource () const |
virtual void | OnSourceChanged ()=0 |
Called when the source has changed or been unset by calling SetSource. More... | |
virtual void | OnItemChanged (int index)=0 |
Called when the item at the given index has changed in a way that should update the viewer. More... | |
virtual void | OnItemAdded (int index)=0 |
Called when the item at the given index has been added. More... | |
virtual void | OnItemRemoved (int index)=0 |
Called when the item at the given index has been removed. More... | |
virtual void | OnAllItemsRemoved ()=0 |
Called when all items have been removed. More... | |
Public Member Functions inherited from tb::TBLinkOf< TBSelectItemViewer > | |
TBSelectItemViewer * | GetPrev () const |
TBSelectItemViewer * | GetNext () const |
Public Member Functions inherited from tb::TBLink | |
bool | IsInList () const |
Return true if the link is currently added to a list. More... | |
Protected Attributes | |
TBSelectItemSource * | m_source |
Additional Inherited Members | |
Public Attributes inherited from tb::TBLink | |
TBLink * | prev |
TBLink * | next |
TBLinkList * | linklist |
TBSelectItemViewer is the viewer for items provided by TBSelectItemSource.
There can be multiple viewers for each source. The viewer will recieve callbacks when the source is changed, so it can update itself.
|
pure virtual |
Called when all items have been removed.
Implemented in tb::TBSelectDropdown, and tb::TBSelectList.
|
pure virtual |
Called when the item at the given index has been added.
Implemented in tb::TBSelectDropdown, and tb::TBSelectList.
|
pure virtual |
Called when the item at the given index has changed in a way that should update the viewer.
Implemented in tb::TBSelectDropdown, and tb::TBSelectList.
|
pure virtual |
Called when the item at the given index has been removed.
Implemented in tb::TBSelectDropdown, and tb::TBSelectList.
|
pure virtual |
Called when the source has changed or been unset by calling SetSource.
Implemented in tb::TBSelectDropdown, and tb::TBSelectList.
void tb::TBSelectItemViewer::SetSource | ( | TBSelectItemSource * | source | ) |
Set the source which should provide the items for this viewer.
This source needs to live longer than this viewer. Set nullptr to unset currently set source.