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

Adobe AIR Development

Reply
Developer
Posts: 136
Registered: ‎03-04-2009
My Device: Not Specified
Accepted Solution

QNX dialog text alignment

Hi,

 

Any ideas how to left-align QNX dialog text? i.e.

 

var alert:qnx.dialog.AlertDialog = new qnx.dialog.AlertDialog();
alert.title = "my amazing title";
alert.message = "1. hello\n" + "2. how are you\n" + "3. and have a REALLY good morning today";

 

I want it to show up as:

 

1. hello

2. how are you

3. and have a REALLY good morning today

 

But now it show up as:

 

                               1. hello

                           2. how are you

     3. and have a REALLY good morning today

 

 

I tried also the messageHtml etc ... nada no alignment,

 

Thanks!!

Udi

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: QNX dialog text alignment

[ Edited ]

hey udik,

 

try running the following program and see its output:

 

 

package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import qnx.dialog.AlertDialog;
	import qnx.dialog.DialogAlign;
	import qnx.dialog.DialogSize;
	
	public class DialogTest extends Sprite
	{
		private var myAlert:AlertDialog;
		
		public function DialogTest()
		{
			super();
			
			// support autoOrients
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			myAlert = new AlertDialog();
			myAlert.title = "myAlertDialog";
			myAlert.align = DialogAlign.CENTER;
			myAlert.messageHtml = 	"<p align='left'>" + 
						"1. Something goes here <br />" + 
						"2. Something else here too <br />" + 
						"3. And a last thing to go here." + 
						"</p>";
			myAlert.addButton("OK");
			myAlert.addButton("CANCEL");
			myAlert.dialogSize = DialogSize.SIZE_MEDIUM;
			myAlert.show();
		}
	}
}

 

so basically you had the right idea except when you are trying to left align use the <p aligh='left'> tag and when putting in line breaks use <br /> instead of \n in case that was an issue too. Let me know how it turns out. Good luck!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 136
Registered: ‎03-04-2009
My Device: Not Specified

Re: QNX dialog text alignment

Perfect, thanks!!!