| 1232 | } |
| 1233 | |
| 1234 | bool GuiWindowCtrl::onKeyDown(const GuiEvent &event) |
| 1235 | { |
| 1236 | // If this control is a dead end, kill the event |
| 1237 | if ((! mVisible) || (! mActive) || (! mAwake)) return true; |
| 1238 | |
| 1239 | if ((event.keyCode == KEY_TAB) && (event.modifier & SI_PRIMARY_CTRL)) |
| 1240 | { |
| 1241 | // Find the next sibling window, and select it |
| 1242 | GuiControl *parent = getParent(); |
| 1243 | if (parent) |
| 1244 | { |
| 1245 | GuiWindowCtrl *firstWindow = NULL; |
| 1246 | iterator i; |
| 1247 | for (i = parent->begin(); i != parent->end(); i++) |
| 1248 | { |
| 1249 | GuiWindowCtrl *ctrl = dynamic_cast<GuiWindowCtrl *>(*i); |
| 1250 | if (ctrl && ctrl->getTabIndex() == mTabIndex + 1) |
| 1251 | { |
| 1252 | ctrl->selectWindow(); |
| 1253 | return true; |
| 1254 | } |
| 1255 | else if (ctrl && ctrl->getTabIndex() == 0) |
| 1256 | { |
| 1257 | firstWindow = ctrl; |
| 1258 | } |
| 1259 | } |
| 1260 | // Recycle from the beginning |
| 1261 | if (firstWindow != this) |
| 1262 | { |
| 1263 | firstWindow->selectWindow(); |
| 1264 | return true; |
| 1265 | } |
| 1266 | } |
| 1267 | } |
| 1268 | |
| 1269 | return Parent::onKeyDown(event); |
| 1270 | } |
| 1271 | |
| 1272 | //----------------------------------------------------------------------------- |
| 1273 |
nothing calls this directly
no test coverage detected