| 1260 | } |
| 1261 | |
| 1262 | bool GuiWindowCtrl::onKeyDown(const GuiEvent &event) |
| 1263 | { |
| 1264 | // If this control is a dead end, kill the event |
| 1265 | if ((! mVisible) || (! mActive) || (! mAwake)) return true; |
| 1266 | |
| 1267 | if ((event.keyCode == KEY_TAB) && (event.modifier & SI_PRIMARY_CTRL)) |
| 1268 | { |
| 1269 | // Find the next sibling window, and select it |
| 1270 | GuiControl *parent = getParent(); |
| 1271 | if (parent) |
| 1272 | { |
| 1273 | GuiWindowCtrl *firstWindow = NULL; |
| 1274 | iterator i; |
| 1275 | for (i = parent->begin(); i != parent->end(); i++) |
| 1276 | { |
| 1277 | GuiWindowCtrl *ctrl = dynamic_cast<GuiWindowCtrl *>(*i); |
| 1278 | if (ctrl && ctrl->getTabIndex() == mTabIndex + 1) |
| 1279 | { |
| 1280 | ctrl->selectWindow(); |
| 1281 | return true; |
| 1282 | } |
| 1283 | else if (ctrl && ctrl->getTabIndex() == 0) |
| 1284 | { |
| 1285 | firstWindow = ctrl; |
| 1286 | } |
| 1287 | } |
| 1288 | // Recycle from the beginning |
| 1289 | if (firstWindow != this) |
| 1290 | { |
| 1291 | firstWindow->selectWindow(); |
| 1292 | return true; |
| 1293 | } |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | return Parent::onKeyDown(event); |
| 1298 | } |
| 1299 | |
| 1300 | //----------------------------------------------------------------------------- |
| 1301 |
nothing calls this directly
no test coverage detected