The GUI for signs. More...
#include "stdafx.h"
#include "company_gui.h"
#include "company_func.h"
#include "signs_base.h"
#include "signs_func.h"
#include "debug.h"
#include "command_func.h"
#include "strings_func.h"
#include "window_func.h"
#include "map_func.h"
#include "viewport_func.h"
#include "querystring_gui.h"
#include "sortlist_type.h"
#include "stringfilter_type.h"
#include "string_func.h"
#include "core/geometry_func.hpp"
#include "hotkeys.h"
#include "transparency.h"
#include "widgets/sign_widget.h"
#include "table/strings.h"
#include "table/sprites.h"
Go to the source code of this file.
Data Structures | |
struct | SignList |
struct | SignListWindow |
struct | SignWindow |
Enumerations | |
enum | SignListHotkeys { SLHK_FOCUS_FILTER_BOX } |
Enum referring to the Hotkeys in the sign list window. More... | |
Functions | |
Window * | ShowSignList () |
Open the sign list window. | |
EventState | SignListGlobalHotkeys (uint16 key, uint16 keycode) |
static bool | RenameSign (SignID index, const char *text) |
Actually rename the sign. | |
void | HandleClickOnSign (const Sign *si) |
Handle clicking on a sign. | |
void | ShowRenameSignWindow (const Sign *si) |
Show the window to change the text of a sign. | |
void | DeleteRenameSignWindow (SignID sign) |
Close the sign window associated with the given sign. | |
Variables | |
Hotkey< SignListWindow > * | _signlist_hotkeys = SignListWindow::signlist_hotkeys |
static const NWidgetPart | _nested_sign_list_widgets [] |
static WindowDesc | _sign_list_desc (WDP_AUTO,"list_signs", 358, 138, WC_SIGN_LIST, WC_NONE, 0, _nested_sign_list_widgets, lengthof(_nested_sign_list_widgets)) |
static const NWidgetPart | _nested_query_sign_edit_widgets [] |
static WindowDesc | _query_sign_edit_desc (WDP_AUTO,"query_sign", 0, 0, WC_QUERY_STRING, WC_NONE, WDF_CONSTRUCTION, _nested_query_sign_edit_widgets, lengthof(_nested_query_sign_edit_widgets)) |
The GUI for signs.
Definition in file signs_gui.cpp.
enum SignListHotkeys |
Enum referring to the Hotkeys in the sign list window.
Definition at line 143 of file signs_gui.cpp.
void DeleteRenameSignWindow | ( | SignID | sign | ) |
Close the sign window associated with the given sign.
sign | The sign to close the window for. |
Definition at line 571 of file signs_gui.cpp.
References FindWindowById(), WC_QUERY_STRING, and WN_QUERY_STRING_SIGN.
Referenced by Sign::~Sign().
void HandleClickOnSign | ( | const Sign * | si | ) |
Handle clicking on a sign.
si | The sign that was clicked on. |
Definition at line 546 of file signs_gui.cpp.
References _ctrl_pressed, _local_company, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, OWNER_DEITY, RenameSign(), and ShowRenameSignWindow().
static bool RenameSign | ( | SignID | index, | |
const char * | text | |||
) | [static] |
Actually rename the sign.
index | the sign to rename. | |
text | the new name. |
Definition at line 405 of file signs_gui.cpp.
References CMD_MSG, CMD_RENAME_SIGN, DoCommandP(), and StrEmpty().
Referenced by HandleClickOnSign().
void ShowRenameSignWindow | ( | const Sign * | si | ) |
Show the window to change the text of a sign.
si | The sign to show the window for. |
Definition at line 559 of file signs_gui.cpp.
References DeleteWindowByClass(), and WC_QUERY_STRING.
Referenced by CcPlaceSign(), and HandleClickOnSign().
Window* ShowSignList | ( | ) |
Open the sign list window.
Definition at line 385 of file signs_gui.cpp.
Referenced by MenuClickMap(), and MainToolbarWindow::OnKeyPress().
const NWidgetPart _nested_query_sign_edit_widgets[] [static] |
{ NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, WID_QES_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_EDITBOX, COLOUR_GREY, WID_QES_TEXT), SetMinimalSize(256, 12), SetDataTip(STR_EDIT_SIGN_SIGN_OSKTITLE, STR_NULL), SetPadding(2, 2, 2, 2), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_QES_OK), SetMinimalSize(61, 12), SetDataTip(STR_BUTTON_OK, STR_NULL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_QES_CANCEL), SetMinimalSize(60, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_QES_DELETE), SetMinimalSize(60, 12), SetDataTip(STR_TOWN_VIEW_DELETE_BUTTON, STR_NULL), NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), EndContainer(), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_QES_PREVIOUS), SetMinimalSize(11, 12), SetDataTip(AWV_DECREASE, STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_QES_NEXT), SetMinimalSize(11, 12), SetDataTip(AWV_INCREASE, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP), EndContainer(), }
Definition at line 517 of file signs_gui.cpp.
const NWidgetPart _nested_sign_list_widgets[] [static] |
{ NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, WID_SIL_CAPTION), SetDataTip(STR_SIGN_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_DEFSIZEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_VERTICAL), NWidget(WWT_PANEL, COLOUR_GREY, WID_SIL_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + 255 + WD_FRAMETEXT_RIGHT, 50), SetResize(1, 10), SetFill(1, 0), SetScrollbar(WID_SIL_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SIL_FILTER_TEXT), SetMinimalSize(80, 12), SetResize(1, 0), SetFill(1, 0), SetPadding(2, 2, 2, 2), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), EndContainer(), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_SIL_FILTER_MATCH_CASE_BTN), SetDataTip(STR_SIGN_LIST_MATCH_CASE, STR_SIGN_LIST_MATCH_CASE_TOOLTIP), EndContainer(), EndContainer(), NWidget(NWID_VERTICAL), NWidget(NWID_VERTICAL), SetFill(0, 1), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_SIL_SCROLLBAR), EndContainer(), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), EndContainer(), }
Definition at line 344 of file signs_gui.cpp.