Macadamian/titanium_mobile — pull request #107 by Harutyun (2012-07-18 12:48:54+00:00)
Title: TIMOB-9972: Implement UI.Tab.open and .setWindow, needed for KitchenSink

Reviewers: DavidC

ChangeLog:
- implemented UI.Tab.open function by adding Navigation panes for the

tabs
- fix the issue for event handler i.e. when adding controls to the

window on tab, event handler didn't work.
Ther reason is because for each control completeInitializtion is called

only after open function is called for the current control, but for

tabbedPane, it needs to call open only for tabGroup (not for window).

Test Cases:
- build tibb and tibbtest
- run following snippet to test added functionality:
- click on 'button' make sure new window is opened and there is back

button on down left corner so that you can go back to the tabGroup

var tabGroup = Titanium.UI.createTabGroup();

var win1 = Titanium.UI.createWindow({
backgroundColor:'#336699'
})

var tab1 = Titanium.UI.createTab({
title: 'TAB1',
window: win1,
});

var win2 = Titanium.UI.createWindow({
})

var tab2 = Titanium.UI.createTab({
title: 'TAB2',
window: win2,
});

var win3 = Titanium.UI.createWindow({
backgroundColor:'#0FF'
})

var but = Titanium.UI.createButton({title: 'BUTTON'});

but.addEventListener('click', function(e) {
tab1.open(win3);
});

win1.add(but);

tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();