MODULE; IMPORT Axis, Region, Shadow, ShadowPaint, VBT; REVEAL T = Public BRANDED OBJECT axis : Axis.T; shadow: Shadow.T; style : Shadow.Style; OVERRIDES init := Init; shape := Shape; repaint := Repaint; END; PROCEDURE ShadowedBarVBT Init (v : T; axis : Axis.T; shadow: Shadow.T := NIL; style : Shadow.Style := Shadow.Style.Flat): T = BEGIN IF shadow = NIL THEN shadow := Shadow.None; END; v.axis := axis; v.shadow := shadow; v.style := style; RETURN v END Init; PROCEDURESet (v: T; shadow: Shadow.T) = BEGIN IF v.shadow.size # shadow.size THEN VBT.NewShape (v); END; v.shadow := shadow; VBT.Mark (v); END Set; PROCEDURESetStyle (v: T; style: Shadow.Style) = BEGIN v.style := style; VBT.Mark(v); END SetStyle; PROCEDUREShape (v: T; ax: Axis.T; n: CARDINAL): VBT.SizeRange = VAR sr: VBT.SizeRange; BEGIN IF v.axis = ax THEN sr.lo := ROUND(VBT.MMToPixels(v, ABS(v.shadow.size), ax)); sr.pref := sr.lo; sr.hi := sr.lo + 1; RETURN sr; ELSE RETURN VBT.Leaf.shape(v, ax, n) END; END Shape; PROCEDURERepaint (v: T; READONLY rgn: Region.T) = BEGIN ShadowPaint.Bar(v, rgn, v.shadow, v.style, v.axis, VBT.Domain (v)); END Repaint; BEGIN END ShadowedBarVBT.