IConsoleWindow Struct Reference

Inheritance diagram for IConsoleWindow:
Window ZeroedMemoryAllocator

Public Member Functions

void Scroll (int amount)
 Scroll the content of the console.
virtual void OnPaint ()
 The window must be repainted.
virtual void OnHundredthTick ()
 Called once every 100 (game) ticks.
virtual void OnMouseLoop ()
 Called for every mouse loop run, which is at least once per (game) tick.
virtual EventState OnKeyPress (uint16 key, uint16 keycode)
 A key has been pressed.
virtual void OnMouseWheel (int wheel)
 The mouse wheel has been turned.

Data Fields

int line_height
 Height of one line of text in the console.
int line_offset

Static Public Attributes

static int scroll = 0

Detailed Description

Definition at line 171 of file console_gui.cpp.


Member Function Documentation

virtual EventState IConsoleWindow::OnKeyPress ( uint16  key,
uint16  keycode 
) [inline, virtual]

A key has been pressed.

Parameters:
key the Unicode value of the key.
keycode the untranslated key code including shift state.
Returns:
ES_HANDLED if the key press has been handled and no other window should receive the event.

Reimplemented from Window.

Definition at line 242 of file console_gui.cpp.

References Textbuf::buf, CC_COMMAND, CS_ALPHANUMERAL, DeleteTextBufferAll(), DeleteTextBufferChar(), ES_HANDLED, ES_NOT_HANDLED, Window::height, ICONSOLE_FULL, ICONSOLE_OPENED, IConsoleCmdExec(), IConsoleHistoryAdd(), IConsoleHistoryNavigate(), IConsolePrintF(), IConsoleResize(), IConsoleSwitch(), InsertTextBufferChar(), InsertTextBufferClipboard(), IsValidChar(), line_height, LRM, MarkWholeScreenDirty(), MoveTextBufferPos(), Scroll(), and Window::SetDirty().

virtual void IConsoleWindow::OnMouseWheel ( int  wheel  )  [inline, virtual]

The mouse wheel has been turned.

Parameters:
wheel the amount of movement of the mouse wheel.

Reimplemented from Window.

Definition at line 346 of file console_gui.cpp.

References Scroll().

virtual void IConsoleWindow::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 203 of file console_gui.cpp.

References Textbuf::buf, Textbuf::caret, Textbuf::caretxoffs, CC_COMMAND, DrawString(), DrawStringMultiLine(), IConsoleLine::Get(), GfxFillRect(), Window::height, line_height, Textbuf::pixels, IConsoleLine::previous, SA_BOTTOM, SA_FORCE, SA_LEFT, SetDParamStr(), and Window::width.

void IConsoleWindow::Scroll ( int  amount  )  [inline]

Scroll the content of the console.

Parameters:
amount Number of lines to scroll back.

Definition at line 196 of file console_gui.cpp.

References Window::height, line_height, Window::SetDirty(), and IConsoleLine::size.

Referenced by OnKeyPress(), and OnMouseWheel().


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

Generated on Fri Mar 4 21:37:58 2011 for OpenTTD by  doxygen 1.6.1