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 |
Definition at line 281 of file network_chat_gui.cpp.
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 358 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.
item | The current indexed item to return. This function can, and most likely will, alter item, to skip empty items in the arrays. |
Definition at line 321 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.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 479 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.
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 489 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.
*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. |
Reimplemented from Window.
Definition at line 460 of file network_chat_gui.cpp.
References FindWindowById(), and Window::height.
virtual void NetworkChatWindow::OnInvalidateData | ( | int | data | ) | [inline, virtual] |
Some data on this window has become invalid.
data | information about the changed data. |
Reimplemented from Window.
Definition at line 534 of file network_chat_gui.cpp.
virtual EventState NetworkChatWindow::OnKeyPress | ( | uint16 | key, | |
uint16 | keycode | |||
) | [inline, virtual] |
A key has been pressed.
key | the Unicode value of the key. | |
keycode | the untranslated key code including shift state. |
Reimplemented from Window.
Definition at line 504 of file network_chat_gui.cpp.
References Textbuf::buf, ChatTabCompletion(), ES_HANDLED, ES_NOT_HANDLED, FindWindowById(), Window::InvalidateData(), and Window::parent.
virtual void NetworkChatWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 454 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.
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 466 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.