83Plus:OS:Dialog context
This Documentation is for use with the
To start this context, load a menu structure* to ramCode, BCALL DialogInit and then BCALL StartDialog. You choose whether the run indicator is displayed and whether contexts are allowed (appAllowContext,(iy+appFlags)). It is imperative that (cxCurApp) be one of the allowed values (use 58h=kExtApps).
If kSolveRoot (SOLVE EDITOR), kStatEd (list editor), or kInfStat (inferential statistic editor) are pressed, the entire screen is redrawn and then the parser callback is called with A=1.
If [UP], [DOWN], or [ENTER] are pressed, any entered number is parsed*.
If [2nd]+[QUIT] is pressed, whatever has been entered will be parsed* (no errors thrown nor anything displayed) to OP1, the previous context vectors are restored, SP is restored from (spSave), and the run indicator is turned off.
Parsing the number
ParseInp is called on the data entered, and OP1 is checked to make sure it is REAL (error thrown if not (and this may return to the edit)). A=0 is passed to the parser callback. B (8006h) is the index into a prompt structure (probably bID = 3). It is expected to return a value in A. Return zero to display the current line (string and number). It also copies the number in OP1 to the spot bNumIndex points to. If 0,(iy+2Eh) is set, the rest of the line is not erased (then NewLine).
Menu structure
Load as many of these structures, one after the other (zero-terminated), to ramCode in the order you want it displayed. Store the length-indexed strings in RAM as well (right after this structure, in ramCode).
bID can be from 1-6: bID = 1: display string (cannot select). bID = 2: display highlightable choices (as in the MODE context). A byte table at 8009h has to do with what is selected here. bID = 3: display prompt string and number. bID = 4: display highlightable string. bID = 5: display menu number (ex. "1:") and prompt string. bID = 6: hidden, skip displaying this entry.
Prompt structure when bID = 1:
DB bID ; DB bNumChoices ;probably always 1 DB bUnknown ; DW wStringOffset ;offset from start of ramCode
Prompt structure when bID = 2:
DB bID ; DB bNumChoices ; DB bUnknown ;I think this is the number of rows to skip for next item, or something DW wStringOffset ;offset from start of ramCode /
DB bColumn ;column to display string (this is probably ignored) \ There are bNumChoices of these.
Prompt structure when bID = 3:
DB bID ; DB bNumChoices ;probably always 1 DB bNumIndex ; DW wStringOffset ;offset from start of ramCode
Prompt structure when bID = 4:
DB bID ; DB bNumChoices ;probably always 1 DB bUnknown ; DW wStringOffset ;offset from start of ramCode
Prompt structure when bID = 5: DB bID ;
DB bNumEntries ;probably always 1 DB bMenuItemNum ;1 for "1:", 2 for "2:", etc. DW wStringOffset ;offset from start of ramCode
Prompt structure when bID = 6:
DB bID ; DB bNumChoices ; DB bUnknown ; DW wStringOffset ;offset from start of ramCode < There are bNumChoices of these.
8038h: bNumIndex above is an offset into a list of floating-point numbers:
DB 00h,80h,00h,00h,00h,00h,00h,00h,00h