15 #define GETTEXT_DOMAIN "wesnoth-lib"
35 const std::string text =
_(
"Press desired hotkey (Esc cancels)");
41 const int centerx = video.
getx() / 2;
42 const int centery = video.
gety() / 2;
45 centery - text_size.h / 2 - 16, text_size.w + 60,
50 mini_frame.
layout(centerx - text_size.w / 2 - 20,
51 centery - text_size.h / 2 - 6, text_size.w + 40,
57 centerx - text_size.w / 2, centery - text_size.h / 2);
67 keycode =
event.key.keysym.sym;
71 SDL_PollEvent(&event);
74 }
while (event.type != SDL_KEYUP && event.type != SDL_JOYBUTTONUP
75 && event.type != SDL_JOYHATMOTION
76 && event.type != SDL_MOUSEBUTTONUP);
hotkey_ptr show_binding_dialog(CVideo &video, const std::string &id)
const SDL_Color NORMAL_COLOR
Keyboard shortcuts for game actions.
dimension_measurements layout(int x, int y, int w, int h)
static UNUSEDNOWARN std::string _(const char *str)
hotkey_ptr create_hotkey(const std::string &id, SDL_Event &event)
Create a new hotkey item for a command from an SDL_Event.
SDL_Rect draw_text(surface &dst, const SDL_Rect &area, int size, const SDL_Color &color, const std::string &txt, int x, int y, bool use_tooltips, int style)
Function to draw text on a surface.
boost::shared_ptr< hotkey_base > hotkey_ptr
SDL_Rect create_rect(const int x, const int y, const int w, const int h)
Creates an empty SDL_Rect.
Contains the SDL_Rect helper code.
GLsizei const GLcharARB ** string