Classes | Namespaces | Defines

gui/dialogs/dialog.hpp File Reference

#include "gui/dialogs/field-fwd.hpp"
#include <string>
#include <vector>
Include dependency graph for dialog.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Namespaces

namespace  gui2
 

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


Defines

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

Define 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 95 of file dialog.hpp.

Referenced by gui2::tdata_manage::pre_show(), and gui2::tmp_create_game::tmp_create_game().

#define REGISTER_DIALOG2 (   type,
  id 
)
Value:
\
REGISTER_WINDOW(id)                                                        \
                                                                           \
const std::string&                                                         \
type::window_id() const                                                    \
{                                                                          \
    static const std::string result(#id);                                  \
    return result;                                                         \
}

Registers a window for a dialog.

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

  // Inherited from tdialog, implemented by REGISTER_DIALOG.
    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:
type Class type of the window to register.
id Id of the window, multiple dialogs can use the same window so the id doesn't need to be unique.

Definition at line 79 of file dialog.hpp.

#define REGISTER_WINDOW (   id  ) 
Value:
namespace {                                                                \
                                                                           \
    namespace ns_##id {                                                    \
                                                                           \
        struct tregister_helper {                                          \
            tregister_helper()                                             \
            {                                                              \
                register_window(#id);                                      \
            }                                                              \
        };                                                                 \
                                                                           \
        tregister_helper register_helper;                                  \
    }                                                                      \
}

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:
id Id of the window, multiple dialogs can use the same window so the id doesn't need to be unique.

Definition at line 42 of file dialog.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:05:17 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs