Join Our 3 MILLION+ Members Today! Register Here | Login
Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > App Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
    Thread Author   #1  
Old 06-03-2011, 01:31 AM
CrackBerry Newbie
Device(s): Not a BlackBerry/Smartphone User
 
Join Date: Jun 2008
Posts: 4
Likes Received: 0
Thanked 0 Times in 0 Posts
Question error drawFocus bb 9780

Im confused i use this code and in bb 8520 works fine but in bb 9780 it appears to do something diferrent. And when the button gets the focus it draw all black.


Code:
    protected void paint(Graphics graphics) {
        graphics.setFont(font);
        graphics.setColor(color);
        graphics.drawBitmap(0, 0, graphics.getScreenWidth(), graphics.getScreenHeight(), imgBtn, 0, 0);
        graphics.drawText(label, xTexto, (imgBtn.getHeight() - font.getHeight()) / 2);
    }
    
    protected void drawFocus(Graphics g, boolean on) {
        g.setGlobalAlpha(0);
        g.clear();
    }
Reply With Quote Tip this Post
  #2  
Old 06-04-2011, 12:06 PM
Developer - ToySoft
Device(s): 9800 (Torch)
Carrier: Fido
 
Location: Canada
Join Date: May 2008
Posts: 2,756
Likes Received: 48
Thanked 80 Times in 54 Posts
Default

Quote:
Originally Posted by brsaca View Post
Im confused i use this code and in bb 8520 works fine but in bb 9780 it appears to do something diferrent. And when the button gets the focus it draw all black.


Code:
    protected void paint(Graphics graphics) {
        graphics.setFont(font);
        graphics.setColor(color);
        graphics.drawBitmap(0, 0, graphics.getScreenWidth(), graphics.getScreenHeight(), imgBtn, 0, 0);
        graphics.drawText(label, xTexto, (imgBtn.getHeight() - font.getHeight()) / 2);
    }
    
    protected void drawFocus(Graphics g, boolean on) {
        g.setGlobalAlpha(0);
        g.clear();
    }
trying adding

super.paint(graphics);

at the end of the paint()
__________________
Visit our website www.toysoft.ca for Cool BlackBerry Apps!
Follow us @ http://twitter.com/toysoft or visit us at AppWorld
Reply With Quote Tip this Post
Reply
BlackBerry Forums at CrackBerry.com > > BlackBerry Professionals > App Developers   error drawFocus bb 9780

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes