if(index--) {
Print2DExpr(expr[i],w,x1,y);
x1+=wi[i];
if(f!=1)
WinFont (w, f);
}
}
if(tag!=LIST_TAG) break;
top_estack=ap1;
y=y1;
}
ER_success();
}
w->Flags&=~WF_TTY ;
if(f!=1)
WinFont (w, 1);
if(c>=0)
WinAttr (w, attr);
if(error) ER_throwVar (error);
// ngetchx();
}
[7.46] 'Custom' command makes menu labels for trapped function keys
This tip shows how to use the Custom command to create labels for function keys used in interactive
programs. An example might be a program which uses the Graph screen to display information, and
the user can press one of several keys to perform program features. For example, suppose you have
written a program which manipulates graphic objects on the screen. The objects can be moved and
rotated, and there is a help feature. You want to provide quick, obvious access to these features. This
program shows the basic idea.
tooltab(m)
Prgm
© Custom toolbar with key trap demonstration
© (m) m is program name to restore menu, as a string
© 13jan02/dburkett@infinet.com
local key © Pressed key code
dispg © Display graph screen
custom © Display toolbar tabs
title "Move"
title "Rotate"
title "Help"
endcustm
custmon © Display toolbar
© Loop to wait for key presses
loop
getkey()→key © Get pressed key code
if key=264:exit © Exit when [ESC] pressed
if key=268 then © [F1] key
dialog
title "Move"
text "F1"
enddlog
elseif key=269 then © [F2] key
dialog
title "Rotate"
text "F2"
7 - 60