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

GUI component for selecting or writing scripts. Performs syntax validation as well. More...

#include <ScriptSelector.hpp>

Public Types

using OnSelect = std::function< void(const std::string &)>
 Callback type for when a script is chosen. More...
 
using OnCancel = std::function< void()>
 Called when the window is closed without a selection. More...
 

Public Member Functions

 ScriptSelector (const OnSelect &onSelect, const OnCancel &onCancel)
 Construct a new Script Selector dialog. More...
 
void open (bl::gui::GUI *parent, const std::string &value={})
 Opens the dialog to select a script. More...
 

Detailed Description

GUI component for selecting or writing scripts. Performs syntax validation as well.

Definition at line 17 of file ScriptSelector.hpp.

Member Typedef Documentation

◆ OnCancel

using editor::component::ScriptSelector::OnCancel = std::function<void()>

Called when the window is closed without a selection.

Definition at line 23 of file ScriptSelector.hpp.

◆ OnSelect

using editor::component::ScriptSelector::OnSelect = std::function<void(const std::string&)>

Callback type for when a script is chosen.

Definition at line 20 of file ScriptSelector.hpp.

Constructor & Destructor Documentation

◆ ScriptSelector()

editor::component::ScriptSelector::ScriptSelector ( const OnSelect onSelect,
const OnCancel onCancel 
)

Construct a new Script Selector dialog.

Parameters
onSelectCallback to call when a script is chosen
onCancelCalled when the window is closed without a selection

Definition at line 12 of file ScriptSelector.cpp.

Member Function Documentation

◆ open()

void editor::component::ScriptSelector::open ( bl::gui::GUI *  parent,
const std::string &  value = {} 
)

Opens the dialog to select a script.

Parameters
parentThe parent to add the GUI elements to
valueThe default script value to fill

Definition at line 59 of file ScriptSelector.cpp.


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