Public Member Functions | Data Fields

CheatWindow Struct Reference

GUI for the cheats. More...

Inheritance diagram for CheatWindow:
Window ZeroedMemoryAllocator

Public Member Functions

 CheatWindow (WindowDesc *desc)
virtual void DrawWidget (const Rect &r, int widget) const
 Draw the contents of a nested widget.
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.
virtual void OnClick (Point pt, int widget, int click_count)
 A click with the left mouse button has been made on the window.
virtual void OnTimeout ()
 Called when this window's timeout has been reached.
virtual void OnQueryTextFinished (char *str)
 The query window opened from this window has closed.

Data Fields

int clicked
int header_height

Detailed Description

GUI for the cheats.

Definition at line 173 of file cheat_gui.cpp.


Member Function Documentation

virtual void CheatWindow::DrawWidget ( const Rect r,
int  widget 
) const [inline, virtual]

Draw the contents of a nested widget.

Parameters:
r Rectangle occupied by the widget.
widget Number of the widget to draw.
Note:
This method may not change any state, it may only use drawing functions.

Reimplemented from Window.

Definition at line 182 of file cheat_gui.cpp.

References _current_text_dir, _date, _local_company, CheatEntry::been_used, DrawArrowButtons(), DrawBoolButton(), DrawCompanyIcon(), DrawSprite(), DrawString(), DrawStringMultiLine(), FONT_HEIGHT_NORMAL, GetStringBoundingBox(), lastof, lengthof, ReadValue(), SA_CENTER, SetDParam(), SETTING_BUTTON_WIDTH, CheatEntry::str, CheatEntry::type, CheatEntry::variable, WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP, and WID_C_PANEL.

virtual void CheatWindow::OnClick ( Point  pt,
int  widget,
int  click_count 
) [inline, virtual]

A click with the left mouse button has been made on the window.

Parameters:
pt the point inside the window that has been clicked.
widget the clicked widget.
click_count Number of fast consecutive clicks at same position

Reimplemented from Window.

Definition at line 284 of file cheat_gui.cpp.

References _current_text_dir, CheatEntry::been_used, CHT_CHANGE_DATE, CHT_MONEY, CS_NUMERAL, NWidgetBase::current_x, FONT_HEIGHT_NORMAL, IsInsideMM(), lengthof, NWidgetBase::pos_x, NWidgetBase::pos_y, CheatEntry::proc, QSF_ACCEPT_UNCHANGED, ReadValue(), Window::SetDirty(), SetDParam(), Window::SetTimeout(), SETTING_BUTTON_WIDTH, ShowQueryString(), CheatEntry::type, CheatEntry::variable, WD_FRAMERECT_TOP, WD_PAR_VSEP_NORMAL, and WriteValue().

virtual void CheatWindow::OnQueryTextFinished ( char *  str  )  [inline, virtual]

The query window opened from this window has closed.

Parameters:
str the new value of the string, NULL if the window was cancelled or an empty string when the default button was pressed, i.e. StrEmpty(str).

Reimplemented from Window.

Definition at line 338 of file cheat_gui.cpp.

References CheatEntry::been_used, CheatEntry::proc, ReadValue(), Window::SetDirty(), StrEmpty(), CheatEntry::type, CheatEntry::variable, and WriteValue().

virtual void CheatWindow::UpdateWidgetSize ( int  widget,
Dimension size,
const Dimension padding,
Dimension fill,
Dimension resize 
) [inline, virtual]

Update size and resize step of a widget in the window.

After retrieval of the minimal size and the resize-steps of a widget, this function is called to allow further refinement, typically by computing the real maximal size of the content. Afterwards, size is taken to be the minimal size of the widget and resize is taken to contain the resize steps. For the convenience of the callee, padding contains the amount of padding between the content and the edge of the widget. This should be added to the returned size.

Parameters:
widget Widget number.
size Size of the widget.
padding Recommended amount of space between the widget content and the widget edge.
fill Fill step of the widget.
resize Resize step of the widget.

Reimplemented from Window.

Definition at line 241 of file cheat_gui.cpp.

References ConvertYMDToDate(), FONT_HEIGHT_NORMAL, GetStringBoundingBox(), GetStringHeight(), lengthof, max(), MAX_COMPANIES, MAX_YEAR, SetDParam(), SetDParamMaxValue(), CheatEntry::str, CheatEntry::type, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP, WD_PAR_VSEP_NORMAL, WID_C_PANEL, and Window::width.


The documentation for this struct was generated from the following file: