source: trunk/PARPG/scripts/common/eventlistenerbase.py @ 196

Revision 147, 2.2 KB checked in by barra_parpg, 11 years ago (diff)
  • SVN EOL style fixes
  • Property svn:eol-style set to native
Line 
1#!/usr/bin/python
2
3#   This file is part of PARPG.
4
5#   PARPG is free software: you can redistribute it and/or modify
6#   it under the terms of the GNU General Public License as published by
7#   the Free Software Foundation, either version 3 of the License, or
8#   (at your option) any later version.
9
10#   PARPG is distributed in the hope that it will be useful,
11#   but WITHOUT ANY WARRANTY; without even the implied warranty of
12#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#   GNU General Public License for more details.
14
15#   You should have received a copy of the GNU General Public License
16#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>.
17
18import fife
19
20class EventListenerBase(fife.IKeyListener, fife.ICommandListener, fife.IMouseListener, fife.ConsoleExecuter):
21    def __init__(self, engine, regKeys=False, regCmd=False, regMouse=False, regConsole=False, regWidget=False):
22        """Initialise the instance"""
23        self.eventmanager = engine.getEventManager()
24
25        fife.IKeyListener.__init__(self)
26        if regKeys:
27            self.eventmanager.addKeyListener(self)
28        fife.ICommandListener.__init__(self)
29        if regCmd:
30            self.eventmanager.addCommandListener(self)
31        fife.IMouseListener.__init__(self)
32        if regMouse:
33            self.eventmanager.addMouseListener(self)
34        fife.ConsoleExecuter.__init__(self)
35        if regConsole:
36            engine.getGuiManager().getConsole().setConsoleExecuter(self)
37
38    def mousePressed(self, evt):
39        pass
40
41    def mouseReleased(self, evt):
42        pass   
43
44    def mouseEntered(self, evt):
45        pass
46
47    def mouseExited(self, evt):
48        pass
49
50    def mouseClicked(self, evt):
51        pass
52
53    def mouseWheelMovedUp(self, evt):
54        pass   
55
56    def mouseWheelMovedDown(self, evt):
57        pass
58
59    def mouseMoved(self, evt):
60        pass
61
62    def mouseDragged(self, evt):
63        pass
64
65    def keyPressed(self, evt):
66        pass
67
68    def keyReleased(self, evt):
69        pass
70
71    def onCommand(self, command):
72        pass
73
74    def onToolsClick(self):
75        print "No tools set up yet"
76
77    def onConsoleCommand(self, command):
78        pass
79
80    def onWidgetAction(self, evt):
81        pass
82
Note: See TracBrowser for help on using the repository browser.