Travis Evans wrote:
> So last night I finally realized that the softkey menu was designed so
> that instead of static strings or grobs for menu labels, you can use a
> secondary starting with TakeOver that returns an object to be used as
> the label.
Fun, huh? Another trick is to follow the TakeOver command with a string and a DROP. This has no effect on the operation or appearance of the key, but when you press right-shift down-cursor (to see the full names of the menu keys), the string you put after the TakeOver gets displayed! This lets you name your custom menu key whatever you want, even something totally different than what is displayed in the menu label.
The following example (a slightly modified version of CLKMENU on Goodies Disk #10) creates a "menu clock" which has 7 features:
(1) It displays the current time, updated when the menu line is updated (e.g. after every calculation).
(2) The menu label is in inverse video, which looks cool.
(3) Pressing it puts the current time, day of week, and date on the stack.
(4) Pressing it left-shifted performs ->TIME.
(5) Pressing it right-shifted performs ->DATE.
(6) Pressing right-shift down-cursor displays its name as "Time/Date".
(7) It works correctly regardless of the settings of flags -41 and -42 (12/24 mode and MDY/DMY mode).
As shown, it can be stored into 'CST' as-is. If included as one of several lists inside 'CST', then do 1 GET on it first, of course. The listing below is in HP50g MASD syntax.
{ { :: TakeOver "Time/Date" DROP
TOD TOD>t$ 41 SysITE
:: 2 6 SUB$ TOD ;
:: 1 5 SUB$ TOD %1- %12 %MOD %1+ ;
%10 %< IT :: 2 5 SUB$ ;
20 11 GROB 3A 8000051 MakeLabel ;
{ :: DATE TOD TIMESTR DUP
41 SysITE 15 14 LAST$ SWAP 1 12 SUB$ ;
xSETTIME xSETDATE } } }
HP 50g BYTES (when compiled): 193 #579Ch
-Joe-