PreviousUpNext

15.4.1383  src/lib/x-kit/widget/leaf/boxbutton-shape.pkg

## boxbutton-shape.pkg
#
# Shape for rectangular button.

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






###                    "If you have ambition, you might not achieve anything,
###                     but without ambition, you are almost certain
###                     not to achieve anything."
###
###                                              -- Whitfield Diffie 


# This package gets used in:

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

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

    package boxbutton_shape: (weak)  Button_Shape {                     # Button_Shape                  is from   src/lib/x-kit/widget/leaf/button-shape.api


        attributes = [];

        fun drawfn (d, size, bwid)
            =
            draw
            where
                r = xg::box::make (xg::point::zero, size);

                draw_box = d3::draw3drect d (r, bwid);

                fun draw (base, top, bottom)
                    =
                    {   xc::fill_box  d  base  r;

                        draw_box { top, bottom };
                    };
            end;

        fun sizefn (wid, ht)
            =
            wg::make_tight_size_preference
              (
                wid,

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

        fun config _
            =
            (sizefn, drawfn);

    };

end;

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


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext