BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 03-04-2010, 04:28 AM   #1
satyarajasekhar
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: AIRTEL
Posts: 25
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, 04:30 AM   #2
satyarajasekhar
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: AIRTEL
Posts: 25
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, 08:15 AM   #3
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
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, 10:43 PM   #4
satyarajasekhar
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: AIRTEL
Posts: 25
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-05-2010, 12:18 AM   #5
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
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



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


150mm/6

150mm/6" Semiconductor 15-Tray Wafer Cassette/Magazine for Robotic Inspection

$349.00



Peak, Atlas DCA55 Semiconductor Tester,  picture

Peak, Atlas DCA55 Semiconductor Tester,

$97.99



Sensata Crydom F1892RD1200 Discrete SCR Diode Power Module Rectifier picture

Sensata Crydom F1892RD1200 Discrete SCR Diode Power Module Rectifier

$118.99



Ferraz Shawmut A50P125-4TA Semiconductor Fuse picture

Ferraz Shawmut A50P125-4TA Semiconductor Fuse

$199.99



Dual Range Transistor Diode Semiconductor & Passive Curve Tracer Tester/Tracker picture

Dual Range Transistor Diode Semiconductor & Passive Curve Tracer Tester/Tracker

$26.99



1 Reliance ELECTRIC 701819-AB MICRO SEMICONDUCTOR picture

1 Reliance ELECTRIC 701819-AB MICRO SEMICONDUCTOR

$224.00







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