14.37 Palette Interface

14.38 Palette

ORIGIN 'Bifrost';
BODY 'private/Impl/PaletteImpl';
INCLUDE 'PredefinedGO' ;

(*
 * COPYRIGHT 
 *       Copyright Mjolner Informatics, 1990-94 
 *       All rights reserved.
 *)

-- BifrostAttributes: attributes --

Palette: BifrostCanvas
  (* A canvas showing an either vertical or horizontal sequence of
   * graphical objects.  At any time exactly one of these are
   * highlighted by a black frame.  This default highlight may be
   * changed by furtherbinding "hiliteitem".  Graphical objects are
   * added to THIS(Palette) by using "append".  The number of the
   * currently selected graphical object is in "selection".
   *)
  (# eventhandler::<(# onOpen::<
            (# ... #);
          onMouseDown::< 
            (# ... #);
       #);
     
     blackpaint: @SolidColor; (* A black solid color *)
     
     selection: @integerValue
       (* Number of currently selected item *)
       (# checknew: @
            (# ns: @integer;
            enter ns ... 
            #);
       enter checknew
       #);
     noOfItems: integerValue
       (* Exit the number of graphical objects in THIS(Palette) *)
       (# ... #);
     framePaint: @
       (* The paint used in the frame and default hilite *)
       (# f: ^Paint;
          newFramePaint: @
            (# 
            enter f[] 
            do ...
            #)
       enter newFramePaint
       exit f[]
       #);
     goPaint: @
       (* The paint used in the AbstractGraphicalObjects *)
       (# g: ^Paint;
          newGoPaint: @
            (# b: @boolean
            enter g[]
            do ...;
            #)
       enter newGoPaint
       exit g[]
       #);
     
     open::< 
       (* Open THIS(Palette). Place it at position.  deltax,
        * deltay gives the step-lengths in horizontal and vertical
        * direction, respectively.  If vertical is true, it will be a
        * vertical palette, otherwise a horizontal one.
        *)
       (# deltax, deltay: @integer; 
          vertical: @boolean;
       enter (deltax, deltay, vertical)
       ...
       #);
     size:
       (* Hides BifrostCanvas.size. The size of THIS(Palette) should
        * not be set directly, since it will adjust itself depending 
        * on the number of items.
        *)
       (# s: @point
       exit (# ... exit s #)
       #);
     close::<
       (# ... #);
     append:< 
       (* Append go as a selectable item in THIS(Palette).  go will
        * be centered in a box with dimensions deltax and deltay (as
        * specified to init)
        *)
       (# go: ^AbstractGraphicalObject;
       enter go[]
       do ...; INNER;
       #);
     hiliteitem:< 
       (* Highlight item no i instead of the currently highlighted
        * item.  Does not change the current selection
        *)
       (# doneininner: @boolean;
          i: @integer;
       enter i
       do INNER; ...
       #);
     changed:< 
       (* Called when the selection changes *)
       (# ... #);
     
     paletteprivate: @...;
  #)


14.37 Palette Interface
© 1991-2002 Mjølner Informatics
[Modified: Thursday October 24th 1996 at 16:58]