PreviousUpNext

15.4.1503  src/lib/x-kit/widget/old/leaf/boxbutton-drawfn-and-sizefn.pkg

## boxbutton-drawfn-and-sizefn.pkg
#
# Shape for rectangular button.

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






# This package gets used in:

#     src/lib/x-kit/widget/old/leaf/boxbutton-look.pkg

stipulate
    package d3 =  three_d;                                              # three_d                       is from   src/lib/x-kit/widget/old/lib/three-d.pkg
    package xc =  xclient;                                              # xclient                       is from   src/lib/x-kit/xclient/xclient.pkg
    package g2d=  geometry2d;                                           # geometry2d                    is from   src/lib/std/2d/geometry2d.pkg
    package wg =  widget;                                               # widget                        is from   src/lib/x-kit/widget/old/basic/widget.pkg
herein

    package boxbutton_drawfn_and_sizefn
    : (weak)   Button_Drawfn_And_Sizefn                                 # Button_Drawfn_And_Sizefn      is from   src/lib/x-kit/widget/old/leaf/button-drawfn-and-sizefn.api
    {
        attributes = [];
        #
        fun drawfn (d, size, bwid)
            =
            draw
            where
                r = g2d::box::make (g2d::point::zero, size);
                #
                draw_box = d3::draw3drect d (r, bwid);

                fun draw (base, top, bottom)                            # Mode-dependent colors in which to draw.
                    =
                    {   xc::fill_box  d  base  r;
                        #
                        draw_box { top, bottom };
                    };
            end;

        fun sizefn (wid, ht)
            =
            wg::make_tight_size_preference                              # make_tight_size_preference    is from   src/lib/x-kit/widget/old/basic/widget-base.pkg
              (
                wid,

                case ht
                    THE h => h;
                    NULL  => wid;
                esac
              );

        fun make_button_drawfn_and_sizefn _
            =
            (drawfn, sizefn);
    };

end;

## COPYRIGHT (c) 1994 by AT&T Bell Laboratories  See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext