Package horizons :: Package gui :: Package mousetools :: Module navigationtool :: Class NavigationTool
[hide private]
[frames] | no frames]

Class NavigationTool

source code

fife.fife.IMouseListener --+    
                           |    
       cursortool.CursorTool --+
                               |
                              NavigationTool

Navigation Class to process mouse actions ingame

Instance Methods [hide private]
 
__init__(self, session) source code
 
remove(self) source code
 
mousePressed(self, evt) source code
 
mouseReleased(self, evt) source code
 
mouseDragged(self, evt) source code
 
mouseMoved(self, evt) source code
 
mouseWheelMovedUp(self, evt) source code
 
mouseWheelMovedDown(self, evt) source code
 
onCommand(self, command)
Called when some kind of command-event happens.
source code
 
get_hover_instances(self, where, layers=None)
Utility method, returns the instances under the cursor
source code
 
end(self) source code
 
_schedule_hover_instance_update(self)
Hover instances have potentially changed, do an update in a timely fashion (but not right away)
source code
 
_send_hover_instance_upate(self)
Broadcast update with new instances below mouse (hovered).
source code
    Inherited from cursortool.CursorTool
 
_get_screenpoint(self, arg)
Python lacks polymorphism.
source code
 
_round_map_coords(self, map_x, map_y)
Returns the coordinates of an event at the map.
source code
 
disable(self)
Call this to not get events.
source code
 
enable(self)
Call this to get events.
source code
 
get_exact_world_location(self, evt)
Returns the coordinates of an event at the map.
source code
 
get_world_location(self, evt) source code
 
mouseClicked(self, evt) source code
 
mouseEntered(self, evt) source code
 
mouseExited(self, evt) source code
Class Variables [hide private]
  last_event_pos = fife.ScreenPoint(0, 0)
  send_hover_instances_update = True
  HOVER_INSTANCES_UPDATE_DELAY = 1
  last_hover_instances = WeakList()
    Inherited from cursortool.CursorTool
  log = logging.getLogger("gui.mousetools")
Method Details [hide private]

__init__(self, session)
(Constructor)

source code 
Overrides: cursortool.CursorTool.__init__

remove(self)

source code 
Overrides: cursortool.CursorTool.remove

mousePressed(self, evt)

source code 
Overrides: cursortool.CursorTool.mousePressed

mouseReleased(self, evt)

source code 
Overrides: cursortool.CursorTool.mouseReleased

mouseDragged(self, evt)

source code 
Overrides: cursortool.CursorTool.mouseDragged

mouseMoved(self, evt)

source code 
Overrides: cursortool.CursorTool.mouseMoved

mouseWheelMovedUp(self, evt)

source code 
Overrides: cursortool.CursorTool.mouseWheelMovedUp

mouseWheelMovedDown(self, evt)

source code 
Overrides: cursortool.CursorTool.mouseWheelMovedDown

onCommand(self, command)

source code 

Called when some kind of command-event happens. For "documentation", see: engine/core/eventchannel/command/ec_commandids.h engine/core/eventchannel/eventmanager.cpp in fife. It's usually about mouse/keyboard focus or window being iconified/restored.

get_hover_instances(self, where, layers=None)

source code 

Utility method, returns the instances under the cursor

Parameters:
  • where - anything supporting getX/getY
  • layers - list of layer ids to search for. Default to OBJECTS

end(self)

source code 
Overrides: cursortool.CursorTool.end

_send_hover_instance_upate(self)

source code 

Broadcast update with new instances below mouse (hovered). At most called in a certain interval, not after every mouse move in order to prevent delays.