×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    3

    Question Series 60 CustomItem implementation problems?

    Hello again,

    More problems with midp2, this time involving a customItem repaint behavior. It works correctly on wtk and a Motorola device but on the Nokia emulator and test devices I have strange repaint problems.

    The custom item cursor updates correctly but when the user scrolls up or down the custom item is drawn in different (vertical) positions over its older instances / paints (its probably easier to explain with a screenshot - see link). As you can see there (on the left) the first time the user enters the customitem there are no problems and the top left icon is highlighted. If the user moves downwards the second item in the column gets highlighted but the screen does not refresh properly...

    Is that a known Nokia problem? Am I missing something? I issue repaint calls without using the inOut_rect array.

    for the figure see :http://213.249.39.23/screen/kvmfig.png

    Cheers,
    Fotis

  2. #2
    Registered User
    Join Date
    Mar 2005
    Posts
    1

    Series 60 CustomItem Paint Problem

    Hello Fotis,

    Did you ever find a solution to the paint problem? We are seeing the same issue?

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    3

    Solution to buggy implementation

    In the traverse function you have to explicitly set the visRect_inout
    array:

    case Canvas.UP :
    if (!isInside)
    {
    isInside = true ;
    currentRow = MAX_ROWS - 1 ;
    repaint(0, 0, prefW, prefH);
    visRect_inout[0] = currentColumn * ICON_SIZE;
    visRect_inout[1] = currentRow * ICON_SIZE;
    visRect_inout[2] = ICON_SIZE + 1;
    visRect_inout[3] = ICON_SIZE + 1;
    return true ;
    }
    else
    {
    if (currentRow > 0)
    {
    currentRow--;
    repaint(0, 0, prefW, prefH);
    visRect_inout[0] = currentColumn * ICON_SIZE;
    visRect_inout[1] = currentRow * ICON_SIZE;
    visRect_inout[2] = ICON_SIZE + 1;
    visRect_inout[3] = 2 * ICON_SIZE + 1;
    return true;
    }
    else
    {
    return false;
    }
    }
    case Canvas.LEFT :
    if (currentColumn > 0)
    {
    currentColumn--;
    repaint(0, 0, prefW, prefH);
    visRect_inout[0] = 0;
    visRect_inout[1] = 0;
    visRect_inout[2] = prefW;
    visRect_inout[3] = prefH;
    return true ;
    }
    break;

    When visRect is set to the shown values (either the updated rectangle , or the whole CustomItem in the second case) everything works fine!
    Repainting the whole custom item or just the changed bits does not matter (even though repainting the changned bits only should be quicker)

    PS: Do not forget to set the minH and minW values to the same ones used in prefW and prefH...

    PS@: I did this after printing the values of the visRect array whenever the traverse function was called. Half (or more) the times these values did not make sense as they included 0 width and height or irrelevant x,y values...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×