
Public Member Functions | |
| ReplaceVehicleWindow (const WindowDesc *desc, VehicleType vehicletype, GroupID id_g) | |
| virtual void | OnPaint () |
| This window is currently being repainted. | |
| virtual void | OnClick (Point pt, int widget) |
| A click with the left mouse button has been made on the window. | |
| virtual void | OnDropdownSelect (int widget, int index) |
| A dropdown option associated to this window has been selected. | |
| virtual void | OnResize (Point new_size, Point delta) |
| Called when the window got resized. | |
| virtual void | OnInvalidateData (int data) |
| Some data on this window has become invalid. | |
Private Member Functions | |
| bool | GenerateReplaceRailList (EngineID e, bool draw_left, bool show_engines) |
| Figure out if an engine should be added to a list. | |
| void | GenerateReplaceVehList (Window *w, bool draw_left) |
| Generate a list. | |
| void | GenerateLists () |
| Generate the lists. | |
Private Attributes | |
| byte | sel_index [2] |
| EngineID | sel_engine [2] |
| uint16 | count [2] |
| bool | wagon_btnstate |
| true means engine is selected | |
| GUIEngineList | list [2] |
| bool | update_left |
| bool | update_right |
| bool | init_lists |
| GroupID | sel_group |
Static Private Attributes | |
| static RailType | sel_railtype = RAILTYPE_RAIL |
Definition at line 89 of file autoreplace_gui.cpp.
| bool ReplaceVehicleWindow::GenerateReplaceRailList | ( | EngineID | e, | |
| bool | draw_left, | |||
| bool | show_engines | |||
| ) | [inline, private] |
Figure out if an engine should be added to a list.
| e | The EngineID | |
| draw_left | If true, then the left list is drawn (the engines specific to the railtype you selected) | |
| show_engines | if truem then locomotives are drawn, else wagons (never both) |
Definition at line 107 of file autoreplace_gui.cpp.
References RAILVEH_WAGON.
Referenced by GenerateReplaceVehList().
| void ReplaceVehicleWindow::GenerateReplaceVehList | ( | Window * | w, | |
| bool | draw_left | |||
| ) | [inline, private] |
Generate a list.
| w | Window, that contains the list | |
| draw_left | true if generating the left list, otherwise false |
Definition at line 126 of file autoreplace_gui.cpp.
References CheckAutoreplaceValidity(), EngineReplacementForCompany(), EngList_Sort(), GenerateReplaceRailList(), GetGroupNumEngines(), wagon_btnstate, and Window::window_number.
Referenced by GenerateLists().
| virtual void ReplaceVehicleWindow::OnClick | ( | Point | pt, | |
| int | widget | |||
| ) | [inline, virtual] |
A click with the left mouse button has been made on the window.
| pt | the point inside the window that has been clicked. | |
| widget | the clicked widget. |
Reimplemented from Window.
Definition at line 335 of file autoreplace_gui.cpp.
References CMD_SET_AUTOREPLACE, DoCommandP(), GetRailTypeInfo(), HasBit(), RailtypeInfo::label, RAILTYPE_BEGIN, RAILTYPE_END, RailtypeInfo::replace_text, Window::resize, Window::SetDirty(), ShowDropDownList(), ResizeInfo::step_height, RailtypeInfo::strings, wagon_btnstate, and Point::y.
| virtual void ReplaceVehicleWindow::OnDropdownSelect | ( | int | widget, | |
| int | index | |||
| ) | [inline, virtual] |
A dropdown option associated to this window has been selected.
| widget | the widget (button) that the dropdown is associated with. | |
| index | the element in the dropdown that is selected. |
Reimplemented from Window.
Definition at line 399 of file autoreplace_gui.cpp.
References Scrollbar::pos, Window::SetDirty(), Window::vscroll, and Window::vscroll2.
Called when the window got resized.
| new_size | the new size of the window. | |
| delta | the amount of which the window size changed. |
Reimplemented from Window.
Definition at line 414 of file autoreplace_gui.cpp.
References Scrollbar::cap, Widget::data, Widget::left, Window::resize, ResizeButtons(), Widget::right, ResizeInfo::step_height, Window::vscroll, Window::vscroll2, Point::x, and Point::y.
| virtual void ReplaceVehicleWindow::OnInvalidateData | ( | int | data | ) | [inline, virtual] |
Some data on this window has become invalid.
| data | information about the changed data. |
Reimplemented from Window.
Definition at line 438 of file autoreplace_gui.cpp.
1.5.6