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
Developer
Posts: 146
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain
Accepted Solution

AbstractTextControl without setTextStyle() ??

Hello, guys !

 

I'm working with text manipulation ( Label, TextField ...etc. you know) and i need change text style with C++, but Cascades API dont show how setting a TextStyleDefinition on a text control.

 

Exists a AbstractTextControl::textStyle() method returning TextStyleDefinition pointer, but dont a AbstractTextControl::setTextStyle(TextStyleDefinition).

 

I know that is possible with QML, but not in C++. I have text control in a custom C++ class, and dont know how change it's text style.

 

Any ideas ?

 

Thanks.

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Developer
Posts: 146
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: AbstractTextControl without setTextStyle() ??

Obviously, I answer myself :

 

----------------------

 

Label *label = Label::create().text("Texto por defecto");

TextStyleDefinition *tStyle = label->textStyle();
tStyle->setFontWeight(FontWeight::Bold);

 

----------------------

I'm **bleep** this morning :Rolleyes:

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook