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



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


Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod picture

Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod

$45.00



Retro 1951 Apple Computer Logo 0.7mm Ballpoint Black Ink Pen Gold Barrel picture

Retro 1951 Apple Computer Logo 0.7mm Ballpoint Black Ink Pen Gold Barrel

$56.41



Vintage  Rainbow Logo Apple Post-It Sticky Notes 4

Vintage Rainbow Logo Apple Post-It Sticky Notes 4" Rare computer collectible

$39.99



Vintage Print Block “ Apple Corer Kitchen Tool “ Copper Face Block picture

Vintage Print Block “ Apple Corer Kitchen Tool “ Copper Face Block

$16.00



VINTAGE 1994 Apple Black Toner Laser Writer Cartridge M 2473 G/A NEW SEALED picture

VINTAGE 1994 Apple Black Toner Laser Writer Cartridge M 2473 G/A NEW SEALED

$25.95



Vintage Red Apple Six Drawer Storage Organizer File Cabinet  picture

Vintage Red Apple Six Drawer Storage Organizer File Cabinet

$28.00







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