NetworkChatWindow Struct Reference

Inheritance diagram for NetworkChatWindow:
QueryStringBaseWindow Window QueryString ZeroedMemoryAllocator

Public Member Functions

 NetworkChatWindow (const WindowDesc *desc, DestType type, int dest)
const char * ChatTabCompletionNextItem (uint *item)
 Find the next item of the list of things that can be auto-completed.
void ChatTabCompletion ()
 See if we can auto-complete the current text of the user.
virtual void OnPaint ()
 The window must be repainted.
virtual Point OnInitialPosition (const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
 Compute the initial position of the window.
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 DrawWidget (const Rect &r, int widget) const
 Draw the contents of a nested widget.
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 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 OnOpenOSKWindow (int wid)
virtual void OnInvalidateData (int data)
 Some data on this window has become invalid.

Static Public Member Functions

static char * ChatTabCompletionFindText (char *buf)
 Find what text to complete.

Data Fields

DestType dtype
StringID dest_string
int dest

Detailed Description

Definition at line 277 of file network_chat_gui.cpp.


Member Function Documentation

static char* NetworkChatWindow::ChatTabCompletionFindText ( char *  buf  )  [inline, static]

Find what text to complete.

It scans for a space from the left and marks the word right from that as to complete. It also writes a at the position of the space (if any). If nothing found, buf is returned.

Definition at line 352 of file network_chat_gui.cpp.

Referenced by ChatTabCompletion().

const char* NetworkChatWindow::ChatTabCompletionNextItem ( uint *  item  )  [inline]

Find the next item of the list of things that can be auto-completed.

Parameters:
item The current indexed item to return. This function can, and most likely will, alter item, to skip empty items in the arrays.
Returns:
Returns the char that matched to the index.

Definition at line 315 of file network_chat_gui.cpp.

References NetworkClientInfo::client_name, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_town_pool >::GetPoolSize(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, lastof, MAX_CLIENT_SLOTS, and SetDParam().

Referenced by ChatTabCompletion().

virtual void NetworkChatWindow::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 473 of file network_chat_gui.cpp.

References DESTTYPE_CLIENT, DrawString(), NetworkFindClientInfoFromClientID(), SA_RIGHT, SetDParamStr(), WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.

virtual void NetworkChatWindow::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 483 of file network_chat_gui.cpp.

References Textbuf::buf.

virtual Point NetworkChatWindow::OnInitialPosition ( const WindowDesc desc,
int16  sm_width,
int16  sm_height,
int  window_number 
) [inline, virtual]

Compute the initial position of the window.

Parameters:
*desc The pointer to the WindowDesc of the window to create.
sm_width Smallest width of the window.
sm_height Smallest height of the window.
window_number The window number of the new window.
Returns:
Initial position of the top-left corner of the window.

Reimplemented from Window.

Definition at line 454 of file network_chat_gui.cpp.

References WindowDesc::default_width, FindWindowById(), Window::height, and max().

virtual void NetworkChatWindow::OnInvalidateData ( int  data  )  [inline, virtual]

Some data on this window has become invalid.

Parameters:
data information about the changed data.

Reimplemented from Window.

Definition at line 527 of file network_chat_gui.cpp.

virtual EventState NetworkChatWindow::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 498 of file network_chat_gui.cpp.

References Textbuf::buf, ChatTabCompletion(), Window::ES_HANDLED, Window::ES_NOT_HANDLED, FindWindowById(), Window::InvalidateData(), and Window::parent.

virtual void NetworkChatWindow::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 448 of file network_chat_gui.cpp.

References Window::DrawWidgets().

virtual void NetworkChatWindow::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 460 of file network_chat_gui.cpp.

References DESTTYPE_CLIENT, GetStringBoundingBox(), maxdim(), NetworkFindClientInfoFromClientID(), SetDParamStr(), WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.


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

Generated on Wed Mar 31 22:44:09 2010 for OpenTTD by  doxygen 1.6.1