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

Java Development

Reply
Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone

Changing paint context stack but leaving field's location intact

Hi all!

I will try to explain what I'm trying to do:

-I have a Manager (will talk about him later).

-I have a BitmapField with a height of 25 pixels.

-Last I have a ListField that occupies the rest of the screen.

-I add the two fields on the Manager.

Well, then I want that the BitmapField overlap the ListField by 5 pixels. But instead, I got the ListField over the BitmapField by those 5 pixels.

 

That's the situation. About how I'm going to overlap them, I'm using the NegativeMarginVerticalFieldManager that comes inside the AdvancedUI example project, exactly the one used in UIExampleNegativeMarginScreen class.

 

Problem: after trying things and reading all I could find about paint, subpaint,  layout and subLayout. I realized I had to modify the context stack from Graphics:

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/Graphics.html

More specific info about context stack:

http://docs.blackberry.com/es-es/developers/deliverables/36434/Context_stack_1579423_11.jsp

 

Ok, so after reading them... I'm lost.

How do I say to the context stack that if I have these fields:

1-ButtonField

2-BitmapField

3-ListField

 

I want the order of painting them like this?:

1-ButtonField

2-ListField

3-BitmapField

 

Please note that I'm saying the order of painting, not the position on the screen, the position should be like the first list.

 

Well, thanks for any help and sorry about the explanation, I thought this was the most accurate way of saying it without leaving space for misunderstandings.

If any snippet code is needed, say so.

 

 

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Changing paint context stack but leaving field's location intact

maybe it is as easy as changing the order in which the fields are added?
i have no experience with pushContext and the like, if the adding order does not help i'll leave the field for other experts who may have dabbled there.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone

Re: Changing paint context stack but leaving field's location intact

[ Edited ]

Thanks for the suggestion simon, but I already tried to substitute add() with insert() and trying to insert my BitmapField the last one, but on the context stack it was still the second field.
I have the feeling this stack goes from the most top field of the screen to the most below one.
That's why I thought that maybe I had to artificially alter the order and how the field is added to the stack.