Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial framework for a GUI2 version of the help browser
- Loading branch information
Showing
4 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
#textdomain wesnoth-lib | ||
|
||
[window] | ||
id = "help_browser" | ||
description = "Battle for Wesnoth Help." | ||
|
||
[resolution] | ||
definition = "default" | ||
|
||
automatic_placement = "true" | ||
vertical_placement = "center" | ||
horizontal_placement = "center" | ||
|
||
[tooltip] | ||
id = "tooltip_large" | ||
[/tooltip] | ||
|
||
[helptip] | ||
id = "tooltip_large" | ||
[/helptip] | ||
|
||
[linked_group] | ||
id = "images" | ||
fixed_width = true | ||
[/linked_group] | ||
|
||
[linked_group] | ||
id = "names" | ||
fixed_width = true | ||
[/linked_group] | ||
|
||
[grid] | ||
[row] | ||
grow_factor = 1 | ||
[column] | ||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "left" | ||
[label] | ||
definition = "title" | ||
label = _ "Battle For Wesnoth Help" | ||
[/label] | ||
[/column] | ||
[/row] | ||
[row] | ||
[column] | ||
grow_factor = 1 | ||
[grid] | ||
[row] | ||
grow_factor = 1 | ||
[column] | ||
border = "all" | ||
border_size = 5 | ||
vertical_alignment = "top" | ||
[listbox] | ||
id = "topic_list" | ||
[list_definition] | ||
[row] | ||
[column] | ||
vertical_grow = true | ||
horizontal_grow = true | ||
grow_factor = 1 | ||
[toggle_panel] | ||
[grid] | ||
[row] | ||
[column] | ||
border = "all" | ||
border_size = 5 | ||
[image] | ||
id = "topic_list_image" | ||
linked_group = "images" | ||
label = "icons/menu-book.png" | ||
[/image] | ||
[/column] | ||
[column] | ||
border = "all" | ||
border_size = 5 | ||
[label] | ||
id = "topic_list_name" | ||
linked_group = "names" | ||
[/label] | ||
[/column] | ||
[column] | ||
border = "all" | ||
border_size = 5 | ||
[spacer] | ||
width = 5 | ||
[/spacer] | ||
[/column] | ||
[/row] | ||
[/grid] | ||
[/toggle_panel] | ||
[/column] | ||
[/row] | ||
[/list_definition] | ||
[/listbox] | ||
[/column] | ||
[column] | ||
[multi_page] | ||
id = "help_text_pages" | ||
[page_definition] | ||
[row] | ||
grow_factor = 1 | ||
[column] | ||
border = "all" | ||
border_size = 5 | ||
vertical_grow = true | ||
[scroll_label] | ||
id = "topic_text" | ||
[/scroll_label] | ||
[/column] | ||
[/row] | ||
[/page_definition] | ||
[/multi_page] | ||
[/column] | ||
[/row] | ||
[/grid] | ||
[/column] | ||
[/row] | ||
[row] | ||
[column] | ||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "right" | ||
[button] | ||
definition=default | ||
id = "close_button" | ||
return_value = 1 | ||
label = _ "Close" | ||
[/button] | ||
[/column] | ||
[/row] | ||
[/grid] | ||
[/resolution] | ||
[/window] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright (C) 2008 - 2015 by Charles Dang <exodia339@gmail.com> | ||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY. | ||
See the COPYING file for more details. | ||
*/ | ||
|
||
#define GETTEXT_DOMAIN "wesnoth-lib" | ||
|
||
#include "gui/dialogs/help_browser.hpp" | ||
|
||
#include "gui/auxiliary/find_widget.tpp" | ||
#include "gui/widgets/button.hpp" | ||
#include "gui/widgets/window.hpp" | ||
#include "gui/widgets/settings.hpp" | ||
#include "gui/widgets/text_box.hpp" | ||
#include "gui/widgets/image.hpp" | ||
#include "gui/widgets/multi_page.hpp" | ||
#include "gui/widgets/scroll_label.hpp" | ||
#include "gui/widgets/settings.hpp" | ||
|
||
#ifdef GUI2_EXPERIMENTAL_LISTBOX | ||
#include "gui/widgets/list.hpp" | ||
#else | ||
#include "gui/widgets/listbox.hpp" | ||
#endif | ||
|
||
#include "help/help.hpp" | ||
|
||
#include <boost/bind.hpp> | ||
|
||
namespace gui2 | ||
{ | ||
|
||
REGISTER_DIALOG(help_browser) | ||
|
||
thelp_browser::thelp_browser(const std::vector<config>& help) | ||
: initial_topic_("introduction") | ||
{ | ||
} | ||
|
||
void thelp_browser::pre_show(CVideo& video, twindow& window) | ||
{ | ||
} | ||
|
||
void thelp_browser::post_show(twindow& window) | ||
{ | ||
} | ||
|
||
} // namespace gui2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
Copyright (C) 2008 - 2015 by Charles Dang <exodia339@gmail.com> | ||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY. | ||
See the COPYING file for more details. | ||
*/ | ||
|
||
#include "gui/dialogs/dialog.hpp" | ||
|
||
#include "config.hpp" | ||
|
||
namespace gui2 | ||
{ | ||
|
||
/** Help browser dialog. */ | ||
class thelp_browser : public tdialog | ||
{ | ||
public: | ||
thelp_browser(const std::vector<config>& help); | ||
|
||
private: | ||
std::string initial_topic_; | ||
|
||
/** Inherited from tdialog, implemented by REGISTER_DIALOG. */ | ||
virtual const std::string& window_id() const; | ||
|
||
/** Inherited from tdialog. */ | ||
void pre_show(CVideo& video, twindow& window); | ||
|
||
/** Inherited from tdialog. */ | ||
void post_show(twindow& window); | ||
}; | ||
|
||
} // namespace gui2 |