CHECKBOX - how to change skin of focused widget

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

    • CHECKBOX - how to change skin of focused widget

      Hello.

      I have dialog window (FRAMEWIN) with a set of widgets on it, there are BUTTON's, EDITBOX'es, also there are some CHECKBOX widgets.
      For navigate between widgets TAB-key is used.

      I would like to do following:
      If one of CHECKBOX-widgets got focus (is selected), I would like to change skin of it - change gradient colors of its box for better visual perception that it has got focus, and return back old skin if it has lost focus.

      But for this purpose there is no appropriate function, there is only CHECKBOX_SetSkinFlexProps that changes skin for all CHECKBOX-widgets everywhere and for this function there are no index-parameters for which state of CHECKBOX (focused - unfocused) which skin should be used. For example BUTTON-widget does have this possibility.

      How I can solve this problem?
      Maybe the right way is using CHECKBOX_SetSkin, but I don't understand how to use it.
      If the problem can be solved with this function, could you give an example of code.

      In short, I would like to change box gradient colors of CHECKBOX-widget in a similar way as I can change its box size using a function CHECKBOX_SetSkinFlexButtonSize(CHECKBOX_Handle hObj, int ButtonSize).

      Regards.
      Best regards,
      Volodymyr.

      The post was edited 1 time, last by volodymyr ().

    • Hello,

      check the attached code. There are two checkboxes in a window (320 * 240), and one of them changes its skin frame and gradient colors when got the focus and returns default skin colors when lost the focus.

      Simply call CreateWindowChckBx() from your main() or whatever you are using.


      Alex.
      Files
    • LexaGb wrote:

      Hello,

      check the attached code. There are two checkboxes in a window (320 * 240), and one of them changes its skin frame and gradient colors when got the focus and returns default skin colors when lost the focus.

      Simply call CreateWindowChckBx() from your main() or whatever you are using.


      Alex.
      Thanks, Alex, your sample is perfect and solves my problem.
      :thumbup:
      Best regards,
      Volodymyr.