# signs_gui.cpp File Reference

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 "gfx_func.h"`
`#include "viewport_func.h"`
`#include "querystring_gui.h"`
`#include "sortlist_type.h"`
`#include "string_func.h"`
`#include "core/geometry_func.hpp"`
`#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 | SignListWidgets { SLW_CAPTION, SLW_LIST, SLW_SCROLLBAR }
| Enum referring to the widgets of the sign list window.
enum | QueryEditSignWidgets { QUERY_EDIT_SIGN_WIDGET_CAPTION, QUERY_EDIT_SIGN_WIDGET_TEXT, QUERY_EDIT_SIGN_WIDGET_OK, QUERY_EDIT_SIGN_WIDGET_CANCEL, QUERY_EDIT_SIGN_WIDGET_DELETE, QUERY_EDIT_SIGN_WIDGET_PREVIOUS, QUERY_EDIT_SIGN_WIDGET_NEXT }
| Widget numbers of the query sign edit window. More...
## Functions
void | ShowSignList ()
static bool | RenameSign (SignID index, const char *text)
| Actually rename the sign.
void | HandleClickOnSign (const Sign *si)
void | ShowRenameSignWindow (const Sign *si)
void | DeleteRenameSignWindow (SignID sign)
## Variables
static const NWidgetPart | _nested_sign_list_widgets []
static const WindowDesc | _sign_list_desc (WDP_AUTO, 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 const WindowDesc | _query_sign_edit_desc (WDP_AUTO, 0, 0, WC_QUERY_STRING, WC_NONE, WDF_CONSTRUCTION|WDF_UNCLICK_BUTTONS, _nested_query_sign_edit_widgets, lengthof(_nested_query_sign_edit_widgets))

## Detailed Description

The GUI for signs.

Definition in file signs_gui.cpp.

## Enumeration Type Documentation

enum QueryEditSignWidgets

Widget numbers of the query sign edit window.

Definition at line 246 of file signs_gui.cpp.

## Function Documentation

static bool RenameSign | ( | SignID | index,
|  | const char * | text |
| ) |  |  | `[static]`

Actually rename the sign.

Parameters:

  | index | the sign to rename.
  | text | the new name.

Returns:
  true if the window will already be removed after returning.

Definition at line 238 of file signs_gui.cpp.

References CMD_MSG, CMD_RENAME_SIGN, DoCommandP(), and StrEmpty().

Referenced by SignWindow::OnClick(), and SignWindow::OnKeyPress().

## Variable Documentation

const NWidgetPart _nested_query_sign_edit_widgets[]`[static]`

Initial value:

     {
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_CLOSEBOX, COLOUR_GREY),
        NWidget(WWT_CAPTION, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
      EndContainer(),
      NWidget(WWT_PANEL, COLOUR_GREY),
        NWidget(WWT_EDITBOX, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_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, QUERY_EDIT_SIGN_WIDGET_OK), SetMinimalSize(61, 12), SetDataTip(STR_BUTTON_OK, STR_NULL),
        NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_CANCEL), SetMinimalSize(60, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
        NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_DELETE), SetMinimalSize(60, 12), SetDataTip(STR_TOWN_VIEW_DELETE_BUTTON, STR_NULL),
        NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), EndContainer(),
        NWidget(NWID_BUTTON_ARROW, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_PREVIOUS), SetMinimalSize(11, 12), SetDataTip(AWV_DECREASE, STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP),
        NWidget(NWID_BUTTON_ARROW, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_NEXT), SetMinimalSize(11, 12), SetDataTip(AWV_INCREASE, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP),
      EndContainer(),
    }

Definition at line 396 of file signs_gui.cpp.

const NWidgetPart _nested_sign_list_widgets[]`[static]`

Initial value:

     {
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_CLOSEBOX, COLOUR_GREY),
        NWidget(WWT_CAPTION, COLOUR_GREY, SLW_CAPTION), SetDataTip(STR_SIGN_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
        NWidget(WWT_SHADEBOX, COLOUR_GREY),
        NWidget(WWT_STICKYBOX, COLOUR_GREY),
      EndContainer(),
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_PANEL, COLOUR_GREY, SLW_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + MAX_LENGTH_SIGN_NAME_PIXELS + WD_FRAMETEXT_RIGHT, 50),
                  SetResize(1, 10), SetFill(1, 0), EndContainer(),
        NWidget(NWID_VERTICAL),
          NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR),
          NWidget(WWT_RESIZEBOX, COLOUR_GREY),
        EndContainer(),
      EndContainer(),
    }

Definition at line 202 of file signs_gui.cpp.