Changeset - r3467:6bc1d5601bb8
[Not reviewed]
master
0 3 0
tron - 18 years ago 2006-04-07 08:57:03
tron@openttd.org
(svn r4312) Calculate the maximum pixel width of the entered text in the chat box from the "text box"-widget instead of hardcoding an arbitrary - and wrong - number
3 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
gui.h
Show inline comments
 
@@ -121,13 +121,13 @@ void SetFiosType(const byte fiostype);
 

	
 
/*	FIOS_TYPE_FILE, FIOS_TYPE_OLDFILE etc. different colours */
 
extern const byte _fios_colors[];
 

	
 
/* network gui */
 
void ShowNetworkGameWindow(void);
 
void ShowChatWindow(int maxlen, int maxwidth, WindowClass window_class, WindowNumber window_number);
 
void ShowChatWindow(int maxlen, WindowClass window_class, WindowNumber window_number);
 

	
 
/* bridge_gui.c */
 
void ShowBuildBridgeWindow(uint start, uint end, byte type);
 

	
 
enum {
 
	ZOOM_IN = 0,
main_gui.c
Show inline comments
 
@@ -329,13 +329,13 @@ static void MenuClickBuildAir(int index)
 
#ifdef ENABLE_NETWORK
 

	
 
void ShowNetworkChatQueryWindow(byte desttype, byte dest)
 
{
 
	_rename_id = desttype + (dest << 8);
 
	_rename_what = 2;
 
	ShowChatWindow(150, 338, 1, 0);
 
	ShowChatWindow(150, 1, 0);
 
}
 

	
 
void ShowNetworkGiveMoneyWindow(byte player)
 
{
 
	_rename_id = player;
 
	_rename_what = 3;
network_gui.c
Show inline comments
 
@@ -1542,13 +1542,13 @@ static const WindowDesc _chat_window_des
 
	WC_SEND_NETWORK_MSG,0,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 
	_chat_window_widgets,
 
	ChatWindowWndProc
 
};
 

	
 
void ShowChatWindow(int maxlen, int maxwidth, WindowClass window_class, WindowNumber window_number)
 
void ShowChatWindow(int maxlen, WindowClass window_class, WindowNumber window_number)
 
{
 
	Window *w;
 

	
 
	DeleteWindowById(WC_SEND_NETWORK_MSG, 0);
 

	
 
	_edit_str_buf[0] = '\0';
 
@@ -1558,13 +1558,13 @@ void ShowChatWindow(int maxlen, int maxw
 
	w->click_state = 1 << 1;
 
	WP(w,querystr_d).caption = STR_NULL;
 
	WP(w,querystr_d).wnd_class = window_class;
 
	WP(w,querystr_d).wnd_num = window_number;
 
	WP(w,querystr_d).text.caret = false;
 
	WP(w,querystr_d).text.maxlength = maxlen;
 
	WP(w,querystr_d).text.maxwidth = maxwidth;
 
	WP(w,querystr_d).text.maxwidth = w->widget[1].right - w->widget[1].left - 2; // widget[1] is the "text box"
 
	WP(w,querystr_d).text.buf = _edit_str_buf;
 
	UpdateTextBufferSize(&WP(w, querystr_d).text);
 
}
 

	
 
#else
 
void ShowJoinStatusWindowAfterJoin(void) {}
0 comments (0 inline, 0 general)