How to show the ListField focus point in reverse or other color

I saw similar comments, but not enough information to go. I'm new to b'berry and java too, this is my first application, and it comes to Notifications, storage options, the requests HTTP, XML and browser integration, there has been a steep learning curve!

I have a ListField with a ListFieldCallback, which draws text in the list of members. When the wheel is used to select items, the background is blue but unchanged in the foreground, making almost unreadable text. I want the text to be reversed in color, or blue background (preferably) be a rectangle outline. I think that the answer lies somewhere like getCallback and focusRect, but I don't know what to do. Ideally, I would like to change the code in the callback class 'drawListRow()', but I suspect that things are not so simple!

My code looks like (sorry I can't put much too, I wanted to know what pieces of change):

...

final class SMobile extends UiApplication
{
...
    private ListCallback myCallback;
    private ListField myList;

    public static void main(String[] args)
    {
...
            SMobile theApp = new SMobile( true);
            theApp.enterEventDispatcher();
...
    }
...
    private SMobile( boolean runmode)
    {
...
            myList = new ListField();
            myCallback = new ListCallback();
            myList.setCallback(myCallback);
            myCallback.erase();

            _mainScreen.add(myList);
...
            pushScreen(_mainScreen);
    }
...
    private static class ListEntry {
        public String s = "";
        public String t = "";
        public String f = "";
        public String st = "";
        public String m = "";
    }

    private static class ListCallback implements ListFieldCallback {
        private Vector listElements = new Vector();

        public void drawListRow(ListField list, Graphics g,
                                        int index, int y, int w) {  

            ListEntry _entry = (ListEntry)listElements.elementAt(index);

            if ( _entry.st.indexOf("U") != -1)
            {
                g.setColor( Color.DARKRED);
            }
            else
            {
                g.setColor( Color.DARKGREEN);
            }

            Font _font = g.getFont();
            int size = (_font.getHeight() ) / 2;
            _font = _font.derive(0, size, Ui.UNITS_px);
            g.setFont( _font);
            g.drawText(_entry.s.concat(", ").concat(_entry.t).concat(",").concat(_entry.st),
                        0, y+1, (int)( DrawStyle.ELLIPSIS | DrawStyle.LEFT ), w);

            g.setColor( Color.BLACK);
            g.drawText(_entry.f.concat(", ").concat(_entry.m),
                        10, y + _font.getHeight()-1,
                        (int)( DrawStyle.ELLIPSIS | DrawStyle.LEFT ), w);
        }

        public Object get(ListField list, int index) {
            return listElements.elementAt(index);
        }
        public int indexOfList(ListField list, String p, int s) {
            return -1; //Not implemented, as we have an object in the Vector, not a string
        }
        public int getPreferredWidth(ListField list) {
            return Display.getWidth();
        }
        public void insert(ListEntry toInsert, int index) {
            listElements.insertElementAt(toInsert, index);
        }
        public void erase() {
                listElements.removeAllElements();
        }
    }

...
}

Please can someone advise?

Thank you.

Steve

Thanks Mark,

I ended up using a similar method with a twist. I drew a background rectangle slightly smaller than the list item, then the blue selection box turns into a blue outline, and colors of foreground elements are not hidden by it:

...
        public void drawListRow(ListField list, Graphics g,
                                        int index, int y, int w) {  

            ListEntry _entry = (ListEntry)listElements.elementAt(index);

            //Draw background rectangle to replace dk blue selection rectangle with outline only
            g.setColor( Color.WHITESMOKE); //Pale but not white
            int h = list.getRowHeight();
            g.fillRect( 2, y+2, w-4, h-4);
...

Steve

Tags: BlackBerry Developers

Similar Questions

  • How to show the photo album in Apple Tv screensaver.

    How to show the photo album in Apple Tv screensaver. ?

    You can use your photo stream or albums shared for the screen saver, the iCloud photo library can be viewed only manually.

  • The rebel sl1 is adjustable to use only the Center focus point?

    The rebel sl1 is adjustable to use only the Center focus point?

    I've never used one, but I'm sure you can.  Judging by the images I found on a Google search looking for the button in the top right rear, it looks like a rectangle with a sign in there.  Which will allow you to select your focus points.

  • How to help the user focus

    How to help the user focus

    Magnifier enlarges part of the screen. This is especially useful for viewing objects that are difficult to see. It is also useful for people who are generally difficult to see the screen.

  • How to show the ink levels on the computer for Officejet 6600

    How to show the ink levels on the computer for Officejet 6600

    What is the full product name or product number?

    is your printer?

    This is the Manual of your printer the following image was derived.

    You can use the printer's built-in web server to get the status of the printer information from a browser.

  • How to show the multiple declaration for an application

    How to show the multiple declaration for an application

    Thanks for your suggestions...

    Looking at the javadocs you can only save an indicator by application. You will need to do three separate applications and package them as an If you want three different indicators to be visible at a time. Or change the flag that (or which group) of the indicators you want to display.

  • How to show the main screen (home screen of blackberry)

    Hi guys,.

    I need to know how to show the main screen (home screen of the blackberry), even if it's in any screen (like saying "Calculator" etc)...

    This must be done by programming... is there a solution for this?

    Thanks in advance,

    I also had. This is to disconnect incoming call and display the main screen (home screen of the blackberry).

    EventInjector.invokeEvent (new EventInjector.KeyCodeEvent (EventInjector.KeyCodeEvent.KEY_DOWN, (char) Keypad.KEY_END, 0, 100));
    EventInjector.invokeEvent (new EventInjector.KeyCodeEvent (EventInjector.KeyCodeEvent.KEY_UP, (char) Keypad.KEY_END, 0, 100));

  • How to show the photograph next to a project?

    How to show the photograph next to a project?

    in Adobe MyPortfolio

    It isn't a way by default to show them side by side, but we are looking in new views of project for the future.

  • How to list the active recording points in a session?

    How to list the active recording points in a session?

    Brands of Marcelo - ESRI wrote:
    How to list the active recording points in a session?

    not easily

    http://www.orafaq.com/Forum/t/122719/2/

  • Photoshop Elements 8, how to show the value, the hue and saturation of a specific area of a pickture?

    Hello

    Photoshop Elements 8, how to show the value, the hue and saturation of a specific area of the image?

    How to choose the area? Which tool?

    Thank you in advance, Karl

    Make sure first that your range of information is visible: window menu / Info (shortcut F8)

    In this palette, click the small icon 'more '.

    Select "Palette Options".

    and choose HSB to second reading of palette.

  • How to show the characters from a certain point

    This should be quite simple to do, but I do not know how...

    I have a field that has an output like:

    Personal shopping - clothes

    Is there a way to show that what comes after the two indents (only show the word clothing on the screen).

    I am using ColdFusion 5.

    Any help would be appreciated!

    If dashes are constant and will not appear more than once, you can do this:


    It's a little sloppy because of the assumptions, but it should work.

  • How to show the name of Manager instead od managerId in the hr schema

    I have a requirement,

    I use oracle xe database to connect to the hr schema, I created EmployeeEO, EmployeeVO,

    in the user interface, I want to show the name of Manager instead of ManagerId, the problem is that both come from the same table.

    How to fully complete this requirement, buy using the capabilities of the ADF without doing any coding (also search)

    Hello

    You will need to create a ViewCriteria in EmployeesVO based on the EmployeeId that receives a parameter. Next, you will need to go to the tab of the accessors for EmployeeVO and add a new pointing to EmployeesVO. Then edit and shuttle to the ViewCriteria to the right and in the inputParameter for empId you write (or select) ManagerId. In this way, that this accessor class will always be information of your manager.

    Then create a transitional attribute with the value of the following expression: yourViewAccessorName.first (). = null? "yourViewAccessorName.first () .getAttribute ("FirstName") +" "+ yourViewAccessorName.first () .getAttribute ("LastName"): '"

    Hope this helps

  • How to show the mouth full function

    Hi all, I'm sure this is a stupid question, but I can't seem to track it down.

    When I use the Palace of function, it shows a view of abbreivated, Express, Favorites, user libraries and then an arrow down to show the rest of the Palace.

    How can I put it so that it always opens the mouth (as if you had hit the arrow down)?

    Thank you

    (If you get the palette via right click, you will need to nail it down to see the 'view' button).

    Press 'view' in the top right, select "Change the visible categories", then tap on ""select all "." Quite.

  • Bouba Analyzer: How to control the number of points per decade?

    Total newbie here. I can't control the number of points per decade in the Bode VI. It's always 5 points per decade.

    Don't know even how to get the Version of Elvis #, but it is at a minimum 4.1, because Elvis installer will install 4.1 (said the current version is most recent). Running Windows XP.

    How can I get Elvis to respond to my request for more points per decade?

    Mike

    Hi Mike,.

    If you are still curious about what drivers you have installed, you can view by using the Measurement & Automation Explorer (start"all programs" National Instruments"Measurement & Automation Explorer).  "Once their, go to my system" software and you'll find NI ELVISmx and its version.

    This behavior you're seeing is a known, class problem under Corrective Action Request (CAR) #373017.  For now, the number of points per decade will remain at 5.  Please wait for the next update of NOR-ELVISmx to see if this problem is fixed.

    See you soon,.

  • How to show the number n of labelfields in a HFM without roller horizontal sc

    Hi all

    I want to show n number of labels without scrolling in a HFM areas, how?

    The suggestion above reduces to a minimum the width given to each LabelField so that they fit.  If you want just the overlow when the screen width has been reached, try FlowFieldManager.

Maybe you are looking for

  • What is the software problem IOS 9.3.2

    '9.3.2 IOS' I always get the message following 'a problem occurred with this Web page, so it has been reloaded' and however took place at the closing of the Web page. This problem occurred after upgrading to IOS 9.3.2. How to return to the previous 9

  • How can I change the resolution of my pictures stored in Google Reader?

    How can I change the resolution of my pictures stored in Google Reader? I want to have received their approval, but they were taken with a phone and the resolution is not large enough to produce a clear image.

  • Windows Vista PC does not connect to internet

    I've had this computer for 3 years now and it was working fine 2 weeks ago and now all of a sudden he has no internet connection. I tried to change the Ethernet cable and reset the router several times and still no lights are showing up on my Linksys

  • How to remove smart enigne safely.

    I have the smart engine on my computer (I know it's a virus).  I can't afford a tech out to remove it.  Please can someone tell me how to safely remove this thing?  It blocks my defender of the immediate window.  Please help me if you can.  Thank you

  • Reading total failure first Pro CC 2015.4

    I'm on Premiere Pro 2015.4 CC, and tonight my reading the script completely ceased to operate. I am quite at a loss to know what to do.I'm on a Mac, OS X 10.10.5Processor 3.5 GHz 6-Core Intel Xeon E516 GB 1866 MHz DDR3 ECC memoryGraphics AMD over-pan