Skinned button default 'callback' routine

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

  • Skinned button default 'callback' routine

    I created a skinned button with BUTTON_SKIN_FLEX. There is a redraw routine in the default callback when button is pressed. I overwrite the default callback to accept touch message and my button don't get redrawn on pressed.

    How can I get back the redraw functionality from the overwrite callback.

    Sample:


    static void _cbButton(WM_MESSAGE *pMsg){
    int Id;
    BUTTON_SKINFLEX_PROPS Props;

    GUI_PID_STATE current_PIDState;
    switch(pMsg->MsgId){
    case WM_TOUCH:
    GUI_PID_GetCurrentState(&current_PIDState);
    if(UnPressed_Flag == true){
    if(current_PIDState.Pressed == 1){
    Id = WM_GetId(pMsg->hWin);
    switch(Id){
    case ID_BUTTON_0:
    _BringToBottom(_hWindow4);
    _BringToTop(_hWindow5);
    break;
    case ID_BUTTON_3:
    _BringToBottom(_hWindow4);
    _BringToTop(_hWindow6);
    break;
    case ID_BUTTON_6:
    PROGBAR_SetValue(_hProgBar_1, 0);
    _BringToBottom(_hWindow5);
    _BringToTop(_hWindow4);
    break;
    case ID_BUTTON_7:
    _ProgBarStat(_hProgBar_1);
    break;
    case ID_BUTTON_8:
    _BringToBottom(_hWindow6);
    _BringToTop(_hWindow4);
    break;
    default:
    break;
    }
    }
    }
    break;
    default:
    BUTTON_Callback(pMsg);
    break;
    }
    }

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

  • @Adrian: Tnx for quick reply.

    I tried to invalidate the button but it don't get redrawn.
    At Default the buttons background changes on Pressed. If I redirect the callback to my own callback the buttons background don't change anymore on Pressed?
    Can I work this out with WM_PAINT? If I leave WM_PAINT empty my buttons don't get shown?
  • Hello,

    Please check if your callback function receives WM_PAINT messages. If it does, please make sure that the message is forwarded to the internal callback function BUTTON_SetCallback(pMsg) unless the custom callback function is intended to draw the BUTTON. If it does not, please make sure that the widget is properly invalidated and check your application if it regularly executes the Window Manager (GUI_Delay(), GUI_Exec() or WM_Exec()).

    Best regards,
    Adrian