39#include <guichan/listmodel.hpp>
41#include <SDL_keyboard.h>
75 mKeyList(new
ListBox(mKeyListModel)),
87 scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
123 new OkDialog(
_(
"Key Conflict(s) Detected."),
150 else if (event.getId() ==
"assign")
159 else if (event.getId() ==
"unassign")
167 else if (event.getId() ==
"makeDefault")
189 game->updateWindowMenuCaptions();
LayoutCell & place(int x, int y, gcn::Widget *wg, int w=1, int h=1)
Adds a widget to the container and sets it at given cell.
The main class responsible for running the game.
static Game * instance()
Provides access to the game instance.
The list model for key function list.
int getNumberOfElements() override
Returns the number of elements in container.
std::string getElementAt(int i) override
Returns element from container.
void setElementAt(int i, const std::string &caption)
Sets element from container.
std::string mKeyFunctions[KeyboardConfig::KEY_TOTAL]
std::string getBindError() const
int getKeyValue(int index) const
Obtain the value stored in memory.
void store()
Store the key values to config file.
void setNewKey(SDL_Keycode value)
Set the value of the new key.
int getNewKeyIndex() const
Get the index of the new key to be assigned.
void makeDefault()
Make the keys their default values.
bool hasConflicts()
Determines if any key assignments are the same as each other.
void retrieve()
Retrieve the key values from config file.
void setEnabled(bool flag)
Set the enable flag, which will stop the user from doing actions.
const std::string & getKeyCaption(int index) const
Get the key caption, providing more meaning to the user.
void setNewKeyIndex(int value)
Set the index of the new key to be assigned.
void setSetupKeyboard(Setup_Keyboard *setupKey)
Set a reference to the key setup window.
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
A list box, meant to be used inside a scroll area.
void setName(const std::string &name)
Sets the name displayed on the tab.
void cancel() override
Called when the Cancel button is pressed in the setup window.
void keyUnresolved()
If a key function is unresolved, then this reverts it.
void newKeyCallback(int index)
The callback function when a new key has been pressed.
class KeyListModel * mKeyListModel
void refreshAssignedKey(int index)
Get an update on the assigned key.
gcn::Button * mMakeDefaultButton
void refreshKeys()
Shorthand method to update all the keys.
~Setup_Keyboard() override
gcn::Button * mAssignKeyButton
bool mKeySetting
flag to check if key being set.
void action(const gcn::ActionEvent &event) override
void apply() override
Called when the Apply button is pressed in the setup window.
gcn::Button * mUnassignKeyButton
gcn::Font * monoFont
Monospaced text font.
std::string strprintf(char const *format,...)
A safe version of sprintf that returns a std::string of the result.
std::string toString(const T &arg)
Converts the given value to a string using std::stringstream.