#include #include /********************************************************************* * Parameters */ persist(iconfont); persist(iconlabel); float w = 64; float h = 64; boolean visible = true; displayitem iconlabel() { return framelabel; } menu @menu() { return @iconmenu; } /********************************************************************* * Painting */ void PaintIconImage() { super.Paint(); } void PaintIconLabel(displayitem lab) { ginit(); setcolor(FG); setfont(iconfont); DIPaintCentered(lab,1,4,w-2,DIHeight(lab)); } void Paint() { PaintIconImage(); PaintIconLabel(iconlabel); } /********************************************************************* * Synchornize open/close with the window */ void OnInit() { float X = iconX, Y = iconY; store(/iconX,iconX + w + 10); move(X,Y); } void open() { Send open() to @window; } void close() { Send close() to @window; } void owner_open() { unmap(); } void owner_close() { } void OnSelect2() { open(); }