/* dialog by macfly august 2001 */ fun EVENTBOX_CBpaint (win, param) = let param -> [font value color] in let _GETwindowPositionSize win -> [_ _ w h] in ( _PAINTrectangle win 0 0 w h DRAW_SOLID 1 color DRAW_SOLID color; if font == nil then nil else let _GETstringSize font value -> [ww hh] in _TXTout win font (w-ww)/2 (h-hh)/2 TD_LEFT|TD_TOP 0 value; ) ;; proto EVENTBOX_CBunclick = fun [ObjWin [ObjFont I S S fun [I I S] I] I I I] I;; fun EVENTBOX_CBkillFocus (win, param) = let param -> [font _ value _ _] in ( _CBwinPaint win @EVENTBOX_CBpaint [font value make_rgb 150 150 150]; _CBwinKeyup win nil nil; _CBwinUnclick win @EVENTBOX_CBunclick param; _CBwinKillFocus win nil nil; _PAINTwindow win; 0 ) ;; fun EVENTBOX_CBkeyUp (win, param, scan) = let param -> [font prevscan value code func] in ( EVENTBOX_CBkillFocus win param; exec func with [if scan == 1 then nil else scan prevscan code]; ) ;; fun EVENTBOX_CBunclick2 (win, param, a, b, c) = let param -> [font prevscan value code func] in ( EVENTBOX_CBkillFocus win param; exec func with [(-c) prevscan code]; ) ;; fun EVENTBOX_CBunclick (win, param, a, b, c) = let param -> [font _ value _ _] in ( _SETfocus win; _CBwinPaint win @EVENTBOX_CBpaint [font value make_rgb 220 220 0]; _CBwinKeyup win @EVENTBOX_CBkeyUp param; _CBwinUnclick win @EVENTBOX_CBunclick2 param; _PAINTwindow win; _CBwinKillFocus win @EVENTBOX_CBkillFocus param; 0 ) ;; fun _DRAWeventBox (win, font, prevscan, value, code, func) = _CBwinPaint win @EVENTBOX_CBpaint [font value make_rgb 150 150 150]; _CBwinUnclick win @EVENTBOX_CBunclick [font prevscan value code func]; _PAINTwindow win ;; fun _CReventBox (chan, win, x, y, w, h, code) = _CRwindow chan win x y w h WN_CHILDINSIDE|WN_DOWN code;;