Spinbox buttons don't react

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

  • Spinbox buttons don't react

    Can you please help me to solve the problem: spinbox buttons behave strangely. Below is an explanation.
    I use STM32F429I-Discovery.
    I tried two precompiled libraries 5.28 and 5.32 (the result is the same).
    The items I used maybe seen on the picture.
    When I reset the board and the first touch I make is the spinbox button (either up or down) value begins to change continuously (even when I release the button)) until it reaches its max or min value. After that, neither item can get focus (however, the software is running - checked it with a debugger).
    If my first touch is radio or any button - radio and buttons work ok, but spinbox can only get focus - the buttons of the spinbox do not react...
    Is there something I can change or check?
    • Spinbox.jpeg

      70.92 kB, 389×519, viewed 263 times
  • Hi,

    I checked it with the STemWin_SampleDemo project comming with STM32Cube FW F4 V1.13.0.

    For this I have created a single spinbox. Everything is working as expected. Attached is the application I used for this (it's pretty simple).
    Does it work on your side?

    Are you handling the touch input on your own?
    If that is the case, please make sure the release events are generated properly.

    Added attachment ;)

    • Test.zip

      (411 Byte, downloaded 138 times, last: )
  • Hi.
    I tried your example - in my case, it works wrong (as I described above). Can you please check the touch input function (it is from ST example), the function is called periodically by timer interrupt:

    void BSP_Pointer_Update(void)
    static TS_StateTypeDef prev_state;
    TS_StateTypeDef ts;
    uint16_t xDiff, yDiff;


    TS_State.Pressed = ts.TouchDetected;

    xDiff = (prev_state.X > ts.X) ? (prev_state.X - ts.X) : (ts.X - prev_state.X);
    yDiff = (prev_state.Y > ts.Y) ? (prev_state.Y - ts.Y) : (ts.Y - prev_state.Y);

    if((prev_state.TouchDetected != ts.TouchDetected )||
    (xDiff > 3 )||
    (yDiff > 3))
    prev_state = ts;

    TS_State.Layer = 0;
    TS_State.x = ts.X;
    TS_State.y = ts.Y;


  • Hi,

    Your solution is kind of similar to the way we do it in most cases:

    C Source Code

    1. static void PID_X_Exec(void) {
    2. TS_STATE * pStateTS;
    3. static GUI_PID_STATE StatePID;
    4. static int IsTouched;
    5. pStateTS = IOE_TS_GetState();
    6. StatePID.Layer = _LayerIndex;
    7. if (pStateTS->TouchDetected) {
    8. IsTouched = 1; // Remember that we had a touch event
    9. StatePID.Pressed = 1;
    10. StatePID.x = pStateTS->X; // Store x
    11. StatePID.y = pStateTS->Y; // and y coordinates
    12. GUI_PID_StoreState(&StatePID);
    13. } else {
    14. if (IsTouched == 1) { // If we had a touch event
    15. IsTouched = 0;
    16. StatePID.Pressed = 0; // Set pressed state to 0
    17. GUI_PID_StoreState(&StatePID); // Send pressed state 0 with the same coordinates as the last touch event.
    18. // since it is a static variable it has the same x/y coordinates as the last pressed event.
    19. }
    20. }
    21. }
    Display All

    The function PID_X_Exec() gets called periodically (like every 25 ms).