BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 04-14-2009, 05:37 PM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: 9000
PIN: N/A
Carrier: vodafone
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Screen custom paint. How to show scrollbars?

Please Login to Remove!

hi all,
in a screen i override paint function to design screen's content as i like. The matter is that the height of the content painted inside the screen exceed display max height and the vertical scrollbar is missing.
code is simple... for example
protected void paint(Graphics graphics) {
super.paint(graphics);
for ( int i = 0; i < 100; i++ ) {
graphics.drawText("test", 5, y + ( i * 30 ), DrawStyle.ELLIPSIS );
}
}

how can i force the vertical scrollbar to be displayed?

next step is more complex. i need to add a button at the bottom of the screen. how can this be solved?

please post code
thanks
J.

Last edited by ichigo72 : 04-14-2009 at 06:03 PM. Reason: added a question
Offline  
Old 04-14-2009, 07:29 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

If you paint your own screen, then you'll be responsible for the scroll bars and the scrolling.

Instead, extend Field (creating your own custom field), do your painting inside the Field class. Now you can add your Field to a Manager and set the SCROLL properties in the manager. The Manager will scroll your field if the field vitual extent exceeds the display area.

Your next step is really a variation of this first. Set the physical extent of your Field so that it will not encroach on the area reserved for the button.

And BTW, post on one forum or the other, not both.
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

Polycom Soundstation IP5000 Conference VoIP Phone 2201-30900-001
$89.99
Polycom Soundstation IP5000 Conference VoIP Phone 2201-30900-001 pictureYealink SIP-T28P business class ip phone voip Black - With Power Supply
$43.99
Yealink SIP-T28P business class ip phone voip Black - With Power Supply pictureAastra 6755i 55i VoIP Display Phone w/ brand new power adapter
$29.99
Aastra 6755i 55i VoIP Display Phone w/ brand new power adapter    picture Obihai OBi1032 VoIP IP Phone Dialpad
$69.99
 Obihai OBi1032  VoIP  IP Phone    Dialpad pictureCisco CP-7937G VoIP Conference Station Unified IP PoE Phone 7937G
$65.0
Cisco CP-7937G VoIP Conference Station Unified IP PoE Phone 7937G picture






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