BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-26-2008, 01:53 PM   #1 (permalink)
New Member
 
Join Date: Sep 2008
Model: 8330
PIN: N/A
Carrier: verizon
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Angry Layout Manager losing scroll up and down arrow

Please Login to Remove!

The following test codes is my testing code for custom layout manager, just trying to have first half screen scrollable and 2nd half non-scrollable. The first haf screen works, however, I don't see the upward scroll arrow and downward scroll arrow on the right side of screen. How could I fix it so that I have half-screen scrollable with upward and downward arrow on right side?



Can anybody help me and post some sample codes?



Thank you very much.



Scott





/*
* Napolean.java
*
* <your company here>, 2003-2008
* Confidential and proprietary.
*/

package com.source;

import net.rim.device.api.ui.UiApplication;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;






class Napolean extends UiApplication {


public static void main (String[] args)
{

Napolean theApp =new Napolean();
theApp.enterEventDispatcher();

}


public Napolean()
{

pushScreen(new NP_RegisterScreen2());

}
}





class NP_RegisterScreen2 extends MainScreen {


NP_RegisterScreen2()
{
CustomManager_test Layout_test = new CustomManager_test(120);
add(Layout_test);

for (int i=0; i<10; i++) {
ButtonField btn = new ButtonField( "test"+i);

Layout_test.add(btn);
}

}
}



class CustomManager_test extends VerticalFieldManager
{
int _managerHeight; // Total height of the manager
int screen_width= Graphics.getScreenWidth();
// Pass in desired height. Scrolling is turned off in both directions.
public CustomManager_test(int passHeight)
{
super( VerticalFieldManager.VERTICAL_SCROLL);

_managerHeight = passHeight;
}

// Sublayout is called automatically to position all the internal fields to this
// layout. Its sublayouts job to read in the custom coordinates of each of the fields
// and place them accordingly.
protected void sublayout(int width, int height)
{
Field field;
int numberoofFields =getFieldCount();



int x=0;
int y=0;
for (int lcv = 0; lcv < numberoofFields; lcv++)
{
field = getField(lcv);
setPositionChild(field, x, y);
layoutChild(field, width , height);
x=0;
y+=30;

}

//Set the manager's dimensions
setExtent(width, _managerHeight);
}

public int getPreferredWidth()
{
return Graphics.getScreenWidth();
}

public int getPreferredHeight()
{
return Graphics.getScreenHeight();
}
}
Offline  
Old 11-26-2008, 01:59 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use the following in you custom manager constructor:

super(Manager.VERTICAL_SCROLL|Manager.VERTICAL_SCR OLLBAR);


Rab
Offline  
Old 11-28-2008, 06:04 PM   #3 (permalink)
New Member
 
Join Date: Sep 2008
Model: 8330
PIN: N/A
Carrier: verizon
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I changed it, but still couldn't see the upward and downward scroll arrow.........I even hardcode the preferredHeight to return 100, but not working.........

public int getPreferredHeight()
{
//return Graphics.getScreenHeight();
return 100;

}
Offline  
Old 11-29-2008, 12:31 AM   #4 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by youarenumber1 View Post
The first haf screen works, however, I don't see the upward scroll arrow and downward scroll arrow on the right side of screen. How could I fix it so that I have half-screen scrollable with upward and downward arrow on right side?
What do u mean by the first half screen works but u are not able to see the scroll bar. Is ur scrolling working?
__________________
Smart People ask for Help!!!
Offline  
Old 11-30-2008, 09:42 PM   #5 (permalink)
New Member
 
Join Date: Sep 2008
Model: 8330
PIN: N/A
Carrier: verizon
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

"What do u mean by the first half screen works but u are not able to see the scroll bar. Is ur scrolling working?"
------------
yes, scrolling working, but without the upward and downward arrow on the right side of screen (it supposed to)
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.