(svn r17572) -Codechange: Use the Window::GetWidget() function to access nested widgets through the nested_array.

This commit is contained in:
alberth
2009-09-19 11:31:12 +00:00
parent 9d7fe9bd86
commit 116c77c342
26 changed files with 162 additions and 133 deletions

View File

@@ -215,7 +215,7 @@ struct MainWindow : Window
this->InitNested(&_main_window_desc, 0);
ResizeWindow(this, _screen.width, _screen.height);
NWidgetViewport *nvp = (NWidgetViewport *)this->nested_array[MW_VIEWPORT];
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(MW_VIEWPORT);
nvp->InitializeViewport(this, TileXY(32, 32), ZOOM_LVL_VIEWPORT);
}
@@ -386,7 +386,7 @@ struct MainWindow : Window
virtual void OnResize(Point delta)
{
if (this->viewport != NULL) {
NWidgetViewport *nvp = (NWidgetViewport *)this->nested_array[MW_VIEWPORT];
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(MW_VIEWPORT);
nvp->UpdateViewportCoordinates(this);
}
}