Scrollbar without arrows

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

  • Scrollbar without arrows

    Hi,
    I need to show a listbox widget with a vertical scrollbar, but without the arrow symbols.
    Can this be achieved with pure skinning or do I need to overwrite the WM_PAINT message?

    Thanks in advance!
  • Overwriting the WM_PAINT of the scrollbar means, I have to re-implement all functionality, that was already implemented by Segger.
    Is there any reference available, how a user scrollbar callback routine has to be written?
  • Hi Frost,

    I'm afraid, simply removing the arrows from the SCROLLBAR is not possible.

    But a scrollbar without arrows is almost a SLIDER widget.

    For adapting the look of the SLIDER you can use skinning.
    Please have a look into chapter 22 'Skinning' of the emWin user manual (UM03001_emWin5.pdf) and further to chapter 22.17 'SCROLLBAR_SKIN_FLEX'.

    For a vertical slider please have a look into this sample:
    segger.com/cms/admin/uploads/u…c/WIDGET_SchemeMedium.zip

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Dear Sven,

    thanks for the input regarding the use of sliders.
    The problem is, that I would like to attach it to a listbox and in the end it should look like in the attached picture. I'm afraid it is not possible to attach a customized slider to a listbox?
    Images
    • custom-scrollbar.png

      4.71 kB, 317×202, viewed 741 times
  • Hello.


    I have been able to remove the arrows of the scrollbar :
    You have to create your own scrollbar skin :


    static int _Drawscrollbar(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo) {

    switch (pDrawItemInfo->Cmd)
    {
    case WIDGET_ITEM_GET_BUTTONSIZE :
    case WIDGET_ITEM_DRAW_BUTTON_L :
    case WIDGET_ITEM_DRAW_BUTTON_R :
    case WIDGET_ITEM_DRAW_SHAFT :
    case WIDGET_ITEM_DRAW_OVERLAP :
    return 0;
    default :
    return SCROLLBAR_DrawSkinFlex(pDrawItemInfo);
    }
    }

    in the WM_INIT_DIALOG :
    SCROLLBAR_SetSkin(WM_GetDialogItem(pMsg->hWin, ID_SCROLLBAR_G),_Drawscrollbar);
  • Hi,

    YPO53 is absolutely right.

    Here is also an example (attached).

    Regards,
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.