Public Member Functions | |
virtual void | OnPaint () |
The window must be repainted. | |
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. | |
LandInfoWindow (TileIndex tile) | |
Data Fields | |
char | landinfo_data [LAND_INFO_LINE_END][LAND_INFO_LINE_BUFF_SIZE] |
Private Types | |
enum | { LAND_INFO_CENTERED_LINES = 12, LAND_INFO_MULTICENTER_LINE = LAND_INFO_CENTERED_LINES, LAND_INFO_LINE_END, LAND_INFO_LINE_BUFF_SIZE = 512 } |
Definition at line 78 of file misc_gui.cpp.
anonymous enum [private] |
LAND_INFO_CENTERED_LINES |
Up to 12 centered lines. |
LAND_INFO_MULTICENTER_LINE |
One multicenter line. |
Definition at line 79 of file misc_gui.cpp.
virtual void LandInfoWindow::DrawWidget | ( | const Rect & | r, | |
int | widget | |||
) | const [inline, virtual] |
Draw the contents of a nested widget.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 95 of file misc_gui.cpp.
References DrawString(), DrawStringMultiLine(), FONT_HEIGHT_NORMAL, LAND_INFO_CENTERED_LINES, LAND_INFO_MULTICENTER_LINE, LIW_BACKGROUND, SA_CENTER, SetDParamStr(), StrEmpty(), WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_PAR_VSEP_NORMAL, WD_TEXTPANEL_BOTTOM, and WD_TEXTPANEL_TOP.
virtual void LandInfoWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 90 of file misc_gui.cpp.
References Window::DrawWidgets().
virtual void LandInfoWindow::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.
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 114 of file misc_gui.cpp.
References FONT_HEIGHT_NORMAL, GetStringBoundingBox(), GetStringHeight(), LAND_INFO_CENTERED_LINES, LAND_INFO_MULTICENTER_LINE, LIW_BACKGROUND, max(), min(), SetDParamStr(), StrEmpty(), WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_PAR_VSEP_NORMAL, WD_TEXTPANEL_BOTTOM, WD_TEXTPANEL_TOP, and Window::width.