var app, sendButton, photoButton, controller; exports.MessageWindow = function() { // Globals app = require('/common/globals'); var self = Ti.UI.createWindow({ title : L('message'), backgroundColor : '#ffffff', exitOnClose : true, navBarHidden : false, modal : true, windowSoftInputMode : Titanium.UI.Android.SOFT_INPUT_ADJUST_RESIZE }); textArea = Titanium.UI.createTextArea({ width : app.globals.pW, height : app.globals.pH / 3, top : '60dp' }) self.add(textArea); var btop = 10; //((app.globals.pH / 3) + 5); sendButton = Titanium.UI.createButton({ title : 'Send', width : '70dp', height : '40dp', right : '5dp', top : btop + 'dp' }); self.add(sendButton); photoButton = Titanium.UI.createButton({ title : 'Photo', width : '70dp', height : '40dp', left : '5dp', top : btop + 'dp' }); self.add(photoButton); self.addEventListener('open', function() { textArea.focus(); }) var MessageController = require('/ui/controllers/MessageController').MessageController; controller = new MessageController(self); photoButton.addEventListener('click', controller.photoButtonClick); sendButton.addEventListener('click', controller.sendButtonClick); return self; };