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
New Developer
ryanrhee90
Posts: 4
Registered: ‎12-24-2008
My Device: Not Specified

setPosition of BitmapField

[ Edited ]

Hello,

 

I'm trying to move a BitmapField within the mainscreen via click&drag.

I have the movement event done, but I can't seem to get the BitmapField to move.

How would I accomplish this?

 

I'm using 4.7.0, and the 9530 emulator.

 

-Ryan

Message Edited by ryanrhee90 on 12-24-2008 12:12 PM
Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: setPosition of BitmapField

In the fields manager you can call setPositionChild(Field, x, y) from sublayout()
Please use plain text.
New Developer
ryanrhee90
Posts: 4
Registered: ‎12-24-2008
My Device: Not Specified

Re: setPosition of BitmapField

[ Edited ]

>In the fields manager you can call setPositionChild(Field, x, y) from sublayout()

 

Sorry, I'm not sure what you mean by that.

I don't have a sublayout() function.

I'm not using a custom manage. I have two classes,

-class HelloWorldDemo extends UiApplication

-final class HelloWorldScreen extends MainScreen implements FieldChangeListener.

 

Could you explain in more detail please?

Message Edited by ryanrhee90 on 12-29-2008 01:38 PM
Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: setPosition of BitmapField

The MainScreen is a manager, if you are adding the BitmapField directly to the MainScreen, then override sublayout() in your MainScreen (HelloWorldScreen).

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&view=by_date_ascending&messa...

Please use plain text.
New Developer
ryanrhee90
Posts: 4
Registered: ‎12-24-2008
My Device: Not Specified

Re: setPosition of BitmapField


mreed wrote:

The MainScreen is a manager, if you are adding the BitmapField directly to the MainScreen, then override sublayout() in your MainScreen (HelloWorldScreen).

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&view=by_date_ascending&messa...


Should I replace getSomeField(); with the BitmapField I want to move?

And when I want the BitmapField to be moved, should I just call sublayout()?

If so, what should the variables width and height be when calling sublayout()?

Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: setPosition of BitmapField

Replace getSomeField() with the getter for your field. Calling updateLayout() will call sublayout() for you.
Please use plain text.
New Developer
ryanrhee90
Posts: 4
Registered: ‎12-24-2008
My Device: Not Specified

Re: setPosition of BitmapField

It still doesn't seem to work.

 

Is there a freeform display manager that can freely place fields anywhere on the screen?

Like using swing, without layout managers.

Please use plain text.
Administrator
MSohm
Posts: 14,310
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: setPosition of BitmapField

There is a sample custom manager and field sample found at the link below that allows you to specify X and Y coordinates for a field.

 

http://na.blackberry.com/eng/devjournals/resources/journals/jul_2005/gui_part_1.jsp

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.