OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
148 using WindowList = std::list<Window *>;
150 extern Window *_focused_window;
269 enum TooltipCloseCondition {
302 inline void *
operator new[](
size_t size) =
delete;
333 WindowList::iterator z_position;
335 template <
class NWID>
336 inline const NWID *
GetWidget(uint widnum)
const;
337 template <
class NWID>
347 virtual const char *
GetCaret()
const;
389 if (this->nested_array[widget_index] !=
nullptr) this->GetWidget<NWidgetCore>(widget_index)->SetDisabled(disab_stat);
418 return this->GetWidget<NWidgetCore>(widget_index)->IsDisabled();
428 return this->nested_focus !=
nullptr && this->nested_focus->
index == widget_index;
450 this->GetWidget<NWidgetCore>(widget_index)->SetLowered(lowered_stat);
460 bool lowered_state = this->GetWidget<NWidgetCore>(widget_index)->IsLowered();
461 this->GetWidget<NWidgetCore>(widget_index)->SetLowered(!lowered_state);
490 return this->GetWidget<NWidgetCore>(widget_index)->IsLowered();
497 virtual void InsertTextString(
int wid,
const char *str,
bool marked,
const char *caret,
const char *insert_location,
const char *replacement_end);
500 int GetRowFromWidget(
int clickpos,
int widget,
int padding,
int line_height = -1)
const;
513 virtual void Close();
517 void ReInit(
int rx = 0,
int ry = 0);
642 virtual bool OnTooltip(
Point pt,
int widget, TooltipCloseCondition close_cond) {
return false; }
813 template <
bool TtoBack>
818 typedef size_t difference_type;
819 typedef std::forward_iterator_tag iterator_category;
827 bool operator==(
const WindowIterator &other)
const {
return this->it == other.it; }
828 bool operator!=(
const WindowIterator &other)
const {
return !(*
this == other); }
829 Window * operator*()
const {
return *this->it; }
830 WindowIterator & operator++() { this->Next(); this->Validate();
return *
this; }
832 bool IsEnd()
const {
return this->it ==
_z_windows.end(); }
835 WindowList::iterator it;
838 while (!this->IsEnd() && *this->it ==
nullptr) this->Next();
842 if constexpr (!TtoBack) {
858 template <
bool Tfront>
863 if constexpr (Tfront) {
884 template <
class NWID>
888 NWID *nwid =
dynamic_cast<NWID *
>(this->
nested_array[widnum]);
889 assert(nwid !=
nullptr);
895 inline const NWidgetBase *Window::GetWidget<NWidgetBase>(uint widnum)
const
907 template <
class NWID>
910 return const_cast<Window *
>(
this)->GetWidget<NWID>(widnum);
925 void Close()
override;
939 template <
typename Wcls>
943 if (w !=
nullptr)
return return_existing ? w :
nullptr;
944 return new Wcls(desc, window_number);
949 void GuiShowTooltips(
Window *parent,
StringID str, uint paramcount = 0,
const uint64 params[] =
nullptr, TooltipCloseCondition close_tooltip = TCC_HOVER);
954 extern Point _cursorpos_drag_start;
956 extern int _scrollbar_start_pos;
957 extern int _scrollbar_size;
958 extern byte _scroller_click_timeout;
Iterator to iterate all valid Windows.
Data structure for a window viewport.
void Close() override
Hide the window and all its child windows, and mark them for a later deletion.
void SetTimeout()
Set the timeout flag of the window and initiate the timer.
@ WD_FRAMERECT_TOP
Offset at top to draw the frame rectangular area.
@ WD_DEFSIZEBOX_LEFT
Left offset of defsize sprite.
uint32 TileIndex
The index/ID of a Tile.
@ WC_INVALID
Invalid window.
@ WD_RESIZEBOX_BOTTOM
Bottom offset of resize sprite.
uint8 timeout_timer
Timer value of the WF_TIMEOUT for flags.
virtual void OnHundredthTick()
Called once every 100 (game) ticks, or once every 3s, whichever comes last.
@ WD_MATRIX_RIGHT
Offset at right of a matrix cell.
char32_t WChar
Type for wide characters, i.e.
@ WF_SIZING
Window is being resized.
virtual void OnEditboxChanged(int widget)
The text in an editbox has been edited.
void SetWhiteBorder()
Set the timeout flag of the window and initiate the timer.
SortButtonState
State of a sort direction button.
List of hotkeys for a window.
@ WD_STICKYBOX_WIDTH
Width of a standard sticky box widget.
Dimensions (a width and height) of a rectangle in 2D.
virtual ~Window()
Remove window and all its child windows from the window stack.
Wcls * AllocateWindowDescFront(WindowDesc *desc, int window_number, bool return_existing=false)
Open a new window.
void DrawSortButtonState(int widget, SortButtonState state) const
Draw a sort button's up or down arrow symbol.
NWidgetBase * nested_root
Root of the nested tree.
const Scrollbar * GetScrollbar(uint widnum) const
Return the Scrollbar to a widget index.
@ WDF_CONSTRUCTION
This window is used for construction; close it whenever changing company.
bool _scrolling_viewport
A viewport is being scrolled with the mouse.
NWidgetStacked * shade_select
Selection widget (NWID_SELECTION) to use for shading the window. If nullptr, window cannot shade.
@ WD_SHADEBOX_BOTTOM
Bottom offset of shade sprite.
@ WF_SIZING_RIGHT
Window is being resized towards the right.
virtual void OnHover(Point pt, int widget)
The mouse is hovering over a widget in the window, perform an action for it.
virtual void ApplyDefaults()
Read default values from WindowDesc configuration an apply them to the window.
void ReInit(int rx=0, int ry=0)
Re-initialize a window, and optionally change its size.
virtual void DrawWidget(const Rect &r, int widget) const
Draw the contents of a nested widget.
ViewportDragDropSelectionProcess
Drag and drop selection process, or, what to do with an area of land when you've selected it.
@ WD_MATRIX_TOP
Offset at top of a matrix cell.
void ScrollbarClickHandler(Window *w, NWidgetCore *nw, int x, int y)
Special handling for the scrollbar widget type.
void InitializePositionSize(int x, int y, int min_width, int min_height)
Set the position and smallest size of the window.
WindowList _z_windows
List of windows opened at the screen sorted from the front to back.
@ WF_DISABLE_VP_SCROLL
Window does not do autoscroll,.
ViewportData * viewport
Pointer to viewport data, if present.
@ WD_STICKYBOX_TOP
Top offset of sticky sprite.
int32 scrollpos_y
Currently shown y coordinate (virtual screen coordinate of topleft corner of the viewport).
FrameFlags
Flags to describe the look of the frame.
void CreateNestedTree(bool fill_nested=true)
Perform the first part of the initialization of a nested widget tree.
@ WDP_ALIGN_TOOLBAR
Align toward the toolbar.
virtual void OnGameTick()
Called once per (game) tick.
@ WD_CLOSEBOX_RIGHT
Right offset of closebox string.
virtual bool IsNewGRFInspectable() const
Is the data related to this window NewGRF inspectable?
@ WF_STICKY
Window is made sticky by user.
WidgetDrawDistances
Distances used in drawing widgets.
@ WDF_NO_FOCUS
This window won't get focus/make any other window lose focus when click.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
virtual void OnInvalidateData(int data=0, bool gui_scope=true)
Some data on this window has become invalid.
void RaiseButtons(bool autoraise=false)
Raise the buttons of the window.
@ WD_FRAMETEXT_TOP
Top offset of the text of the frame.
@ WD_SCROLLBAR_RIGHT
Right offset of scrollbar.
StringAlignment
How to align the to-be drawn text.
@ WD_DEFSIZEBOX_BOTTOM
Bottom offset of defsize sprite.
void SetWidgetHighlight(byte widget_index, TextColour highlighted_colour)
Sets the highlighted status of a widget.
WindowClass cls
Class of the window,.
virtual void OnTimeout()
Called when this window's timeout has been reached.
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable.
virtual void OnDropdownClose(Point pt, int widget, int index, bool instant_close)
A dropdown window associated to this window has been closed.
int32 WindowNumber
Number to differentiate different windows of the same class.
@ FR_LOWERED
If set the frame is lowered and the background colour brighter (ie. buttons when pressed)
ViewportPlaceMethod
Viewport place method (type of highlighted area and placed objects)
@ WD_DEBUGBOX_LEFT
Left offset of debug sprite.
void HandleButtonClick(byte widget)
Do all things to make a button look clicked and mark it to be unclicked in a few ticks.
virtual Point GetCaretPosition() const
Get the current caret position if an edit box has the focus.
Owner
Enum for all companies/owners.
@ WD_FRAMETEXT_LEFT
Left offset of the text of the frame.
@ FR_TRANSPARENT
Makes the background transparent if set.
virtual EventState OnHotkey(int hotkey)
A hotkey has been pressed.
Window(WindowDesc *desc)
Empty constructor, initialization has been moved to InitNested() called from the constructor of the d...
const NWidgetCore * nested_focus
Currently focused nested widget, or nullptr if no nested widget has focus.
Data stored about a string that can be modified in the GUI.
std::vector< int > scheduled_invalidation_data
Data of scheduled OnInvalidateData() calls.
bool IsWidgetHighlighted(byte widget_index) const
Gets the highlighted status of a widget.
virtual const char * GetCaret() const
Get the string at the caret if an edit box has the focus.
@ WD_IMGBTN_BOTTOM
Bottom offset of image in the button.
@ WD_INSET_TOP
Top offset of string.
virtual EventState OnCTRLStateChange()
The state of the control key has changed.
virtual const char * GetTextCharacterAtPosition(const Point &pt) const
Get the character that is rendered at a position by the focused edit box.
SmallMap< int, QueryString * > querystrings
QueryString associated to WWT_EDITBOX widgets.
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
The user has dragged over the map when the tile highlight mode has been set.
void ProcessScheduledInvalidations()
Process all scheduled invalidations.
int16 default_width_trad
Preferred initial width of the window (pixels at 1x zoom).
WindowPosition default_pos
Preferred position of the window.
High level window description.
void SetFocusedWindow(Window *w)
Set the window that has the focus.
virtual void SetStringParameters(int widget) const
Initialize string parameters for a widget.
@ WF_SIZING_LEFT
Window is being resized towards the left.
void SetShaded(bool make_shaded)
Set the shaded state of the window to make_shaded.
const NWID * GetWidget(uint widnum) const
Get the nested widget with number widnum from the nested widget tree.
void DrawCaption(const Rect &r, Colours colour, Owner owner, TextColour text_colour, StringID str, StringAlignment align)
Draw a caption bar.
virtual void OnFocusLost()
Called when window loses focus.
Data structure for viewport, display of a part of the world.
bool _mouse_hovering
The mouse is hovering over the same point.
void UnfocusFocusedWidget()
Makes no widget on this window have focus.
@ WDP_AUTO
Find a place automatically.
const char * ini_key
Key to store window defaults in openttd.cfg. nullptr if nothing shall be stored.
@ WD_RESIZEBOX_RIGHT
Right offset of resize sprite.
ResizeInfo resize
Resize information.
@ WSM_PRESIZE
Presizing mode (docks, tunnels).
@ WD_SHADEBOX_RIGHT
Right offset of shade sprite.
void EnableWidget(byte widget_index)
Sets a widget to Enabled.
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
void ProcessHighlightedInvalidations()
Process all invalidation of highlighted widgets.
@ WD_CLOSEBOX_TOP
Top offset of closebox string.
int height
Height of the window (number of pixels down in y direction)
@ WF_CENTERED
Window is centered and shall stay centered after ReInit.
@ WF_WHITE_BORDER
Window white border counter bit mask.
SpecialMouseMode
Mouse modes.
@ WD_INSET_RIGHT
Right offset of string.
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
Point GetToolbarAlignedWindowPosition(int window_width)
Computer the position of the top-left corner of a window to be opened right under the toolbar.
@ WD_FRAMERECT_LEFT
Offset at left to draw the frame rectangular area.
virtual void OnFocus()
Called when window gains focus.
@ WD_PAR_VSEP_NORMAL
Normal amount of vertical space between two paragraphs of text.
@ WD_FRAMERECT_RIGHT
Offset at right to draw the frame rectangular area.
Base class that provides memory initialization on dynamically created objects.
@ ES_NOT_HANDLED
The passed event is not handled.
@ WD_FRAMERECT_BOTTOM
Offset at bottom to draw the frame rectangular area.
@ WD_DEFSIZEBOX_RIGHT
Right offset of defsize sprite.
@ WD_FRAMETEXT_BOTTOM
Bottom offset of the text of the frame.
virtual bool OnVehicleSelect(const struct Vehicle *v)
The user clicked on a vehicle while HT_VEHICLE has been set.
EventState HandleEditBoxKey(int wid, WChar key, uint16 keycode)
Process keypress for editbox widget.
void DisableAllWidgetHighlight()
Disable the highlighted status of all widgets.
virtual void OnPlaceObject(Point pt, TileIndex tile)
The user clicked some place on the map when a tile highlight mode has been set.
virtual void OnDropdownSelect(int widget, int index)
A dropdown option associated to this window has been selected.
const QueryString * GetQueryString(uint widnum) const
Return the querystring associated to a editbox.
int16 GetDefaultWidth() const
Determine default width of window.
void SetWidgetDisabledState(byte widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
static void DeleteClosedWindows()
Delete all closed windows.
Window * parent
Parent window.
@ WD_STICKYBOX_RIGHT
Right offset of sticky sprite.
bool IsWidgetGloballyFocused(byte widget_index) const
Check if given widget has user input focus.
int left
x position of left edge of the window
virtual void OnDragDrop(Point pt, int widget)
A dragged 'object' has been released.
WindowFlags flags
Window flags.
void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, FrameFlags flags)
Draw frame rectangle.
@ WF_TIMEOUT
Window timeout counter.
@ WD_INSET_LEFT
Left offset of string.
WindowClass
Window classes.
virtual void ShowNewGRFInspectWindow() const
Show the NewGRF inspection window.
int16 default_height_trad
Preferred initial height of the window (pixels at 1x zoom).
int GetWidgetFromPos(const Window *w, int x, int y)
Returns the index for the widget located at the given position relative to the window.
@ WD_DEBUGBOX_RIGHT
Right offset of debug sprite.
@ WDF_MODAL
The window is a modal child of some other window, meaning the parent is 'inactive'.
int16 GetDefaultHeight() const
Determine default height of window.
static const int TIMEOUT_DURATION
The initial timeout value for WF_TIMEOUT.
Coordinates of a point in 2D.
@ WF_HIGHLIGHTED
Window has a widget that has a highlight.
const NWidgetPart * nwid_parts
Nested widget parts describing the window.
WindowDefaultFlag
Window default widget/window handling flags.
int32 dest_scrollpos_y
Current destination y coordinate to display (virtual screen coordinate of topleft corner of the viewp...
bool IsWidgetFocused(byte widget_index) const
Check if given widget is focused within this window.
@ WSM_DRAGDROP
Drag&drop an object.
virtual void OnInit()
Notification that the nested widget tree gets initialized.
Dimension unshaded_size
Last known unshaded size (only valid while shaded).
static void SaveToConfig()
Save all WindowDesc settings to _windows_file.
@ WD_FRAMETEXT_RIGHT
Right offset of the text of the frame.
bool SetFocusedWidget(int widget_index)
Set focus within this window to the given widget.
WindowNumber window_number
Window number within the window class.
@ WD_DROPDOWNTEXT_RIGHT
Right offset of the dropdown widget string.
@ WD_SCROLLBAR_LEFT
Left offset of scrollbar.
uint step_height
Step-size of height resize changes.
WindowDesc(WindowPosition default_pos, const char *ini_key, int16 def_width_trad, int16 def_height_trad, WindowClass window_class, WindowClass parent_class, uint32 flags, const NWidgetPart *nwid_parts, int16 nwid_length, HotkeyList *hotkeys=nullptr)
Window description constructor.
void InvalidateData(int data=0, bool gui_scope=true)
Mark this window's data as invalid (in need of re-computing)
int mouse_capture_widget
Widgetindex of current mouse capture widget (e.g. dragged scrollbar). -1 if no widget has mouse captu...
Iterable ensemble of all valid Windows.
NWidgetBase ** nested_array
Array of pointers into the tree. Do not access directly, use Window::GetWidget() instead.
virtual void OnPlacePresize(Point pt, TileIndex tile)
The user moves over the map when a tile highlight mode has been set when the special mouse mode has b...
@ WD_SHADEBOX_TOP
Top offset of shade sprite.
@ WD_SCROLLBAR_BOTTOM
Bottom offset of scrollbar.
@ WD_DROPDOWNTEXT_TOP
Top offset of the dropdown widget string.
@ WD_SHADEBOX_LEFT
Left offset of shade sprite.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
virtual void OnClick(Point pt, int widget, int click_count)
A click with the left mouse button has been made on the window.
@ SBS_DOWN
Sort ascending.
int32 scrollpos_x
Currently shown x coordinate (virtual screen coordinate of topleft corner of the viewport).
virtual void OnMouseLoop()
Called for every mouse loop run, which is at least once per (game) tick.
@ WD_DROPDOWN_HEIGHT
Height of a drop down widget.
int16 nwid_length
Length of the nwid_parts array.
uint step_width
Step-size of width resize changes.
virtual void OnMouseWheel(int wheel)
The mouse wheel has been turned.
bool IsShaded() const
Is window shaded currently?
virtual void OnPlaceObjectAbort()
The user cancelled a tile highlight mode that has been set.
Data structure for resizing a window.
@ WD_CLOSEBOX_WIDTH
Width of a close box widget.
void GuiShowTooltips(Window *parent, StringID str, uint paramcount=0, const uint64 params[]=nullptr, TooltipCloseCondition close_tooltip=TCC_HOVER)
Shows a tooltip.
static std::vector< Window * > closed_windows
List of closed windows to delete.
void CloseChildWindows(WindowClass wc=WC_INVALID) const
Close all children a window might have in a head-recursive manner.
@ WD_BEVEL_RIGHT
Width of right bevel border.
void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets,...)
Sets the lowered/raised status of a list of widgets.
@ WD_CAPTIONTEXT_TOP
Offset of the caption text at the top.
virtual bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond)
Event to display a custom tooltip.
@ WD_DEFSIZEBOX_WIDTH
Width of a standard defsize box widget.
@ WD_SHADEBOX_WIDTH
Width of a standard shade box widget.
@ WD_DEBUGBOX_WIDTH
Width of a standard debug box widget.
virtual Rect GetTextBoundingRect(const char *from, const char *to) const
Get the bounding rectangle for a text range if an edit box has the focus.
@ WD_DEBUGBOX_BOTTOM
Bottom offset of debug sprite.
@ WD_SCROLLBAR_TOP
Top offset of scrollbar.
virtual void OnPaint()
The window must be repainted.
void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets,...)
Sets the enabled/disabled status of a list of widgets.
bool IsWidgetLowered(byte widget_index) const
Gets the lowered state of a widget.
virtual void OnMouseOver(Point pt, int widget)
The mouse is currently moving over the window or has just moved outside of the window.
EventState
State of handling an event.
bool pref_sticky
Preferred stickyness.
@ WF_DRAGGING
Window is being dragged.
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
Update size and resize step of a widget in the window.
@ WD_IMGBTN_TOP
Top offset of image in the button.
@ WD_RESIZEBOX_WIDTH
Width of a resize box widget.
@ WSM_DRAGGING
Dragging mode (trees).
WindowClass window_class
Window class.
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
@ WD_STICKYBOX_BOTTOM
Bottom offset of sticky sprite.
Base class for windows opened from a toolbar.
SpecialMouseMode _special_mouse_mode
Mode of the mouse.
int top
y position of top edge of the window
void DrawViewport() const
Draw the viewport of this window.
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
uint32 VehicleID
The type all our vehicle IDs have.
static const int WHITE_BORDER_DURATION
The initial timeout value for WF_WHITE_BORDER.
@ WD_BEVEL_TOP
Height of top bevel border.
virtual void OnMouseDrag(Point pt, int widget)
An 'object' is being dragged at the provided position, highlight the target if possible.
@ WD_BEVEL_LEFT
Width of left bevel border.
VehicleID follow_vehicle
VehicleID to follow if following a vehicle, INVALID_VEHICLE otherwise.
@ WD_MATRIX_BOTTOM
Offset at bottom of a matrix cell.
virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
Compute the initial position of the window.
void ToggleWidgetLoweredState(byte widget_index)
Invert the lowered/raised status of a widget.
int width
width of the window (number of pixels to the right in x direction)
static void LoadFromConfig()
Load all WindowDesc settings from _windows_file.
void RelocateAllWindows(int neww, int newh)
Relocate all windows to fit the new size of the game application screen.
int32 dest_scrollpos_x
Current destination x coordinate to display (virtual screen coordinate of topleft corner of the viewp...
@ WD_CAPTIONTEXT_BOTTOM
Offset of the caption text at the bottom.
@ WDP_MANUAL
Manually align the window (so no automatic location finding)
static int SortButtonWidth()
Get width of up/down arrow of sort button state.
@ FR_DARKENED
If set the background is darker, allows for lowered frames with normal background colour when used wi...
@ WD_RESIZEBOX_TOP
Top offset of resize sprite.
virtual void InsertTextString(int wid, const char *str, bool marked, const char *caret, const char *insert_location, const char *replacement_end)
Insert a text string at the cursor position into the edit box widget.
WindowDesc * window_desc
Window description.
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
The user is dragging over the map when the tile highlight mode has been set.
virtual void OnRealtimeTick(uint delta_ms)
Called periodically.
@ WD_DEBUGBOX_TOP
Top offset of debug sprite.
@ WD_CAPTION_HEIGHT
Height of a title bar.
@ WD_DROPDOWNTEXT_BOTTOM
Bottom offset of the dropdown widget string.
WindowClass parent_cls
Class of the parent window.
Data structure for an opened window.
@ WD_CAPTIONTEXT_LEFT
Offset of the caption text at the left.
void RaiseWidget(byte widget_index)
Marks a widget as raised.
@ WD_MATRIX_LEFT
Offset at left of a matrix cell.
void DrawWidgets() const
Paint all widgets of a window.
Window * FindWindowFromPt(int x, int y)
Do a search for a window at specific coordinates.
virtual bool OnRightClick(Point pt, int widget)
A click with the right mouse button has been made on the window.
virtual void OnQueryTextFinished(char *str)
The query window opened from this window has closed.
virtual void OnScroll(Point delta)
Handle the request for (viewport) scrolling.
@ WD_DROPDOWNTEXT_LEFT
Left offset of the dropdown widget string.
@ WD_IMGBTN_LEFT
Left offset of the image in the button.
@ SBS_OFF
Do not sort (with this button).
uint nested_array_size
Size of the nested array.
bool IsWidgetDisabled(byte widget_index) const
Gets the enabled/disabled status of a widget.
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
Specification of a rectangle with absolute coordinates of all edges.
void LowerWidget(byte widget_index)
Marks a widget as lowered.
@ WD_CLOSEBOX_BOTTOM
Bottom offset of closebox string.
virtual const char * GetMarkedText(size_t *length) const
Get the range of the currently marked input text.
int GetRowFromWidget(int clickpos, int widget, int padding, int line_height=-1) const
Compute the row of a widget that a user clicked in.
virtual void OnResize()
Called after the window got resized.
void DisableWidget(byte widget_index)
Sets a widget to disabled.
@ WD_BEVEL_BOTTOM
Height of bottom bevel border.
HotkeyList * hotkeys
Hotkeys for the window.
@ WD_PAR_VSEP_WIDE
Large amount of vertical space between two paragraphs of text.
WindowPosition
How do we the window to be placed?
@ WD_IMGBTN_RIGHT
Right offset of the image in the button.
@ WDP_CENTER
Center the window.
void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
int16 pref_height
User-preferred height of the window. Zero if unset.
@ WD_CLOSEBOX_LEFT
Left offset of closebox string.
uint8 white_border_timer
Timer value of the WF_WHITE_BORDER for flags.
@ WD_TEXTPANEL_BOTTOM
Offset at bottom to draw below the text.
@ WD_RESIZEBOX_LEFT
Left offset of resize sprite.
@ WSM_NONE
No special mouse mode.
@ WD_STICKYBOX_LEFT
Left offset of sticky sprite.
int16 pref_width
User-preferred width of the window. Zero if unset.
void InitializeData(WindowNumber window_number)
Initializes the data (except the position and initial size) of a new Window.
@ FR_BORDERONLY
Draw border only, no background.
virtual const char * GetFocusedText() const
Get the current input text if an edit box has the focus.
@ WD_CAPTIONTEXT_RIGHT
Offset of the caption text at the right.
@ WD_TEXTPANEL_TOP
Offset at top to draw above the text.
virtual void FindWindowPlacementAndResize(int def_width, int def_height)
Resize window towards the default size.
@ WD_DEFSIZEBOX_TOP
Top offset of defsize sprite.
virtual EventState OnKeyPress(WChar key, uint16 keycode)
A key has been pressed.
virtual void Close()
Hide the window and all its child windows, and mark them for a later deletion.
Window * BringWindowToFrontById(WindowClass cls, WindowNumber number)
Find a window and make it the relative top-window on the screen.