Disable button pressed and unpressed effect

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

    • Disable button pressed and unpressed effect

      Hello,

      I wanted to disable button pressed and unpressed effect. The pressed and unpressed effect which is visible when button is pressed and released.
      Is there a way to do this?

      Thanks
      Regards,

      Anuj
    • Hi,

      if you are using the default look of a button you can do the following:

      Source Code

      1. BUTTON_GetSkinFlexProps(&Props, BUTTON_SKINFLEX_PI_ENABLED);
      2. BUTTON_SetSkinFlexProps(&Props, BUTTON_SKINFLEX_PI_PRESSED);
      3. BUTTON_SetSkinFlexProps(&Props, BUTTON_SKINFLEX_PI_FOCUSED);
      4. BUTTON_SetSkinFlexProps(&Props, BUTTON_SKINFLEX_PI_DISABLED);
      5. BUTTON_Create(10, 10, 80, 20, GUI_ID_BUTTON0, WM_CF_SHOW);
      Please note that this can be globally for all buttons.

      You could alos overwrite the callback functon and draw the button only with one state. The same is true for setting a custom skinning function.
      Here is an example on how to overwrite the callback function:
      wiki.segger.com/BUTTON_-_Custom_(Sample)

      This one shows how to set a skinning routine:
      wiki.segger.com/Skinning_routine_(Sample)

      Regards,
      Sven