#include /******************************************************************** * Painting */ void PaintButton(boolean down) { setcolor(down ? BG2 : BG); rectpath(0,0,w,h); fill(); setcolor(FG); rectpath(insetstroke(0,[0,0,w,h])); stroke(); } void Paint() { PaintButton(false); } /******************************************************************** * Track button */ boolean trackinpath = false; void trackbutton() { boolean b = pointinpath(trackx,tracky); if (b != trackinpath) { trackinpath = b; gsave(); newpath(); Send PaintButton(b); grestore(); } } void OnSelect() { name t; path(); t = track(/trackbutton); if (trackinpath) { newpath(); if (t != /mouse_cancel) { Send PaintButton(false); action(); } } unpromote(/trackinpath); }