Changeset 146:516b35b98365 for src/mlx
- Timestamp:
- 05/01/12 18:12:10 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r145 r146 995 995 super(FuelTank, self).__init__() 996 996 997 self._enabled = True 997 998 self.fuelTank = fuelTank 998 999 self.capacity = capacity … … 1054 1055 """Disable the fuel tank.""" 1055 1056 self._expectedButton.set_sensitive(False) 1057 self._enabled = False 1056 1058 1057 1059 def _redraw(self): … … 1139 1141 1140 1142 The expected level will be set there.""" 1141 if event.button==1:1143 if self._enabled and event.button==1: 1142 1144 self._setExpectedFromY(event.y) 1143 1145 1144 1146 def _motionNotify(self, tankFigure, event): 1145 1147 """Called when the mouse pointer moves within the area of a tank figure.""" 1146 if event.state==BUTTON1_MASK:1148 if self._enabled and event.state==BUTTON1_MASK: 1147 1149 self._setExpectedFromY(event.y) 1148 1150 1149 1151 def _scrolled(self, tankFigure, event): 1150 1152 """Called when a scroll event is received.""" 1151 increment = 1 if event.state==CONTROL_MASK \ 1152 else 100 if event.state==SHIFT_MASK \ 1153 else 10 if event.state==0 else 0 1154 if increment!=0: 1155 if event.direction==SCROLL_DOWN: 1156 increment *= -1 1157 self._expectedButton.spin(SPIN_USER_DEFINED, increment) 1153 if self._enabled: 1154 increment = 1 if event.state==CONTROL_MASK \ 1155 else 100 if event.state==SHIFT_MASK \ 1156 else 10 if event.state==0 else 0 1157 if increment!=0: 1158 if event.direction==SCROLL_DOWN: 1159 increment *= -1 1160 self._expectedButton.spin(SPIN_USER_DEFINED, increment) 1158 1161 1159 1162 def _expectedChanged(self, spinButton):
Note:
See TracChangeset
for help on using the changeset viewer.