Increase the area of Icon used in icon widget

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

  • Increase the area of Icon used in icon widget

    Hello,
    I want to increase the area of icon that I am using in Iconview Widget. Actually the main issue that I am facing is if my text set in Icons is too long, then it over laps the icon image [as in case of 'LCD Brightness' (enabled Word Wrap)] or it gets truncated from either sides [as in case of 'Date/Time' (word wrap disabled)]. So Kindly suggest a way to solve this problem.

    I have attached the image (Problem Image.png) for the reference of the problem statement.

    I am using 320 x 240 area for my LCD. The emWin version that I am using is 5.18.
    There are two IconView Widgets used on either side of the vertical line which will have 4 icons on each side.
    Images
    • Problem Image.png

      29.81 kB, 390×390, viewed 628 times
  • Hello,
    I am referring to the user manual Version 5.18 (while the latest one is V 5.26). This is because I am using the V 5.18 version library.
    In the manual, I saw the structure:

    typedef struct {
    GUI_WIDGET_CREATE_FUNC * pfCreateIndirect; // Create function
    const char * pName; // Text (not used for all widgets)
    I16 Id; // Window ID of the widget
    I16 x0, y0, xSize, ySize; // Size and position of the widget
    I16 Flags; // Widget-specific flags (or 0)
    I32 Para; // Widget-specific parameter (or 0)
    U32 NumExtraBytes; // Number of extra bytes usable
    // with <WIDGET>_SetUserData &
    // <WIDGET>_GetUserData
    } GUI_WIDGET_CREATE_INFO;


    Here I am not able to get the details of the structure element "I32 Para;". However when using the function "ICONVIEW_CreateIndirect()", I modified the field for the "Para" element as follows:


    "{ ICONVIEW_CreateIndirect, NULL, ID_ICONVIEW_2, 1, 192, 318, 46, WM_CF_SHOW | WM_CF_HASTRANS, (45 << 16) | 48, 0 },"



    and this way I am able to control the desired width of (all) icons in the Iconview widget. I did that from some external reference, but practically I have no idea how is that working. Please let me know the details of the element "Para" in the structure.
    But still there is no particular function using which I can control the area of a particular icon in icon view widget (say if I want to have some icons in the widget with smaller area).


    Also there is one more thing that I would like to ask, can I have icons without any image with just pure text (if yes then how?)
  • Hello,
    I think I have got the information for what I was looking for. The details of the element 'I32 Para' mentioned in "GUI_WIDGET_CREATE_INFO" structure is given in emWin manual V 5.26. Manual reads the following text:

    "The upper 16 bit of the element Para of the according GUI_WIDGET_CREATE_INFO structure are used according to the parameter xSizeItems of the function ICONVIEW_CreateEx(). The lower 16 bit of the element Para are used according to the parameter ySizeItems of the function ICONVIEW_CreateEx()"



    I think this piece of information was missing from emWin User manual V 5.18.

    Thanks