GUIX Studio generated headers pixel map sort order

My application has 255 pixel maps and the order that the #defines appear in the generated header file is important.  For months, it was correctly sorting them alphabetically from A - Z, but today, they are now Z - A and I don't know why.  Nothing I do seems to change that.  I've deleted and re-added all the pixel maps, but no change.

Here is a sample of the correct #defines 

#define GX_PIXELMAP_ID_AAA_00_STARTUP_GXP 1
#define GX_PIXELMAP_ID_AAA_01_SHUTDOWN_GXP 2
#define GX_PIXELMAP_ID_AAB_0_KEY_UP 3

...

#define GX_PIXELMAP_ID_WATER_DISABLED 252
#define GX_PIXELMAP_ID_WATER_UP 253
#define GX_PIXELMAP_ID_YES_UP 254
#define TOUCHSCREEN_PIXELMAP_TABLE_SIZE 255


and here is what it looks like today

#define GX_PIXELMAP_ID_YES_UP 1
#define GX_PIXELMAP_ID_WATER_UP 2
#define GX_PIXELMAP_ID_WATER_DISABLED 3

...

#define GX_PIXELMAP_ID_AAB_0_KEY_UP 252
#define GX_PIXELMAP_ID_AAA_01_SHUTDOWN_GXP 253
#define GX_PIXELMAP_ID_AAA_00_STARTUP_GXP 254
#define TOUCHSCREEN_PIXELMAP_TABLE_SIZE 255

How can I trick GUIX Studio to do the right thing and generate the pixel maps with IDs sorted A - Z instead of Z - A?

  • Note: I just learned about GUIX Studio version 5.4.1.1 (I was using 5.4.0.) This is the first entry in the release notes:

    04/26/2018 GUIX Studio release 5.4.1.1

    Fix bug in multi-theme projects where pixelmap tables are not generated in consistent alphabetical order.

    Sounds great, but still didn't work.

    The generated sort order is now
    #define GX_PIXELMAP_ID_YES_UP 1 <- wrong
    #define GX_PIXELMAP_ID_WATER_UP 2 <- wrong
    #define GX_PIXELMAP_ID_WATER_DISABLED 3 <- wrong
    #define GX_PIXELMAP_ID_WATER_CUTOFF_UP 4 <- wrong
    #define GX_PIXELMAP_ID_AAA_00_STARTUP_GXP 5 <- should be 1
    #define GX_PIXELMAP_ID_AAA_01_SHUTDOWN_GXP 6 <- should be 2
    #define GX_PIXELMAP_ID_AAB_0_KEY_UP 7 <- should be 3
    #define GX_PIXELMAP_ID_AAB_1_KEY_UP 8 <- should be 4, etc.
    ...

    The first four #defines should appear at the end of the list, but the rest of the 251 are correct.
  • In reply to dmknuth:

    Hi,

    Depending on the version of GUIX Studio, the generation order of resource IDs is different.
    However, if you create the code using the ID name, not a direct number, it should not be a problem.

    What is your problem when ID numbers are different?

    Thanks,
    Miya
  • In reply to Miya:

    Thanks for the suggestion, but that is the crux of the problem: the IDs are unpredictable. The host computer that communicates with the touchscreen is expecting a particular pixel map for a given ID. If the order of the pixel maps in GX_CONST GX_PIXELMAP *Touchscreen_default_theme_pixelmap_table[] is wrong, then the wrong pixel map is displayed when the host computer sends a command to display a particular pixel map.

    What's frustrating is that the order was correct for many months of development: all the pixel maps appeared in this table in predictable alphabetical order, the order I loaded them into GUIX Studio 5.4.0.0. But now, GUIX Studio 5.4.0.0 has decided to sort the pixel maps in reverse alphabetical order and I don't know why. What's worse is that GUIX Studio 5.4.1.1 takes the last 4 pixel maps, puts them at the start of the array and then the rest of the icons in alphabetical order, so the table of pixel maps is useless.
  • In reply to dmknuth:

    Hi,

    In the range I confirmed, it was successfully generated normally in the order of the latin alphabet on GUIX Studio 5.4.1.1.


    I think that the ID communicating with the host computer should be defined separately from the order of pixelmap_table.
    Alternatively, the host computer that handles the ID number directly should also update the ID number.

    The ID number generated by GUIX Studio is generated as a resource for GUIX.
    Therefore, it is defined to maintain internal consistency of the resource, but the numerical value itself has no meaning.
    Of course, this number is used by the application, but it is used only for identifying pixelmap.

    If you need to file check by me, please send a .gxp file on this page.
    It is possible to attach files from [Use rich formatting].
    Because it is for trying the generation state, it is ok with only the .gxp file.

    Thanks,
    Miya
  • In reply to dmknuth:

    One solution would be to modify your code to use an array to convert from the host ID to the GUIX ID. An example is provided below:

    GX_RESOURCE_ID conversion_array[255] =
    {
    GX_PIXELMAP_ID_AAA_00_STARTUP_GXP,
    GX_PIXELMAP_ID_AAA_01_SHUTDOWN_GXP,

    }

    some_host_parser_function(host_image_id)
    {
    some_drawing_function(conversion_array[host_image_id]);
    return(0);
    }