| 1318 | } |
| 1319 | |
| 1320 | ControlId ControlsContainer::Prev(ControlId& id) |
| 1321 | { |
| 1322 | switch (id.list) |
| 1323 | { |
| 1324 | case CLNone: |
| 1325 | if (_controlsForeground.Size() > 0) |
| 1326 | { |
| 1327 | return ControlId(CLForeground, _controlsForeground.Size() - 1); |
| 1328 | } |
| 1329 | if (_objects.Size() > 0) |
| 1330 | { |
| 1331 | return ControlId(CLObjects, _objects.Size() - 1); |
| 1332 | } |
| 1333 | if (_controlsBackground.Size() > 0) |
| 1334 | { |
| 1335 | return ControlId(CLBackground, _controlsBackground.Size() - 1); |
| 1336 | } |
| 1337 | return ControlId::Null(); |
| 1338 | case CLBackground: |
| 1339 | if (id.id > 0) |
| 1340 | { |
| 1341 | return ControlId(CLBackground, id.id - 1); |
| 1342 | } |
| 1343 | if (_controlsForeground.Size() > 0) |
| 1344 | { |
| 1345 | return ControlId(CLForeground, _controlsForeground.Size() - 1); |
| 1346 | } |
| 1347 | if (_objects.Size() > 0) |
| 1348 | { |
| 1349 | return ControlId(CLObjects, _objects.Size() - 1); |
| 1350 | } |
| 1351 | if (_controlsBackground.Size() > 0) |
| 1352 | { |
| 1353 | return ControlId(CLBackground, _controlsBackground.Size() - 1); |
| 1354 | } |
| 1355 | return ControlId::Null(); |
| 1356 | case CLObjects: |
| 1357 | if (id.id > 0) |
| 1358 | { |
| 1359 | return ControlId(CLObjects, id.id - 1); |
| 1360 | } |
| 1361 | if (_controlsBackground.Size() > 0) |
| 1362 | { |
| 1363 | return ControlId(CLBackground, _controlsBackground.Size() - 1); |
| 1364 | } |
| 1365 | if (_controlsForeground.Size() > 0) |
| 1366 | { |
| 1367 | return ControlId(CLForeground, _controlsForeground.Size() - 1); |
| 1368 | } |
| 1369 | if (_objects.Size() > 0) |
| 1370 | { |
| 1371 | return ControlId(CLObjects, _objects.Size() - 1); |
| 1372 | } |
| 1373 | return ControlId::Null(); |
| 1374 | case CLForeground: |
| 1375 | if (id.id > 0) |
| 1376 | { |
| 1377 | return ControlId(CLForeground, id.id - 1); |
no test coverage detected