src/town_gui.cpp
branchcpp_gui
changeset 6263 19dab6a68886
parent 6258 a2f86b8fd99b
child 6298 c30fe89622df
equal deleted inserted replaced
6262:bd89f58e8623 6263:19dab6a68886
   455 				y += 10;
   455 				y += 10;
   456 				i++;
   456 				i++;
   457 				if (++n == w->vscroll.cap) break; // max number of towns in 1 window
   457 				if (++n == w->vscroll.cap) break; // max number of towns in 1 window
   458 			}
   458 			}
   459 			SetDParam(0, GetWorldPopulation());
   459 			SetDParam(0, GetWorldPopulation());
   460 			DrawString(3, w->height - 12 + 2, STR_TOWN_POPULATION, 0);
   460 			DrawString(3, w->Height() - 12 + 2, STR_TOWN_POPULATION, 0);
   461 		}
   461 		}
   462 	} break;
   462 	} break;
   463 
   463 
   464 	case WE_CLICK:
   464 	case WE_CLICK:
   465 		switch (e->we.click.widget) {
   465 		switch (e->we.click.widget) {
   518 	BaseWindow *w = BaseWindow::AllocateFront(&_town_directory_desc, 0);
   518 	BaseWindow *w = BaseWindow::AllocateFront(&_town_directory_desc, 0);
   519 
   519 
   520 	if (w != NULL) {
   520 	if (w != NULL) {
   521 		w->vscroll.cap = 16;
   521 		w->vscroll.cap = 16;
   522 		w->resize.step_height = 10;
   522 		w->resize.step_height = 10;
   523 		w->resize.height = w->height - 10 * 6; // minimum of 10 items in the list, each item 10 high
   523 		w->resize.height = w->Height() - 10 * 6; // minimum of 10 items in the list, each item 10 high
   524 	}
   524 	}
   525 }
   525 }