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
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

get rid of vertical scrollbar when extending MainScreen NO_SCROLLBAR

One would think the Vertical scroll down arrow would be removed. Its still there, the background paints nicely

but my Fields cannot expand all the way the right and there is space to the right with a down arow icon at the bottom.

How do you get rid of this thing.

 public class myForm extends MainScreen {

 

    public myForm(UiEngine ui, bbWidgetDataModelInterface wdmi){
        super(DEFAULT_MENU);
        this.ui=ui;
        this.wdmi=wdmi;
        theFieldManager = new VerticalFieldManager(Manager.USE_ALL_HEIGHT|Manager.USE_ALL_WIDTH|
                                                   Manager.NO_VERTICAL_SCROLL|Manager.NO_VERTICAL_SCROLLBAR){

            private void drawBackground(Graphics gc){
                int height= Graphics.getScreenHeight();
                int width = Graphics.getScreenWidth();
                int hlen=width/bk.getWidth()+1;
                int vlen=height/bk.getHeight()+1;

                for (int i=0; i<vlen; i++)
                    for (int j=0; j<hlen; j++)
                        gc.drawImage(j*bk.getWidth(),i*bk.getHeight(),bk.getWidth(),bk.getHeight(),bk,0,0,0);

            }
            public void paint(Graphics graphics){
                drawBackground(graphics);
                graphics.setColor(0);
                super.paint(graphics);
            }
        };
        try {
            bk = bbToolkit.createImage("IBMpaper.png");    
        } catch (Exception e) {
        }

        add(theFieldManager);

    }

Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: get rid of vertical scrollbar when extending MainScreen NO_SCROLLBAR

Still have that vertical Scrollbar in the display? Maybe someone can enlighten me.

 

 Basically take a Vertical manager and subclass it so I can pain tthe background

I have used the noscrollbar style and others

 

sample screen
 

Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified

Re: get rid of vertical scrollbar when extending MainScreen NO_SCROLLBAR

Have you tried passing all those style constants you use in the VerticalFieldManager constructor into the the call to super, which is hte MainScreen default constructor? According to the docs MainScreen includes it's own VerticalFieldManager, so presumably you need some way to notify that that you don't want scrollbars. Haven't tested this myself though so can't guarantee this does what you want..
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: get rid of vertical scrollbar when extending MainScreen NO_SCROLLBAR

How do you do that with an anonymous function?

I would think the parms would be passed in?

 

Just let me know

Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified

Re: get rid of vertical scrollbar when extending MainScreen NO_SCROLLBAR

[ Edited ]

To clarify, I mean have you tried doing

 

 

super(DEFAULT_MENU|USE_ALL_HEIGHT|USE_ALL_WIDTH|NO_VERTICAL_SCROLL|NO_VERTICAL_SCROLLBAR);

 

instead of just

 

 

super(DEFAULT_MENU);

 

 I'm not sure what you mean about an anonymous function I'm afraid..

 

 

Message Edited by malcolm on 09-15-2008 07:29 AM
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: get rid of vertical scrollbar when extending MainScreen NO_SCROLLBAR

Yes that worked from the Screen super() the anonymous function I was talking about is the Vertical Screen manager that I am

extending. Thanks.