Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

MIDP2.0 Gauge Pearl 8110

On the Blackberry Pearl 8110, this Item does not look like a Gauge and

does not seem to work well (interactive).

 

 

        red= new Gauge(tbsmNLS.get("label-vib")+" 0\n", true, 10, 0);
        sf.setItemStateListener(this);
        red.setLayout(Item.LAYOUT_NEWLINE_BEFORE|Item.LAYOUT_EXPAND);
        sf.append(red);

 

 [this]

    public   void itemStateChanged( Item item ){
        if (item instanceof Gauge)
            item.setLabel(tbsmNLS.get("label-vib")+" "+((Gauge)item).getValue()+"\n");

    }

 

Before I abandon using this control. Is there some magic here, this works fine on WTK

and is a nice control.

 

 

 

 

Please use plain text.
Developer
redpath
Posts: 62
Registered: ‎07-29-2008
My Device: Not Specified

Re: MIDP2.0 Gauge Pearl 8110

I guess if you try a bunch of combinations of things you can get it to work.

 

        red= new Gauge(tbsmNLS.get(" ", true, 10, 0);
        sf.setItemStateListener(this);
        red.setLayout(Item.LAYOUT_NEWLINE_BEFORE|Item.LAYOUT_EXPAND);
        sf.append(red);

 

 [this]

    public   void itemStateChanged( Item item ){
        if (item instanceof Gauge){int i=((Gauge)item).getValue();
//            item.setLabel(tbsmNLS.get("label-vib")+" "+i+"\n");
            if (i!=gsave){
               gsave=i;
               ((Gauge)item).setValue(i);
            }

        }

    }


Its not very pretty though with Bars just one horizontal stick, needless to say

that a single stick is not pretty.

 

Please use plain text.