The Battle for Wesnoth
1.13.4+dev
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
help
help_browser.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2003 - 2016 by David White <
[email protected]
>
3
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY.
11
12
See the COPYING file for more details.
13
*/
14
15
#ifndef HELP_BROWSER_HPP
16
#define HELP_BROWSER_HPP
17
18
#include <deque>
// for deque
19
#include <string>
// for string
20
#include <SDL_events.h>
// for SDL_Event
21
#include "
help_menu.hpp
"
// for help_menu
22
#include "
help_text_area.hpp
"
// for help_text_area
23
#include "widgets/button.hpp"
// for button
24
#include "widgets/widget.hpp"
// for widget
25
class
CVideo
;
// lines 18-18
26
struct
SDL_Rect;
27
28
namespace
help
{
29
30
/// A help browser widget.
31
class
help_browser
:
public
gui::widget
32
{
33
public
:
34
help_browser
(
CVideo
&
video
,
const
section
&
toplevel
);
35
36
void
adjust_layout
();
37
38
/// Display the topic with the specified identifier. Open the menu
39
/// on the right location and display the topic in the text area.
40
void
show_topic
(
const
std::string
&topic_id);
41
42
protected
:
43
virtual
void
update_location
(SDL_Rect
const
&rect);
44
virtual
void
process_event
();
45
virtual
void
handle_event
(
const
SDL_Event &
event
);
46
47
private
:
48
/// Update the current cursor, set it to the reference cursor if
49
/// mousex, mousey is over a cross-reference, otherwise, set it to
50
/// the normal cursor.
51
void
update_cursor
();
52
void
show_topic
(
const
topic
&
t
,
bool
save_in_history=
true
);
53
/// Move in the topic history. Pop an element from from and insert
54
/// it in to. Pop at the fronts if the maximum number of elements is
55
/// exceeded.
56
void
move_in_history
(std::deque<const topic *> &from, std::deque<const topic *> &to);
57
help_menu
menu_
;
58
help_text_area
text_area_
;
59
const
section
&
toplevel_
;
60
bool
ref_cursor_
;
// If the cursor currently is the hyperlink cursor.
61
std::deque<const topic *>
back_topics_
,
forward_topics_
;
62
gui::button
back_button_
,
forward_button_
;
63
topic
const
*
shown_topic_
;
64
};
65
66
}
// end namespace help
67
68
#endif
help::help_browser::update_cursor
void update_cursor()
Update the current cursor, set it to the reference cursor if mousex, mousey is over a cross-reference...
Definition:
help_browser.cpp:168
help::help_browser::forward_button_
gui::button forward_button_
Definition:
help_browser.hpp:62
help_menu.hpp
help::help_browser::menu_
help_menu menu_
Definition:
help_browser.hpp:57
help::help_browser::move_in_history
void move_in_history(std::deque< const topic * > &from, std::deque< const topic * > &to)
Move in the topic history.
Definition:
help_browser.cpp:120
help::section
A section contains topics and sections along with title and ID.
Definition:
help_impl.hpp:143
help::help_browser::shown_topic_
topic const * shown_topic_
Definition:
help_browser.hpp:63
CVideo
Definition:
video.hpp:58
help::toplevel
help::section toplevel
Definition:
help_impl.cpp:66
gui::widget::video
CVideo & video() const
Definition:
widget.hpp:83
help::help_browser::handle_event
virtual void handle_event(const SDL_Event &event)
Definition:
help_browser.cpp:137
help::help_browser::help_browser
help_browser(CVideo &video, const section &toplevel)
Definition:
help_browser.cpp:33
help::help_browser::forward_topics_
std::deque< const topic * > forward_topics_
Definition:
help_browser.hpp:61
gui::widget
Definition:
widget.hpp:25
t
GLdouble GLdouble t
Definition:
glew.h:1366
help::help_browser::toplevel_
const section & toplevel_
Definition:
help_browser.hpp:59
help::help_browser::back_topics_
std::deque< const topic * > back_topics_
Definition:
help_browser.hpp:61
help::help_text_area
The area where the content is shown in the help browser.
Definition:
help_text_area.hpp:34
help::help_browser::back_button_
gui::button back_button_
Definition:
help_browser.hpp:62
help::help_browser::ref_cursor_
bool ref_cursor_
Definition:
help_browser.hpp:60
gui::button
Definition:
button.hpp:27
help_text_area.hpp
help::help_browser::show_topic
void show_topic(const std::string &topic_id)
Display the topic with the specified identifier.
Definition:
help_browser.cpp:183
help::help_browser::process_event
virtual void process_event()
Definition:
help_browser.cpp:95
help::help_browser::adjust_layout
void adjust_layout()
Definition:
help_browser.cpp:54
help::help_browser::update_location
virtual void update_location(SDL_Rect const &rect)
Definition:
help_browser.cpp:90
event
cl_event event
Definition:
glew.h:3070
help::help_menu
The menu to the left in the help browser, where topics can be navigated through and chosen...
Definition:
help_menu.hpp:31
help::topic
A topic contains a title, an id and some text.
Definition:
help_impl.hpp:111
help
Definition:
help.cpp:57
string
GLsizei const GLcharARB ** string
Definition:
glew.h:4503
help::help_browser
A help browser widget.
Definition:
help_browser.hpp:31
help::help_browser::text_area_
help_text_area text_area_
Definition:
help_browser.hpp:58
Generated by
1.8.8