[7.46] Custom Command Makes Menu Labels For Trapped Function Keys - Texas Instruments TI-89 Tip List

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

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
dispg
custom
title "Move"
title "Rotate"
title "Help"
endcustm
custmon
© Loop to wait for key presses
loop
getkey()→key
if key=264:exit
if key=268 then
dialog
title "Move"
text "F1"
enddlog
elseif key=269 then
dialog
title "Rotate"
text "F2"
© Pressed key code
© Display graph screen
© Display toolbar tabs
© Display toolbar
© Get pressed key code
© Exit when [ESC] pressed
© [F1] key
© [F2] key
7 - 60

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents