BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 06-19-2008, 02:47 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 8310
PIN: N/A
Carrier: Developper
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Extends HorizontalFieldManager problems

Please Login to Remove!

Hi,

I want to create my own class which extends from in order to get a HorizontalFieldManager with a specific color.

I have this :
Code:
public class tabManager extends HorizontalFieldManager {

    public tabManager() {
    }

    protected void paint(Graphics graphics) {
        graphics.setColor(Color.LIGHTBLUE);
        super.paint(graphics); // ERROR
    }
            
}
i don't undersant the error.

Thanks for your help.
Offline  
Old 06-19-2008, 08:35 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

no need to create own extended calss if you just want to change the color. Override paint() directly on object creation.

PHP Code:
HorizontalFieldManager hfmMyHManager = new HorizontalFieldManager()
{

   ...                       
   protected 
void paint(Graphics g)
   {
       
// Background color if necessary
       
g.setBackgroundColor(Color.LIGHTBLUE);
       
g.clear();

       ... 
here your own drawing ...

       
super.paint(g);
   }
   ...
}; 
P.S. which error do you get?

Last edited by Ivanov : 06-19-2008 at 08:38 AM.
Offline  
Old 06-19-2008, 09:42 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 8310
PIN: N/A
Carrier: Developper
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

in fact, i want to create an HorizontalMenu for all my App, so i want to create a Class.

I have solved the my problem (an import was missing) now, it works perfectly with this code :

Code:
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.container.HorizontalFieldManager;

public class tabManager extends HorizontalFieldManager {

    public tabManager() {
        
    }
    
    public tabManager(long style){
       
    }

    public void paint(Graphics g) {
        g.setBackgroundColor(Color.VIOLET);
        g.clear();
        super.paint(g);
    }
}
But i don't know what i need to put in order to support the STYLE directive in the constructor. I don't see any method like setStyle().
Offline  
Old 06-19-2008, 10:40 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
    public tabManager(long style){
       super(style);

       // do other initializations
    }

Last edited by Ivanov : 06-19-2008 at 10:42 AM.
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

Jalenko Commodore II Dental Oven Laboratory Furnace - for Parts/Repair
$114.24
Jalenko Commodore II Dental Oven Laboratory Furnace - for Parts/Repair pictureWINDSOR COMMODORE 20 CARPET EXTRACTOR TENNANT ADVANCE KENT
$392.0
WINDSOR COMMODORE 20 CARPET EXTRACTOR TENNANT ADVANCE KENT pictureCommodore VIC-20 Power Supply 902502-02
$39.99
Commodore VIC-20 Power Supply 902502-02    pictureFlight Simulatore CM-FS2 With All Booklets And Sheets Commodore
$0.99
Flight Simulatore CM-FS2 With All Booklets And Sheets Commodore pictureJelenko Commodore 100 Dental Laboratory Oven/Furnaces 120V - for Parts
$97.41
Jelenko Commodore 100 Dental Laboratory Oven/Furnaces 120V - for Parts picture






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