gui Namespace Reference

General purpose widgets. More...


Classes

struct  dialog_process_info
class  dialog_image
class  dialog_textbox
class  dialog_button
class  standard_dialog_button
class  dialog
class  message_dialog
class  floating_textbox
struct  dialog_manager
class  dialog_frame
class  dialog_button_action
struct  dialog_button_info
struct  check_item
class  preview_pane
class  button
class  combo
class  file_menu
 A widget where the user may navigate through directories and choose a file. More...
class  label
class  menu
class  progress_bar
class  scrollarea
class  scrollbar
 Scrollbar. More...
class  scrollpane
 Scrollpane. More...
class  slider
class  list_slider
class  textbox
class  widget

Typedefs

typedef Uint32 msecs

Enumerations

enum  TEXTBOX_MODE {
  TEXTBOX_NONE, TEXTBOX_SEARCH, TEXTBOX_MESSAGE, TEXTBOX_COMMAND,
  TEXTBOX_AI
}
enum  DIALOG_RESULT {
  DIALOG_BACK = -7, DIALOG_FORWARD = -6, CREATE_ITEM = -5, DELETE_ITEM = -4,
  ESCAPE_DIALOG = -3, CONTINUE_DIALOG = -2, CLOSE_DIALOG = -1
}
enum  DIALOG_TYPE {
  MESSAGE, OK_ONLY, YES_NO, OK_CANCEL,
  CANCEL_ONLY, CLOSE_ONLY, NULL_DIALOG
}
enum  TITLE_RESULT {
  TUTORIAL = 0, NEW_CAMPAIGN, MULTIPLAYER, LOAD_GAME,
  GET_ADDONS, CHANGE_LANGUAGE, EDIT_PREFERENCES, SHOW_ABOUT,
  QUIT_GAME, TIP_PREVIOUS, TIP_NEXT, SHOW_HELP,
  BEG_FOR_UPLOAD, REDRAW_BACKGROUND, NOTHING
}
 Values for the menu-items of the main menu. More...

Functions

bool in_dialog ()
void show_error_message (display &disp, std::string const &message)
int show_dialog (display &screen, surface image, const std::string &caption, const std::string &message, DIALOG_TYPE type, const std::vector< std::string > *menu_items, const std::vector< preview_pane * > *preview_panes, const std::string &text_widget_label, std::string *text_widget_text, const int text_widget_max_chars, std::vector< check_item > *options, int xloc, int yloc, const dialog_frame::style *dialog_style, std::vector< dialog_button_info > *action_buttons, const menu::sorter *sorter, menu::style *menu_style)
void check_quit (CVideo &video)
TITLE_RESULT show_title (game_display &screen, config &tips_of_day, bool redraw_background)
 Show titlepage with logo and background, menu-buttons and tip-of-the-day.
static bool not_image (const std::string &str)
static const std::string dir_picture ("misc/folder-icon.png")
static const std::string path_up ("..")

Variables

const msecs three_blinks = 300
const int ButtonHPadding = 10
const int ButtonVPadding = 10
const int font_size = font::SIZE_SMALL
const int horizontal_padding = font::SIZE_SMALL
const int checkbox_horizontal_padding = font::SIZE_SMALL / 2
const int vertical_padding = font::SIZE_SMALL / 2
menuempty_menu = NULL
const unsigned int copypaste_modifier


Detailed Description

General purpose widgets.

This module primarily contains a number of common, general purpose widgets for the construction of composite user interfaces.


Typedef Documentation

typedef Uint32 gui::msecs

Definition at line 290 of file construct_dialog.hpp.


Enumeration Type Documentation

Enumerator:
DIALOG_BACK 
DIALOG_FORWARD 
CREATE_ITEM 
DELETE_ITEM 
ESCAPE_DIALOG 
CONTINUE_DIALOG 
CLOSE_DIALOG 

Definition at line 39 of file show_dialog.hpp.

Enumerator:
MESSAGE 
OK_ONLY 
YES_NO 
OK_CANCEL 
CANCEL_ONLY 
CLOSE_ONLY 
NULL_DIALOG 

Definition at line 161 of file show_dialog.hpp.

Enumerator:
TEXTBOX_NONE 
TEXTBOX_SEARCH 
TEXTBOX_MESSAGE 
TEXTBOX_COMMAND 
TEXTBOX_AI 

Definition at line 30 of file floating_textbox.hpp.

Values for the menu-items of the main menu.

Enumerator:
TUTORIAL  Start special campaign 'tutorial'.
NEW_CAMPAIGN  Let user select a campaign to play.
MULTIPLAYER  Play single scenario against humans or AI.
LOAD_GAME 
GET_ADDONS 
CHANGE_LANGUAGE 
EDIT_PREFERENCES 
SHOW_ABOUT  Show credits.
QUIT_GAME 
TIP_PREVIOUS  Show previous tip-of-the-day.
TIP_NEXT  Show next tip-of-the-day.
SHOW_HELP 
BEG_FOR_UPLOAD  Ask user for permission to upload game-stats as feedback.
REDRAW_BACKGROUND  Used after an action needing a redraw (ex: fullscreen).
NOTHING  Default, nothing done, no redraw needed.

Definition at line 24 of file titlescreen.hpp.


Function Documentation

void gui::check_quit ( CVideo video  ) 

static const std::string gui::dir_picture ( "misc/folder-icon.png"   )  [static]

bool gui::in_dialog (  ) 

Definition at line 71 of file show_dialog.cpp.

References is_in_dialog.

Referenced by play_controller::handle_event(), and hotkey::basic_handler::handle_event().

static bool gui::not_image ( const std::string &  str  )  [static]

Definition at line 238 of file widgets/button.cpp.

References IMAGE_PREFIX.

Referenced by gui::button::set_label().

static const std::string gui::path_up ( ".."   )  [static]

int gui::show_dialog ( display screen,
surface  image,
const std::string &  caption,
const std::string &  message,
DIALOG_TYPE  type,
const std::vector< std::string > *  menu_items,
const std::vector< preview_pane * > *  preview_panes,
const std::string &  text_widget_label,
std::string *  text_widget_text,
const int  text_widget_max_chars,
std::vector< check_item > *  options,
int  xloc,
int  yloc,
const dialog_frame::style *  dialog_style,
std::vector< dialog_button_info > *  action_buttons,
const menu::sorter *  sorter,
menu::style *  menu_style 
)

void gui::show_error_message ( display disp,
std::string const &  message 
)

Definition at line 366 of file show_dialog.cpp.

References _, ERR_G, and OK_ONLY.

Referenced by enter_lobby_mode(), mp::connect::load_game(), play_game(), play_replay(), and twml_exception::show().

TITLE_RESULT gui::show_title ( game_display screen,
config tips_of_day,
bool  redraw_background 
)

Show titlepage with logo and background, menu-buttons and tip-of-the-day.

After the page is shown, this routine waits for the user to click one of the menu-buttons, or a keypress.

Parameters:
screen display object
tips_of_day list of tips
redraw_background redraw background and buttons box, see draw_background()
Returns:
the value of the menu-item the user has choosen.
Return values:
see TITLE_RESULT for possible values

Definition at line 341 of file titlescreen.cpp.

References _, b, BEG_FOR_UPLOAD, display::delay(), draw_background(), draw_tip_of_day(), display::flip(), display::h(), gui::widget::location(), LOG_DP, gui::button::MINIMUM_SPACE, CVideo::modeChanged(), N_, next_tip_of_day(), cursor::NORMAL, gui::button::pressed(), events::pump(), QUIT_GAME, events::raise_draw_event(), events::raise_process_event(), REDRAW_BACKGROUND, cursor::set(), gui::widget::set_help_string(), gui::widget::set_location(), sgettext(), SHOW_HELP, TIP_NEXT, TIP_PREVIOUS, game_config::title_buttons_padding, game_config::title_buttons_x, game_config::title_buttons_y, game_config::title_tip_padding, gui::dialog_frame::titlescreen_style, gui::button::TYPE_IMAGE, gui::button::TYPE_PRESS, update_whole_screen(), display::video(), and display::w().

Referenced by play_game(), help::help_text_area::set_items(), and show_intro_part().


Variable Documentation

const int gui::ButtonHPadding = 10

const int gui::ButtonVPadding = 10

Definition at line 35 of file widgets/button.cpp.

Referenced by gui::button::calculate_size(), and gui::button::draw_contents().

const unsigned int gui::copypaste_modifier [static]

Initial value:




        KMOD_CTRL

Definition at line 366 of file textbox.cpp.

Referenced by gui::textbox::handle_event(), and gui2::ttext_::key_press().

Definition at line 34 of file widgets/button.cpp.

Referenced by gui::button::calculate_size().

const msecs gui::three_blinks = 300

Definition at line 291 of file construct_dialog.hpp.

Definition at line 36 of file widgets/button.cpp.

Referenced by gui::button::calculate_size().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs