Changeset - r8419:29f0cb4af271
[Not reviewed]
master
0 1 0
peter1138 - 16 years ago 2008-01-26 21:02:35
peter1138@openttd.org
(svn r11989) -Fix: Resize autoreplace window to fit purchase information text if it is too large.
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_gui.cpp
Show inline comments
 
@@ -345,7 +345,13 @@ static void ReplaceVehicleWndProc(Window
 
				/* Also draw the details if an engine is selected */
 
				if (WP(w, replaceveh_d).sel_engine[i] != INVALID_ENGINE) {
 
					const Widget *wi = &w->widget[i == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS];
 
					DrawVehiclePurchaseInfo(wi->left + 2, wi->top + 1, wi->right - wi->left - 2, WP(w, replaceveh_d).sel_engine[i]);
 
					int text_end = DrawVehiclePurchaseInfo(wi->left + 2, wi->top + 1, wi->right - wi->left - 2, WP(w, replaceveh_d).sel_engine[i]);
 

	
 
					if (text_end > wi->bottom) {
 
						SetWindowDirty(w);
 
						ResizeWindowForWidget(w, i == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS, 0, text_end - wi->bottom);
 
						SetWindowDirty(w);
 
					}
 
				}
 
			}
 

	
0 comments (0 inline, 0 general)