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 "hotkeys.h"
#include "table/strings.h"
#include "table/sprites.h"

Go to the source code of this file.

Data Structures

struct  FilterInfo
 Contains the necessary information to decide if a sign should be filtered out or not. More...
struct  SignList
struct  SignListWindow
struct  SignWindow

Enumerations

enum  SignListWidgets {
  SLW_CAPTION, SLW_LIST, SLW_SCROLLBAR, SLW_FILTER_TEXT,
  SLW_FILTER_MATCH_CASE_BTN, SLW_FILTER_CLEAR_BTN
}
 

Enum referring to the widgets in the sign list window.

More...
enum  SignListHotkeys { SLHK_FOCUS_FILTER_BOX }
 

Enum referring to the Hotkeys in the sign list window.

More...
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

WindowShowSignList ()
 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)
void ShowRenameSignWindow (const Sign *si)
void DeleteRenameSignWindow (SignID sign)

Variables

Hotkey< SignListWindow > * _signlist_hotkeys = SignListWindow::signlist_hotkeys
static const NWidgetPart _nested_sign_list_widgets []
static const WindowDesc _sign_list_desc (WDP_AUTO, 358, 138, WC_SIGN_LIST, WC_NONE, WDF_UNCLICK_BUTTONS, _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

Widget numbers of the query sign edit window.

Definition at line 466 of file signs_gui.cpp.

Enum referring to the Hotkeys in the sign list window.

Enumerator:
SLHK_FOCUS_FILTER_BOX 

Focus the edit box for editing the filter string.

Definition at line 141 of file signs_gui.cpp.

Enum referring to the widgets in the sign list window.

Enumerator:
SLW_FILTER_TEXT 

Text box for typing a filter string.

SLW_FILTER_MATCH_CASE_BTN 

Button to toggle if case sensitive filtering should be used.

SLW_FILTER_CLEAR_BTN 

Button to clear the filter.

Definition at line 131 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 458 of file signs_gui.cpp.

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

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

Window* ShowSignList (  ) 

Open the sign list window.

Returns:
newly opened sign list window, or NULL if the window could not be opened.

Definition at line 438 of file signs_gui.cpp.

Referenced by MainToolbarWindow::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(WWT_PUSHARROWBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_PREVIOUS), SetMinimalSize(11, 12), SetDataTip(AWV_DECREASE, STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP),
    NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_NEXT), SetMinimalSize(11, 12), SetDataTip(AWV_INCREASE, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP),
  EndContainer(),
}

Definition at line 616 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(NWID_VERTICAL),
      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), SetScrollbar(SLW_SCROLLBAR), EndContainer(),
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1),
          NWidget(WWT_EDITBOX, COLOUR_GREY, SLW_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, SLW_FILTER_MATCH_CASE_BTN), SetDataTip(STR_SIGN_LIST_MATCH_CASE, STR_SIGN_LIST_MATCH_CASE_TOOLTIP),
        NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, SLW_FILTER_CLEAR_BTN), SetDataTip(STR_SIGN_LIST_CLEAR, STR_SIGN_LIST_CLEAR_TOOLTIP),
      EndContainer(),
    EndContainer(),
    NWidget(NWID_VERTICAL),
      NWidget(NWID_VERTICAL), SetFill(0, 1),
        NWidget(NWID_VSCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR),
      EndContainer(),
      NWidget(WWT_RESIZEBOX, COLOUR_GREY),
    EndContainer(),
  EndContainer(),
}

Definition at line 397 of file signs_gui.cpp.


Generated on Sun May 15 19:20:28 2011 for OpenTTD by  doxygen 1.6.1