Macadamian/titanium_mobile — pull request #117 by Harutyun (2012-07-27 12:40:45+00:00)
Title: TIMOB-9454: BlackBerry: Complete Layout Handling of UI View

Reviewers: JP

ChangeLog:
- fixed getter implementation for run time
- implemented getTop, getleft, getWidth, getLeft getters for native
control
- retrieved layout information from cascade using bb::cascades::LayoutUpdateHandler
- clean up the listView code, to use base NativeControlobject functionality instead of reimplementing it

Test Cases:
- make sure you can successfully build tibb and tibbtest
- run the above snippet of code and make sure getters for
controllers are working correctly
- make sure listView functionality is not broken

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

var label1 = Ti.UI.createLabel({
left: 50,
top: 60,
width: 70,
height: 80,
text: 'A simple label',
});

var button1 = Titanium.UI.createButton({
title: 'change postion',
top: 400,
});

var a = 60;
button1.addEventListener('click',function(e)
{
Titanium.API.info("You clicked the button");
label1.left = a;
label1.top = a;
label1.height = a;
label1.width = a;
a += 10;
});

var button2 = Titanium.UI.createButton({
title:
'print
position',
top: 600,
});

button2.addEventListener('click',function(e)
{
Titanium.API.info("Positions:");
Titanium.API.info("left:" + label1.getLeft());
Titanium.API.info("Top:" + label1.getTop());
Titanium.API.info("Height:"	+ label1.getHeight());
Titanium.API.info("Width:"	+ label1.getWidth());
});

win1.add(label1);
win1.add(button1);
win1.add(button2);

win1.open();