diff options
author | frosch <frosch@openttd.org> | 2010-08-12 09:11:12 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-08-12 09:11:12 +0000 |
commit | 55bd5de43d31c71e81d7a6164830374485a75cb4 (patch) | |
tree | 249f429a723d6f65030f457362ad3f0b41d40e21 /src/window.cpp | |
parent | 57c063250fb8234f17ceda91fb87c2057d5d212e (diff) | |
download | openttd-55bd5de43d31c71e81d7a6164830374485a75cb4.tar.xz |
(svn r20458) -Codechange: Move Scrollbar from window.cpp to widget.cpp
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/window.cpp b/src/window.cpp index 3919bf674..469e0c26b 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -98,38 +98,6 @@ int Window::GetRowFromWidget(int clickpos, int widget, int padding, int line_hei } /** - * Compute the row of a scrolled widget that a user clicked in. - * @param clickpos Vertical position of the mouse click (without taking scrolling into account). - * @param widget Widget number of the widget clicked in. - * @param padding Amount of empty space between the widget edge and the top of the first row. Default value is \c 0. - * @param line_height Height of a single row. A negative value means using the vertical resize step of the widget. - * @return Row number clicked at. If clicked at a wrong position, #INT_MAX is returned. - */ -int Scrollbar::GetScrolledRowFromWidget(int clickpos, const Window * const w, int widget, int padding, int line_height) const -{ - uint pos = w->GetRowFromWidget(clickpos, widget, padding, line_height); - if (pos != INT_MAX) pos += this->GetPosition(); - return (pos >= this->GetCount()) ? INT_MAX : pos; -} - -/** - * Set capacity of visible elements from the size and resize properties of a widget. - * @param w Window. - * @param widget Widget with size and resize properties. - * @param padding Padding to subtract from the size. - * @note Updates the position if needed. - */ -void Scrollbar::SetCapacityFromWidget(Window *w, int widget, int padding) -{ - NWidgetBase *nwid = w->GetWidget<NWidgetBase>(widget); - if (this->is_vertical) { - this->SetCapacity(((int)nwid->current_y - padding) / (int)nwid->resize_y); - } else { - this->SetCapacity(((int)nwid->current_x - padding) / (int)nwid->resize_x); - } -} - -/** * Return the Scrollbar to a widget index. * @param widnum Scrollbar widget index * @return Scrollbar to the widget |