A "car map" is the map shown in a CarSim application window.
It may contain any number of cars which are drawn onto the map. A car map
listens for mouse commands that signal the creation of cars or execution
of car methods. A yellow line on the car map shows the most recent
movement of a car.
|
__init__(self,
parent,
width,
height,
grid_row,
grid_column)
Creates the main window and places the components |
|
|
|
update_status_text(self,
event)
Changes the text in the status label when the pointer is over a car
or a car is dragged. |
|
|
|
save_location(self,
event)
When button 1 is pressed, its location is saved and if it happens
above a car image, the image item is saved. |
|
|
car object
|
get_closest_car(self,
location)
Goes through all the car objects and selects the closest one to the
given location. |
|
|
|
drive_selected_car(self,
event)
When a car is dragged to its new position, releasing the mouse button
activates this method. |
|
|
|
create_menu(self,
event)
Shows a fueling menu for a car nearest to the right clicking point |
|
|
|
fuel(self)
Shows the fueling menu and does the fueling |
|
|
|
fill_up(self)
Fills up the tank of the selected car |
|
|
|
create_new_car(self,
event)
Left double click saves the location of the click and shows menus
that ask information for a new car. |
|
|
|
show_text(self,
event)
Selects the closest car of the events(mouse goes over an image) and
shows its status text |
|
|
|
hide_text(self,
event)
Hides the status text when the mouse leaves the image |
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|