diff options
author | alberth <alberth@openttd.org> | 2009-10-31 11:34:43 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-10-31 11:34:43 +0000 |
commit | 82e21df3a48cc20b8df71a197e1f634eb611240e (patch) | |
tree | c63b1aabbec3a2f11d41e380f48aaa27c808b8b2 /src/window.cpp | |
parent | 52b2d67200e489f017d520b408cf9509f459e222 (diff) | |
download | openttd-82e21df3a48cc20b8df71a197e1f634eb611240e.tar.xz |
(svn r17915) -Codechange: Allow windows to compute their own initial position.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp index 3ba3866e4..4c1b8d698 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1310,6 +1310,11 @@ static Point LocalGetWindowPlacement(const WindowDesc *desc, int16 sm_width, int return pt; } +/* virtual */ Point Window::OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number) +{ + return LocalGetWindowPlacement(desc, sm_width, sm_height, window_number); +} + /** * Set the positions of a new window from a WindowDesc and open it. * @@ -1356,7 +1361,7 @@ void Window::FinishInitNested(const WindowDesc *desc, WindowNumber window_number { this->InitializeData(desc->cls, NULL, window_number); this->desc_flags = desc->flags; - Point pt = LocalGetWindowPlacement(desc, this->nested_root->smallest_x, this->nested_root->smallest_y, window_number); + Point pt = this->OnInitialPosition(desc, this->nested_root->smallest_x, this->nested_root->smallest_y, window_number); this->InitializePositionSize(pt.x, pt.y, this->nested_root->smallest_x, this->nested_root->smallest_y); this->FindWindowPlacementAndResize(desc->default_width, desc->default_height); } |