CheatWindow Struct Reference

Inheritance diagram for CheatWindow:
Window ZeroedMemoryAllocator

Public Member Functions

 CheatWindow (const 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 OnPaint ()
 The window must be repainted.
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.

Data Fields

int clicked
int header_height

Detailed Description

Definition at line 149 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 158 of file cheat_gui.cpp.

References _date, _dynlang, CheatEntry::been_used, DrawArrowButtons(), DrawFrameRect(), DrawSprite(), DrawString(), DrawStringMultiLine(), FONT_HEIGHT_NORMAL, FR_LOWERED, GetStringBoundingBox(), lastof, lengthof, ReadValue(), SA_CENTER, SetDParam(), CheatEntry::str, TD_RTL, DynamicLanguages::text_dir, CheatEntry::type, CheatEntry::variable, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP, and WD_PAR_VSEP_NORMAL.

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 274 of file cheat_gui.cpp.

References _dynlang, CheatEntry::been_used, NWidgetBase::current_x, Window::flags4, FONT_HEIGHT_NORMAL, IsInsideMM(), lengthof, NWidgetBase::pos_x, NWidgetBase::pos_y, CheatEntry::proc, ReadValue(), Window::SetDirty(), TD_RTL, DynamicLanguages::text_dir, CheatEntry::type, CheatEntry::variable, WD_FRAMERECT_TOP, WD_PAR_VSEP_NORMAL, WF_TIMEOUT_BEGIN, and WriteValue().

virtual void CheatWindow::OnPaint (  )  [inline, virtual]

The window must be repainted.

Note:
This method should not change any state, it should only use drawing functions.

Reimplemented from Window.

Definition at line 269 of file cheat_gui.cpp.

References Window::DrawWidgets().

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 218 of file cheat_gui.cpp.

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


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

Generated on Mon Aug 30 19:37:30 2010 for OpenTTD by  doxygen 1.6.1