Created
July 13, 2011 04:55
-
-
Save aaronksaunders/1079742 to your computer and use it in GitHub Desktop.
beginnings of a NavGroup Module to give me top window and a way to pop all windows to go back home. Working on ability to go to specific window also
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ti.include('my_navgroup.js'); | |
function createWindow(_title) { | |
var win1=Titanium.UI.createWindow({ | |
width:'100%', | |
height:'100%', | |
title:_title, | |
id:"win-"+_title, | |
left:0, | |
top:0, | |
backButtonTitle:"Back" | |
}); | |
var actionBtn = Titanium.UI.createButton({ | |
title:"Next", | |
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED, | |
}); | |
actionBtn.addEventListener('click', function() { | |
Ti.API.debug("window clicked"); | |
myNavGroup.openWindow(createWindow((new Date()).getTime()), {}); | |
}); | |
win1.rightNavButton = actionBtn; | |
var homeBtn = Titanium.UI.createButton({ | |
title:"Home", | |
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED, | |
width:100, | |
height:35 | |
}); | |
homeBtn.addEventListener('click', function() { | |
Ti.API.debug("home clicked"); | |
myNavGroup.goHome(); | |
}); | |
win1.add(homeBtn); | |
return win1; | |
} | |
// | |
var win1=Titanium.UI.createWindow({ | |
width:'100%', | |
height:'100%', | |
title:"Home", | |
id:"win-Home", | |
left:0, | |
top:0 | |
}); | |
var actionBtn = Titanium.UI.createButton({ | |
title:"Next", | |
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED, | |
}); | |
actionBtn.addEventListener('click', function() { | |
Ti.API.debug("window clicked"); | |
myNavGroup.openWindow(createWindow((new Date()).getTime()), {}); | |
}); | |
win1.rightNavButton = actionBtn; | |
myNavGroup.create(win1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment