Spinbox Buttons

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

  • Spinbox Buttons

    Hi there,

    I will be using a Spinbox widget without a touch or mouse interface, only using the up, down, left and right arrow keys of a keyboard.

    Is there anyway of getting the buttons on the Spinbox widget to react and change state to depressed when the up or down arrow key is pressed? :huh:

    Thanks and regards,
    Simon
  • I bet you could emulate the behavior though by using WM_SendMessage. Set up a temporary message handler for the notifications sent by the spinbox buttons. In the debugger break on these and make a note of them. Then in a message handler for the keyboard, when the desired key comes in, translate the key message to one of the desired spinbox messages and call WM_SendMessage. It's worth a try.
  • Here's a short example. I found that calling CHECKBOX_SetState(hCbx,1) did not send a notification event like actually clicking on the box would. So I send a message to emulate clicking.

    GUI_HWIN hCbx = WM_GetDialogItem(hDlg,ID_CHECKBOX_0);
    CHECKBOX_SetState(hCbx,1);
    {
    WM_MESSAGE pMsgS;
    pMsgS.MsgId = WM_NOTIFY_PARENT;
    pMsgS.hWin = hDlg;
    pMsgS.hWinSrc = hCbx;
    pMsgS.Data.v = WM_NOTIFICATION_CLICKED;
    WM_SendToParent(hCbx,&pMsgS);
    }