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


10pcs/lot Slide Potentiometer 10K Linear Module Dual Output for Arduino picture

10pcs/lot Slide Potentiometer 10K Linear Module Dual Output for Arduino

$42.88



Dancer 138-0-0-103 Potentiometer 10k OHM picture

Dancer 138-0-0-103 Potentiometer 10k OHM

$349.50



87605245 Potentiometer For CNH tractor Holland tl70 tl80 t4020 ECC 87605247 new picture

87605245 Potentiometer For CNH tractor Holland tl70 tl80 t4020 ECC 87605247 new

$32.98



Potentiometer 87605245 For CNH tractor Holland tl70 tl80 t4020 ECC 87605247 picture

Potentiometer 87605245 For CNH tractor Holland tl70 tl80 t4020 ECC 87605247

$37.98



US Stock 10 Units 10K B10K OHM Linear Taper Rotary Potentiometer POT Blue Knob picture

US Stock 10 Units 10K B10K OHM Linear Taper Rotary Potentiometer POT Blue Knob

$8.99



10 turn Potentiometer 3590S Wirewound Variable Resistor Precision multi-turn POT picture

10 turn Potentiometer 3590S Wirewound Variable Resistor Precision multi-turn POT

$51.49







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