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
perlwhite
Posts: 122
Registered: ‎07-28-2009
My Device: Not Specified

Re: how to Scroll only a part of screen......

Bikas I have 2 or 3 screens in which i need to implement the scroll content logic with keeping the header constant........i need to implement in 3 screens........... So it would be best if i keep this Header code seperatly that is in a  customised class and i call this class when requried.....i tried coding a customed class with the code which u sent but was unsucessful ......the code which has to be customised i am pasting below........i.e it should be Customised HorizontalFieldManager class........

 

final int imageWidth = demoText.getPreferredWidth(); final int imageHeight = demoText.getPreferredHeight(); int dataTransparent[] = new int[imageWidth * imageHeight]; final Bitmap transparentImage = new Bitmap(imageWidth, imageHeight); transparentImage.setARGB(dataTransparent, 0, imageWidth, 0, 0, imageWidth, imageHeight); headerManager = new HorizontalFieldManager() { protected void paintBackground(Graphics graphics) { graphics.drawBitmap(0,0,imageWidth, imageHeight, transparentImage,0,0); } };

i want to keep the above code in a seperate class......is it possible kindly help me and how to call when required.......

Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: how to Scroll only a part of screen......

Please use plain text.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: how to Scroll only a part of screen......

Hi Bikas and all,

                             Please suggest me a way how to implement the following...

           i need to scroll a part of the manager how can i made it possible i used all the stuff of Manager.VERTICAL_SCROLL and etc.,. but iam not getting things rightly. i need to scroll the text in the following code. 

 

 

        any help would be of great!!!!!!!! 

 

class AideManager extends Manager { private TextField text; private NullField nul; private int h; AideManager() { super(Manager.VERTICAL_SCROLLBAR | Manager.VERTICAL_SCROLL | Manager.USE_ALL_HEIGHT | Manager.BOTTOMMOST); setBackground(BackgroundFactory.createSolidTransparentBackground(Color.ANTIQUEWHITE, 150)); text = new TextField(TextField.NO_EDIT_MODE_INPUT | TextField.FIELD_VCENTER |TextField.USE_ALL_WIDTH | Field.USE_ALL_WIDTH | Field.FOCUSABLE); text.setText(AllImages._aide); // is to scrolled along the manager text.setEditable(false); nul = new NullField(); h = AllImages._imgInfotable.getHeight()+text.getHeight()+30; add(text); add(nul); } protected void sublayout(int width, int height) { if(text != null) { setPositionChild(text, 0, AllImages._imgAide.getHeight()+10); layoutChild(text, getScreen().getWidth(), text.getPreferredHeight()); } if(nul != null) { setPositionChild(nul, 0, h); layoutChild(nul, getScreen().getWidth(), 10); } setExtent(getScreen().getWidth(), h+30); } protected void paint(Graphics g) { g.setBackgroundColor(Color.PINK); g.clear(); g.drawBitmap(0, 0, AllImages._imgAide.getWidth(), AllImages._imgAide.getHeight(), AllImages._imgAide, 0, 0); g.drawBitmap(0, AllImages._imgAide.getHeight()+text.getHeight()+10, AllImages._imgInfotable.getWidth(), AllImages._imgInfotable.getHeight(), AllImages._imgInfotable, 0, 0); super.paint(g); } }

 

 

 


Thanks and Regards,

PraveenG 

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
New Developer
perlwhite
Posts: 122
Registered: ‎07-28-2009
My Device: Not Specified

Re: how to Scroll only a part of screen......

Hi Blanc,

                    Can you be more elaborate about your requirment.....I mean You mention Part of you manager...............how your output should like...

Please use plain text.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: how to Scroll only a part of screen......

Thank you for reply...

                      

         my requirement is for example let the height of the manager be 200. it is organised as follows.

 

at   (0,0)  i have image of height 20.

 

at (0, 30) i need to append my text which is of length more than the manager height. now i need to scroll the text between (0,30) and (0,200)

 

these margins.

 

 

    i hope  this will explain my requirement. pleae do help it is my urgent requirement.

 

 

Thanks and Regards,

PraveenG 

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: how to Scroll only a part of screen......

Hi Balnc,

Your above code seems ok.

Try with not drawing  _imgInfotable image in the paint() method.

 

Regards

Bikas

 

Please use plain text.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: how to Scroll only a part of screen......

    Hi Bikas,

                    i need to show the infotable in that manager. is my approach correct?? i checked as you told now it is scrolling when i pressed the down arrow on the keyboard.actually it should be scrolled along with the touch swipe on the screen. it is my actual requirement. to achieve this i added the nulll field at the end of the manager. but it is not working so. 

 

 

                           now i found a new problem. i have another manager which is appended at the bottom of this manager. when i pressed the down arrow the text of manager1 scrolling down but at the end the control is moving to the next manager and the fields in that manager also getting selected. control should not be moved to the next manager ie manager2 when manager1 is selected. 

 

        atleast tell me the approach  to achieve this i posted my requirement in the above post. 

 

 

Thanks and Regards

PraveenG            
 

Thanks and Regards,
PraveenGoparaju.
Please use plain text.