Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBSelectItemViewer Class Referenceabstract

TBSelectItemViewer is the viewer for items provided by TBSelectItemSource. More...

#include <tb_select_item.h>

Inheritance diagram for tb::TBSelectItemViewer:
tb::TBLinkOf< TBSelectItemViewer > tb::TBLink tb::TBSelectDropdown tb::TBSelectList

Public Member Functions

void SetSource (TBSelectItemSource *source)
 Set the source which should provide the items for this viewer. More...
 
TBSelectItemSourceGetSource () 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...
 

Protected Attributes

TBSelectItemSourcem_source
 

Additional Inherited Members

Detailed Description

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.

Member Function Documentation

virtual void tb::TBSelectItemViewer::OnAllItemsRemoved ( )
pure virtual

Called when all items have been removed.

Implemented in tb::TBSelectDropdown, and tb::TBSelectList.

virtual void tb::TBSelectItemViewer::OnItemAdded ( int  index)
pure virtual

Called when the item at the given index has been added.

Implemented in tb::TBSelectDropdown, and tb::TBSelectList.

virtual void tb::TBSelectItemViewer::OnItemChanged ( int  index)
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.

virtual void tb::TBSelectItemViewer::OnItemRemoved ( int  index)
pure virtual

Called when the item at the given index has been removed.

Implemented in tb::TBSelectDropdown, and tb::TBSelectList.

virtual void tb::TBSelectItemViewer::OnSourceChanged ( )
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.


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