PreviousUpNext

15.3.693  src/lib/x-kit/widget/old/layout/widget-with-scrollbars.api

## widget-with-scrollbars.api
#
# Standard "widget with scrollbars" layout:
# One main widget with adjacent to it a
# vertical and a horizontal scrollbar.
#
# The size preferences of the scrolled_widget
# and the scrollbars are not changed; if it
# is desired that the scrollbars run the full
# length of the scrolled_widget their size
# preferences must be specified accordingly.
#
# The 'scrollbar' parameters are deliberately
# of type Widget not Scrollbar to allow custom
# scrollbars to be used, or Scrollbars composed
# with extra buttons or other decorations.

# Compare with:
#     Scrolled_Widget, designed to be easier to use but less flexible:
#         src/lib/x-kit/widget/old/layout/scrolled-widget.api
#
# See also:
#     Viewport, which provides a window onto a larger widget,
#     typically panned using scrollbars:
#         src/lib/x-kit/widget/old/layout/viewport.api

# Compiled by:
#     src/lib/x-kit/widget/xkit-widget.sublib



# This api is implemented in:
#
#     src/lib/x-kit/widget/old/layout/widget-with-scrollbars.pkg

stipulate
    package lw =  line_of_widgets;                              # line_of_widgets       is from   src/lib/x-kit/widget/old/layout/line-of-widgets.pkg
    package wg =  widget;                                       # widget                is from   src/lib/x-kit/widget/old/basic/widget.pkg
herein

    api Widget_With_Scrollbars {

        # If horizontal_scrollbar is not NULL,
        # it will be centered above the
        # scrolled_widget if top is TRUE, else below,
        # and similarly with vertical_scrollbar.
        #
        # The 'pad' value is the number of pixels
        # to leave between the scrollbar and the
        # scrolled_widget.
        #
        make_widget_with_scrollbars
            :
            wg::Root_Window
            ->
            {
              scrolled_widget:  wg::Widget,
              #
              horizontal_scrollbar:  Null_Or {   scrollbar: wg::Widget,   pad: Int,   top:  Bool   },
              vertical_scrollbar:    Null_Or {   scrollbar: wg::Widget,   pad: Int,   left: Bool   }
            }
            ->
            lw::Line_Of_Widgets;
    };

end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext