BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-03-2010, 04: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, 04: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  
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.