fICONVIEW how to place each icon

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • fICONVIEW how to place each icon

    Hi,

    I'm working on project which I want to add, at the bottom of the TFT display (which has 320 x 240 pixels), 6 icons. So I've created an ICONVIEW

    C Source Code

    1. static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
    2. { WINDOW_CreateIndirect, "MAIN", ID_WINDOW_0, 0, 0, 320, 240, 0, 0x0, 0 },
    3. [...]
    4. { ICONVIEW_CreateIndirect, "", ID_ICONVIEW_0, 1,200, 36, 318, WM_CF_SHOW | WM_CF_HASTRANS, ( (53*6) << 16) | 36, 0},
    5. };



    In order to add the bitmaps items, I've defined the 6 icons:

    C Source Code

    1. /*********************************************************************** Types************************************************************************/
    2. typedef struct {
    3. const GUI_BITMAP * pBitmap;
    4. const char * pText;
    5. const char * pExplanation;
    6. } BITMAP_ITEM;
    7. /*********************************************************************** _aBitmapItem*/
    8. static const BITMAP_ITEM _aBitmapItem[] = {
    9. {&bmEntradamatricula, "", "Plate entrance"},
    10. {&bmimprimir, "", "Print"},
    11. {&bmreimpressio, "", "Reprint"},
    12. {&bmajustosinterns, "", "Internal adjust"},
    13. {&bmbasededades, "", "Data base"},
    14. {&bmok, "", "Ok"},};
    Display All



    And when I create the _cbDialog I (think I) add all 6 icons:

    C Source Code

    1. static void _cbDialog(WM_MESSAGE * pMsg) {
    2. const void * pData;
    3. WM_HWIN hItem;
    4. U32 FileSize;
    5. int NCode;
    6. int Id;
    7. // USER START (Optionally insert additional variables) ICONVIEW_Handle hIconWin; uint8_t i; // USER END
    8. switch (pMsg->MsgId) {
    9. case WM_INIT_DIALOG:
    10. [...]
    11. /** Create iconview widget
    12. * ICONVIEW_Handle ICONVIEW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int xSizeItems, int ySizeItems);
    13. * WM_CF_SHOW to make the widget visible immediately
    14. */
    15. hIcones = WM_GetDialogItem(pMsg->hWin, ID_ICONVIEW_0);
    16. ICONVIEW_SetSpace(hIcones, GUI_COORD_X, 53);
    17. ICONVIEW_SetIconAlign(hIcones, ICONVIEW_IA_TOP);
    18. for (i = 0; i < GUI_COUNTOF(_aBitmapItem); i++)
    19. { /* Add icons to the widget */
    20. ICONVIEW_AddBitmapItem(hIcones, _aBitmapItem[i].pBitmap, _aBitmapItem[i].pText);
    21. }
    22. [..]
    Display All



    All compile correctly, but I can only see the first icon! What I let myself go to put?

    Notice:

    1rst icon size is 53 x 36 pixels
    2nd, 3th, 4th, 5th 6th icon size's are 66 x 36 pixels

    And the window display size is 320 x 240 pixels.

    I would like put the icons like this:

    ------------------------------------------
    -
    -
    -
    -
    -
    -
    -
    ------------------------------------------
    - ic 1 - ic 2 - ic 3 - ic 4 - ic 5 - ic 6
    ------------------------------------------


    Is a problem different "icon size"?

    Thanks in advance
  • Hi,

    You should switch x and y size of the iconview and use "(36 << 16) | 53" as 9th paramter.

    Unfortunately there is a mistake in the manual. It says that the upper 16 bit of the 9th parameter representing the xSize of an item and the lower 16 bit the ySize. Actually it is visa versa.

    Please excuse any inconvenience caused by this. We will fix the manual accordingly.

    Attached is an example which should show how it can be done.

    Regards,
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.