Macadamian/titanium_mobile — pull request #122 by Harutyun (2012-08-02 11:44:12+00:00)
Title: TIMOB-10272: BlackBerry: Finish size and position methods / properties

Reviewers: Davic C.

ChangeLog:
- implemented following functions for UI.View:
getBottom, getRight, getRect and getSize
setBottom, setRight

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

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

var label1 = Ti.UI.createLabel({
text: 'hello',
top: 200,
height: 300
});

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

button.addEventListener('click',function(e)
{
Titanium.API.info("You clicked the button");
var j = label1.getRect();
Titanium.API.info("j.height = " + j.height);
Titanium.API.info("j.width = " + j.width);
Titanium.API.info("j.x = " + j.x);
Titanium.API.info("j.y = " + j.y);
var s = label1.getSize();
Titanium.API.info("s.height = " + s.height);
Titanium.API.info("s.width = " + s.width);
Titanium.API.info("s.x = " + s.x);
Titanium.API.info("s.y = " + s.y);
});

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

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

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

win1.open();