Change pixelmap_button properties at "runtime"

Hello,

I'm probably missing out on a glass of water, there is the possibility of change at "run-time" a property of a pixelmap_button.

I need at start time the pixelmap_button appears disabled and after a certain time enabled, is it possible?


thanks in advance

--

Enzo Laperchia

  • Hello enzo,

    In order to do this, you will first need to get a GX_PIXELMAP_BUTTON or GX_WIDGET pointer for the button. The simplest way to do it is following:

    GX_WIDGET * p_button;

    gx_system_widget_find(YOUR_BUTTON_ID, GX_SEARCH_DEPTH_INFINITE, &p_button);

    gx_widget_style_remove(p_button, GX_STYLE_ENABLED);

    or

    gx_widget_style_add(p_button, GX_STYLE_ENABLED);

    Widget re-drawing should be triggered automatically after this API call.

    Regards

  • I assume this is for GUIX?

    In GUIX studio uncheck the 'Enabled' property for the button for it to start out disabled, and assign your disabled pixelmap using the 'Disabled Pixelmap' property. Assign the enabled pixelmap using the 'Normal Pixelmap' property.

    To change the enabled state at runtime use the GX_STYLE_ENABLED style flag. 'Or' this value in with the existing style flags to preserve the other flags.

    example:

               ULONG style;

               status =  gx_widget_style_get(&my_window.my_pixelmap_button, &style);

               status = gx_widget_style_set(&my_window.my_pixelmap_button, style | GX_STYLE_ENABLED);

    edit:

    Didn't see Karol's post. I guess the gx_widget_style_add() does the same thing as the last two instructions I suggested. 

  • In reply to Gerald:

    Hi Gerald,

    thank you very much for your help, your solution works very well for my needs.

    Thanks again

    --

    Enzo

  • In reply to Gerald:

    Hi,Gerald
    I would like to ask you a question: I have imported the pixmap into the GUIX with the correct operation and generated the corresponding "resources" "specifications" file for the e2 studio to use, but when I compile the program in e2 studio, the system prompts me There was an error in the "specifications" file. After checking, I found that in the generated "resources.h" file there was no Pixelmap ID for the pixel map I imported. Can you help me solve this problem?
    Best regards,
    ghg