SourceCoder 2.5 has long had a virtual calculator keypad that lets you type tokens via a familiar menu format rather than having to guess what SourceCoder uses for each token. It also makes typing unusual characters and symbols much easier. Unfortunately, it requires a good deal of initial work to transcribe the menu format into something that I can use via Javascript in SourceCoder. I'll be inserting the menus into the following Prizm-themed editor view:

http://www.cemetech.net/projects/basicelite/sourcecoder2.php?editme=true&calcType=pz

If you hover over the buttons, you'll notice they're mapped to key codes (not necessarily the Prizm OS's keycodes, of course). The "top level" menu is a set of three-element rows, representing (normal), (with Shift/2nd), (with Alpha) outputs for each key. To borrow from the TI example:


Code:
   13,17,'~A',
   74,21,'~B',
   22,24,'~C',
   27,51,-1,
   -1,-1,-1,


This is the MATH/APPS/PRGM row of the keyboard. 13 is the sub-menu for MATH, 74 is APPS, 22 is PRGM, 27 is VARS. 2nd-MATH is the second element of the first row, 17; menu 17 is TEST. Likewise, 2nd-APPS is ANGLE, menu 21. Items in 'single quotes' are literal outputs, so the third column (ALPHA+key) is the literal A, B, or C typed. Items that are -1 indicate that that key combination does nothing. The Prizm has (norma), (shift), and (alpha) combinations.

That covers the top-level array. If someone could start in on that, it would rock. If it's necessary for me to do a few example keys first, I'd be more than happy to oblige.

The second-level menu arrays are much harder and much more intense. And because of the way Prizm menus work, making you press F6 to go to the next page, we will have a lot more of them. For example, here's the two pages of the MATH menu from the TI example:


Code:
menus[19] = new Array(
   'NAMES MATH',20,
   '1: [A]','~[A]',
   '2: [B]','~[B]',
   '3: [C]','~[C]',
   '4: [D]','~[D]',
   '5: [E]','~[E]',
   '6: [F]','~[F]',
   '7: [G]','~[G]',
   '8: [H]','~[H]',
   '9: [I]','~[I]',
   '0: [J]','~[J]'
   );
menus[20] = new Array(
   'NAMES MATH',19,
   '1: det(','~det(',
   '2: {~T}','~{^T}',
   '3: dim(','~dim(',
   '4: Fill(','~Fill(',
   '5: identity(','~identity(',
   '6: randM(','~randM(',
   '7: augment(','~augment(',
   '8: Matr►list(','~Matr►list(',
   '9: List►matr(','~List►matr(',
   '0: cumSum(','~cumSum(',
   'A: ref(','~ref(',
   'B: rref(','~rref(',
   'C: rowSwap(','~rowSwap(',
   'D: row+(','~row+(',
   'E: *row(','~*row(',
   'F: *row+(','~*row+('
   );


Notice that each menu row has two columns: first, the text to display, and second, the text to insert when that item is chosen, ie, a token. If the second column contains a number instead of a string, that's a menu to jump to when that item is chosen rather than inserting text. Makes sense? Smile
Oh man. I'll have to stare at this for a bit to understand it. But I have one question. Are the codes for "MATH" the getkey code? Or is that something entirely different? Such as menu numbers?

If they are the menu numbers, how do we go about coordinating? Just go down the keys from top left to bottom right and work the menu's up sequentially from there?

I'm lost in the code boxes and detailed explanation that I may be overlooking these answers :/
I misspoke, that's actually the MATRIX menu in the second codebox. The numbers in the first codebox are menu numbers; X in that becomes menus[x] = array(...) later, as shown in the second codebox. The menu numbers are in no particular order; I just kept counting up as needed, but we would indeed need to coordinate somehow.
*bump* Here's the key array and menu arrays for the top row of keys on the Prizm; hopefully it provides some clarification.


Code:

doF1(), -1, -1,      //F1
doF2(), 1, -1,      //F2, 1=ZoomMenu
doF3(),   2, -1,      //F3, 2=VWindow
doF4(), 3, -1,      //F4, 3=Sketch
doF5(), -1, -1,      //F5
doF6(), -1, -1,

zmenus[1] = array(
'[Zoom]',-1,
'Factor','~Factor ',
'Auto','~ZoomAuto');

zmenus[2] = array(
'[V-Window]',-1,
'V-Win','~ViewWindow ',
'Store','~StoV-Win ',
'Recall','~RclV-Win ');

zmenus[3] = array(
'[Sketch]',-1,
'Cls','~Cls',
'Tangent','~Tangent ',
'Norm','~Normal ',
'Inverse','~Inverse ',
'GRAPH',4,
'Next▷',5);

zmenus[5] = array(
'[Sketch 2]',-1,
'PLOT',6,
'LINE',7,
'Circle','~Circle ',
'Vertical',~Vertical ',
'Horz','Horizontal ',
'Next▷',8);

zmenus[8] = array(
'[Sketch 3]',-1,
'Text','~Text ',
'PIXEL',9,
'Test','~PxlTest(',
'STYLE',10,
'Next▷',3);

zmenus[4] = array(
'[Graph]',-1,
'Y=','~Graph Y=',
'r=','~Graph r=',
'Param','~Graph(X,Y)=(',
'X=','~Graph X=',
'G⋅∫d𝓍','~Graph {int}',
'Next▷',11);

zmenus[11] = array(
'[Graph 2]',-1,
'Y>','Graph Y>',
'Y<','Graph Y<',
'Y≥','Graph Y≥',
'Y≤','Graph Y≤',
'Next▷',12);

zmenus[12] = array(
'[Graph 3]',-1,
'X>','Graph X>',
'X<','Graph X<',
'X≥','Graph X≥',
'X≤','Graph X≤',
'Next▷',4);

zmenus[6] = array(
'[Plot]',-1,
'Plot','~Plot ',
'PlotOn','~PlotOn ',
'PlotOff','~PlotOff ',
'PlotChg','~PlotChg ');

zmenus[7] = array(
'[Line]',-1,
'Line','~Line',
'F-Line','~F-Line ');

zmenus[9] = array(
'[Pixel]',-1,
'On','~PxlOn ',
'Off','~PxlOff ',
'PxlChg','~PxlChg ');

zmenus[10] = array(
'[Style]',-1,
'NormalLine','~SketchNormal ',
'ThickLine','~SketchThick ',
'BrokenLine','~SketchBroken ',
'DottedLine','~SketchDot ',
'ThinLine','~SketchThin ');

*Double-bump* Tons more that I added! At least 112 menu screens at this point.


Code:

zmenus[13] = new Array(
'[OPTN]',-1,
'LIST',17,
'MAT',18,
'COMPLEX',19,
'CALC',20,
'STAT',21,
'Next►',22);

zmenus[22] = new Array(
'[OPTN 2]',-1,
'CONVERT',23,
'HYPERBL',24,
'PROB',25,
'NUMERIC',26,
'ANGLE',27,
'Next►',28);

zmenus[28] = new Array(
'[OPTN 3]',-1,
'ENG-SYM',29,
'PICTURE',30,
'FUNCMEM',31,
'LOGIC',32,
'CAPTURE',33,
'Next►',34);

zmenus[34] = new Array(
'[OPTN 4]',-1,
'FINANCE',35,
'Next►',13);

zmenus[14] = new Array(
'[VARS]',-1,
'V-WIN',36,
'FACTOR',37,
'STAT',38,
'GRAPH',39,
'DYNA',40,
'Next►',41);

zmenus[41] = new Array(
'[VARS 2]',-1,
'TABLE',42,
'RECURSION',43,
'EQUATION',44,
'FINANCE',45,
'Str','~Str ',
'Next►',14);

zmenus[15] = new Array(
'[PRGM]',-1,
'COMMAND',46,
'CONTROL',47,
'JUMP',48,
'?','~?',
'◢','~◢\n:',
'Next►',49);

zmenus[49] = new Array(
'[PRGM 2]',-1,
'CLEAR',50,
'DISPLAY',51,
'RELATNL',52,
'I/O',53,
':','~:',
'Next►',54);

zmenus[54] = new Array(
'[PRGM 3]',-1,
'STR',55,
'Next►',15);

zmenus[16] = new Array(
'[SET UP]',-1,
'ANGLE',56,
'COORD',57,
'GRID',58,
'AXES',59,
'LABEL',60,
'Next►',61);

zmenus[61] = new Array(
'[SET UP 2]',-1,
'DISPLAY',62,
'SKT/LIN',63,
'DRAW',64,
'DERIV',65,
'BACK',66,
'Next►',67);

zmenus[67] = new Array(
'[SET UP 3]',-1,
'FUNC',68,
'SIMUL',69,
'SGV-WIN',70,
'LIST',71,
'LOCUS',72,
'Next►',73);

zmenus[73] = new Array(
'[SET UP 4]',-1,
'TBL-VAR',74,
'ΣDISP',75,
'RESID',76,
'COMPLEX',77,
'FRAC',78,
'Next►',79);

zmenus[79] = new Array(
'[SET UP 5]',-1,
'Y=SPEED',80,
'DATE',81,
'PMT',82,
'PERIODS',83,
'INEQ',84,
'Next►',85);

zmenus[85] = new Array(
'[SET UP 6]',-1,
'SIMP',86,
'Q1Q3',87,
'P/L-CLR',88,
'Next►',16);

zmenus[17] = new Array(
'[LIST]',-1,
'List','~List ',
'Lst→Mat','~List→Mat(',
'Dim','~Dim ',
'Fill(','~Fill(',
'Seq','Seq(',
'Next►',89);

zmenus[89] = new Array(
'[LIST 2]',-1,
'Min','~Min(',
'Max','~Max(',
'Mean','~Mean(',
'Med','~Median(',
'Augment','~Augment(',
'Next►',90);

zmenus[90] = new Array(
'[LIST 3]',-1,
'Sum','Sum ',
'Prod','Prod ',
'Cum1','Cum1 1',
'%','Percent ',
'ΔList','~ΔList ',
'Next►',17);

zmenus[18] = new Array(
'[MAT]',-1,
'Mat','~Mat ',
'Mat→Lst','~Mat→List(',
'Det','~Det ',
'Trn','~Trn ',
'Augment','~Augment(',
'Next►',91);

zmenus[91] = new Array(
'[MAT 2]',-1,
'Identity','~Identity',
'Dim','~Dim ',
'Fill(','~Fill(',
'Ref','~Ref ',
'Rref','~Rref ',
'Next►',18);

zmenus[19] = new Array(
'[COMPLEX]',-1,
'𝒊','~{i}',
'Abs','~Abs ',
'Arg','~Arg ',
'Conjg','~Conjg ',
'Next►',92);

zmenus[92] = new Array(
'[COMPLEX 2]',-1,
'ReP','~ReP ',
'ImP','~ImP ',
'►r∠θ','~►r∠θ',
'►a+b𝒊','►a+b{i}',
'Next►',19);

zmenus[20] = new Array(
'[CALC]',-1,
'Solve','~Solve(',
'd/dx','d/dx(',
'd²/dx²','~d{^2}/dx{^2}',
'∫dx','~{int}(',
'SolveN','~SolveN(',
'Next►',93);

zmenus[93] = new Array(
'[CALC 2]',-1,
'FMin','~FMin(',
'FMax','~FMax(',
'Σ(','~{int}(',
'logab','~logab(',
'Next►',94);

zmenus[94] = new Array(
'[CALC 3]',-1,
'Int÷','~Int÷ ',
'Rmdr','~Rmdr ',
'Simp','~►Simp ',
'Next►',20);

zmenus[21] = new Array(
'[STAT]',-1,
'{xhat}','~{xhat}',
'{yhat}','~{yhat}',
'DIST',95,
'StdDev','~StdDev(',
'Var','~Variance(',
'Next►',96);

zmenus[96] = new Array(
'[STAT 2]',-1,
'TEST',97,
'Next►',21);

zmenus[23] = new Array(
'[CONVERT]',-1,
'►','~►',
'LENGTH',98,
'AREA',99,
'VOLUME',100,
'TIME',101,
'Next►',102);

zmenus[102] = new Array(
'[CONVERT 2]',-1,
'►','~►',
'TMPR',103,
'VELOCITY',104,
'MASS',105,
'FORCE',106,
'Next►',107);

zmenus[107] = new Array(
'[CONVERT 3]',-1,
'►','~►',
'PRESSURE',108,
'ENERGY',109,
'POWER',110,
'Next►',23);

zmenus[24] = new Array(
'[HYPRBL]',-1,
'sinh','~sinh ',
'cosh','~cosh ',
'tanh','~tanh ',
'sinh{^-1}','~sinh{^-1} ',
'cosh{^-1}','~cosh{^-1} ',
'tanh{^-1}','~tanh{^-1} ');

zmenus[25] = new Array(
'[PROB]',-1,
'x!','~!',
'nPr','~𝐏',
'nCr','~𝐂',
'RAND',111,
'Next►',112);

zmenus[111] = new Array(
'[RAND]',-1,
'Ran#','~Ran# ',
'Int','~RanInt#(',
'Norm','~RanNorm#(',
'Bin','~RanBin#(',
'List','~RanList#(',

zmenus[112] = new Array(
'[PROB 2]',-1,
'P(','~P(',
'Q(','~Q(',
'R(','~R(',
't(','~t(',
'Next►',25);

zmenus[26] = new Array(
'[NUMERIC]',-1,
'Abs','~Abs ',
'Int','~Int ',
'Frac','~Frac ',
'Rnd','~Rnd',
'Intg','~Intg ',
'Next►',113);

zmenus[113] = new Array(
'[NUMERIC 2]',-1,
'RndFix','~RndFix(',
'GCD','~GCD(',
'LCM','~LCM(',
'MOD','~MOD(',
'MOD_Exp','~MOD_Exp(',
'Next►',26);
Keep it up! I still don't follow the pattern Sad
comicIDIOT wrote:
Keep it up! I still don't follow the pattern Sad
What can I help clarify? What makes sense and what doesn't? I'd love to be able to clarify it so that I could beg assistance from you and our other Prizm owners. Smile
Here's more, if it helps. Sad Projected is well over 150 now, so any assistance would be hugely appreciated.


Code:
zmenus[27] = new Array(
'[ANGLE]',-1,
'°','~°',
'^r','~{^r}',
'^g','~{^g}',
'°\'"','~{^□}',
'Next►',114);

zmenus[114] = new Array(
'[ANGLE 2]',-1,
'Pol(','~Pol(',
'Rec(','~Rec(',
'►DMS','~►DMS',
'Next►',27);

zmenus[29] = new Array(
'[ENG-SYM]',-1,
'm','~m',
'μ','~μ',
'n','~{n}',
'p','~p',
'f','~f',
'Next►',115);

zmenus[115] = new Array(
'[ENG-SYM 2]',-1,
'k','~k',
'M','~{M}',
'G','~{G}',
'T','~{T}',
'P','~{P}',
'Next►',116);

zmenus[116] = new Array(
'[ENG-SYM 3]',-1,
'𝐄','~{E}',
'Next►',29);

zmenus[30] = new Array(
'[PICTURE]',-1,
'Store','~StorePict ',
'Recall','~RclPict ');

zmenus[31] = new Array(
'[FUNCMEM]',-1,
'STORE',117,
'RECALL',118,
'fn','~fᴺ');

zmenus[32] = new Array(
'[LOGIC]',-1,
'And','~ And ',
'Or','~ Or ',
'Not','~ Not ',
'Xor','~ Xor ');

zmenus[33] = new Array(
'[CAPTURE]',-1,
'Recall','~RclCapt ');

zmenus[35] = new Array(
'[FINANCE]',-1,
'SIMPLE',119,
'COMPND',120,
'CASH',121,
'AMORTZN',122,
'CONVERT',123,
'Next►',124);

zmenus[124] = new Array(
'[FINANCE 2]',-1,
'COST',125,
'DAYS',126,
'BOND',127);

zmenus[36] = new Array(
'[V-WIN]',-1,
'X',128,
'Y',129,
'T,θ',130,
'R-X',131,
'R-Y',132,
'R-T,θ',133);

zmenus[37] = new Array(
'[FACTOR]',-1,
'Xfct','~Xfct',
'Yfct','~Yfct');

zmenus[38] = new Array(
'[STAT]',-1,
'X',134,
'Y',135,
'GRAPH',136,
'PTS',137,
'INPUT',138,
'RESULT',139);

zmenus[39] = new Array(
'[GRAPH]',-1,
'Y','~{Y}',
'r','~{r}',
'Xt','~{X}t',
'Yt','~{Y}t',
'X','~{X}');

zmenus[40] = new Array(
'[DYNA]',-1,
'Start','~D Start',
'End','~D End',
'Pitch','~D pitch');

zmenus[42] = new Array(
'[TABLE]',-1,
'Start','~F Start',
'End','~F End',
'Pitch','~F pitch',
'Result','~F Result');

zmenus[43] = new Array(
'[RECURSION]',-1,
'FORMULA',140,
'RANGE',141,
'Result','~R Result');

zmenus[44] = new Array(
'[EQUATION]',-1,
'SimRes','~Sim Result',
'SimCoef','~Sim Coef',
'PlyRes','~Ply Result',
'PlyCoef','~Ply Coef');

zmenus[45] = new Array(
'[FINANCE]',-1,
'n','~n',
'I%','~I%',
'PV','~{PV}',
'PMT','~{PMT}',
'FV','~{FV}',
'Next►',142);

zmenus[142] = new Array(
'[FINANCE 2]',-1,
'P/Y','~{P/Y}',
'C/Y','~{C/Y}',
'Next►',45);

zmenus[46] = new Array(
'[COMMAND]',-1,
'If','~If ',
'Then','~Then ',
'Else','~Else ',
'IfEnd','~IfEnd',
'Next►',143);

zmenus[143] = new Array(
'[COMMAND 2]',-1,
'For','~For ',
'To','~ To ',
'Step','~ Step ',
'Next','~Next'
'Next►',144);

zmenus[144] = new Array(
'[COMMAND 3]',-1,
'While','~While ',
'WEnd','~WhileEnd',
'Do','~Do',
'LpWhile','~LpWhile ',
'Next►',46);

zmenus[47] = new Array(
'[CONTROL]',-1,
'Prog','~Prog ',
'Return','~Return',
'Break','~Break',
'Stop','~Stop');

zmenus[48] = new Array(
'[JUMP]','-1',
'Lbl','~Lbl ',
'Goto','~Goto ',
'=>','~=>',
'Isz','~Isz ',
'Dsz','~Dsz ',
'Menu','~Menu ');

zmenus[50] = new Array(
'[CLEAR]',-1,
'Text','~ClrText',
'Graph','~ClrGraph',
'List','~ClrList ',
'Mat','~ClrMat ');

zmenus[51] = new Array(
'[DISPLAY]',-1,
'Stat','~DrawStat',
'Graph','~DrawGraph',
'Dyna','~DrawDyna',
'FUNCTAB',145,
'RECRTAB',146);

zmenus[52] = new ArraY(
'[RELATNL]',-1,
'=','~=',
'≠','~≠',
'>','~>',
'<','~<',
'≥','~≥',
'≤','~≤');

zmenus[53] = new Array(
'[I/O]',-1,
'Locate','~Locate ',
'Getkey','~Getkey',
'Send','Send(',
'Receive','Receive(',
'Next►',147);

zmenus[147] = new Array(
'[I/O 2]',-1,
'S38k','~Send38k ',
'R38k','~Receive38k ',
'Open','~OpenComport38k',
'Close','~CloseComport38k',
'Next►',53);

zmenus[55] = new Array(
'[STR]',-1,
'Join','~StrJoin(',
'Len','~StrLen(',
'Cmp','~StrCmp(',
'Src','~StrSrc(',
'Next►',148);

zmenus[148] = new Array(
'[STR 2]',-1,
'Left','~StrLeft(',
'Right','~StrRight(',
'Mid','~StrMid(',
'E->S','~Exp►Str(',
'Next►',149);

zmenus[149] = new Array(
'[STR 3]',-1,
'Upr','~StrUpr(',
'Lwr','~StrLwr(',
'Inverse','~StrInv(',
'Shift','~StrShift(',
'Rotate','~StrRotate(',
'Next►',55);

zmenus[56] = new Array(
'[ANGLE]',-1,
'Deg','~Deg',
'Rad','~Rad',
'Gra','~Gra');

zmenus[57] = new Array(
'[COORD]',-1,
'On','~CoordOn',
'Off','~CoordOff');

zmenus[58] = new Array(
'[GRID]',-1,
'On','~GridOn',
'Off','~GridOff',
'Line',~GridLine');

zmenus[59] = new Array(
'[AXES]',-1,
'On','~AxesOn',
'Off','~AxesOff',
'Scale','~AxesScale');

zmenus[60] = new Array(
'[LABEL]',-1,
'On','~LabelOn',
'Off','~LabelOff');

zmenus[62] = new Array(
'[DISPLAY]',-1,
'Fix','~Fix ',
'Sci','~Sci ',
'Norm','~Norm ',
'ENG',150);

zmenus[63] = new Array(
'[SKT/LIN]',-1,
'NormalLine','~S-L-Normal',
'ThickLine','~S-L-Thick',
'BrokenLine','~S-L-Broken',
'DottedLine','~S-L-Dot',
'ThinLine','~S-L-Thin');

zmenus[64] = new Array(
'[DRAW]',-1,
'Connect','~G-Connect',
'Plot','~G-Plot');

zmenus[65] = new ArraY(
'[DERIV]',-1,
'On','~DerivOn',
'Off','~DerivOff');

zmenus[66] = new Array(
'[BACK]',-1,
'None','~BG-None',
'Pict','~BG-Pict ');

zmenus[68] = new Array(
'[FUNC]',-1,
'On','~FuncOn',
'Off','~FuncOff');

zmenus[69] = new Array(
'[SIMUL]',-1,
'On','~SimulOn',
'Off','~SimulOff');

zmenus[70] = new Array(
'[SGV-WIN]',-1,
'Auto','~S-WindAuto',
'Manual','~S-WindMan');
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement