The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros
dialog.hpp File Reference
#include "gui/auxiliary/field-fwd.hpp"
#include "utils/functional.hpp"
#include <string>
#include <vector>
Include dependency graph for dialog.hpp:

Go to the source code of this file.

Classes

class  gui2::tdialog
 Abstract base class for all dialogs. More...
 

Namespaces

 gui2
 A class inherited from ttext_box that displays its input as stars.
 

Macros

#define REGISTER_WINDOW(id)
 Registers a window. More...
 
#define REGISTER_DIALOG2(type, id)
 Registers a window for a dialog. More...
 
#define REGISTER_DIALOG(window_id)   REGISTER_DIALOG2(t##window_id, window_id)
 Wrapper for REGISTER_DIALOG2. More...
 

Macro Definition Documentation

#define REGISTER_DIALOG (   window_id)    REGISTER_DIALOG2(t##window_id, window_id)

Wrapper for REGISTER_DIALOG2.

"Calls" REGISTER_DIALOG2(twindow_id, window_id)

Definition at line 93 of file dialog.hpp.

#define REGISTER_DIALOG2 (   type,
  id 
)
Value:
REGISTER_WINDOW(id) const std::string& type::window_id() const \
{ \
static const std::string result(#id); \
return result; \
}
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1221
STL namespace.
#define REGISTER_WINDOW(id)
Registers a window.
Definition: dialog.hpp:43
GLuint64EXT * result
Definition: glew.h:10727
GLsizei const GLcharARB ** string
Definition: glew.h:4503

Registers a window for a dialog.

Call this function to register a window. In the header of the class it adds the following code:

1 // Inherited from tdialog, implemented by REGISTER_DIALOG.
2  virtual const std::string& id() const;

Then use this macro in the implementation, inside the gui2 namespace.

Note
When the id is "foo" and the type tfoo it's easier to use REGISTER_DIALOG(foo).
Parameters
typeClass type of the window to register.
idId of the window, multiple dialogs can use the same window so the id doesn't need to be unique.

Definition at line 81 of file dialog.hpp.

#define REGISTER_WINDOW (   id)
Value:
namespace \
{ \
\
namespace ns_##id \
{ \
\
struct tregister_helper \
{ \
tregister_helper() \
{ \
} \
}; \
\
tregister_helper register_helper; \
} \
}
void register_window(const std::string &id)
Registers a window.
Definition: settings.cpp:467

Registers a window.

This function registers a window. The registration is used to validate whether the config for the window exists when starting Wesnoth.

Note
Most of the time you want to call REGISTER_DIALOG instead of this function. It also directly adds the code for the dialog's id function.
Parameters
idId of the window, multiple dialogs can use the same window so the id doesn't need to be unique.

Definition at line 43 of file dialog.hpp.