Controlling MUI window scroll bars
  • Just looking around
    evenmore
    Posts: 8 from 2012/2/6
    From: N. Ireland
    I have an MUI custom class gadget that needs to use the scroll bars in the borders of a window, but as far as I can see there is no way of linking to it other than using a traditional slider object or listview.

    Does anyone know if there is a way to access these directly?
    Thanks!
  • »06.02.12 - 17:15
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 2323 from 2003/2/24
    Code:

    struct Data *data,t;
    obj = (Object*)DoSuperNew(cl,obj,
    MUIA_Window_ID, MAKE_ID('M','A','I','N'),
    MUIA_Window_UseRightBorderScroller, TRUE,
    MUIA_Window_UseBottomBorderScroller, TRUE,
    MUIA_Window_Title, GetString(MSG_DisplayWindow_Title),
    MUIA_Window_Menustrip , MUI_MakeObject(MUIO_MenustripNM,displaywindowmenu,MUIO_MenustripNM_CommandKeyCheck),
    WindowContents,
    HGroup,
    Child, t.hscroller = ScrollbarObject,
    MUIA_Prop_Horiz,TRUE,
    MUIA_Prop_UseWinBorder, MUIV_Prop_UseWinBorder_Bottom,
    MUIA_Prop_Slider,TRUE,MUIA_Prop_Visible,10, MUIA_Prop_Entries,2000,
    End,
    Child, t.vscroller = ScrollbarObject,
    MUIA_Prop_Horiz,FALSE,
    MUIA_Prop_UseWinBorder, MUIV_Prop_UseWinBorder_Right,
    MUIA_Prop_Slider,TRUE,MUIA_Prop_Visible,1000, MUIA_Prop_Entries,2000,
    End, ......


    /me has subclasses MUIC_Window here passing those 2 attributes to normal window-class-object should have same effect... both scrollobjects should be children of the window (or one of it's groups).

    Code:


    DoMethod(data->display,MUIM_Notify,MA_Display_VisibleWidth,MUIV_EveryTime,data->hscroller,3,MUIM_Set,MUIA_Prop_Visible,MUIV_TriggerValue);
    DoMethod(data->display,MUIM_Notify,MA_Display_VisibleHeight,MUIV_EveryTime,data->vscroller,3,MUIM_Set,MUIA_Prop_Visible,MUIV_TriggerValue);
    DoMethod(data->display,MUIM_Notify,MA_Display_FullWidth,MUIV_EveryTime,data->hscroller,3,MUIM_Set,MUIA_Prop_Entries,MUIV_TriggerValue);
    DoMethod(data->display,MUIM_Notify,MA_Display_FullHeight,MUIV_EveryTime,data->vscroller,3,MUIM_Set,MUIA_Prop_Entries,MUIV_TriggerValue);


    DoMethod(data->hscroller,MUIM_Notify,MUIA_Prop_First,MUIV_EveryTime,data->display,3,MUIM_Set,MA_Display_HorizOffset,MUIV_TriggerValue);
    DoMethod(data->vscroller,MUIM_Notify,MUIA_Prop_First,MUIV_EveryTime,data->display,3,MUIM_Set,MA_Display_VertOffset,MUIV_TriggerValue);



    Should be all you need ;)
  • »06.02.12 - 17:42
    Profile
  • Just looking around
    evenmore
    Posts: 8 from 2012/2/6
    From: N. Ireland
    That's great! I was going to say I thought I had maybe worked it out myself, by possibly adding an invisible prop gadget? Don't know if that would have worked or not. But you have given me much more help here than I could have imagined! Thanks very much for your help!!
  • »06.02.12 - 17:49
    Profile Visit Website