52 auto *okButton =
new Button(
_(
"Close"),
"close",
this);
58 place(4, 3, okButton);
68 if (event.getId() ==
"close")
74 std::string helpFile = link;
95 const std::string fileName = helpPath + file +
".txt";
97 size_t contentsLength;
98 char *fileContents = (
char *)
FS::loadFile(fileName, contentsLength);
101 Log::info(
"Couldn't load text file: %s", fileName.c_str());
106 SDL_free(fileContents);
A simple browser box able to handle links and forward events to the parent conteiner.
void addRows(std::string_view rows)
Adds one or more text rows to the browser, separated by ' '.
void setLinkHandler(LinkHandler *handler)
Sets the handler for links.
void clearRows()
Remove all rows.
std::string getStringValue(const std::string &key) const
gcn::ScrollArea * mScrollArea
void loadFile(const std::string &file)
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
void handleLink(const std::string &link) override
Handles link action.
void loadHelp(const std::string &helpFile)
Loads help in the dialog.
void setRowHeight(int n, int h)
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
This class is an helper for setting the position of widgets.
@ AUTO_SET
Uses the share as the new size.
void registerWindowForReset(Window *window)
Enables the Reset Windows button.
virtual void setVisible(bool visible)
Overloads window setVisible by Guichan to allow sticky window handling.
void setMinHeight(int height)
Sets the minimum height of the window.
void setContentSize(int width, int height)
Sets the size of this window.
Layout & getLayout()
Gets the layout handler for this window.
void setWindowName(const std::string &name)
Sets the name of the window.
void setResizable(bool resize)
Sets whether or not the window can be resized.
LayoutCell & place(int x, int y, gcn::Widget *, int w=1, int h=1)
Adds a widget to the window and sets it at given cell.
void setDefaultSize()
Set the default win pos and size to the current ones.
void loadWindowState()
Reads the position (and the size for resizable windows) in the configuration based on the given strin...
void setMinWidth(int width)
Sets the minimum width of the window.
Configuration paths
XML default paths information reader.
Configuration branding
XML branding information reader.
gcn::Font * monoFont
Monospaced text font.
void * loadFile(const std::string &path, size_t &datasize)
void info(const char *log_text,...) LOG_PRINTF_ATTR