BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-04-2008, 08:47 AM   #1
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Default Ellipses on drawText

Please Login to Remove!

hi

i have a screen, on this i want to draw some text using drawText in the Graphics function(). Now the problem is if i draw a very long screen then it is not shown fully on the screen. i want to add ellipses if the string is very long using drawText. I have tried to add DrawStyle.ELLIPSES but of no use.


Does anyone have any ideas please share it with me.


Thanks ..
Offline  
Old 06-04-2008, 08:59 AM   #2
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Default

Never mind. Got it with a little deeper search.. Dint get it previously...
Offline  
Old 06-04-2008, 08:59 AM   #3
CELITE
Thumbs Must Hurt
 
Join Date: Dec 2005
Model: 8310
Carrier: Rogers
Posts: 138
Default

This function:

PHP Code:
public int drawText(String text
                    
int x,
                    
int y,
                    
int flags,
                    
int width
In the graphics class should do what you're after. Width specifies the max width of the draw space (in your case Display.getWidth()) and flags is DrawStyle.ELLIPSES
Offline  
Old 06-17-2008, 10:59 AM   #4
ashut_it
New Member
 
Join Date: Mar 2006
Location: India
Model: 8800
Carrier: airtel
Posts: 7
Default Problem on drawing the Characters 'r', 'L' in 8130 & 8120.

Hi,

In my Application, I m using
drawText(char character,
int x,
int y,
int flags,
int width)
to draw all the characters.
Now the problem is all the characters are drawn perfectly except the letter 'r', 'L', '/', & '\', & this problem occurs only in BB 8120 & BB 8130 of 4.3.0JDE Version.

Earlier I was finding-out the width by
width = graphics.getFont().getAdvance(character);
which was returning the correct value for all letters but 'r', 'L', '/', & '\' are not rendered.

After applying your suggestion by giving the width as Display.getWidth(), in the below method
drawText(character, xPos, yPos, DrawStyle.LEFT | DrawStyle.TOP, Display.getWidth());

Now 'r' & 'L' are also displayed, each character is displayed perfectly, its working fine.

My concern is can i use Display.getWidth() in drawText to draw the characters ? will it be the correct way ? As we know the Display.getWidth() will return total drawing width of the display's drawable area which is not very much required for a single character to display on the screen.
But as your suggestion works fine & is a solution for me, i just wanted to be sure of passing the Display.getWidth() just to draw a single character.

Please provide your input on this.

Many Thanks for your suggestion.

-A

Last edited by ashut_it; 06-17-2008 at 06:35 PM..
Offline  
Old 06-17-2008, 05:59 PM   #5
CELITE
Thumbs Must Hurt
 
Join Date: Dec 2005
Model: 8310
Carrier: Rogers
Posts: 138
Default

If you're just drawing a single character, I would instead to the boundary check yourself by checking to see if x extends Display.getWidth(), and if so, do not draw the character.
Offline  
Old 06-21-2008, 02:21 PM   #6
ashut_it
New Member
 
Join Date: Mar 2006
Location: India
Model: 8800
Carrier: airtel
Posts: 7
Default

Thanks
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


60 Return Address Labels Personalized Printed 3/4 x 2 1/4 College Football Teams picture

60 Return Address Labels Personalized Printed 3/4 x 2 1/4 College Football Teams

$2.89



1x Vintage MOS 6510CBM 6510 HMOS Commodore C64 IC picture

1x Vintage MOS 6510CBM 6510 HMOS Commodore C64 IC

$26.90



Vanderbilt University Field Runner Mat - 30in. x 72in. picture

Vanderbilt University Field Runner Mat - 30in. x 72in.

$71.76



NCAA Vanderbilt Commodores Golf Hitting Mat, Team Color, One Size picture

NCAA Vanderbilt Commodores Golf Hitting Mat, Team Color, One Size

$53.00



Vintage Calculator Commodore Custom Green Line GL-997R power supply TESTED WORKS picture

Vintage Calculator Commodore Custom Green Line GL-997R power supply TESTED WORKS

$39.99



1976 Commodore 899D Portable Mini Computer Calculator NEW in BOX Vintage  picture

1976 Commodore 899D Portable Mini Computer Calculator NEW in BOX Vintage

$450.00







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