Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
messi009
Posts: 4
Registered: ‎07-14-2013
My Device: Blackberry q10. Blackberry developer
My Carrier: Airtel

How to convert bb.cascades code 1.2 to bb.cascades 1.0?

 

For example i have a code which is in cascades 1.2 which i need it in cascades 1.0 format 

 

Code:

 

import bb.cascades 1.2

 

TitleBar {
id: newsTitleBar
property alias newsTitle: titleLabel.text
property int layoutHeight: 0
property int layoutWidth: 0

kind: TitleBarKind.FreeForm


kindProperties: FreeFormTitleBarKindProperties {
Container {
leftPadding: 25

background: titlePaint.imagePaint
attachedObjects: [
ImagePaintDefinition {
id: titlePaint
imageSource: "asset:///images/title.png"
},
LayoutUpdateHandler {
id: layoutHandler
onLayoutFrameChanged: {

newsTitleBar.layoutHeight = layoutFrame.height;
newsTitleBar.layoutWidth = layoutFrame.width;
}
}
]

layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}

Label {
id: titleLabel
verticalAlignment: VerticalAlignment.Center

textStyle {
color: Color.create("#ffffff")
base: SystemDefaults.TextStyles.TitleText
fontWeight: FontWeight.W500
}

layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
}

}
}
}

 

 

Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: How to convert bb.cascades code 1.2 to bb.cascades 1.0?

You could try by just changing the import at the top, but there might be an incompatibility. There is no automatic way, but if you want backwards compatibility it is easier to start from 1.0 and go to 1.2 than vice versa.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Developer
ekke
Posts: 1,412
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: How to convert bb.cascades code 1.2 to bb.cascades 1.0?

I'm using Git Branches to manage projects supporting more then one API Level

 

have written a blog on this:

https://ekkescorner.wordpress.com/2013/07/11/mobile-development-git-helps-to-manage-apps-for-differe...

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.