SPINBOX_SetSkinFlexProps() ;this function doesn't work properly

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

    • SPINBOX_SetSkinFlexProps() ;this function doesn't work properly

      I only have keyboard input device.

      SPINBOX_GetSkinFlexProps(&SPINBOX_pProps, SPINBOX_SKINFLEX_PI_FOCUSED);
      SPINBOX_pProps.ColorBk = GUI_BLUE;
      SPINBOX_pProps.ColorText = GUI_WHITE;
      SPINBOX_pProps.ColorArrow = GUI_WHITE;
      SPINBOX_pProps.aColorUpper[0] = GUI_BLUE;
      SPINBOX_pProps.aColorUpper[1] = GUI_BLUE;
      SPINBOX_pProps.aColorLower[0] = GUI_BLUE;
      SPINBOX_pProps.aColorLower[1] = GUI_BLUE;
      SPINBOX_SetSkinFlexProps(&SPINBOX_pProps,SPINBOX_SKINFLEX_PI_FOCUSED);

      this is what I set for SPINBOX, but only the upper botton's color changed when the focus is on, neither background color nor text color changed, I'v tried so many ways, I found SPINBOX_SetBkColor() has higher priority even hasn't use, is this a BUG, can any great man fix this? I'm new so not familiar with the callback function.
      this is only happen when SPINBOX_SKINFLEX_PI_FOCUSED

      my device is STM32F429, cubemx4.27.0, F4 package is 1.21.0, 5.42 emwin manual is inside.
      Images
      • TIM截图20181022102042.png

        82.45 kB, 286×107, viewed 86 times

      The post was edited 2 times, last by mountain ().

    • Hi,

      Unfrotunately, I can't tell when the next version of emWin will be released. Also please note that we are not responsible for the release of the libraries provided by the silicon vendors.

      To keep updated to the latest version of emWin you could buy a source code upgrade which includes a discount (compared to a general emWin purchase). This way you will have always access to the latest version of emWin.
      segger.com/products/user-inter…win/emwin-source-upgrade/

      To get rid of the leading zeros you can overwrite the callback function of the EDIT widget attached to the spinbox. With the callback overwritten you have full control about how the EDIT widget gets displayed.

      C Source Code

      1. /*********************************************************************
      2. *
      3. * _cbEdit
      4. */
      5. static void _cbEdit(WM_MESSAGE * pMsg) {
      6. GUI_RECT Rect;
      7. char acBuffer[16];
      8. int Value;
      9. switch (pMsg->MsgId) {
      10. case WM_PAINT:
      11. GUI_SetBkColor(GUI_BLUE);
      12. GUI_Clear();
      13. WM_GetClientRect(&Rect);
      14. Value = EDIT_GetValue(pMsg->hWin);
      15. GUI_DispDecMin(Value);
      16. sprintf(acBuffer, "%i", Value);
      17. GUI_SetFont(EDIT_GetFont(pMsg->hWin));
      18. GUI_DispStringInRect(acBuffer, &Rect, EDIT_GetTextAlign(pMsg->hWin));
      19. break;
      20. default:
      21. EDIT_Callback(pMsg);
      22. break;
      23. }
      24. }
      Display All

      Call these function to get the EDIT handle and set the custom callback function.

      C Source Code

      1. hEdit = SPINBOX_GetEditHandle(hSpinbox);
      2. WM_SetCallback(hEdit, _cbEdit);

      Regards,
      Sven
    • thank you for your detailed reply!
      I have one more question, I only have keyboard input device, the CHECKBOX is not so obviously to look when focused, if only it can change color! and BUTTON_SKINFLEX_PROPS has no ColorText member, I hope you can add this function in next release too, for now do you have any ideas to solve it for temporary, and the SPINBOX as well, thanks so much! looking forward to
      seeing your upgrade!

      oops,CHECKBOX_SetSkinFlexProps has no CHECKBOX_SKINPROPS_FOCUSED index, I feel confused

      The post was edited 4 times, last by mountain ().