Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Contributor
brad51
Posts: 32
Registered: 02-02-2011
My Carrier: none

Re: Picker black themed skin not working

you are awesome. thanks.

--------------------------------------
Dirty Kitchen Cooking Timer
http://appworld.blackberry.com/webstore/content/37403
Please use plain text.
Developer
studiochris
Posts: 160
Registered: 10-26-2010
My Carrier: .

Re: Picker black themed skin not working

[ Edited ]

I'd go about this a different way and add the labels to the selectionSkin instead of as children of the picker itself. Then, you could set the selectionSkin's mouseChildren property to false, if it isn't already (I'd imagine it is though), so that the skin parts themselves don't catch mouse events.

 

With the way you're doing it now, you could also try setting the labels' mouseEnabled property to false and any mouse events that would normally be caught by the labels would just pass through to the next object below that is mouseEnabled.

Please use plain text.
Contributor
brad51
Posts: 32
Registered: 02-02-2011
My Carrier: none

Re: Picker black themed skin not working

can you give an example of the code? i'm not sure how to go about that. thank you.

--------------------------------------
Dirty Kitchen Cooking Timer
http://appworld.blackberry.com/webstore/content/37403
Please use plain text.
Developer
studiochris
Posts: 160
Registered: 10-26-2010
My Carrier: .

Re: Picker black themed skin not working

[ Edited ]

 

label.mouseEnabled = false;

 

For the skinning method, there are many examples of skinning the components on the forum at this point, including this very thread that describes changing the button skin of the Picker class. The selection skin would be exactly the same, except you'd be changing selectionSkin instead of buttonSkin.

 

If necessary, the mouseChildren property works just like mouseEnabled.

 

 

someItem.mouseChildren = false;

 

 

Please use plain text.
Contributor
brad51
Posts: 32
Registered: 02-02-2011
My Carrier: none

Re: Picker black themed skin not working

hi. the solution provided in page 1 of this thread (the customPicker) was working for me for until SDK 1.0.1.

now i get an error message:

 

 

CustomPicker.as, Line 15 1178: Attempted access of inaccessible property __backgroundButton through a reference with static type CustomPicker.

here is the code again.

package
{
	import qnx.ui.picker.Picker;
	
	public class CustomPicker extends Picker
	{
		public function CustomPicker()
		{
			super();
		}
		
		override public function setButtonSkin(skin:Object):void
		{
			this.__backgroundButton.setSkin(skin);
		}
	}
}

 


strangely, when i remove the line in question, of course i lose the error but my custom skinning still seems to work fine on my desktop as displayed in the flash player (i'm building my app in flash pro).
but in the simulator 1.0.1 i'm losing my custom changes to the picker. (actually, could this be a simulator issue? my old build using SDK 0.9.4 (which doesn't get the error message and looks perfect in the simulator 0.9.4) loses its custom settings also when sent to the 1.0.1 simulator.) 
thanks.

 

--------------------------------------
Dirty Kitchen Cooking Timer
http://appworld.blackberry.com/webstore/content/37403
Please use plain text.
Developer
studiochris
Posts: 160
Registered: 10-26-2010
My Carrier: .

Re: Picker black themed skin not working

 

If I remember right, the above was a workaround for a bug in a previous version of the SDK where the black skin wouldn't apply to the button. It doesn't look like that variable exists anymore.
Try changing that line to: 
this.setButtonSkin(skin);

 

to match the real API.

 

 

Please use plain text.
Contributor
brad51
Posts: 32
Registered: 02-02-2011
My Carrier: none

Re: Picker black themed skin not working

that was it! thanks very much.

--------------------------------------
Dirty Kitchen Cooking Timer
http://appworld.blackberry.com/webstore/content/37403
Please use plain text.
Contributor
brad51
Posts: 32
Registered: 02-02-2011
My Carrier: none

Re: Picker black themed skin not working

i guess i spoke too soon. i'm building from flash pro and now it outputs without an error. but just tried it in the simulator. the custom font is no longer being used by the picker!

--------------------------------------
Dirty Kitchen Cooking Timer
http://appworld.blackberry.com/webstore/content/37403
Please use plain text.
Contributor
brad51
Posts: 32
Registered: 02-02-2011
My Carrier: none

Re: Picker black themed skin not working

Add this to your custom cell renderer to get a custom font to embed properly in the picker:

 

this.label.embedFonts=true;

 i've been trying to figure this out for months! it seems so easy now:Sweatdrop:...

--------------------------------------
Dirty Kitchen Cooking Timer
http://appworld.blackberry.com/webstore/content/37403
Please use plain text.
Contributor
brad51
Posts: 32
Registered: 02-02-2011
My Carrier: none

Re: Picker black themed skin not working

it did seem easy. now I find that using:

this.label.embedFonts=true;

actually causes the picker text to turn to gibberish in many cases. only the numbers come through unscathed. so after a year of trying, my picker is still using a default font. this sucks! (i need programmer skills obviously)

 

--------------------------------------
Dirty Kitchen Cooking Timer
http://appworld.blackberry.com/webstore/content/37403
Please use plain text.