Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-10270: BlackBerry: Implement getWidth, getHeight in UI View #126

Merged
merged 3 commits into from
Aug 9, 2012

Conversation

Harutyun
Copy link

@Harutyun Harutyun commented Aug 6, 2012

Reviewers: Davic C.

ChangeLog:

  • keep the top, left, height, width, right, left etc properties as JS
    properties

Test Cases:

  • make sure you can successfully build tibb and tibbte
  • run the above snippet of code and make sure right values are printed
    for the get, left, etc. positional properties

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

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

var label1 = Ti.UI.createLabel({
text: 'hello',
width: "200in",
height: "100mm",
left: "10px",
top: "20",
bottom: "345dip",
right: "211pt",
});

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

button.addEventListener('click',function(e)
{
Titanium.API.info("You clicked the button");
Titanium.API.info("Height = " + label1.getHeight());
Titanium.API.info("Width = " + label1.getWidth());
Titanium.API.info("Top = " + label1.getTop());
Titanium.API.info("Left = " + label1.getLeft());
Titanium.API.info("Right = " + label1.getRight());
Titanium.API.info("Bottom = " + label1.getBottom());
});

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

win1.open();

Reviewers: Davic C.

ChangeLog:
- keep the top, left, height, width, right, left etc properties as JS
  properties

Test Cases:
- make sure you can successfully build tibb and tibbte
- run the above snippet of code and make sure right values are printed
   for the get, left, etc. positional properties

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

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

var label1 = Ti.UI.createLabel({
text: 'hello',
width: "200in",
height: "100mm",
left: "10px",
top: "20",
bottom: "345dip",
right: "211pt",
});

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

button.addEventListener('click',function(e)
{
Titanium.API.info("You clicked the button");
Titanium.API.info("Height = " + label1.getHeight());
Titanium.API.info("Width = " + label1.getWidth());
Titanium.API.info("Top = " + label1.getTop());
Titanium.API.info("Left = " + label1.getLeft());
Titanium.API.info("Right = " + label1.getRight());
Titanium.API.info("Bottom = " + label1.getBottom());
});

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

win1.open();
@@ -373,17 +375,24 @@ int NativeControlObject::setFont(TiObject*)
int NativeControlObject::setHeight(TiObject* obj)
{
Q_ASSERT(container_ != NULL);
if (height_)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appcelerator coding standards state that you must use == or != operator, i.e.

if (height_ != NULL)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dcampbell-macadamian
Copy link

reviewed

@Harutyun
Copy link
Author

Harutyun commented Aug 8, 2012

patch is updated

Conflicts:
	blackberry/tibb/NativeControlObject.cpp
	blackberry/tibb/NativeControlObject.h
@dcampbell-macadamian
Copy link

approved

Harutyun pushed a commit that referenced this pull request Aug 9, 2012
TIMOB-10270: BlackBerry: Implement getWidth, getHeight in UI View
@Harutyun Harutyun merged commit f97b8fa into Macadamian:blackberry Aug 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants