BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-04-2010, 03:28 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: AIRTEL
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default colour issue for HorizontalFieldManager and custom label field

Please Login to Remove!

Hi,
I am usiing horizontalfieldmanager and customfield and overriding the paint method in both classes. I am displaying rectangle around label to get a table like view structure. The issue is, when the focus is on row ie., on horizontalfieldmanager i require rectangles to be drawn with different colour and text to be drawn with different colour.

How to do this. Please help me.
I had gone through fillRect method suggested, but in that case, i am not getting the text.
Offline  
Old 03-04-2010, 03:30 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: AIRTEL
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default SetColor issue

when we call setColour on graphics object and drawing the rectangle its also changing the text colour also. How to draw text and rectangle with different colours. Please, help me.
Offline  
Old 03-04-2010, 07:15 AM   #3 (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

setColor() changed the color for all drawing operations, including text.

You need to set the color for the part that you are drawing, right?
Offline  
Old 03-04-2010, 09:43 PM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: AIRTEL
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default color issue for custom HorizontalFieldManager and custom label field

Hi,
thanks for your reply. Actually, the thing is, adding the label field is not in my control. I am just creating the insance of the custom label field, and drawing the rectanglel around that custom label field.

Its difficult for me to draw the text using paint because the size of the text will vary. So, only i was drawing the rectangle. When i was setting the color either in the custom horizontal fieldmanager or custom label field using paint method, all the rectangles and text are painted with same color.

Please help me.
Offline  
Old 03-04-2010, 11:18 PM   #5 (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 everything is drawing in the same color, and this is the color that you set in paint(), then it is doing what you told it to do, right?

Most likely, you need to get the current color, set the color you need for the rectangle, draw the rectangle, then reset the color back to what it was before calling super.paint()

Post a code snippet.
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





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