[TIMOB-11639] Blackberry: Window Management
| GitHub Issue | n/a |
|---|---|
| Type | Story |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-11-12T20:33:08.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 3.1.0, 2012 Sprint 23, BB Preview 3 |
| Components | BlackBerry |
| Labels | n/a |
| Reporter | Josh Roesslein |
| Assignee | Josh Roesslein |
| Created | 2012-11-01T21:20:58.000+0000 |
| Updated | 2017-03-08T18:26:57.000+0000 |
Description
As a developer, I need the ability to create windows and present
them onto a scene so that they can be positioned, sized, and drawn
onto the display.
Acceptance Test
1. Run application. 2. A series of windows should open. First blue, then red, and finally green. 3. For each window as they open the following events should fire in order: "open", "focus", "blur" (last window to open should remain focused) 4. Once all windows are open they should begin to close. First green, then red, and finally blue. 5. For each window as they close the following events should fire in order: "focus" (exclude first window which is focused already), "blur", "close"var colors = ['blue', 'red', 'green'], windows = []; function openNextWindow() { Ti.API.info('opening next...'); var color = colors.pop(); if (!color) { clearInterval(interval); interval = setInterval(closeNextWindow, 2000); return; } var win = Ti.UI.createWindow(); win.addEventListener('open', function() { Ti.API.info(color + ' window opened'); }); win.addEventListener('focus', function() { Ti.API.info(color + ' window focused'); }); win.addEventListener('blur', function() { Ti.API.info(color + ' window blurred'); }); win.addEventListener('close', function() { Ti.API.info(color + ' window closed'); }); win.add(Ti.UI.createView({backgroundColor: color, width: 500, height: 500})); win.open(); windows.push(win); } function closeNextWindow() { Ti.API.info('closing next...'); var win = windows.pop(); if (!win) { clearInterval(interval); return; } win.close(); } var interval = setInterval(openNextWindow, 2000);Closing ticket as resolved.