26#include <guichan/actionlistener.hpp>
27#include <guichan/listmodel.hpp>
47 public gcn::ActionListener,
58 void action(
const gcn::ActionEvent &event)
override;
65 void setText(
const std::vector<std::string> &
string);
73 void addText(
const std::string &
string,
bool save =
true);
95 void close()
override;
125 void textRequest(
const std::string &defaultText = std::string());
138 void move(
int amount);
142 void mouseClicked(gcn::MouseEvent &mouseEvent)
override;
A simple browser box able to handle links and forward events to the parent conteiner.
TextBox which only accepts numbers as input.
A list box, meant to be used inside a scroll area.
static bool isAnyInputFocused()
void initChoiceSelection()
Put focus on the first choice.
void addChoice(const std::string &)
Adds a choice to the list box.
gcn::ScrollArea * mScrollArea
static DialogList instances
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
void setVisible(bool visible) override
Overloads window setVisible by Guichan to allow sticky window handling.
void integerRequest(int defaultValue, int min, int max)
Requests an integer from the user.
void nextDialog()
Notifies the server that client has performed a next action.
bool isWaitingForTheServer() const
bool isTextInputFocused() const
static NpcDialog * getActive()
Returns the first active instance.
std::unique_ptr< ItemLinkHandler > mItemLinkHandler
std::vector< std::string > mNewText
void choiceRequest()
Makes this dialog request a choice selection from the user.
std::list< NpcDialog * > DialogList
NpcActionState mActionState
void showNextButton()
When called, the widget will show a "Next" button.
bool isInputFocused() const
std::vector< std::string > mItems
std::string mDefaultString
void setText(const std::vector< std::string > &string)
Sets the text shows in the dialog.
void showCloseButton()
When called, the widget will show a "Close" button and will close the dialog when clicked.
std::string getElementAt(int i) override
Returns the name of item number i of the choices list.
void mouseClicked(gcn::MouseEvent &mouseEvent) override
void textRequest(const std::string &defaultText=std::string())
Requests a text string from the user.
void addText(const std::string &string, bool save=true)
Adds the text to the text shows in the dialog.
static void closeAll()
Closes all instances.
void close() override
Notifies the server that the client has performed a close action.
gcn::ScrollArea * mListScrollArea
NpcInputState mInputState
int getNumberOfElements() override
Returns the number of items in the choices list.