Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | Static Public Member Functions | List of all members
editor::component::ItemSelector Class Reference

Wrapper over ComboBox that allows selection of any item in the item database. More...

#include <ItemSelector.hpp>

+ Inheritance diagram for editor::component::ItemSelector:

Public Types

using Ptr = std::shared_ptr< ItemSelector >
 Pointer to this component. More...
 
using ChangeCb = std::function< void(core::item::Id)>
 Called when the item changes. More...
 

Public Member Functions

core::item::Id currentItem () const
 Returns the current selected item. More...
 
void setItem (core::item::Id item)
 Set the current item. More...
 
void refresh ()
 Refreshes the items from the item database. More...
 

Static Public Member Functions

static Ptr create (const ChangeCb &cb=[](core::item::Id) {})
 Creates a new ItemSelector. More...
 

Detailed Description

Wrapper over ComboBox that allows selection of any item in the item database.

Definition at line 17 of file ItemSelector.hpp.

Member Typedef Documentation

◆ ChangeCb

Called when the item changes.

Definition at line 23 of file ItemSelector.hpp.

◆ Ptr

Pointer to this component.

Definition at line 20 of file ItemSelector.hpp.

Member Function Documentation

◆ create()

ItemSelector::Ptr editor::component::ItemSelector::create ( const ChangeCb cb = [](core::item::Id) {})
static

Creates a new ItemSelector.

Parameters
cbThe function to call when the item is changed

Definition at line 9 of file ItemSelector.cpp.

◆ currentItem()

core::item::Id editor::component::ItemSelector::currentItem ( ) const

Returns the current selected item.

Returns
core::item::Id

Definition at line 21 of file ItemSelector.cpp.

◆ refresh()

void editor::component::ItemSelector::refresh ( )

Refreshes the items from the item database.

Definition at line 30 of file ItemSelector.cpp.

◆ setItem()

void editor::component::ItemSelector::setItem ( core::item::Id  item)

Set the current item.

Definition at line 26 of file ItemSelector.cpp.


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