BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-03-2010, 05:26 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 8300
PIN: N/A
Carrier: Rogers
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Custom RichTextField NON_FOCUSABLE.. How is it done?

Please Login to Remove!

hey all,

I found this class below online. it works great for what i need, but I want to make the text unselectable. I know normally you add "Field.NON_FOCUSABLE" as one of the parameters to a richtextfield to make that work... but not sure what to do if it's a custom one like below.

Thanks in advance!!

Code:
class SectionHeader extends RichTextField { 
 
        int mTextColor; 
        int mBgColor; 
 
        public SectionHeader(String text, int bgColor, int textColor) { 
                super(text); 
                mTextColor = textColor; 
                mBgColor = bgColor; 
        } 
 
        protected void paint(Graphics graphics) { 
                graphics.clear(); 
                graphics.setColor(mBgColor); 
                graphics.fillRect(0, 0, getWidth(), getHeight()); 
                graphics.setColor(mTextColor); 
                super.paint(graphics); 
        } 
    }
Offline  
Old 03-03-2010, 05:29 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 8300
PIN: N/A
Carrier: Rogers
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

nevermind... figured it out. Change one of the lines to :

Code:
super(text,Field.NON_FOCUSABLE);
Still trying to understand the super() method
Offline  




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