Scroll bar issue

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

  • Scroll bar issue

    Dear Sir,

    Am creating a page with dropdown and radio button widgets.
    I have created a window and attached a scrollbar.
    In the fourth row, i have a text and dropdown, when i scroll down the text and the dropdown gives a merged look.
    how to solve this issue.
    Thank you


    static void _cbWindow(WM_MESSAGE * pMsg) {
    WM_SCROLL_STATE ScrollState;
    int y;
    int item = 0;
    WM_HWIN hItem;
    switch (pMsg->MsgId) {
    case WM_INIT_DIALOG:
    //
    // Initialization of 'Dimension'
    //
    hItem = WM_GetDialogItem(pMsg->hWinSrc, ID_DROPDOWN_0);
    DROPDOWN_SetListHeight(hItem, 50);
    DROPDOWN_AddString(hItem, "Kg");
    DROPDOWN_AddString(hItem, "Ton");
    DROPDOWN_AddString(hItem, "lbs");
    break;

    case WM_NOTIFY_PARENT:
    if (pMsg->Data.v == WM_NOTIFICATION_VALUE_CHANGED) {
    if (WM_GetId(pMsg->hWinSrc) == GUI_ID_VSCROLL) {
    WM_GetScrollState(pMsg->hWinSrc, &ScrollState);
    if (_x != ScrollState.v) {

    y = _x - ScrollState.v;
    WM_MoveWindow(hWin,0,y);

    _x = ScrollState.v;
    }
    }
    }
    break;

    case WM_PAINT:
    // GUI_Set
    GUI_SetBkColor(GUI_WHITE);
    GUI_Clear();
    break;
    default:
    WM_DefaultProc(pMsg);
    }
    }
    /*********************************************************************
    *
    * Public code
    *
    **********************************************************************
    */
    /*********************************************************************
    *
    * CreateBasic Settings
    */
    WM_HWIN Basic_Settings(void);
    WM_HWIN Basic_Settings(void) {

    SCROLLBAR_Handle hScroll;
    char message[6];
    hWin = WM_CreateWindow(0,0, 480, 272, WM_CF_SHOW, _cbWindow, 0);
    DROPDOWN_Handle dropdown[3];
    TEXT_Handle text[8];
    RADIO_Handle Weight_backup;
    // hWin = FRAMEWIN_Create("Basic Setting",_cbWindow,WM_CF_SHOW,0,0,480,272);//("Basic Setting",0, 480, 272, WM_CF_SHOW, _cbWindow, 0);



    // SCROLLBAR_SetNumItems(hScroll, 20);
    // SCROLLBAR_SetValue(hScroll,5);
    // SCROLLBAR_SetPageSize(hScroll,25);
    SCROLLBAR_SetDefaultWidth(30);


    int item = 0;
    text[0] = TEXT_CreateAsChild( 25, 50, 190, 40,hWin, ID_TEXT_0, WM_CF_SHOW,"Dimension", 5);
    setText_prop(text[0]);
    dropdown[0] = DROPDOWN_CreateEx(250, 55, 120, 40,hWin,WM_CF_SHOW, 0, ID_DROPDOWN_0);
    DROPDOWN_AddString(dropdown[0],"Kg");
    DROPDOWN_AddString(dropdown[0],"Lbs");
    DROPDOWN_AddString(dropdown[0],"Ton");
    setDropdown_prop(dropdown[0]);
    text[1] = TEXT_CreateAsChild( 24, 105, 190, 40,hWin, ID_TEXT_1, WM_CF_SHOW,"WtBackUp", 5);
    setText_prop(text[1]);
    Weight_backup = RADIO_CreateEx(250, 115, 140,180,hWin,WM_CF_SHOW, 0,ID_RADIO_0,2,40);
    RADIO_SetFont(Weight_backup,GUI_FONT_32_1);
    RADIO_SetTextColor(Weight_backup,GUI_BLUE);
    RADIO_SetText(Weight_backup, "Normal", 0);
    RADIO_SetText(Weight_backup, "Back Up", 1);
    text[2] = TEXT_CreateAsChild(25,175,180,40,hWin, ID_TEXT_2, WM_CF_SHOW,"ZT-Range", 5);
    setText_prop(text[2]);
    dropdown[1] = DROPDOWN_CreateEx(250, 190,120,40,hWin,WM_CF_SHOW, 0, ID_DROPDOWN_1);
    DROPDOWN_AddString(dropdown[1],"0");
    DROPDOWN_AddString(dropdown[1],"0.5");
    DROPDOWN_AddString(dropdown[1],"1");
    // DROPDOWN_AddString(dropdown[1],"2");
    setDropdown_prop(dropdown[1]);
    text[3] = TEXT_CreateAsChild( 25, 230,180,40,hWin, ID_TEXT_3, WM_CF_SHOW,"MB-Range", 5);
    setText_prop(text[3]);
    dropdown[2] = DROPDOWN_CreateEx(250, 245,120,40,hWin,WM_CF_SHOW, 0, ID_DROPDOWN_2);
    DROPDOWN_AddString( dropdown[2], "0.5");
    DROPDOWN_AddString(dropdown[2], "1.2");
    DROPDOWN_AddString(dropdown[2], "4");
    DROPDOWN_AddString(dropdown[2], "8");
    setDropdown_prop(dropdown[2]);
    hScroll = SCROLLBAR_CreateAttached(hWin,SCROLLBAR_CF_VERTICAL);

    #if 0
    while(item
    sprintf(message,"Rama%d\n",item);
    _aahEdit[item] = TEXT_CreateAsChild(x_value,y_value,X_SIZE,Y_SIZE,hWin, 13, WM_CF_SHOW,message, 5);
    y_value = y_value+20;
    item++;
    }
    #endif

    // hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbWindow, WM_HBKWIN, 0, 0);

    return hWin;
    }

    // USER START (Optionally insert additional public code)
    void setDropdown_prop(WM_HWIN hDlg)
    {
    DROPDOWN_SetListHeight(hDlg,60);
    DROPDOWN_SetTextHeight(hDlg,30);
    DROPDOWN_SetTextAlign(hDlg,0);
    DROPDOWN_SetItemSpacing(hDlg,5);
    DROPDOWN_SetAutoScroll(hDlg,1);
    DROPDOWN_SetFont(hDlg,GUI_FONT_24B_1);
    }

    void setText_prop(WM_HWIN hDlg)
    {
    TEXT_SetFont(hDlg, GUI_FONT_32B_1);
    TEXT_SetTextColor(hDlg,GUI_BLUE);
    }
    // USER END

    /*************************** End of file ****************************/