*** PT100v96.text Fri Apr 18 19:37:07 1997 --- PT100v97.text Fri Apr 18 19:40:12 1997 *************** *** 1,9 **** ! // Text of project PT100 written on 4/18/97 at 7:26 PM // Beginning of text file version.txt ! constant kVersionString := "Version 0.96b"; // Changes for v0.96b ! // ¥ allowed calloptoinsslip editting to update // number to dial // ¥ Fixed 48803 bug. Problem with standard options frames // when a request had no response --- 1,27 ---- ! // Text of project PT100 written on 4/18/97 at 7:28 PM // Beginning of text file version.txt ! constant kVersionString := "Version 0.971b"; + // Changes for 0.971b + // ¥ Fixed "Edit List" bug + + // Changes for v0.97b + // ¥ About shows Owner name and time online + // ¥ tapping on middle of compass finds cursor + // ¥ deals correctly with NO monospaced fonts + // ¥ Tap on word sends or inserts into input Line + // ¥ rewrote all screen code to blast it into a bitmap + // ¥ kbd characters are chunked in BufferOutput to prevent NIE bug + // ¥ check for session and username/passwd before trying to send + // ¥ fixed capslock behaviour on soft kbd + // ¥ put a protoOrientation button in prefs + // ¥ input line better sized + // ¥Êusing 0 instead of kModemECProtocolNone fixing some problems. + // ¥ Removed second call to Option since it's screwing up some modems. + // ¥ Handles GoAhead telnet character + // Changes for v0.96b ! // ¥ allowed callOptionsSlip editting to update // number to dial // ¥ Fixed 48803 bug. Problem with standard options frames // when a request had no response *************** *** 101,106 **** --- 119,126 ---- knownGlobalFunctions.InetReleaseLink := 3; knownGlobalFunctions.OpenHelpBook := 1; knownGlobalFunctions.BinEqual := 2; + knownGlobalFunctions.StrHexDump := 2; + knownGlobalFunctions.CreateSoupFromSoupDef := 3; constant kInfoAbout := 0; constant kInfoHelp := 1; *************** *** 107,117 **** constant kInfoPrefs := 2; constant kEditSessions := 4; constant kInfoCopytoNotes := 5; //constant kInfoDebugToggle := 6; //constant kInfoRegister := 8; ! constant kInfoRegister := 7; constant kInputLine := 0; constant kInputkbd := 1; --- 127,138 ---- constant kInfoPrefs := 2; constant kEditSessions := 4; constant kInfoCopytoNotes := 5; + constant kInfoClearScreen := 6; //constant kInfoDebugToggle := 6; //constant kInfoRegister := 8; ! constant kInfoRegister := 8; constant kInputLine := 0; constant kInputkbd := 1; *************** *** 122,127 **** --- 143,149 ---- constant kFontInverse := 2; constant kFontUnderline := 4; + constant kMaxKeyboardBuffer := 20; constant kSharewareFee := 25; *************** *** 150,157 **** DefineGlobalConstant('kCheckRegister, func native() begin ! local reg := "", name := getglobals().userConfiguration.name; ! local string := name & "PT100"; while (strlen(string) < 20) do begin string := string & string; --- 172,193 ---- DefineGlobalConstant('kCheckRegister, func native() begin ! local reg := ""; ! local sn, name; ! local string; ! ! // Do this once we get 2.1 defs file ! /* try sn := call ROM_GetSerialNumber with () onException |evt.ex| do nil; ! ! if sn then // 2.1 unit ! name := StrHexDump(sn, 0); ! else */ ! name := getglobals().userConfiguration.name; ! ! ! name := getglobals().userConfiguration.name; ! ! string := name & "PT100"; while (strlen(string) < 20) do begin string := string & string; *************** *** 193,202 **** string := string & string; end; ! local h := 0; ! local g; ! local i; ! local len := StrLen(string) - 1; local newString := ""; for i := 0 to len do begin --- 229,238 ---- string := string & string; end; ! local int h := 0; ! local int g; ! local int i; ! local int len := StrLen(string) - 1; local newString := ""; for i := 0 to len do begin *************** *** 345,350 **** --- 381,389 ---- constant telnetUnicodeWont := "\u00b8\u"; constant telnetWill := 251; constant telnetUnicodeWill := "\u02da\u"; + constant telnetGoAhead := 249; + constant telnetUnicodeGoAhead := "\u02d8\u"; + constant telnetUnicodeGoAheadChar := $\u02d8; // used to map second chars to request symbols telnetRequestLookupFrame := { *************** *** 364,369 **** --- 403,593 ---- }; DefineGlobalConstant('kTelnetResponseLookupFrame, telnetResponseLookupFrame); // End of text file telnet.txt + // Beginning of text file lex.txt + constant normalChars := '[ + // Don't forget that everything in normalChars must also be in the + // termination frame of the InputSpec. + "\n", "\u000a\u", "\u0008\u", "\u0007\u", "\u0009\u", + "\u000e\u", "\u000f\u", + ]; + constant normalArray := '[ + LeftEdge, + ScrollUp, + MoveLeft, + RingBell, + TabNext, + Ignore, + Ignore, + ]; + + constant escChars := '[ + "7", "8", "M", "=", ">", "H", + ]; + constant escArray := '[ + SaveCursor, // 7 + RestoreCursor, // 8 + ScrollTextDown, // M + DecIgnore, // = DECKPAM + DecIgnore, // > DECKPNM + TabSet, + ]; + + constant lBrackChars := '[ + "L", "J", "K", "P", "M", "H", "f", "m", "C", "A", "B", "@", "k", "h", "l", + "D", "r", "n", + ]; + constant lBrackArray := '[ + AddNLines, // L + ClearTo, // J + ClearToEOL, // K + DeleteNChars, // P + DeleteNLines, // M + ZapCursor, // H + ZapCursor, // f Identical to H + TurnOnAttribs, // m + MoveRightN, // C + MoveUpN, // A + MoveDownN, // B + InsertNChars, // @ + ClearTabStops, // k + EnterInsert, // h + ExitInsert, // l + MoveLeftN, // D + ChangeScrollRegion, // r + DevStatRep, // n + ]; + + constant semiChars := '[ + "H", "f", "r", "m" + ]; + constant semiArray := '[ + ZapCursor, + ZapCursor, + ChangeScrollRegion, + TurnOnAttribs, + ]; + + constant decQuesChars := '[ + "h", "l", + ]; + constant decQuesArray := '[ + DecSetMode, // h dpmodes function (in xterm source) + DecResetMode, // l "Reset" (see xterm source) + ]; + + // We use the unicode "translations" that will be produced by + // the de-encoding in the endpoint. + // We assume kMacAsciiEncoding. + iacCharsDef := [ + telnetUnicodeDont, + telnetUnicodeWont, + telnetUnicodeDo, + telnetUnicodeWill, + ]; + DefineGlobalConstant('iacChars, iacCharsDef); + + constant iacArray := '[ + Ignore, // Ignore donts and wonts since we don't do anything + Ignore, // special anyway. + TelnetDo, + TelnetWill, + ]; + + StandardInputSpec := { + form: 'string, + filter: { + byteProxy: { + byte: 0x00, + proxy: nil, + }, + }, + termination: { endSequence:[ + unicodeLF, + unicodeCR, + unicodeESC, + unicodeBEL, + unicodeBS, + unicodeHT, + unicodeSO, + unicodeSI, + ], + }, + discardAfter: 256, + inputScript: func(ep, data, terminator, options) begin + ep:MInput(data, nil); + end, + partialScript: func(ep, data) begin + ep:MInput(data, 'partial); + ep:FlushInput(); + end, + partialFrequency: 250, + }; + DefineGlobalConstant('kEndPointInputSpec, StandardInputSpec); + + TelnetInputSpec := { + form: 'string, + filter: { + byteProxy: { + byte: 0x00, + proxy: nil, + }, + }, + termination: { endSequence:[ + unicodeLF, + unicodeCR, + unicodeESC, + unicodeBEL, + unicodeBS, + unicodeHT, + unicodeSO, + unicodeSI, + telnetUnicodeIACChar, + ], + }, + discardAfter: 256, + inputScript: func(ep, data, terminator, options) begin + ep:MTelnetInput(data, nil); + end, + partialScript: func(ep, data) begin + ep:MTelnetInput(data, 'partial); + ep:FlushInput(); + end, + partialFrequency: 250, + }; + DefineGlobalConstant('kEndPointTelnetInputSpec, TelnetInputSpec); + + StandardOneCharInputSpec := { + form: 'string, + filter: { + byteProxy: { + byte: 0x00, + proxy: nil, + }, + }, + termination: { byteCount: 1, + }, + discardAfter: 256, + inputScript: func(ep, data, terminator, options) + ep:MInput(data, nil), + }; + DefineGlobalConstant('kEndPointOneCharInputSpec, StandardOneCharInputSpec); + + TelnetOneCharInputSpec := { + form: 'string, + filter: { + byteProxy: { + byte: 0x00, + proxy: nil, + }, + }, + termination: { byteCount: 1, + }, + discardAfter: 256, + inputScript: func(ep, data, terminator, options) + ep:MTelnetInput(data, nil), + }; + DefineGlobalConstant('kEndPointOneCharTelnetInputSpec, TelnetOneCharInputSpec); + // End of text file lex.txt // Beginning of file telnet.l _v74_0 := { *************** *** 452,458 **** begin // We're in normal, so this must be the second char. self.secondChar := aChar; ! :TSetState('tGotSecond); end, DoTGotSecond: func(aChar) --- 676,686 ---- begin // We're in normal, so this must be the second char. self.secondChar := aChar; ! ! // Ignore the Go Ahead message. ! if (aChar <> telnetUnicodeGoAheadChar) then begin ! :TSetState('tGotSecond); ! end; end, DoTGotSecond: func(aChar) *************** *** 461,467 **** self.optionChar := aChar; local optionNum := Ord(aChar); if optionNum > 127 then begin ! print("Whoops"); :TSetState('tNormal); // God, what a crock. end else begin :TSetState('tGotOption); --- 689,695 ---- self.optionChar := aChar; local optionNum := Ord(aChar); if optionNum > 127 then begin ! print("Whoops" && Ord(secondChar) && optionNum); :TSetState('tNormal); // God, what a crock. end else begin :TSetState('tGotOption); *************** *** 561,750 **** constant |layout_telnet.l| := _v74_0; // End of file telnet.l - // Beginning of text file lex.txt - constant normalChars := '[ - // Don't forget that everything in normalChars must also be in the - // termination frame of the InputSpec. - "\n", "\u000a\u", "\u0008\u", "\u0007\u", "\u0009\u", - "\u000e\u", "\u000f\u", - ]; - constant normalArray := '[ - LeftEdge, - ScrollUp, - MoveLeft, - RingBell, - TabNext, - Ignore, - Ignore, - ]; - - constant escChars := '[ - "7", "8", "M", "=", ">", "H", - ]; - constant escArray := '[ - SaveCursor, // 7 - RestoreCursor, // 8 - ScrollTextDown, // M - DecIgnore, // = DECKPAM - DecIgnore, // > DECKPNM - TabSet, - ]; - - constant lBrackChars := '[ - "L", "J", "K", "P", "M", "H", "f", "m", "C", "A", "B", "@", "k", "h", "l", - "D", "r", - ]; - constant lBrackArray := '[ - AddNLines, // L - ClearTo, // J - ClearToEOL, // K - DeleteNChars, // P - DeleteNLines, // M - ZapCursor, // H - ZapCursor, // f Identical to H - TurnOnAttribs, // m - MoveRightN, // C - MoveUpN, // A - MoveDownN, // B - InsertNChars, // @ - ClearTabStops, // k - EnterInsert, // h - ExitInsert, // l - MoveLeftN, // D - ChangeScrollRegion, // r - ]; - - constant semiChars := '[ - "H", "f", "r", "m" - ]; - constant semiArray := '[ - ZapCursor, - ZapCursor, - ChangeScrollRegion, - TurnOnAttribs, - ]; - - constant decQuesChars := '[ - "h", "l", - ]; - constant decQuesArray := '[ - DecIgnore, // h dpmodes function (in xterm source) - DecIgnore, // l "Reset" (see xterm source) - ]; - - // We use the unicode "translations" that will be produced by - // the de-encoding in the endpoint. - // We assume kMacAsciiEncoding. - iacCharsDef := [ - telnetUnicodeDont, - telnetUnicodeWont, - telnetUnicodeDo, - telnetUnicodeWill, - ]; - DefineGlobalConstant('iacChars, iacCharsDef); - - constant iacArray := '[ - Ignore, // Ignore donts and wonts since we don't do anything - Ignore, // special anyway. - TelnetDo, - TelnetWill, - ]; - - StandardInputSpec := { - form: 'string, - filter: { - byteProxy: { - byte: 0x00, - proxy: nil, - }, - }, - termination: { endSequence:[ - unicodeLF, - unicodeCR, - unicodeESC, - unicodeBEL, - unicodeBS, - unicodeHT, - unicodeSO, - unicodeSI, - ], - }, - discardAfter: 256, - inputScript: func(ep, data, terminator, options) begin - ep:MInput(data, nil); - end, - partialScript: func(ep, data) begin - ep:MInput(data, 'partial); - ep:FlushInput(); - end, - partialFrequency: 250, - }; - DefineGlobalConstant('kEndPointInputSpec, StandardInputSpec); - - TelnetInputSpec := { - form: 'string, - filter: { - byteProxy: { - byte: 0x00, - proxy: nil, - }, - }, - termination: { endSequence:[ - unicodeLF, - unicodeCR, - unicodeESC, - unicodeBEL, - unicodeBS, - unicodeHT, - unicodeSO, - unicodeSI, - telnetUnicodeIACChar, - ], - }, - discardAfter: 256, - inputScript: func(ep, data, terminator, options) begin - ep:MTelnetInput(data, nil); - end, - partialScript: func(ep, data) begin - ep:MTelnetInput(data, 'partial); - ep:FlushInput(); - end, - partialFrequency: 250, - }; - DefineGlobalConstant('kEndPointTelnetInputSpec, TelnetInputSpec); - - StandardOneCharInputSpec := { - form: 'string, - filter: { - byteProxy: { - byte: 0x00, - proxy: nil, - }, - }, - termination: { byteCount: 1, - }, - discardAfter: 256, - inputScript: func(ep, data, terminator, options) - ep:MInput(data, nil), - }; - DefineGlobalConstant('kEndPointOneCharInputSpec, StandardOneCharInputSpec); - - TelnetOneCharInputSpec := { - form: 'string, - filter: { - byteProxy: { - byte: 0x00, - proxy: nil, - }, - }, - termination: { byteCount: 1, - }, - discardAfter: 256, - inputScript: func(ep, data, terminator, options) - ep:MTelnetInput(data, nil), - }; - DefineGlobalConstant('kEndPointOneCharTelnetInputSpec, TelnetOneCharInputSpec); - // End of text file lex.txt // Beginning of file lex.l lex := { --- 789,794 ---- *************** *** 767,772 **** --- 811,822 ---- self.params[paramNum] := self.params[paramNum] * 10 + (Ord(aChar) - 48); end; end, + DecSetMode: + func() + begin + if params[0] = 1 then + self.cursorMode = 'set; + end, tabNext: func() begin *************** *** 965,970 **** --- 1015,1026 ---- begin screen:ScrollRegionSet(params[0], params[1]); end, + DecResetMode: + func() + begin + if params[0] = 1 then + self.cursorMode = 'reset; + end, SendBuffer: func() begin *************** *** 985,992 **** // Do we need to do anything? if state = newState then return; self.state := newState; - base.ept:MSetInputSpec(newState); end, MoveUpN: func() --- 1041,1054 ---- // Do we need to do anything? if state = newState then return; + // I'm assuming here that normal takes one state and all + // of the other states use another (identical) state. + // True for now, but remember this for the future. + if ((self.state <> 'normal and newState = 'normal) or + (self.state = 'normal and newState <> 'normal)) then begin + base.ept:MSetInputSpec(newState); + end; self.state := newState; end, MoveUpN: func() *************** *** 1100,1105 **** --- 1162,1168 ---- debugging: nil, // An odd debugging flag. telnetState: nil, // The telnet options state addOn: nil, // Some addon, probably telnet. + cursorMode: 'reset, // 'set or 'reset }); ret.params := Array(10,-1); ret; *************** *** 1195,1200 **** --- 1258,1279 ---- end; end; end, + DevStatRep: + func() + begin + if params[0] = 6 then begin + ept:MOutputNoRet( + // Send CPR (Oh, my heart!) + unicodeEsc & "[" & + NumberStr(screen.cursor.y) & ";" & + NumberStr(screen.cursor.x) & "R" + ); + end else if params[0] = 5 then begin + ept:MOutputNoRet( + unicodeEsc & "[0n" + ); + end; + end, AddCharToBuffer: func(aChar) begin *************** *** 1213,1219 **** DoString: func(string, partial) begin ! if debugToggle then if kDebugOn then begin local i; write("lex:DoString: "); write("(\"" & SubStr(string, 0, 10) & "\")"); --- 1292,1298 ---- DoString: func(string, partial) begin ! if kDebugOn then if debugToggle then begin local i; write("lex:DoString: "); write("(\"" & SubStr(string, 0, 10) & "\")"); *************** *** 1296,1302 **** constant kState_Connected := 5; // connected (requires disconnect) constant kState_Disconnecting := 6; // in-process of (asynchronous) disconnect ! constant kMessage_Disconnected := "Ready to connectÉ"; constant kMessage_Listening := "Waiting for connection..."; constant kMessage_Connecting := "Connecting..."; constant kMessage_Connected := "Connected."; --- 1375,1381 ---- constant kState_Connected := 5; // connected (requires disconnect) constant kState_Disconnecting := 6; // in-process of (asynchronous) disconnect ! constant kMessage_Disconnected := "Ready to connect..."; constant kMessage_Listening := "Waiting for connection..."; constant kMessage_Connecting := "Connecting..."; constant kMessage_Connected := "Connected."; *************** *** 1408,1415 **** arglist: [ k1StopBits, // 1 stop bit kNoParity, // no parity bit ! k7DataBits, // 8 data bits ! k9600bps, ], // data rate in bps typelist: ['struct, 'long, // stop bits 'long, // parity --- 1487,1494 ---- arglist: [ k1StopBits, // 1 stop bit kNoParity, // no parity bit ! k8DataBits, // 8 data bits ! k2400bps, ], // data rate in bps typelist: ['struct, 'long, // stop bits 'long, // parity *************** *** 1464,1475 **** if pos then begin options[pos].data.arglist[kECIndex] := if theSession.advanced.eCorr then ! kModemECProtocolNone + kModemECProtocolMNP else ! kModemECProtocolNone; end; pos := ArrayPos(options, kCMOSerialIOParms, 0, func(a,b) StrEqual(a, b.label)); ! if pos then begin options[pos].data.arglist[kSerialSpeed] := kSerialSpeedLookup.(if theSession.advanced exists and theSession.advanced.speed exists then Intern(theSession.advanced.speed) else --- 1543,1557 ---- if pos then begin options[pos].data.arglist[kECIndex] := if theSession.advanced.eCorr then ! // This is a documentation bug. ! // Using kModemECProtocolNone does NOT work. ! // Use '0' instead. ! 0 + kModemECProtocolMNP else ! 0; end; pos := ArrayPos(options, kCMOSerialIOParms, 0, func(a,b) StrEqual(a, b.label)); ! if nil then begin options[pos].data.arglist[kSerialSpeed] := kSerialSpeedLookup.(if theSession.advanced exists and theSession.advanced.speed exists then Intern(theSession.advanced.speed) else *************** *** 1486,1491 **** --- 1568,1574 ---- kSerialDataLookup.(if theSession.advanced exists and theSession.advanced.data exists then Intern(theSession.advanced.data) else '8); + if kdebugOn then print(options[pos]); end; options; *************** *** 1540,1548 **** :MConnectAction(:TBuildConfigOptions(theLinkID)); end, resetTimer: ! func() begin self.sessionStart := TimeInSeconds(); end, SetUpInputSpecs: InputSpecsDef := { --- 1623,1635 ---- :MConnectAction(:TBuildConfigOptions(theLinkID)); end, resetTimer: ! func(start) begin self.sessionStart := TimeInSeconds(); + + if start then + self.sessionActualStart := TimeInSeconds(); + end, SetUpInputSpecs: InputSpecsDef := { *************** *** 2029,2039 **** local options := :MBuildConfigOptionsModem(); local pos := ArrayPos(options, kCMOSerialIOParms, 0, func(a,b) StrEqual(a, b.label)); if (pos) then begin ! :Option([options[pos]],nil); end; end; ! :ResetTimer(); :MSetEndPointState(kState_Connected); :MMessage(kMessage_Connected); --- 2116,2127 ---- local options := :MBuildConfigOptionsModem(); local pos := ArrayPos(options, kCMOSerialIOParms, 0, func(a,b) StrEqual(a, b.label)); if (pos) then begin ! // Debugging code. ! // :Option([options[pos]],nil); end; end; ! :ResetTimer(true); :MSetEndPointState(kState_Connected); :MMessage(kMessage_Connected); *************** *** 2095,2101 **** :MSetEndPointState(kState_Connecting); :MMessage(kMessage_Connecting); local opts := if theSession.type = 'telnet then ! :TBuildConnectOptions(theAddress, Floor(StringToNumber(theSession.advanced.portNumber))); else [ fconnectAddress ]; :Connect(opts, { async: true, --- 2183,2190 ---- :MSetEndPointState(kState_Connecting); :MMessage(kMessage_Connecting); local opts := if theSession.type = 'telnet then ! :TBuildConnectOptions(theAddress, ! Floor(StringToNumber(StringFilter(theSession.advanced.portNumber, "0123456789.", 'passAll)))); else [ fconnectAddress ]; :Connect(opts, { async: true, *************** *** 2413,2473 **** // End of file dialbox.l // Beginning of file protoLine line := ! { ! AttributeFrame: ! { ! location : nil, ! attribute : 0, ! }, ! AttributeCleanup: func() begin ! local attr := attribs; ! local a, i; ! // remove duplicates? ! for i:= 1 to Length(attr)-1 do begin ! if attr[i].attribute = attr[i-1].attribute then begin ! attr[i].attribute := 'duplicate; ! attr[i].location := attr[i].location + 1; ! end else if attr[i].location = attr[i-1].location then begin ! attr[i-1].attribute := 'duplicate; ! attr[i-1].location := attr[i].location - 1; end; ! end; ! foreach a in attr do begin ! if a.attribute = 'duplicate then ! BDelete(attr, a.location, '|<|, 'location, nil); end; ! if Length(attr)<2 then attribs := nil; ! end, - viewFormat: 256, - viewLineSpacing: nil, - viewDrawScript: - func() - begin - if cursorVisible EXISTS and - cursorVisible and - cursor.y-1 = linenum then begin - cursorVisible := nil; // We've overwritten it! - AddProcrastinatedCall(cursorSymbol, cursorDraw, ['draw, :Parent()], 100); - end; - end, - viewFlags: 1, linenum: nil, AttributeNew: func() begin self.attribs := [Clone(AttributeFrame), Clone(AttributeFrame)]; self.attribs[0].location := 0; ! self.attribs[1].location := Width * charWidth; end, - blip: nil, - viewBounds: {left: 0, top: 0, right: 300, bottom: 10}, AttributeUpdate: func(curX, length) begin --- 2502,2635 ---- // End of file dialbox.l // Beginning of file protoLine line := ! {text: nil, ! TextBounds: nil, ! Clear: func() begin ! self.text := Clone(spaces); ! self.attribs := nil; ! self.dirty := true; ! self.redraw := true; ! end, ! attribs: nil, ! set: ! func(newLine) ! begin ! // use this to just update the view -- not to cause it to update ! text := newLine.text; ! textPicture := newLine.textPicture; ! attribs := newLine.attribs; ! dirty := true; ! end, ! Update: ! func() ! begin ! local textShape, attribShape, shapeElements, numShapes := 0; ! local lattribs := attribs, i, ldescent := descent, inverseHeight := viewLineSpacing; ! local lcharWidth := charWidth; ! local styleFrameUnderLine := {font:viewFont, ! transfermode: modeXor, ! fillPattern : vfBlack}; ! local styleFrameInverse := {font:viewFont, ! transfermode: modeXor, ! fillPattern : vfBlack, ! penPattern : vfNone}; ! local styleFrameBold := {font:{face: kFaceBold, ! family:viewFont.family, ! size:viewFont.size}, }; ! local styleFrameText := {font:viewFont, ! transfermode: modeCopy, ! fillPattern : vfBlack}; ! ! ! textShape := MakeText(text, ! textBounds.left, ! textBounds.top, ! textBounds.right, ! textBounds.bottom); + shapeElements := [{fillpattern:vfWhite, penPattern:vfNone}, blankRect, + styleFrameText, textShape, styleFrameBold]; ! if lattribs then begin ! numShapes := 0; ! attribShape := Array(Length(lattribs)+1, nil); ! ! for i:=0 to Length(lattribs)-2 do begin ! // Bold Stuff ! if BAnd(lattribs[i].attribute, kFontBold) <> 0 then begin ! attribShape[numShapes] := ! MakeText(SubStr(self.text, lattribs[i].location, lattribs[i+1].location), ! lattribs[i].location*lcharWidth, ! textBounds.top, ! lattribs[i+1].location*lcharWidth, ! textBounds.bottom); ! numShapes := numShapes + 1; ! end; end; ! ! // Now reset the style frame for the next set of stuff ! attribShape[numShapes] := styleFrameUnderLine; ! numShapes := numShapes + 1; ! ! ArrayMunger(shapeElements, Length(shapeElements), nil, attribShape, 0, numShapes); ! ! // Add in the overlaying lines for underlined text ! ! numShapes := 0; ! for i:=0 to Length(lattribs)-2 do begin ! ! // Underline Stuff ! if BAnd(lattribs[i].attribute, kFontUnderLine) <> 0 then begin ! attribShape[numShapes] := ! MakeLine(lattribs[i].location*lcharWidth, ! textBounds.bottom, ! lattribs[i+1].location*lcharWidth-1, ! textBounds.bottom); ! numShapes := numShapes + 1; ! end; ! end; ! ! // Now reset the style frame for the next set of stuff ! attribShape[numShapes] := styleFrameInverse; ! numShapes := numShapes + 1; ! ! ArrayMunger(shapeElements, Length(shapeElements), nil, attribShape, 0, numShapes); ! ! // Add in the overlaying rectangles inverse text ! ! numShapes := 0; ! for i:=0 to Length(lattribs)-2 do begin ! // invert Stuff ! if BAnd(lattribs[i].attribute, kFontInverse) <> 0 then begin ! attribShape[numShapes] := ! MakeRect(lattribs[i].location*lcharWidth-1, ! 0, ! lattribs[i+1].location*lcharWidth+1, ! inverseHeight); ! numShapes := numShapes + 1; ! end; ! end; ! ArrayMunger(shapeElements, Length(shapeElements), nil, attribShape, 0, numShapes); end; ! self.textPicture := MakePict(shapeElements, nil); end, linenum: nil, + AttributeFrame: + { + location : nil, + attribute : 0, + }, AttributeNew: func() begin self.attribs := [Clone(AttributeFrame), Clone(AttributeFrame)]; self.attribs[0].location := 0; ! self.attribs[1].location := width; end, AttributeUpdate: func(curX, length) begin *************** *** 2484,2490 **** // 5. Find all redundancies and replace them ! local startLoc := curX*charWidth, endLoc := (curX+length)*charWidth; local oldAttribute; local newAttrib := Clone(AttributeFrame); local attr := attribs; --- 2646,2652 ---- // 5. Find all redundancies and replace them ! local startLoc := curX, endLoc := (curX+length); local oldAttribute; local newAttrib := Clone(AttributeFrame); local attr := attribs; *************** *** 2518,2645 **** end; :AttributeCleanup(); - end;, ! TextBounds: nil, ! viewJustify: 8192, ! icon: nil, ! Update: ! func(text) begin ! local textShape, attribShape, shapeElements, numShapes := 0; ! local lattribs := attribs, i, descent; ! local styleFrameNormal := {font:viewFont, ! transfermode: modeXor, ! fillPattern : vfBlack}; ! local styleFrameBold := {font:{face: kFaceBold, ! family:viewFont.family, ! size:viewFont.size}, }; ! local styleFrameText := {font:viewFont, ! transfermode: modeCopy, ! fillPattern : vfBlack}; ! ! ! // If we were given an updated text string, set it ! if text then ! self.text := text; ! ! textShape := MakeText(self.text, ! textBounds.left, ! textBounds.top, ! textBounds.right, ! textBounds.bottom); ! ! shapeElements := [styleFrameText, textShape, blip, styleFrameBold]; ! ! if lattribs then begin ! numShapes := 0; ! attribShape := Array(Length(lattribs)+1, nil); ! for i:=0 to Length(lattribs)-2 do begin ! ! // Bold Stuff ! if BAnd(lattribs[i].attribute, kFontBold) <> 0 then begin ! attribShape[numShapes] := ! MakeText(SubStr(self.text, Floor(lattribs[i].location/charWidth), Floor(lattribs[i+1].location/charWidth)), ! lattribs[i].location, ! textBounds.top, ! lattribs[i+1].location, ! textBounds.bottom); ! numShapes := numShapes + 1; ! end; end; - - // Now reset the style frame for the next set of stuff - attribShape[numShapes] := styleFrameNormal; - numShapes := numShapes + 1; - - ArrayMunger(shapeElements, Length(shapeElements), nil, attribShape, 0, numShapes); end; - ! // Add in the overlaying rectangles and lines for ! // inverse and underlined text ! ! numShapes := 0; ! if lattribs then begin ! attribShape := Array(Length(lattribs)+1, nil); ! for i:=0 to Length(lattribs)-2 do begin ! ! // Underline Stuff ! if BAnd(lattribs[i].attribute, kFontUnderLine) <> 0 then begin ! attribShape[numShapes] := ! MakeLine(lattribs[i].location, ! textBounds.bottom, ! lattribs[i+1].location-1, ! textBounds.bottom); ! numShapes := numShapes + 1; ! end; ! ! // invert Stuff ! if BAnd(lattribs[i].attribute, kFontInverse) <> 0 then begin ! attribShape[numShapes] := ! MakeRect(lattribs[i].location-1, ! viewBounds.top, ! lattribs[i+1].location+1, ! viewBounds.bottom+1); ! numShapes := numShapes + 1; ! end; ! end; ! ArrayMunger(shapeElements, Length(shapeElements), nil, attribShape, 0, numShapes); ! end; - setValue(self, 'icon, MakePict(shapeElements, styleFrameNormal)); end, ! viewClass: 76 /* clPictureView */, ! set: ! func(newLine) ! begin ! // use this to just update the view -- not to cause it to update ! text := newLine.text; ! icon := newLine.icon; ! attribs := newLine.attribs; ! ! end, ! text: nil, ! Clear: ! func() ! begin ! self.text := Clone(spaces); ! self.icon := nil; ! self.attribs := nil; ! end, ! attribs: nil, ! resizeAttribs: ! func(old, new) ! begin ! if attribs then ! foreach a in attribs do ! a.location := Floor((a.location/old) * new); ! end, ! viewFont: nil }; constant |layout_protoLine| := line; // End of file protoLine // Beginning of file protoScreen --- 2680,2717 ---- end; :AttributeCleanup(); end;, ! textPicture: nil, ! dirty: nil, ! redraw: nil, ! AttributeCleanup: ! func() begin ! local attr := attribs; ! local a, i; ! for i:=Length(attr)-2 to 1 by -1 do begin ! if attr[i].attribute = attr[i-1].attribute then begin ! RemoveSlot(attr, i); ! end else if attr[i].location = attr[i-1].location then begin ! RemoveSlot(attr, i-1); end; end; ! if Length(attr)<2 then attribs := nil; end, ! viewClass: 76 /* clPictureView */ }; + // After Script for line + thisView := line; + RemoveSlot(thisView, 'viewClass); + RemoveSlot(thisView, 'icon); + // this is a George like object structure + + constant |layout_protoLine| := line; // End of file protoLine // Beginning of file protoScreen *************** *** 2673,2679 **** if cursor.y-1 <= topScroll then begin for i := botScroll to topScroll+1 by -1 do begin - // lines[i]:set(lines[i-1]); call lWhackLine with (lines[i],lines[i-1]); end; --- 2745,2750 ---- *************** *** 2687,2695 **** end else if direction = 'up then begin if cursor.y - 1 >= botScroll then begin ! for i := topScroll to botScroll-1 do begin - // lines[i]:set(lines[i+1]); call lWhackLine with (lines[i],lines[i+1]); end; --- 2758,2776 ---- end else if direction = 'up then begin if cursor.y - 1 >= botScroll then begin ! ! // save scrollback ! if scrollback then begin ! local newEntry := ! { ! num: scrollback.current MOD scrollback.max, ! text : Clone(lines[topScroll].text), ! attribs : DeepClone(lines[topScroll].attribs), ! }; ! :BufferScrollback(newEntry); ! end; ! for i := topScroll to botScroll-1 do begin call lWhackLine with (lines[i],lines[i+1]); end; *************** *** 2703,2714 **** end; ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); ! ! if NOT bufferLines then begin ! :dirty(); ! refreshViews(); ! end; end, tabNext: func() --- 2784,2790 ---- end; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, tabNext: func() *************** *** 2738,2760 **** :cursorMove('down); end; end, ! referenceLines: ! func() begin ! lines := Array(height, nil); ! foreach child in :ChildViewFrames() do begin ! if child.lineNum exists then begin ! child.text := SubStr(child.text&Clone(spaces), 0 , width); // clear the text slot ! lines[child.lineNum] := child; // link lines to the overall array end; end; ! end, TabReset: func() begin local i; ! :tabClearAll(); // XXX not sure if tabs start at zero or at one --- 2814,2921 ---- :cursorMove('down); end; end, ! BufferScrollBack: ! // Save the line that is about to be scrolled back ! func(newEntry) ! begin ! AddArraySlot(self.scrollbackBuffer, newEntry); ! scrollback.current := scrollback.current + 1; ! ! if Length(scrollbackBuffer) = 20 then begin ! // Save to soup *right now* ! :FlushScrollBackBuffer(); ! end else begin ! AddProcrastinatedCall(scrollbackSymbol, func(s) ! begin ! s:saveBufferedLines(); ! s.scrollbackBuffer:=Clone('[]); ! end;, ! [self], screen.screenUpdateTime); ! end; ! end, ! scrollBackBuffer: nil, ! ResizeScrollbackBuffer: ! /*func(newSize) begin ! if NOT scrollback then return; ! local cursor := scrollbackSoupCursor; ! local entry; ! local i, newLoc; ! ! // save these to a soup. ! ! ! if newSize < scrollback.max then begin ! ! // 1. remove the entries that no longer fit ! cursor:reset(); ! for i:= scrollback.current+1 to (scrollback.max-newSize) + scrollback.current do begin ! if entry := cursor:Gotokey(i MOD scrollback.max) then begin ! if entry.num = (i MOD scrollback.max) then begin ! EntryRemoveFromSoupXmit(entry, nil); ! end; ! end; end; + + // 2. renumber all the entries + entry := cursor:reset(); + for i:= 0 to newSize-1 do begin + + // reset current pointer + if entry then begin + if entry.num = scrollback.current MOD scrollback.max then begin + newLoc := i+newSize; + end; + end; + if entry AND entry.num then begin + entry.num := i; + EntryChangeXmit(entry, nil); + end; + entry := cursor:Next(); + end; + + if newLoc then + scrollback.current := newLoc; + else + scrollback.current := newSize-1; + + scrollback.max := newSize; + + end else begin // new size is *bigger* that the old! + + // just renumber all the entries + entry := cursor:reset(); + for i:= 0 to newSize-1 do begin + + // reset current pointer + if entry then begin + if entry.num = scrollback.current MOD scrollback.max then begin + newLoc := i+newSize; + end; + end; + if entry AND entry.num then begin + entry.num := i; + EntryChangeXmit(entry, nil); + end; + entry := cursor:Next(); + end; + + if newLoc then + scrollback.current := newLoc; + else + scrollback.current := newSize-1; + + scrollback.max := newSize; + end; ! end ! */, TabReset: func() begin local i; ! :tabClearAll(); // XXX not sure if tabs start at zero or at one *************** *** 2770,2821 **** setValue(screen, 'viewFont, fontSpec); :syncView(); - :syncChildren(); - :referenceLines(); - foreach line in lines do begin - line:resizeAttribs(oldWidth, charWidth); // move attribs about - line:update(nil); // change the fonts all 'round! - end; - end, - cursorDraw: - func(mode, scr) - begin - local curX := scr.cursor.x - 1; - local curY := scr.cursor.y - 1; - local lcharWidth := scr.charWidth; - local lcharHeight := scr.charHeight; - local ldescent := scr.descent-1; ! // erase old cursor ! if scr.cursorBlock and ! (mode = 'refresh or mode = 'erase) and ! scr.cursorVisible then begin ! scr:doDrawing('drawshape, [scr.cursorBlock, {transfermode: modeXor, fillPattern : vfBlack}]); ! scr.cursorVisible := nil; ! end; ! // create new cursor ! scr.cursorBlock := makeRect(curX*lcharWidth-1, curY*lcharHeight, ! (curX+1)*lcharWidth, (curY+1)*lcharHeight+ldescent); ! ! ! // draw new one ! if scr.cursorBlock and ! (mode = 'refresh or mode = 'draw) and ! NOT scr.cursorVisible then begin ! scr:doDrawing('drawshape, [scr.cursorBlock, {transfermode: modeXor, fillPattern : vfBlack}]); ! scr.cursorVisible := true; end; end, viewSetupDoneScript: func() begin ! // get references to the lines ! :referenceLines(); ! // create and position cursor ! cursor := Clone({x: nil, y: nil}); ! ! AddDeferredAction('cursorHome, []); end, deleteLines: func(num) --- 2931,2949 ---- setValue(screen, 'viewFont, fontSpec); :syncView(); ! // :ScrollbackSetup(); ! foreach line in lines do begin ! line.redraw := true; // tag all the lines as dirty end; + AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, 0); end, viewSetupDoneScript: func() begin ! // create the scrollback buffer and soup ! :ScrollbackSetup(); end, deleteLines: func(num) *************** *** 2840,2854 **** lines[max(i, scrollRegion.top)-1]:clear(); end; ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, ! charWidth: nil, ! setupFirst: ! func() begin ! // in here we want to create all of the lines and other ! // good stuff that only needs to be done once end, cursorRestore: func() begin --- 2968,3084 ---- lines[max(i, scrollRegion.top)-1]:clear(); end; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, ! ScrollBackMove: ! func(dir) begin ! ! if dir = 'down then begin ! ! // Are in scrollback mode ! if scrolledBack then begin ! ! // new last line ! scrollback.dispEnd := scrollback.dispStart + 1; ! ! // new first line ! scrollback.dispStart := scrollback.dispStart + height; ! if scrollback.dispStart > (scrollback.max-1) then begin ! scrollback.dispStart := scrollback.dispStart - scrollback.max; ! end; ! ! ! // scrolled back to current data? ! if scrollback.dispEnd = scrollback.current MOD scrollback.max then begin ! :refresh(); ! end else begin ! :ScrollBackShow(); // show the new page! ! end; ! end ! ! // NOT in scrollback -- yell at user ! else begin ! PlaySound(ROM_plinkBeep); ! end; ! end; ! ! if dir = 'up then begin ! ! // Nothing to show yet! ! if scrollback.current = 0 then begin ! PlaySound(ROM_plinkBeep); ! scrolledback := nil; ! return; ! end ! ! // something to scroll back to... ! else begin ! ! // already scrolledback at least one screen ! if scrolledBack then begin ! ! // new first line ! scrollback.dispStart := scrollback.dispEnd - 1; ! if scrollback.dispStart < 0 then begin ! scrollback.dispStart := scrollback.dispStart + scrollback.max; ! end; ! ! // new last line ! scrollback.dispEnd := scrollback.dispEnd - height; ! if scrollback.dispEnd < 0 then begin ! scrollback.dispEnd := scrollback.dispEnd + scrollback.max; ! end; ! ! // Exactly finished? ! if scrollback.dispStart = (scrollback.current - 1) MOD scrollback.max then begin ! ! // do nothing -- reset to previous values ! ! // new last line ! scrollback.dispEnd := scrollback.dispEnd + height; ! if scrollback.dispEnd > (scrollback.max-1) then begin ! scrollback.dispEnd := scrollback.dispEnd - scrollback.max; ! end; ! ! // new first line ! scrollback.dispStart := scrollback.dispStart + height; ! if scrollback.dispStart > (scrollback.max-1) then begin ! scrollback.dispStart := scrollback.dispStart - scrollback.max; ! end; ! end ! ! // not exactly finished ! else begin ! if scrollback.dispEnd < scrollback.current MOD scrollback.max AND ! scrollback.dispStart > scrollback.current MOD scrollback.max then begin ! scrollback.dispEnd := scrollback.current MOD scrollback.max; ! end; ! end; ! end ! ! // first scrollback ! else begin ! ! // enough to fill up the screen ! if scrollback.current > height then begin ! scrollback.dispStart := (scrollback.current - 1) MOD scrollback.max; ! scrollback.dispEnd := (scrollback.current - height) MOD scrollback.max; ! end ! ! // not enough! ! else begin ! scrollback.dispStart := scrollback.current - 1; ! scrollback.dispEnd := 0; ! end; ! end; ! end; ! ! :ScrollBackShow(); // show the new page! ! ! end; end, + charWidth: nil, cursorRestore: func() begin *************** *** 2856,2861 **** --- 3086,3094 ---- :cursorSet(cursorSavedLoc.x, cursorSavedLoc.y); cursorSavedLoc := nil end else print("Called cursorRestore without saving"); + + AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); + end, viewFormat: 1, viewgesturescript: *************** *** 2898,2914 **** func(orig, new) begin orig.text := new.text; ! orig.icon := new.icon; orig.attribs := new.attribs; end, descent: nil, - viewQuitScript: - // must return the value of inherited:?viewQuitScript(); - func() - begin - Attribute := nil; - inherited:?viewQuitScript(); // this method is defined internally - end, tabs: nil, MoveUp: func(num) --- 3131,3142 ---- func(orig, new) begin orig.text := new.text; ! orig.textPicture := new.textPicture; orig.attribs := new.attribs; + orig.dirty := true; + orig.redraw := new.redraw; end, descent: nil, tabs: nil, MoveUp: func(num) *************** *** 2921,2927 **** --- 3149,3218 ---- end, dirtySymbol: Intern(kAppSymbol&&"dirty"), lines: nil, + cursorOld: nil + , spaces: nil, + ScrollBackShow: + func() + begin + self.scrolledback := true; + + // dispStart and dispEnd + + local l := {_proto: lineProto, + _parent: self, + text: Clone(spaces), + attribs: nil, + lineNum: nil}; + local i, num, linePict; + local lviewLineSpacing := viewLineSpacing; + local cursor := scrollbackSoupCursor; + local entry; + local dispEnd; + + call kShowBusyBoxFunc with (nil); + + // clear the screen + self.icon := nil; + licon := MakeBitmap(viewBounds.right - viewBounds.left, + viewBounds.bottom - viewBounds.top, + nil); + + setvalue(self, 'icon, licon); + + if scrollback.dispEnd = 0 then + dispEnd := (scrollback.max-1); + else + dispEnd := scrollback.dispEnd-1; + + + // draw each line into the bitmap; + i := scrollback.dispStart; // start at the bottom line, draw up + num := height - 1; + + while(i<>dispEnd) do begin + // get the old entry from the soup! + if entry := cursor:Gotokey(i) then begin + l.text := entry.text; + l.attribs := entry.attribs; + end else begin + l.text := Clone(spaces); + l.attribs := nil; + end; + + l:update(); + linePict := l.textPicture; + offsetShape(l.textPicture, 0, num * lviewLineSpacing); + DrawIntoBitmap(l.textPicture, nil, licon); + + num := num - 1; + i := i - 1; + if i<0 then i := i + scrollback.max; + end; + + setvalue(self, 'icon, licon); + refreshviews(); + end, viewFlags: 4001, cursorSet: func(x, y) *************** *** 2928,2935 **** begin cursor.x := min(Width, max(x, 1)); cursor.y := min(Height, max(y, 1)); ! :cursorDraw('refresh, self); ! end, getText: func() --- 3219,3225 ---- begin cursor.x := min(Width, max(x, 1)); cursor.y := min(Height, max(y, 1)); ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, getText: func() *************** *** 2951,2963 **** if lines[cursor.y-1].attribs then begin foreach attr in lines[cursor.y-1].attribs do begin ! if attr.location >= (cursor.x)*charWidth then begin attr.attribute := kFontNormal; end; end; local newAttrib := Clone(lines[cursor.y-1].AttributeFrame); ! newAttrib.location := (cursor.x-1)*charWidth; newAttrib.attribute := kFontNormal; BInsertRight(lines[cursor.y-1].attribs, newAttrib, '|<|, 'location, nil); lines[cursor.y-1]:AttributeCleanup(); --- 3241,3253 ---- if lines[cursor.y-1].attribs then begin foreach attr in lines[cursor.y-1].attribs do begin ! if attr.location >= (cursor.x) then begin attr.attribute := kFontNormal; end; end; local newAttrib := Clone(lines[cursor.y-1].AttributeFrame); ! newAttrib.location := (cursor.x-1); newAttrib.attribute := kFontNormal; BInsertRight(lines[cursor.y-1].attribs, newAttrib, '|<|, 'location, nil); lines[cursor.y-1]:AttributeCleanup(); *************** *** 2964,2976 **** end; ! // create the pict to go with it ! lines[cursor.y-1]:update(nil); ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); ! end, width: 80, scrollRegionSet: func(top, bottom) begin --- 3254,3288 ---- end; ! // tag the line as dirty ! lines[cursor.y-1].redraw := true; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, width: 80, + SaveBufferedLines: + func() + begin + local cursor := scrollbackSoupCursor; + local entry; + + // save these to a soup. + try begin + foreach l in scrollBackBuffer do begin + if entry := cursor:Gotokey(l.num) then begin + EntryReplaceXmit(entry, l, nil); + end else begin + scrollbackSoup:AddXmit(l, nil); + end; + end; + end onexception |evt.ex.fr.store| do begin + getroot():Notify(kNotifyAlert, "Store Full", + "You have filled up your card or internal memory. Scrollback is being turned off. Please reduce scrollback size, or increase the available space before restarting scrollback."); + prefs.screen.scrollback := 0; + :ScrollBackSetup(); + end; + end, + scrollbackSymbol: Intern(kAppSymbol&&"scrollbackSymbol"), scrollRegionSet: func(top, bottom) begin *************** *** 2985,2994 **** end; end, viewBounds: {left: 0, top: 0, right: 200, bottom: 200}, - setupRest: - func() - begin - end, clearEOD: func() begin --- 3297,3302 ---- *************** *** 3002,3081 **** for i:=cursor.y to height-1 do lines[i]:Clear(); ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, ! bufferLines: ! 1 // set to nil to show all the lines trickling past.. ! , ! AttributeUpdate: ! func(curX, curY, spacesLeft) begin ! // XXX this should ultimately be moved into the protoLine object ! ! ! if NOT lines[curY].attribs then begin // create it if it doesn't exist ! lines[curY]:AttributeNew(); ! end; ! ! // Here's what I'm going to do: ! // 1. Find the loc just before (or at) the new location - save that oldAttribute ! // 2. Find the loc just before the *end* of the new location - ! // If that exists, use that instead - call it oldAttribute ! // 3. Go through and BDelete everything from newloc to < end of newloc ! // 4. Put newattribute in place, and newAttributeEnd in place with attribute: oldAttribute ! // 5. Find all redundancies and replace them ! ! ! local startLoc := curX*charWidth, endLoc := (curX+spacesLeft)*charWidth; ! local oldAttribute; ! local newAttrib := Clone(lines[curY].AttributeFrame); ! local attr := lines[curY].attribs; ! local a; ! ! newAttrib.location := startLoc; ! newAttrib.attribute := Attribute; ! foreach a in attr do begin ! // Find the first location before the new attribute location starts ! if a.location < startLoc then begin ! oldAttribute := a.attribute; ! end else if a.location >= startLoc AND ! a.location < endLoc then begin ! // Overwrite stuff that is obscured by the new attribute ! oldAttribute := a.attribute; ! BDelete(attr, a.location, '|<|, 'location, nil); end; end; ! ! ! // Insert new item start point ! BInsertRight(attr, newAttrib, '|<|, 'location, nil); ! // create the end point ! if Attribute <> oldAttribute then begin ! local newAttribEnd := Clone(lines[curY].AttributeFrame); ! newAttribEnd.location := endLoc; ! newAttribEnd.attribute := oldAttribute; ! BInsert(attr, newAttribEnd, '|<|, 'location, nil); end; ! // remove duplicates? ! for i:= 1 to Length(attr)-1 do begin ! if attr[i].attribute = attr[i-1].attribute then begin ! attr[i].attribute := 'duplicate; ! attr[i].location := attr[i].location + 1; ! end; ! end; ! foreach a in attr do begin ! if a.attribute = 'duplicate then ! BDelete(attr, a.location, '|<|, 'location, nil); ! end; ! if Length(attr)<2 then lines[curY].attribs := nil; ! ! end;, cursor: nil, GotoLeftEdge: func() begin --- 3310,3364 ---- for i:=cursor.y to height-1 do lines[i]:Clear(); ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, ! GetTappedWord: ! func(xLoc, yLoc) begin ! local x := Floor(xLoc/charWidth); ! local y := Floor(yLoc/charHeight); ! local i, startChar, endChar; ! if scrolledback then begin ! // x, y is the location... but what line is y? ! local l := scrollback.dispStart - (height-1) + y; ! local entry; ! ! if entry := scrollbackSoupCursor:Gotokey(l) then begin ! text := entry.text; ! end else begin ! text := Clone(spaces); end; + end else begin + text := Clone(lines[y].text); end; ! ! if text[x] = Chr(32) then return(nil); ! // Find the preceding space ! i := x; ! ! while (i>=0 and NOT startChar) do ! begin ! if IsWhiteSpace(text[i]) then ! startChar := i+1; ! else ! i := i - 1; end; ! if i <= 0 then startChar := 0; ! // Find the trailing space ! endChar := StrPos(text, " ", startChar+1); ! if NOT endChar then ! return(substr(text, startChar, Strlen(text)-startChar)); ! else ! return(substr(text, startChar, endChar-startChar)); ! end, ! scrollbackSoupCursor: nil, ! scrollSave: nil, cursor: nil, GotoLeftEdge: func() begin *************** *** 3104,3110 **** lines[min(i, scrollRegion.bottom)-1]:clear(); end; - AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, clearBOL: func() --- 3387,3392 ---- *************** *** 3123,3129 **** local attr; foreach attr in lines[cursor.y-1].attribs do begin ! if attr.location <= (cursor.x)*charWidth then begin lastAttrib := Clone(attr); // Save the attrib value attr.attribute := kFontNormal; end; --- 3405,3411 ---- local attr; foreach attr in lines[cursor.y-1].attribs do begin ! if attr.location <= (cursor.x) then begin lastAttrib := Clone(attr); // Save the attrib value attr.attribute := kFontNormal; end; *************** *** 3131,3137 **** // Set the first location to the lastAttrib if lastAttrib then begin ! lastAttrib.location := (cursor.x)*charWidth; BInsertRight(lines[cursor.y-1].attribs, lastAttrib, '|<|, 'location, nil); end; lines[cursor.y-1]:AttributeCleanup(); --- 3413,3419 ---- // Set the first location to the lastAttrib if lastAttrib then begin ! lastAttrib.location := (cursor.x); BInsertRight(lines[cursor.y-1].attribs, lastAttrib, '|<|, 'location, nil); end; lines[cursor.y-1]:AttributeCleanup(); *************** *** 3138,3151 **** end; ! // create the pict to go with it ! lines[cursor.y-1]:update(nil); ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, scrollRegion: nil, - cursorVisible: nil, clearBOD: func() begin --- 3420,3432 ---- end; ! // tag the line as dirty ! lines[cursor.y-1].redraw := true; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, scrollRegion: nil, clearBOD: func() begin *************** *** 3159,3165 **** for i:=0 to cursor.y-2 do lines[i]:Clear(); ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, setAttribute: // newAttribute can be kFontNormal + kFontBold + kFontInverse + kFontUnderline --- 3440,3446 ---- for i:=0 to cursor.y-2 do lines[i]:Clear(); ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, setAttribute: // newAttribute can be kFontNormal + kFontBold + kFontInverse + kFontUnderline *************** *** 3170,3176 **** --- 3451,3469 ---- else attribute := bor(attribute, newAttribute); end, + scrolledback: nil, height: 24, + icon: nil, + FlushScrollBackBuffer: + func() + begin + if NOT scrollback then return; + :saveBufferedLines(); + self.scrollbackBuffer:=Clone('[]); + + // remove the call that was sitting around + AddProcrastinatedCall(scrollbackSymbol, func() nil, nil, 0); + end, insertChar: func(char) begin *************** *** 3202,3209 **** end; end else print("INCORRECT call to cursorMove: "&direction); ! :cursorDraw('refresh, self); end, putChar: func(char) --- 3495,3503 ---- end; end else print("INCORRECT call to cursorMove: "&direction); ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); + end, putChar: func(char) *************** *** 3217,3250 **** cursorSavedLoc := Clone(cursor); end, Refresh: ! func(scr) begin ! scr:cursorDraw('erase, scr); ! scr:Dirty(); refreshviews(); ! scr:cursorDraw('draw, scr); end, declareSelf: 'base, viewSetupFormScript: func() begin - local b:= GetAppParams(); local i; local lineBounds; - local screenBounds := Clone(viewBounds); charHeight := FontHeight(viewFont); // read from prefs? charWidth := StrWidth("W"); // big enough to fit the width*height area ! screenBounds.bottom := height*charHeight; screenBounds.right := width*charWidth; screen.viewBounds := screenBounds; ! if NOT scrollRegion then scrollRegion := {top: 1, bottom: height}; --- 3511,3654 ---- cursorSavedLoc := Clone(cursor); end, Refresh: ! func() begin ! local linePict, dirty := nil; ! local lviewLineSpacing := viewLineSpacing; ! ! local licon := icon; ! ! if scrolledBack = true then begin ! self.scrolledBack := nil; ! foreach l in lines do begin ! l.redraw := true; ! end ! end; ! ! call kShowBusyBoxFunc with (nil); ! ! // cursor stuff ! if NOT cursorOld then begin ! cursorOld := DeepClone(cursor); ! lines[cursor.y-1].redraw := true; ! end else if NOT (cursorOld.x = cursor.x AND cursorOld.y = cursor.y) then begin ! // need to redraw cursor ! lines[cursorOld.y-1].redraw := true; ! lines[cursor.y-1].redraw := true; ! cursorOld := DeepClone(cursor); ! end; ! ! ! ! foreach l in lines do begin ! if l.dirty or l.redraw then begin // update that line ! if l.redraw then begin ! l:update(); ! l.redraw := nil; ! end; ! linePict := DeepClone(l.textPicture); ! offsetShape(linePict, 0, l.lineNum * lviewLineSpacing); ! DrawIntoBitmap(linePict, nil, licon); ! ! if l.lineNum = cursor.y-1 then begin ! linePict := DeepClone(cursorBlock); ! offsetShape(linePict, (cursor.x - 1) * charWidth, l.lineNum * lviewLineSpacing); ! DrawIntoBitmap(linePict, {transfermode: modeXor, fillPattern : vfBlack, penPattern:vfNone}, licon); ! end; ! l.dirty := nil; ! end; ! end; ! ! setvalue(self, 'icon, licon); refreshviews(); ! end, + ScrollbackSetup: + func() + begin + // Do we need to do anything? + + if prefs.screen.scrollback and + prefs.screen.scrollback > 0 then begin + + // create the temporary buffer + self.scrollBackBuffer := Clone('[]); + + local store := GetDefaultStore(); + + if self.scrollbackSoup := + store:GetSoup(kAppSymbol&" Scrollback") then begin + scrollbackSoup:RemoveAllEntries(); + end else begin + local mySoupDef := + { name: kAppSymbol&" Scrollback", + userName: kAppName&" Scrollback", + ownerApp: kAppSymbol, + ownerAppName: kAppName, + userDescr: "This soup is used by "&kAppName, + indexes: [{structure: 'slot, path: 'num, + type: 'int}], + }; + + // get a handle to the soup + self.scrollbackSoup := + CreateSoupFromSoupDef(mySoupDef, store, nil); + end; + + self.scrollbackSoupCursor := + scrollbackSoup:Query({type: 'index, indexPath : 'num,}); + + + self.scrollback := { current: 0, + dispStart: 0, + dispEnd : 0, + max : prefs.screen.scrollback + }; + + end else begin // clear out all that scrollback + + // create the temporary buffer + self.scrollBackBuffer := nil; + + if self.scrollbackSoup := + GetDefaultStore():GetSoup(kAppSymbol&" Scrollback") then begin + scrollbackSoup:RemoveAllEntries(); + scrollbackSoup:RemoveFromStore(); + end; + + // remove the temporary buffer + self.scrollBackBuffer := nil; + self.scrollbackSoupCursor := nil; + + // remove the handle to the soup + self.scrollbackSoup := nil; + self.scrollback := nil; + end; + end, declareSelf: 'base, viewSetupFormScript: func() begin local b:= GetAppParams(); local i; local lineBounds; local screenBounds := Clone(viewBounds); + self.viewlinespacing := FontHeight(viewFont); + self.descent := FontDescent(viewFont); + + charHeight := FontHeight(viewFont); // read from prefs? charWidth := StrWidth("W"); + // big enough to fit the width*height area ! screenBounds.bottom := height*(charHeight); screenBounds.right := width*charWidth; screen.viewBounds := screenBounds; ! if NOT scrollRegion then scrollRegion := {top: 1, bottom: height}; *************** *** 3256,3264 **** end; smartstop(spaces, width); - setvalue(self, 'viewlinespacing, FontHeight(viewFont)); - self.descent := FontDescent(viewFont); - if NOT tabs then begin self.tabs := Array(width, nil); :tabReset(); --- 3660,3665 ---- *************** *** 3272,3277 **** --- 3673,3692 ---- AddArraySlot(tabs, nil); end; end; + + self.icon := nil; + self.icon := MakeBitmap(viewBounds.right - viewBounds.left, + viewBounds.bottom - viewBounds.top, + nil); + + self.cursorBlock := makeRect(0, 0, charWidth, fontHeight(viewFont)); + + if NOT cursor then begin + self.cursor := Clone({x: nil, y: nil}); + :cursorHome(); + end; + + :LineSetup(); end, blankLines: func(num) *************** *** 3283,3289 **** lines[max(cursor.y+i, height)]:clear(); end; ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, SetScreenUpdateTime: --- 3698,3704 ---- lines[max(cursor.y+i, height)]:clear(); end; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, SetScreenUpdateTime: *************** *** 3314,3322 **** lines[i]:clear(); end; ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, ! cursorBlock: nil, viewClickScript: func(unit) begin --- 3729,3801 ---- lines[i]:clear(); end; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, ! lineSetup: ! func() // create all of the child views (lines) ! begin ! local i, kids := if lines then Length(lines) else 0; ! ! if NOT lineProto then ! lineProto := Clone(GetLayout("protoLine")); ! ! lineProto.textBounds:= {left: 0, ! top: 0, ! right: viewBounds.right, ! bottom: FontAscent(viewFont)-1}; ! ! lineProto.blankRect := MakeRect(0, 0, viewBounds.right, viewLineSpacing); ! ! if kids = 0 then begin ! self.lines := Array(height, nil); ! for i:=0 to height-1 do begin ! self.lines[i] := {_proto: lineProto, ! _parent: self, ! text: Clone(spaces), ! attribs: nil, ! lineNum: i}; ! lines[i]:update(); ! end; ! end else begin // we already have the lines created ! if kids < height then begin // too few kids -- make more ! for i := kids to height-1 do begin ! AddArraySlot(self.lines, ! {_proto: lineProto, ! _parent: self, ! text: Clone(spaces), ! attribs: nil, ! lineNum: i}); ! end; ! end else if kids > height then begin // too many kids -- only keep the bottom i ! // clear out the extra ones ! foreach l in lines do begin ! if l.lineNum < kids-height then begin ! if lines[l.lineNum] then begin ! lines[l.lineNum]:=nil; ! end; ! end; ! end; ! ! for i:=Length(lines)-1 to 0 by -1 do begin ! if NOT lines[i] then begin ! RemoveSlot(lines, i); ! end; ! end; ! ! ! ! // Move the bottom ones up ! foreach l in lines do begin ! l.lineNum := l.lineNum - (kids-height); ! end; ! end; // else -- same number of kids as the height -- don't fret ! ! // redraw the kids with same info, but perhaps new sizes ! foreach l in lines do begin ! l:update(); ! end; ! end; ! end, viewClickScript: func(unit) begin *************** *** 3325,3331 **** nil; // Return true if click has been completely handled, nil otherwise end, ! viewClass: 74 /* clView */, cursorMoveN: func (direction, N) begin --- 3804,3810 ---- nil; // Return true if click has been completely handled, nil otherwise end, ! viewClass: 76 /* clPictureView */, cursorMoveN: func (direction, N) begin *************** *** 3339,3345 **** cursor.y := min (cursor.y + N, height); end else print("INCORRECT call to cursorMoveN: "&direction&&N); ! :cursorDraw('refresh, self); end, tabClearAll: --- 3818,3824 ---- cursor.y := min (cursor.y + N, height); end else print("INCORRECT call to cursorMoveN: "&direction&&N); ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, tabClearAll: *************** *** 3350,3358 **** for i:= 0 to Length(ltabs)-1 do ltabs[i] := nil; end, screenUpdateTime: nil, viewFont: {Family: 'Minico, face: kFaceNormal, size: 12}, - cursorSymbol: Intern(kAppSymbol&&"cursor"), deleteChars: func(loc, num) begin --- 3829,3837 ---- for i:= 0 to Length(ltabs)-1 do ltabs[i] := nil; end, + scrollBack: nil, screenUpdateTime: nil, viewFont: {Family: 'Minico, face: kFaceNormal, size: 12}, deleteChars: func(loc, num) begin *************** *** 3361,3465 **** // copy the last bit over the part to delete StrMunger(lines[cursor.y-1].text, loc, nil, tmp, loc+num, width-loc); ! // create the pict to go with it ! lines[cursor.y-1]:update(nil); ! AddProcrastinatedCall(dirtySymbol, refresh, [self], screenUpdateTime); end, cursorSavedLoc: nil, lastPos: nil, - viewSetupChildrenScript: - func() // create all of the child views (lines) - begin - local i, kids; - - if NOT lineProto then - lineProto := Clone(GetLayout("protoLine")); - - lineProto.viewBounds := Clone(viewBounds); - lineProto.viewBounds.bottom := viewLineSpacing; - lineProto.viewBounds.top := 0; - lineProto.viewFont := viewFont; - lineProto.viewLineSpacing := viewLineSpacing; - lineProto.textBounds:= {left: 0, - top: 0, - right: lineProto.viewBounds.right, - bottom: lineProto.viewBounds.bottom-FontDescent(viewFont)}; - - - // Create the bottom edge blip, either at the edge of the line, or at the edge of the clipper - if :parent():parent().viewBounds.right < lineProto.viewBounds.right then - lineProto.blip := MakeLine(lineProto.viewBounds.right, - lineProto.viewBounds.bottom, - lineProto.viewBounds.right, - lineProto.viewBounds.bottom); - else - lineProto.blip := MakeLine(:parent():parent().viewBounds.right, - lineProto.viewBounds.bottom, - :parent():parent().viewBounds.right, - lineProto.viewBounds.bottom); - - - lineProto.text := spaces; - - - // If the stepchildren slot is not there (fat chance!) - // create it before stuffing all the new kids into it. - - if not HasSlot(self, 'stepChildren) then begin - self.stepChildren := Clone(self.stepChildren); - if self.stepChildren = nil then - self.StepChildren := Array(0, nil); - end; - - // check to make sure that we haven't already created - // the child views by counting up the child views - - kids := 0; - foreach kid in stepChildren do begin - if kid._proto = lineProto then - kids := kids + 1; - end; - - if kids = 0 then begin - for i:=0 to height-1 do begin - AddArraySlot(self.stepChildren, - {_proto: lineProto, lineNum: i}); - end; - end else begin // we already have the lines created - if kids < height then begin // too few kids -- make more - for i := kids to height-1 do begin - AddArraySlot(self.stepChildren, - {_proto: lineProto, lineNum : i}); - - end; - end else if kids > height then begin // too many kids -- only keep the bottom i - // clear out the extra ones - foreach kid in stepChildren do begin - if kid._proto = lineProto and kid.lineNum < kids-height then begin - if lines[kid.lineNum] then lines[kid.lineNum]:Clear(); - RemoveSlot(stepChildren, arraypos(stepchildren, kid, 0, nil)); - end; - end; - - // Move the bottom ones up - foreach kid in stepChildren do begin - if kid._proto = lineProto then begin - kid.lineNum := kid.lineNum - (kids-height); - end; - end; - end; // else -- same number of kids as the height -- don't fret - - // redraw the kids with same info, but perhaps new sizes - foreach kid in :childViewFrames() do begin - if kid._proto._proto = lineProto then begin - kid:update(nil); - end; - end; - - end; - - end, insertString: func (string) begin --- 3840,3852 ---- // copy the last bit over the part to delete StrMunger(lines[cursor.y-1].text, loc, nil, tmp, loc+num, width-loc); ! // tag the line as dirty ! lines[cursor.y-1].redraw := true; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, cursorSavedLoc: nil, lastPos: nil, insertString: func (string) begin *************** *** 3468,3476 **** local tmpString; local curX, curY; ! if cursorVisible then ! :cursorDraw('erase, self); ! // if we were hung on the last line, move forward if lastPos then begin if cursor.X = width and strlen(string)>0 then begin --- 3855,3861 ---- local tmpString; local curX, curY; ! // if we were hung on the last line, move forward if lastPos then begin if cursor.X = width and strlen(string)>0 then begin *************** *** 3500,3507 **** // invert/underline this based on the current attribute if attribute > 0 OR lines[curY].attribs then begin // don't bother if it isn't set if lines[curY].attribs then begin ! local boxWidth := spacesLeft*charWidth; ! local lastPoint := curX*charWidth; // move stuff to the right foreach att in lines[curY].attribs do begin --- 3885,3892 ---- // invert/underline this based on the current attribute if attribute > 0 OR lines[curY].attribs then begin // don't bother if it isn't set if lines[curY].attribs then begin ! local boxWidth := spacesLeft; ! local lastPoint := curX; // move stuff to the right foreach att in lines[curY].attribs do begin *************** *** 3508,3513 **** --- 3893,3899 ---- if att.location > lastPoint then begin att.location := att.location + boxWidth; // XXX should check if it's off the end... + if att.location > width then att.location := width; end; end; end; *************** *** 3515,3522 **** //:AttributeUpdate(curX, curY, spacesLeft); end; ! // create the pict to go with it ! lines[curY]:update(nil); string := SubStr(string, spacesLeft, StrLen(string)); --- 3901,3908 ---- //:AttributeUpdate(curX, curY, spacesLeft); end; ! // tag the line as dirty ! lines[cursor.y-1].redraw := true; string := SubStr(string, spacesLeft, StrLen(string)); *************** *** 3538,3545 **** StrMunger(lines[curY].text, curX, nil, tmpString, curX-spacesLeft, width-curX); ! // create the pict to go with it ! lines[curY]:update(nil); end; end; --- 3924,3931 ---- StrMunger(lines[curY].text, curX, nil, tmpString, curX-spacesLeft, width-curX); ! // tag the line as dirty ! lines[cursor.y-1].redraw := true; end; end; *************** *** 3559,3571 **** cursor.x := cursor.x - 1; end; ! AddProcrastinatedCall(cursorSymbol, cursorDraw, ['draw, self], screenUpdateTime); ! ! if NOT bufferLines then begin ! :dirty(); ! refreshViews(); ! end; end, cursorHome: func() begin --- 3945,3953 ---- cursor.x := cursor.x - 1; end; ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end, + scrollbackSoup: nil, cursorHome: func() begin *************** *** 3577,3585 **** local int i; local int spacesLeft; local curX, curY; ! ! if cursorVisible then ! :cursorDraw('erase, self); // if we were hung on the last line, move forward if lastPos then begin --- 3959,3965 ---- local int i; local int spacesLeft; local curX, curY; ! // if we were hung on the last line, move forward if lastPos then begin *************** *** 3602,3624 **** spacesLeft := min(width - curX, strlen(string)); // update the text in the view StrMunger(lines[curY].text, curX, spacesLeft, string, 0, spacesLeft); // invert/underline this based on the current attribute if attribute > 0 OR lines[curY].attribs then begin // don't bother if it isn't set lines[curY]:AttributeUpdate(curX, spacesLeft); - //:AttributeUpdate(curX, curY, spacesLeft); end; // create the pict to go with it ! lines[curY]:update(nil); string := SubStr(string, spacesLeft, StrLen(string)); cursor.x := cursor.x + spacesLeft; ! // Still have stuff to put on another line if strlen(string) > 0 then begin cursor.y := cursor.y + 1; --- 3982,4006 ---- spacesLeft := min(width - curX, strlen(string)); + // update the text in the view StrMunger(lines[curY].text, curX, spacesLeft, string, 0, spacesLeft); + // invert/underline this based on the current attribute if attribute > 0 OR lines[curY].attribs then begin // don't bother if it isn't set lines[curY]:AttributeUpdate(curX, spacesLeft); end; // create the pict to go with it ! lines[curY].dirty := true; ! lines[curY].redraw := true; string := SubStr(string, spacesLeft, StrLen(string)); cursor.x := cursor.x + spacesLeft; ! // Still have stuff to put on another line if strlen(string) > 0 then begin cursor.y := cursor.y + 1; *************** *** 3647,3658 **** ! AddProcrastinatedCall(cursorSymbol, cursorDraw, ['draw, self], screenUpdateTime); ! ! if NOT bufferLines then begin ! :dirty(); ! refreshViews(); ! end; end }; --- 4029,4035 ---- ! AddProcrastinatedSend(dirtySymbol, self, 'Refresh, nil, screenUpdateTime); end }; *************** *** 3665,3673 **** constant |layout_protoScreen| := screen; // End of file protoScreen // Beginning of file targetedLabelPicker.t ! // Before Script for _v190_0 // Inherited views must provide the following. // // labelCommands - Array of strings for popup --- 4042,4126 ---- constant |layout_protoScreen| := screen; // End of file protoScreen + // Beginning of file protoEditLabelPicker + _v190_0 := + {defLabelIndex: 0, + labelActionScript: + func(cmd) + begin + local origList := Clone('[]); + + if StrCompare(labelCommands[cmd], "Edit List") = 0 then begin + + // fire up the edit window, if it exists + if editPopup exists then begin + + if NOT visible(editPopup) then begin + + // setup the popup with what to show -- remove the separator and "Edit List" + ArrayMunger(origList, 0, nil, + labelCommands, 0, LSearch(labelCommands, 'pickseparator, 0, func(a,b) a=b, nil)); + + // callback to set up the new stuff + editPopup.SetNewList := 'SetNewVals; + + editPopup.origList := origList; + editPopup.caller := self; + editPopup.title := _proto.text; // title to use + editPopup.defaultEntry := Clone(labelCommands[defLabelIndex]); + editPopup:Open(); + :UpdateText(origList[defLabelIndex]); + end else begin + :Notify(kNotifyQAlert, + ensureInternal("Close Edit Box"), + ensureInternal("Please close the edit box before attempting to add another entry to "&text)); + end; + end; + end; + end, + SetNewVals: + func(newList) + begin + local tailEnd := ['pickSeparator, "Edit List"]; + + // Add 'pickseparator and "Edit List" to the end of the list + ArrayMunger(newList, Length(newList), nil, + tailEnd, 0, nil); + + SetValue(self, 'labelCommands, newList); + + // set selected value to the new one + :UpdateText(LabelCommands[Length(newList)-3]); + + + // Save dem changes + if prefs then begin + if NOT prefs.pickers then prefs.pickers:={}; + prefs.pickers.(Intern(_proto.text)) := newList; + // EntryChangeXmit(prefs, kAppSymbol); + end; + end, + textSetup: + func() // return first one as default + if labelCommands then + labelCommands[defLabelIndex] + else "", + viewSetupFormScript: + func() + begin + if prefs AND prefs.pickers.(Intern(_proto.text)) then + labelCommands := prefs.pickers.(Intern(_proto.text)); + inherited:?viewSetupFormScript(); // this method is defined internally + end, + _proto: @190 /* protoLabelPicker */ + }; + + + constant |layout_protoEditLabelPicker| := _v190_0; + // End of file protoEditLabelPicker // Beginning of file targetedLabelPicker.t ! // Before Script for _v0_0 // Inherited views must provide the following. // // labelCommands - Array of strings for popup *************** *** 3676,3682 **** // targetSym - symbol to lookup value in target ! _v190_0 := { Retarget: func(newTarget) --- 4129,4135 ---- // targetSym - symbol to lookup value in target ! _v0_0 := { Retarget: func(newTarget) *************** *** 3690,3696 **** textSetup: func() labelCommands[defLabelIndex];, - defLabelIndex: 0, UpdateTarget: func() begin --- 4143,4148 ---- *************** *** 3708,3723 **** :updateTarget(); end, lookup: nil, ! labelActionScript: ! func(cmd) ! begin ! end, ! labelCommands: ["item 1","item 2"], ! _proto: @190 /* protoLabelPicker */ }; ! constant |layout_targetedLabelPicker.t| := _v190_0; // End of file targetedLabelPicker.t // Beginning of file targetedInputLine.t --- 4160,4170 ---- :updateTarget(); end, lookup: nil, ! _proto: _v190_0 }; ! constant |layout_targetedLabelPicker.t| := _v0_0; // End of file targetedLabelPicker.t // Beginning of file targetedInputLine.t *************** *** 3798,3803 **** --- 4245,4252 ---- kbdTabBitmap := GetPictAsBits("KeyboardTab", nil); kbdLeftBitmap := GetPictAsBits("KeyboardLeftArrow", nil); kbdRightBitmap := GetPictAsBits("KeyboardRightArrow", nil); + kbdUpBitmap := GetPictAsBits("KeyboardUpArrow", nil); + kbdDownBitmap := GetPictAsBits("KeyboardDownArrow", nil); CloseResFileX(r); // special bit for | *************** *** 3806,3829 **** constant kSlashChar := $\u005c; // keys that are mapped to others ! constant kDeleteKey := $\u007f ; ! constant kReturnKey := $\u000d ; ! constant kEscapeKey := $\u001b ; ! constant kTabKey := $\u0009 ; ! constant kSpaceKey := $\u0020 ; ! constant kLeftArrowKey := $\u0004 ; // not sure ! constant kRightArrowKey := $\u0003 ; // not sure ! constant kNullKey := $\u0000 ; // modifier keys ! constant kShiftKey := 0x1000 ; ! constant kCapsLockKey := 0x1001 ; ! constant kControlKey := 0x1002 ; ! constant kAltKey := 0x1003 ; /* | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| --- 4255,4288 ---- constant kSlashChar := $\u005c; // keys that are mapped to others ! constant kkbdDeleteKey := $\u007f ; ! constant kkbdReturnKey := $\u000d ; ! constant kkbdEscapeKey := $\u001b ; ! constant kkbdTabKey := $\u0009 ; ! constant kkbdSpaceKey := $\u0020 ; + constant kkbdLeftArrowKey := unicodeFS; + constant kkbdRightArrowKey := unicodeGS; + constant kkbdUpArrowKey := unicodeRS; + constant kkbdDownArrowKey := unicodeUS; + + constant kkbdNullKey := $\u0000 ; + // modifier keys ! constant kkbdShiftKey := 0x1000 ; ! constant kkbdCapsLockKey := 0x1001 ; ! constant kkbdControlKey := 0x1002 ; ! constant kkbdAltKey := 0x1003 ; + // KeyArray index of modifiers + constant kNormalKeys := 0; + constant kShiftedKeys := 1; + constant kCapsLockedKeys := 2; + constant kControlledKeys := 3; + /* | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| *************** *** 3845,3864 **** // the keyboard row definitions row0 := [ keyVUnit, keyVUnit, ! [$\u0060, $\u007e, $\u0000], [$\u0060, $\u007e, $\u0000], keyHHalf + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0031, $\u0021, $\u0000], [$\u0031, $\u0021, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0032, $\u0040, $\u0000], [$\u0032, $\u0040, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0033, $\u0023, $\u0000], [$\u0033, $\u0023, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0034, $\u0024, $\u0000], [$\u0034, $\u0024, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0035, $\u0025, $\u0000], [$\u0035, $\u0025, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0036, $\u005e, $\u005e], [$\u0036, $\u005e, $\u001e], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0037, $\u0026, $\u0000], [$\u0037, $\u0026, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0038, $\u002a, $\u0000], [$\u0038, $\u002a, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0039, $\u0028, $\u0000], [$\u0039, $\u0028, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0030, $\u0029, $\u0000], [$\u0030, $\u0029, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002d, $\u005f, $\u005f], [$\u002d, $\u005f, $\u001f], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u003d, $\u002b, $\u0000], [$\u003d, $\u002b, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! "del", kDeleteKey, keyHUnit + keyHHalf + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3 ]; --- 4304,4323 ---- // the keyboard row definitions row0 := [ keyVUnit, keyVUnit, ! [$\u0060, $\u007e, $\u0060, $\u0000], [$\u0060, $\u007e, $\u0060, $\u0000], keyHHalf + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0031, $\u0021, $\u0031, $\u0000], [$\u0031, $\u0021, $\u0031, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0032, $\u0040, $\u0032, $\u0000], [$\u0032, $\u0040, $\u0032, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0033, $\u0023, $\u0033, $\u0000], [$\u0033, $\u0023, $\u0033, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0034, $\u0024, $\u0034, $\u0000], [$\u0034, $\u0024, $\u0034, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0035, $\u0025, $\u0035, $\u0000], [$\u0035, $\u0025, $\u0035, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0036, $\u005e, $\u0036, $\u005e], [$\u0036, $\u005e, $\u0036, $\u001e], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0037, $\u0026, $\u0037, $\u0000], [$\u0037, $\u0026, $\u0037, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0038, $\u002a, $\u0038, $\u0000], [$\u0038, $\u002a, $\u0038, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0039, $\u0028, $\u0039, $\u0000], [$\u0039, $\u0028, $\u0039, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0030, $\u0029, $\u0030, $\u0000], [$\u0030, $\u0029, $\u0030, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002d, $\u005f, $\u002d, $\u005f], [$\u002d, $\u005f, $\u002d, $\u001f], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u003d, $\u002b, $\u003d, $\u0000], [$\u003d, $\u002b, $\u003d, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! "del", kkbdDeleteKey, keyHUnit + keyHHalf + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3 ]; *************** *** 3866,3886 **** row1 := [ keyVUnit, keyVUnit, ! kbdTabBitmap, kTabKey, keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0071, $\u0051, $\u0051], [$\u0071, $\u0051, $\u0011], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0077, $\u0057, $\u0057], [$\u0077, $\u0057, $\u0017], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0065, $\u0045, $\u0045], [$\u0065, $\u0045, $\u0005], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0072, $\u0052, $\u0052], [$\u0072, $\u0052, $\u0012], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0074, $\u0054, $\u0054], [$\u0074, $\u0054, $\u0014], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0079, $\u0059, $\u0059], [$\u0079, $\u0059, $\u0019], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0075, $\u0055, $\u0055], [$\u0075, $\u0055, $\u0015], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0069, $\u0049, $\u0049], [$\u0069, $\u0049, $\u0009], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006f, $\u004f, $\u004f], [$\u006f, $\u004f, $\u000f], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0070, $\u0050, $\u0050], [$\u0070, $\u0050, $\u0010], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u005b, $\u007b, $\u005b], [$\u005b, $\u007b, $\u001b], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u005d, $\u007d, $\u005d], [$\u005d, $\u007d, $\u001d], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u005c, $\u007c, $\u005c], [$\u005c, $\u007c, $\u001c], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3 ]; --- 4325,4345 ---- row1 := [ keyVUnit, keyVUnit, ! kbdTabBitmap, kkbdTabKey, keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0071, $\u0051, $\u0051, $\u0051], [$\u0071, $\u0051, $\u0051, $\u0011], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0077, $\u0057, $\u0057, $\u0057], [$\u0077, $\u0057, $\u0057, $\u0017], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0065, $\u0045, $\u0045, $\u0045], [$\u0065, $\u0045, $\u0045, $\u0005], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0072, $\u0052, $\u0052, $\u0052], [$\u0072, $\u0052, $\u0052, $\u0012], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0074, $\u0054, $\u0054, $\u0054], [$\u0074, $\u0054, $\u0054, $\u0014], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0079, $\u0059, $\u0059, $\u0059], [$\u0079, $\u0059, $\u0059, $\u0019], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0075, $\u0055, $\u0055, $\u0055], [$\u0075, $\u0055, $\u0055, $\u0015], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0069, $\u0049, $\u0049, $\u0049], [$\u0069, $\u0049, $\u0049, $\u0009], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006f, $\u004f, $\u004f, $\u004f], [$\u006f, $\u004f, $\u004f, $\u000f], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0070, $\u0050, $\u0050, $\u0050], [$\u0070, $\u0050, $\u0050, $\u0010], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u005b, $\u007b, $\u005b, $\u005b], [$\u005b, $\u007b, $\u005b, $\u001b], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u005d, $\u007d, $\u005d, $\u005d], [$\u005d, $\u007d, $\u005d, $\u001d], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u005c, $\u007c, $\u005c, $\u005c], [$\u005c, $\u007c, $\u005c, $\u001c], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3 ]; *************** *** 3887,3941 **** row2 := [ keyVUnit, keyVUnit, ! "cap", kCapsLockKey, keyHUnit + keyHHalf + keyVUnit + keyFramed + keyRoundingUnit*3, ! [$\u0061, $\u0041, $\u0041], [$\u0061, $\u0041, $\u0001], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0073, $\u0053, $\u0053], [$\u0073, $\u0053, $\u0013], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0064, $\u0044, $\u0044], [$\u0064, $\u0044, $\u0004], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0066, $\u0046, $\u0046], [$\u0066, $\u0046, $\u0006], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0067, $\u0047, $\u0047], [$\u0067, $\u0047, $\u0007], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0068, $\u0048, $\u0048], [$\u0068, $\u0048, $\u0008], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006a, $\u004a, $\u004a], [$\u006a, $\u004a, $\u000a], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006b, $\u004b, $\u004b], [$\u006b, $\u004b, $\u000b], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006c, $\u004c, $\u004c], [$\u006c, $\u004c, $\u000c], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u003b, $\u003a, $\u0000], [$\u003b, $\u003a, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0027, $\u0022, $\u0000], [$\u0027, $\u0022, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdReturnBitmap, kReturnKey, keyHUnit + keyHHalf + keyVUnit + keyAutoHilite + keyFramed + keyRoundingUnit*3 ]; row3 := [ keyVUnit, keyVUnit, ! "shift", kShiftKey, 2*keyHUnit + keyVUnit + keyFramed + keyRoundingUnit*3, ! [$\u007a, $\u005a, $\u005a], [$\u007a, $\u005a, $\u001a], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0078, $\u0058, $\u0058], [$\u0078, $\u0058, $\u0018], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0063, $\u0043, $\u0043], [$\u0063, $\u0043, $\u0003], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0076, $\u0056, $\u0056], [$\u0076, $\u0056, $\u0016], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0062, $\u0042, $\u0042], [$\u0062, $\u0042, $\u0002], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006e, $\u004e, $\u004e], [$\u006e, $\u004e, $\u000e], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006d, $\u004d, $\u004d], [$\u006d, $\u004d, $\u000d], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002c, $\u003c, $\u0000], [$\u002c, $\u003c, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002e, $\u003e, $\u0000], [$\u002e, $\u003e, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002f, $\u003f, $\u0000], [$\u002f, $\u003f, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! "shift", kShiftKey, 2*keyHUnit + keyVUnit + keyFramed + keyRoundingUnit*3 ]; row4 := [ keyVUnit, keyVUnit, ! "alt",kAltKey, keyHUnit + keyHHalf + keyVUnit + keyFramed + keyRoundingUnit*3, ! "ctrl", kControlKey, ! 2*keyHUnit + keyHHalf + keyVUnit + keyFramed + keyRoundingUnit*3, ! "", kSpaceKey, ! 6*keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdLeftBitmap, kLeftArrowKey, keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdRightBitmap, kRightArrowKey, keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! "esc", kEscapeKey, ! 2*keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3 ]; // End of text file kbd.txt // Beginning of file PT100 kbd --- 4346,4404 ---- row2 := [ keyVUnit, keyVUnit, ! "cap", kkbdCapsLockKey, keyHUnit + keyHHalf + keyVUnit + keyFramed + keyRoundingUnit*3, ! [$\u0061, $\u0041, $\u0041, $\u0041], [$\u0061, $\u0041, $\u0041, $\u0001], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0073, $\u0053, $\u0053, $\u0053], [$\u0073, $\u0053, $\u0053, $\u0013], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0064, $\u0044, $\u0044, $\u0044], [$\u0064, $\u0044, $\u0044, $\u0004], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0066, $\u0046, $\u0046, $\u0046], [$\u0066, $\u0046, $\u0046, $\u0006], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0067, $\u0047, $\u0047, $\u0047], [$\u0067, $\u0047, $\u0047, $\u0007], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0068, $\u0048, $\u0048, $\u0048], [$\u0068, $\u0048, $\u0048, $\u0008], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006a, $\u004a, $\u004a, $\u004a], [$\u006a, $\u004a, $\u004a, $\u000a], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006b, $\u004b, $\u004b, $\u004b], [$\u006b, $\u004b, $\u004b, $\u000b], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006c, $\u004c, $\u004c, $\u004c], [$\u006c, $\u004c, $\u004c, $\u000c], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u003b, $\u003a, $\u003b, $\u0000], [$\u003b, $\u003a, $\u003b, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0027, $\u0022, $\u0027, $\u0000], [$\u0027, $\u0022, $\u0027, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdReturnBitmap, kkbdReturnKey, keyHUnit + keyHHalf + keyVUnit + keyAutoHilite + keyFramed + keyRoundingUnit*3 ]; row3 := [ keyVUnit, keyVUnit, ! "shift", kkbdShiftKey, 2*keyHUnit + keyVUnit + keyFramed + keyRoundingUnit*3, ! [$\u007a, $\u005a, $\u005a, $\u005a], [$\u007a, $\u005a, $\u005a, $\u001a], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0078, $\u0058, $\u0058, $\u0058], [$\u0078, $\u0058, $\u0058, $\u0018], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0063, $\u0043, $\u0043, $\u0043], [$\u0063, $\u0043, $\u0043, $\u0003], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0076, $\u0056, $\u0056, $\u0056], [$\u0076, $\u0056, $\u0056, $\u0016], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u0062, $\u0042, $\u0042, $\u0042], [$\u0062, $\u0042, $\u0042, $\u0002], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006e, $\u004e, $\u004e, $\u004e], [$\u006e, $\u004e, $\u004e, $\u000e], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u006d, $\u004d, $\u004d, $\u004d], [$\u006d, $\u004d, $\u004d, $\u000d], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002c, $\u003c, $\u002c, $\u0000], [$\u002c, $\u003c, $\u002c, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002e, $\u003e, $\u002e, $\u0000], [$\u002e, $\u003e, $\u002e, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! [$\u002f, $\u003f, $\u002f, $\u0000], [$\u002f, $\u003f, $\u002f, $\u0000], keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! "shift", kkbdShiftKey, 2*keyHUnit + keyVUnit + keyFramed + keyRoundingUnit*3 ]; row4 := [ keyVUnit, keyVUnit, ! "alt",kkbdAltKey, keyHUnit + keyHHalf + keyVUnit + keyFramed + keyRoundingUnit*3, ! "ctrl", kkbdControlKey, ! 2*keyHUnit + keyVUnit + keyFramed + keyRoundingUnit*3, ! "", kkbdSpaceKey, ! 5*keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdLeftBitmap, kkbdLeftArrowKey, keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdRightBitmap, kkbdRightArrowKey, keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdDownBitmap, kkbdDownArrowKey, ! keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! kbdUpBitmap, kkbdUpArrowKey, ! keyHUnit + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3, ! "esc", kkbdEscapeKey, ! keyHUnit + keyHHalf + keyVUnit + keyFramed + keyAutoHilite + keyRoundingUnit*3 ]; // End of text file kbd.txt // Beginning of file PT100 kbd *************** *** 3971,3981 **** [ row0, row1, row2, row3, row4], viewJustify: 240, viewBounds: {left: 0, top: 0, right: 0, bottom: 0}, ! keyResultsAreKeycodes: nil, viewSetupDoneScript: func() begin self.KeyArrayIndex := 0; end, capsDown: nil, shiftDown: nil, --- 4434,4445 ---- [ row0, row1, row2, row3, row4], viewJustify: 240, viewBounds: {left: 0, top: 0, right: 0, bottom: 0}, ! keyResultsAreKeycodes: true, viewSetupDoneScript: func() begin self.KeyArrayIndex := 0; + self.KeyHighlightKeys := Clone('[]); end, capsDown: nil, shiftDown: nil, *************** *** 3983,3989 **** controlDown: nil, viewFormat: 1, keyArrayIndex: 0, ! keyHighlightKeys: [], keyReceiverView: 'viewFrontKey, keySound: nil, viewFlags: 513, --- 4447,4453 ---- controlDown: nil, viewFormat: 1, keyArrayIndex: 0, ! keyHighlightKeys: nil, keyReceiverView: 'viewFrontKey, keySound: nil, viewFlags: 513, *************** *** 3993,4058 **** local output; PlaySound(ROM_typewriter); ! if key = kShiftKey then begin ! if capsDown then begin ! capsDown := nil; ! shiftDown := true; ! end; ! if controlDown then controlDown := nil; ! if shiftDown then begin shiftDown := nil; ! KeyArrayIndex := 0; ! keyHighlightKeys := []; end else begin shiftDown := true; ! keyHighlightKeys := [kShiftKey]; ! KeyArrayIndex := 1; end; ! :Dirty(); ! end else if key = kCapsLockKey then begin ! if controlDown then controlDown := nil; ! if shiftDown then shiftDown := nil; ! if capsDown then begin ! keyHighlightKeys := []; ! capsDown := nil; ! KeyArrayIndex := 0; ! end else begin ! keyHighlightKeys := [kCapslockKey]; ! capsDown := true; ! KeyArrayIndex := 1; ! end; ! :Dirty(); ! end else if key = kControlKey then begin ! if capsDown then capsDown := nil; ! if shiftDown then shiftDown := nil; ! if controlDown then begin ! keyHighlightKeys := []; ! controlDown := nil; ! KeyArrayIndex := 0; ! end else begin ! keyHighlightKeys := [kControlKey]; ! controlDown := true; ! KeyArrayIndex := 2; ! end; ! :Dirty(); ! end else if key = kAltKey then begin ! if capsDown then capsDown := nil; ! if shiftDown then shiftDown := nil; ! if controlDown then controlDown := nil; ! ! if altDown then begin ! keyHighlightKeys := []; ! altDown := nil; ! KeyArrayIndex := 0; ! end else begin ! altDown := true; ! keyHighlightKeys := [kAltKey,]; ! KeyArrayIndex := 1; ! end; ! :Dirty(); end else begin // deal with all other keys if altDown then output := $\u001b&Key; --- 4457,4547 ---- local output; PlaySound(ROM_typewriter); ! if key = kkbdShiftKey then begin ! ! if controlDown then begin ! SetRemove(keyHighlightKeys, kkbdControlKey); ! controlDown := nil; ! end; ! ! if shiftDown then begin // remove the shift ! SetRemove(keyHighlightKeys, kkbdShiftKey); shiftDown := nil; ! if KeyArrayIndex = kShiftedKeys then ! KeyArrayIndex := kNormalKeys; ! if capsDown then ! KeyArrayIndex := kCapsLockedKeys; end else begin shiftDown := true; ! AddArraySlot(keyHighlightKeys,kkbdShiftKey); ! KeyArrayIndex := kShiftedKeys; end; ! ! :Dirty(); ! ! end else if key = kkbdCapsLockKey then begin ! ! if controlDown then begin ! SetRemove(keyHighlightKeys, kkbdControlKey); ! controlDown := nil; ! end; ! ! if shiftDown then begin ! shiftDown := nil; ! SetRemove(keyHighlightKeys, kkbdShiftKey); ! end; ! if capsDown then begin ! SetRemove(keyHighlightKeys, kkbdCapsLockKey); ! capsDown := nil; ! if KeyArrayIndex = kCapsLockedKeys or ! KeyArrayIndex = kShiftedKeys then ! KeyArrayIndex := kNormalKeys; ! ! end else begin ! AddArraySlot(keyHighlightKeys, kkbdCapsLockKey); ! capsDown := true; ! KeyArrayIndex := kCapsLockedKeys; ! end; ! ! :Dirty(); ! ! end else if key = kkbdControlKey then begin ! if capsDown then begin ! SetRemove(keyHighlightKeys, kkbdCapsLockKey); ! capsDown := nil; ! end; ! ! if shiftDown then begin ! shiftDown := nil; ! SetRemove(keyHighlightKeys, kkbdShiftKey); ! end; ! if controlDown then begin ! SetRemove(keyHighlightKeys, kkbdControlKey); ! controlDown := nil; ! if KeyArrayIndex = kControlledKeys then ! KeyArrayIndex := kNormalKeys; ! end else begin ! AddArraySlot(keyHighlightKeys, kkbdControlKey); ! controlDown := true; ! KeyArrayIndex := kControlledKeys; ! end; ! ! :Dirty(); ! end else if key = kkbdAltKey then begin ! ! if altDown then begin ! SetRemove(keyHighlightKeys, kkbdAltKey); ! altDown := nil; ! end else begin ! altDown := true; ! AddArraySlot(keyHighlightKeys, kkbdAltKey); ! end; ! ! :Dirty(); ! end else begin // deal with all other keys if altDown then output := $\u001b&Key; *************** *** 4059,4076 **** else output := ""&key; ! if capsDown then begin ! keyHighlightKeys := [kCapsLockKey]; ! KeyArrayIndex := 1; ! end else begin ! keyHighlightKeys := []; ! KeyArrayIndex := 0; ! end; ! ! shiftDown := nil; ! altDown := nil; ! controlDown:= nil; :Dirty(); end; if output then :kbdOutputReceiver(output); --- 4548,4576 ---- else output := ""&key; ! if controlDown then begin ! SetRemove(keyHighlightKeys, kkbdControlKey); ! controlDown := nil; ! if KeyArrayIndex = kControlledKeys then ! KeyArrayIndex := kNormalKeys; ! end; ! ! if shiftDown then begin // remove the shift ! SetRemove(keyHighlightKeys, kkbdShiftKey); ! shiftDown := nil; ! if KeyArrayIndex = kShiftedKeys then ! KeyArrayIndex := kNormalKeys; ! if capsDown then ! KeyArrayIndex := kCapsLockedKeys; ! end; ! ! if altDown then begin ! SetRemove(keyHighlightKeys, kkbdAltKey); ! altDown := nil; ! end; ! :Dirty(); + end; if output then :kbdOutputReceiver(output); *************** *** 4106,4111 **** --- 4606,4614 ---- :hide(); end;, viewFlags: 1, + _tabChildren: + ['phone.areaCode.entryline, + 'phone.phoneNumber.entryline], viewClass: 74 /* clView */ }; *************** *** 4196,4202 **** indent: 60, targetSym: 'advanced.speed, defLabelIndex: 6, ! _proto: _v190_0 }; AddStepForm(modemBox, modemSpeed); StepDeclare(modemBox, modemSpeed, 'modemSpeed); --- 4699,4705 ---- indent: 60, targetSym: 'advanced.speed, defLabelIndex: 6, ! _proto: _v0_0 }; AddStepForm(modemBox, modemSpeed); StepDeclare(modemBox, modemSpeed, 'modemSpeed); *************** *** 4209,4215 **** viewBounds: {left: 0, top: 51, right: 115, bottom: 65}, indent: 80, targetSym: 'advanced.flow, ! _proto: _v190_0 }; AddStepForm(modemBox, modemFlow); StepDeclare(modemBox, modemFlow, 'modemFlow); --- 4712,4718 ---- viewBounds: {left: 0, top: 51, right: 115, bottom: 65}, indent: 80, targetSym: 'advanced.flow, ! _proto: _v0_0 }; AddStepForm(modemBox, modemFlow); StepDeclare(modemBox, modemFlow, 'modemFlow); *************** *** 4252,4258 **** indent: 65, targetSym: 'advanced.data, defLabelIndex: 3, ! _proto: _v190_0 }; AddStepForm(modemBox, modemDBits); StepDeclare(modemBox, modemDBits, 'modemDBits); --- 4755,4761 ---- indent: 65, targetSym: 'advanced.data, defLabelIndex: 3, ! _proto: _v0_0 }; AddStepForm(modemBox, modemDBits); StepDeclare(modemBox, modemDBits, 'modemDBits); *************** *** 4265,4271 **** viewBounds: {left: 120, top: 51, right: 210, bottom: 65}, indent: 65, targetSym: 'advanced.parity, ! _proto: _v190_0 }; AddStepForm(modemBox, modemParity); StepDeclare(modemBox, modemParity, 'modemParity); --- 4768,4774 ---- viewBounds: {left: 120, top: 51, right: 210, bottom: 65}, indent: 65, targetSym: 'advanced.parity, ! _proto: _v0_0 }; AddStepForm(modemBox, modemParity); StepDeclare(modemBox, modemParity, 'modemParity); *************** *** 4279,4285 **** , indent: 65, targetSym: 'advanced.stop, ! _proto: _v190_0 }; AddStepForm(modemBox, modemSBits); StepDeclare(modemBox, modemSBits, 'modemSBits); --- 4782,4788 ---- , indent: 65, targetSym: 'advanced.stop, ! _proto: _v0_0 }; AddStepForm(modemBox, modemSBits); StepDeclare(modemBox, modemSBits, 'modemSBits); *************** *** 4319,4325 **** indent: 60, targetSym: 'advanced.speed, defLabelIndex: 6, ! _proto: _v190_0 }; AddStepForm(serialBox, serialSpeed); StepDeclare(serialBox, serialSpeed, 'serialSpeed); --- 4822,4828 ---- indent: 60, targetSym: 'advanced.speed, defLabelIndex: 6, ! _proto: _v0_0 }; AddStepForm(serialBox, serialSpeed); StepDeclare(serialBox, serialSpeed, 'serialSpeed); *************** *** 4332,4338 **** viewBounds: {left: 0, top: 51, right: 115, bottom: 65}, indent: 80, targetSym: 'advanced.flow, ! _proto: _v190_0 }; AddStepForm(serialBox, serialFlow); StepDeclare(serialBox, serialFlow, 'serialFlow); --- 4835,4841 ---- viewBounds: {left: 0, top: 51, right: 115, bottom: 65}, indent: 80, targetSym: 'advanced.flow, ! _proto: _v0_0 }; AddStepForm(serialBox, serialFlow); StepDeclare(serialBox, serialFlow, 'serialFlow); *************** *** 4347,4353 **** indent: 65, targetSym: 'advanced.data, defLabelIndex: 3, ! _proto: _v190_0 }; AddStepForm(serialBox, serialDBits); StepDeclare(serialBox, serialDBits, 'serialDBits); --- 4850,4856 ---- indent: 65, targetSym: 'advanced.data, defLabelIndex: 3, ! _proto: _v0_0 }; AddStepForm(serialBox, serialDBits); StepDeclare(serialBox, serialDBits, 'serialDBits); *************** *** 4360,4366 **** viewBounds: {left: 120, top: 51, right: 210, bottom: 65}, indent: 65, targetSym: 'advanced.parity, ! _proto: _v190_0 }; AddStepForm(serialBox, serialParity); StepDeclare(serialBox, serialParity, 'serialParity); --- 4863,4869 ---- viewBounds: {left: 120, top: 51, right: 210, bottom: 65}, indent: 65, targetSym: 'advanced.parity, ! _proto: _v0_0 }; AddStepForm(serialBox, serialParity); StepDeclare(serialBox, serialParity, 'serialParity); *************** *** 4374,4380 **** , indent: 65, targetSym: 'advanced.stop, ! _proto: _v190_0 }; AddStepForm(serialBox, serialSBits); StepDeclare(serialBox, serialSBits, 'serialSBits); --- 4877,4883 ---- , indent: 65, targetSym: 'advanced.stop, ! _proto: _v0_0 }; AddStepForm(serialBox, serialSBits); StepDeclare(serialBox, serialSBits, 'serialSBits); *************** *** 4400,4405 **** --- 4903,4909 ---- :hide(); end;, viewFlags: 1, + _tabChildren: ['machineName.entryline], viewClass: 74 /* clView */ }; *************** *** 4406,4419 **** port := { labelCommands: ! ["23", "25", "79", "80"] // XXX needs to be pickable and editable , text: "Port Number", ! viewBounds: {left: -1, top: 63, right: 109, bottom: 85}, indent: 90, targetSym: 'advanced.portNumber, ! defLabelIndex: 0, ! _proto: _v190_0 }; AddStepForm(telnetBox, port); StepDeclare(telnetBox, port, 'port); --- 4910,4936 ---- port := { labelCommands: ! ["Telnet: 23", "SMTP: 25", "Finger: 79", "HTTP: 80", 'pickSeparator, "Edit List"] // XXX needs to be pickable and editable , text: "Port Number", ! viewBounds: {left: -1, top: 63, right: 200, bottom: 85}, indent: 90, targetSym: 'advanced.portNumber, ! labelActionScript: ! func(cmd) ! begin ! if cmd = Length(labelCommands)-1 then begin ! inherited:?labelActionScript(cmd); ! return; ! end; ! local l := StringToNumber(StringFilter(labelCommands[cmd], "0123456789.", 'passAll)); ! if NOT l then ! GetRoot():Notify(kNotifyQAlert, "Bad Entry", ! "The entry that you selected has no numeric information. Please correct it. The previous entry will remain selected."); ! ! nil; // update the goober; ! end, ! _proto: _v0_0 }; AddStepForm(telnetBox, port); StepDeclare(telnetBox, port, 'port); *************** *** 4646,4651 **** --- 5163,5170 ---- sessionEdit:retarget(newtarget); sessionName:UpdateSessionPopup(); end, + _tabChildren: ['sessionName.entryLine, 'userName.entryLine], + _tabparent: true, _proto: @179 /* protoFloater */ }; *************** *** 4740,4746 **** serial: "Direct Serial Session", telnet: "Telnet Session", }, ! _proto: _v190_0 }; AddStepForm(sessionEdit, sessionType); StepDeclare(sessionEdit, sessionType, 'sessionType); --- 5259,5265 ---- serial: "Direct Serial Session", telnet: "Telnet Session", }, ! _proto: _v0_0 }; AddStepForm(sessionEdit, sessionType); StepDeclare(sessionEdit, sessionType, 'sessionType); *************** *** 4853,4859 **** // End of file sessionEdit.l // Beginning of file prefSetup.l prefsView := ! {viewBounds: {left: -4, top: 14, right: 200, bottom: 226}, getFonts: func() begin --- 5372,5378 ---- // End of file sessionEdit.l // Beginning of file prefSetup.l prefsView := ! {viewBounds: {left: -4, top: 10, right: 200, bottom: 230}, getFonts: func() begin *************** *** 4878,4884 **** if screen.height <> prefs.screen.height or screen.width <> prefs.screen.width then begin ! if fEndPointState <> kState_Disconnected then begin getroot():Confirm("Still Connected", "You are still connected. Resizing the screen are this point may cause odd side effects with cursor location and scroll regions. Are you sure you want to resize?", self, 'screenPrefs); end else begin --- 5397,5403 ---- if screen.height <> prefs.screen.height or screen.width <> prefs.screen.width then begin ! if fEndPointState <> 0 then begin getroot():Confirm("Still Connected", "You are still connected. Resizing the screen are this point may cause odd side effects with cursor location and scroll regions. Are you sure you want to resize?", self, 'screenPrefs); end else begin *************** *** 4886,4895 **** --- 5405,5419 ---- screen.height := prefs.screen.height; screen:scrollRegionSet(1, screen.height); screen:cursorHome(); + screen:Refresh(); end; end; screen:setFont({family: prefs.screen.font.family, face: kFaceNormal, size:prefs.screen.font.size}); + if oldPrefs.screen.scrollback <> prefs.screen.scrollback then begin + screen:FlushScrollBackBuffer(); + screen:ScrollbackSetup(); + end; clipper:syncView(); clipper:resize(); *************** *** 4900,4912 **** screen:SetScreenUpdateTime(prefs.timing.screen); ept:SetPartialTime(prefs.timing.partial); ! ! entryChangeXmit(prefs, kAppSymbol); end, viewQuitScript: func() begin availableFonts := nil; end, getPrefs: func() --- 5424,5436 ---- screen:SetScreenUpdateTime(prefs.timing.screen); ept:SetPartialTime(prefs.timing.partial); ! entryChangeXmit(prefs, nil); end, viewQuitScript: func() begin availableFonts := nil; + oldPrefs := nil; end, getPrefs: func() *************** *** 4918,4924 **** func() begin :getPrefs(); ! oldPrefs := DeepClone(prefs); end, screenPrefs: func(confirm) --- 5442,5448 ---- func() begin :getPrefs(); ! oldPrefs := TotalClone(prefs); end, screenPrefs: func(confirm) *************** *** 4938,4949 **** end, oldPrefs: nil, _proto: @179 /* protoFloater */ }; fontFamily := {text: "Font", ! viewBounds: {left: 10, top: 33, right: 105, bottom: 48}, viewSetupFormScript: func() begin --- 5462,5479 ---- end, oldPrefs: nil, + BadEntry: + func() + begin + GetRoot():Notify(kNotifyQAlert, "Bad Entry", + "The entry that you selected has no numeric information. Please correct it. The previous entry will remain selected."); + end, _proto: @179 /* protoFloater */ }; fontFamily := {text: "Font", ! viewBounds: {left: 10, top: 23, right: 105, bottom: 38}, viewSetupFormScript: func() begin *************** *** 4985,4991 **** fontSize := {text: "Size", ! viewBounds: {left: 122, top: 33, right: 209, bottom: 48}, updateSizes: func(sizes) begin --- 5515,5521 ---- fontSize := {text: "Size", ! viewBounds: {left: 122, top: 23, right: 209, bottom: 38}, updateSizes: func(sizes) begin *************** *** 5064,5074 **** func() begin // keep the old app prefs. ! foreach slot, value in oldPrefs do ! prefs.slot := value; ! base:Close(); ! screen:Refresh(screen); end, viewBounds: {left: 186, top: -18, right: 199, bottom: -5}, viewJustify: 8388742, --- 5594,5605 ---- func() begin // keep the old app prefs. ! foreach slot, value in oldPrefs do begin ! prefs.(slot) := value; ! end; ! base:Close(); ! screen:Refresh(); end, viewBounds: {left: 186, top: -18, right: 199, bottom: -5}, viewJustify: 8388742, *************** *** 5089,5095 **** sample := {text: "Sample Text", ! viewBounds: {left: 50, top: 50, right: 146, bottom: 74}, viewFont: ROM_fontSystem10Bold, viewSetupFormScript: func() --- 5620,5626 ---- sample := {text: "Sample Text", ! viewBounds: {left: 50, top: 40, right: 146, bottom: 64}, viewFont: ROM_fontSystem10Bold, viewSetupFormScript: func() *************** *** 5105,5113 **** inputLines := ! {labelCommands: ["2", "3", "4", "5", "6",], text: "Input Lines", ! viewBounds: {left: 11, top: 83, right: 169, bottom: 97}, textSetup: func() // return first one as default sprintObject(prefs.inputLines);, --- 5636,5644 ---- inputLines := ! {labelCommands: ["1", "2", "3", "4", "5", "6", 'pickSeparator, "Edit List"], text: "Input Lines", ! viewBounds: {left: 11, top: 78, right: 169, bottom: 92}, textSetup: func() // return first one as default sprintObject(prefs.inputLines);, *************** *** 5114,5124 **** labelActionScript: func(cmd) begin ! prefs.inputLines := Floor(StringToNumber(labelCommands[cmd])); nil; // update the goober; end, indent: 100, ! _proto: @190 /* protoLabelPicker */ }; AddStepForm(prefsView, inputLines); StepDeclare(prefsView, inputLines, 'inputLines); --- 5645,5666 ---- labelActionScript: func(cmd) begin ! if cmd = Length(labelCommands)-1 then begin ! inherited:?labelActionScript(cmd); ! return; ! end; ! ! local l := StringToNumber(StringFilter(labelCommands[cmd], "0123456789.", 'passAll)); ! if l then ! prefs.inputLines := Floor(l); ! else ! :BadEntry(); ! ! // inherited:?labelActionScript(cmd); nil; // update the goober; end, indent: 100, ! _proto: _v190_0 }; AddStepForm(prefsView, inputLines); StepDeclare(prefsView, inputLines, 'inputLines); *************** *** 5125,5155 **** ! screenTime := ! {labelCommands: ["0", "25", "50", "100", "150", "200", "250"], ! text: "Screen Update", ! viewBounds: {left: 11, top: 115, right: 169, bottom: 129}, textSetup: func() // return first one as default ! sprintObject(prefs.timing.screen);, labelActionScript: func(cmd) begin ! prefs.timing.screen := Floor(StringToNumber(labelCommands[cmd])); nil; // update the goober; end, indent: 100, ! _proto: @190 /* protoLabelPicker */ }; ! AddStepForm(prefsView, screenTime); ! StepDeclare(prefsView, screenTime, 'screenTime); partialTime := ! {labelCommands: ["25", "50", "100", "250", "500", "750"], text: "Comms Update", ! viewBounds: {left: 11, top: 99, right: 169, bottom: 113}, textSetup: func() // return first one as default sprintObject(prefs.timing.partial);, --- 5667,5709 ---- ! scrollBack := ! {labelCommands: ["0", "100", "250", "500", "1000", "10000"], ! text: "Scroll Back", ! viewBounds: {left: 11, top: 94, right: 169, bottom: 108}, textSetup: func() // return first one as default ! sprintObject(prefs.screen.scrollback);, labelActionScript: func(cmd) begin ! if cmd = Length(labelCommands)-1 then begin ! inherited:?labelActionScript(cmd); ! return; ! end; ! local l := StringToNumber(StringFilter(labelCommands[cmd], "0123456789.", 'passAll)); ! if l then ! prefs.screen.scrollback := Floor(l); ! else ! :BadEntry(); ! ! // inherited:?labelActionScript(cmd); nil; // update the goober; end, indent: 100, ! _proto: _v190_0 }; ! AddStepForm(prefsView, scrollBack); ! StepDeclare(prefsView, scrollBack, 'scrollBack); partialTime := ! { ! labelCommands: ! ["25", "50", "100", "250", "500", "750", 'pickSeparator, "Edit List"], text: "Comms Update", ! viewBounds: {left: 11, top: 131, right: 169, bottom: 145}, textSetup: func() // return first one as default sprintObject(prefs.timing.partial);, *************** *** 5156,5166 **** labelActionScript: func(cmd) begin ! prefs.timing.partial := Floor(StringToNumber(labelCommands[cmd])); nil; // update the goober; end, indent: 100, ! _proto: @190 /* protoLabelPicker */ }; AddStepForm(prefsView, partialTime); StepDeclare(prefsView, partialTime, 'partialTime); --- 5710,5731 ---- labelActionScript: func(cmd) begin ! if cmd = Length(labelCommands)-1 then begin ! inherited:?labelActionScript(cmd); ! return; ! end; ! ! local l := StringToNumber(StringFilter(labelCommands[cmd], "0123456789.", 'passAll)); ! if l then ! prefs.timing.partial := Floor(l); ! else ! :BadEntry(); ! ! // inherited:?labelActionScript(cmd); nil; // update the goober; end, indent: 100, ! _proto: _v190_0 }; AddStepForm(prefsView, partialTime); StepDeclare(prefsView, partialTime, 'partialTime); *************** *** 5167,5176 **** width := ! {labelCommands: ["40", "60", "80", "100", "120", "132"], text: "Screen Width", ! viewBounds: {left: 11, top: 139, right: 169, bottom: 153}, textSetup: func() // return first one as default sprintObject(prefs.screen.width);, --- 5732,5778 ---- + screenTime := + { + labelCommands: + ["50", "100", "150", "200", "250", "300", "400", "500", "750", "1000", 'pickSeparator, "Edit List"] + , + text: "Screen Update", + viewBounds: {left: 11, top: 115, right: 169, bottom: 129}, + textSetup: + func() // return first one as default + sprintObject(prefs.timing.screen);, + labelActionScript: + func(cmd) + begin + if cmd = Length(labelCommands)-1 then begin + inherited:?labelActionScript(cmd); + return; + end; + + local l := StringToNumber(StringFilter(labelCommands[cmd], "0123456789.", 'passAll)); + if l then + prefs.timing.screen := Floor(l); + else + :BadEntry(); + + // inherited:?labelActionScript(cmd); + nil; // update the goober; + end, + indent: 100, + _proto: _v190_0 + }; + AddStepForm(prefsView, screenTime); + StepDeclare(prefsView, screenTime, 'screenTime); + + + width := ! { ! labelCommands: ! ["40", "60", "80", "100", "120", "132", 'pickSeparator, "Edit List"], text: "Screen Width", ! viewBounds: {left: 11, top: 171, right: 169, bottom: 185}, textSetup: func() // return first one as default sprintObject(prefs.screen.width);, *************** *** 5177,5187 **** labelActionScript: func(cmd) begin ! prefs.screen.width := Floor(StringToNumber(labelCommands[cmd])); nil; // update the goober; end, indent: 100, ! _proto: @190 /* protoLabelPicker */ }; AddStepForm(prefsView, width); StepDeclare(prefsView, width, 'width); --- 5779,5800 ---- labelActionScript: func(cmd) begin ! if cmd = Length(labelCommands)-1 then begin ! inherited:?labelActionScript(cmd); ! return; ! end; ! ! local l := StringToNumber(StringFilter(labelCommands[cmd], "0123456789.", 'passAll)); ! if l then ! prefs.screen.width := Floor(l); ! else ! :BadEntry(); ! ! // inherited:?labelActionScript(cmd); nil; // update the goober; end, indent: 100, ! _proto: _v190_0 }; AddStepForm(prefsView, width); StepDeclare(prefsView, width, 'width); *************** *** 5189,5195 **** height := ! {labelCommands: ["10", "24", "25", "30", "40", "60", "80"], text: "Screen Height", viewBounds: {left: 11, top: 155, right: 169, bottom: 169}, textSetup: --- 5802,5810 ---- height := ! { ! labelCommands: ! ["10", "24", "25", "30", "40", "60", "80", 'pickSeparator, "Edit List"], text: "Screen Height", viewBounds: {left: 11, top: 155, right: 169, bottom: 169}, textSetup: *************** *** 5198,5208 **** labelActionScript: func(cmd) begin ! prefs.screen.height := Floor(StringToNumber(labelCommands[cmd])); nil; // update the goober; end, indent: 100, ! _proto: @190 /* protoLabelPicker */ }; AddStepForm(prefsView, height); StepDeclare(prefsView, height, 'height); --- 5813,5834 ---- labelActionScript: func(cmd) begin ! if cmd = Length(labelCommands)-1 then begin ! inherited:?labelActionScript(cmd); ! return; ! end; ! ! local l := StringToNumber(StringFilter(labelCommands[cmd], "0123456789.", 'passAll)); ! if l then ! prefs.screen.height := Floor(l); ! else ! :BadEntry(); ! ! // inherited:?labelActionScript(cmd); nil; // update the goober; end, indent: 100, ! _proto: _v190_0 }; AddStepForm(prefsView, height); StepDeclare(prefsView, height, 'height); *************** *** 5209,5215 **** --- 5835,5851 ---- + prefsView_v474_0 := + {viewBounds: {left: 5, top: -18, right: 51, bottom: -5}, + viewFlags: 515, + viewJustify: 8388742, + _proto: @474 /* protoOrientation */ + }; + AddStepForm(prefsView, prefsView_v474_0); + + + constant |layout_prefSetup.l| := prefsView; // End of file prefSetup.l // Beginning of file register.l *************** *** 5249,5255 **** GetRoot().(kAppSymbol):WarningSet(nil); end else begin getroot():notify(kNotifyQAlert, kVersionString, ! "You typed in an incorrect registration string.\nPlease recheck it and try again. Make sure that Os and 0s, ls, 1s and Is are not begin confused."); end; if visible(InputArea.inputLine) then --- 5885,5891 ---- GetRoot().(kAppSymbol):WarningSet(nil); end else begin getroot():notify(kNotifyQAlert, kVersionString, ! "You typed in an incorrect registration string. Please recheck it and try again. Make sure that Os and 0s, ls, 1s and Is are not begin confused."); end; if visible(InputArea.inputLine) then *************** *** 5336,5363 **** // Beginning of file editPopup.l editPopup := {viewBounds: {left: -1, top: 30, right: 197, bottom: 170}, - newPrefs: nil, viewSetupChildrenScript: func() begin ! newPopup := Clone(prefs.popup); ! setValue(verbPopup, 'labelCommands, newPopup); ! ! if visible(InputArea.inputLine.entryline) and ! StrLen(InputArea.inputLine.entryline.text) > 0 then ! setValue(inputLine, 'text, Clone(InputArea.inputLine.entryline.text)); ! else ! setValue(inputLine, 'text, Clone(lastCommand)); end, - newPopup: nil, viewHideScript: func() begin ! if visible(InputArea.inputLine) then ! SetKeyView(InputArea.inputLine.entryline, 0); ! else ! SetKeyView(weekeyview, 0); end, _proto: @179 /* protoFloater */ }; --- 5972,5996 ---- // Beginning of file editPopup.l editPopup := {viewBounds: {left: -1, top: 30, right: 197, bottom: 170}, viewSetupChildrenScript: func() begin ! setValue(verbPopup, 'labelCommands, origList); ! setValue(inputLine, 'text, defaultEntry); ! setValue(titleView, 'title, "Edit "&title); ! self.newPopup := origList; end, viewHideScript: func() begin ! // just call the SetNewList function with the caller ! Perform(caller, (SetNewList), [newPopup]); end, + SetNewList: nil, + caller: nil, + title: nil, + defaultEntry: nil, + origList: nil, _proto: @179 /* protoFloater */ }; *************** *** 5372,5378 **** RemoveSlot(newPopup, i); end else begin getroot():Notify(kNotifyQAlert, "Not in List", ! "The word you tried to delete in not in the list."); end; end, text: "Delete", --- 6005,6011 ---- RemoveSlot(newPopup, i); end else begin getroot():Notify(kNotifyQAlert, "Not in List", ! "The entry you tried to delete in not in the list."); end; end, text: "Delete", *************** *** 5384,5406 **** editPopup_v163_0 := ! { ! buttonClickScript: ! func() ! begin ! :updatePopups(newPopup); ! ! // Save dem changes ! if prefs then begin ! prefs.popup := newPopup; ! EntryChangeXmit(prefs, kAppSymbol); ! end; ! ! // Save them when we quit the app ! ! editPopup:Close(); ! end, ! viewBounds: {left: 180, top: 121, right: 193, bottom: 134}, viewJustify: 6, _proto: @163 /* protoLargeClosebox */ }; --- 6017,6023 ---- editPopup_v163_0 := ! {viewBounds: {left: 180, top: 121, right: 193, bottom: 134}, viewJustify: 6, _proto: @163 /* protoLargeClosebox */ }; *************** *** 5423,5429 **** if matchFlag then getroot():Notify(kNotifyQAlert, "Already in List", ! "The word you chose to add is already in the list"); else AddArraySlot(newPopup, DeepClone(inputLine.text)); --- 6040,6046 ---- if matchFlag then getroot():Notify(kNotifyQAlert, "Already in List", ! "The entry you chose to add is already in the list"); else AddArraySlot(newPopup, DeepClone(inputLine.text)); *************** *** 5438,5455 **** ! editPopup_v229_0 := {title: "Edit Words", viewBounds: {left: 10, top: 0, right: 90, bottom: 16}, _proto: @229 /* protoTitle */ }; ! AddStepForm(editPopup, editPopup_v229_0); verbPopup := {labelCommands: ["item 1","item 2"], ! text: "Available Words", viewBounds: {left: 11, top: 25, right: 113, bottom: 47}, labelActionScript: func(cmd) --- 6055,6073 ---- ! titleView := {title: "Edit Words", viewBounds: {left: 10, top: 0, right: 90, bottom: 16}, _proto: @229 /* protoTitle */ }; ! AddStepForm(editPopup, titleView); ! StepDeclare(editPopup, titleView, 'titleView); verbPopup := {labelCommands: ["item 1","item 2"], ! text: "Available Entries", viewBounds: {left: 11, top: 25, right: 113, bottom: 47}, labelActionScript: func(cmd) *************** *** 5484,5490 **** // End of file editPopup.l // Beginning of file aboutBox.l aboutBox := ! {viewBounds: {left: 0, top: 54, right: 200, bottom: 242}, _proto: @180 /* protoFloatNGo */ }; --- 6102,6108 ---- // End of file editPopup.l // Beginning of file aboutBox.l aboutBox := ! {viewBounds: {left: 0, top: 10, right: 200, bottom: 230}, _proto: @180 /* protoFloatNGo */ }; *************** *** 5531,5537 **** what := {text: "A VT100 emulator for Modem, Direct Serial and Telnet connections.", ! viewBounds: {left: 4, top: 66, right: 196, bottom: 90}, viewJustify: 0, viewFont: ROM_fontSystem9, _proto: @218 /* protoStaticText */ --- 6149,6155 ---- what := {text: "A VT100 emulator for Modem, Direct Serial and Telnet connections.", ! viewBounds: {left: 4, top: 60, right: 196, bottom: 85}, viewJustify: 0, viewFont: ROM_fontSystem9, _proto: @218 /* protoStaticText */ *************** *** 5545,5551 **** text: "©1996,1997 Scrawl. All Rights Reserved.\nWritten by George Madrid and Sanjay Vakil.\n\nContact help@scrawlsoft.com for information about registration and other products." , ! viewBounds: {left: 4, top: 106, right: 196, bottom: 162}, viewJustify: 0, viewFont: ROM_fontSystem9, _proto: @218 /* protoStaticText */ --- 6163,6169 ---- text: "©1996,1997 Scrawl. All Rights Reserved.\nWritten by George Madrid and Sanjay Vakil.\n\nContact help@scrawlsoft.com for information about registration and other products." , ! viewBounds: {left: 4, top: 95, right: 196, bottom: 150}, viewJustify: 0, viewFont: ROM_fontSystem9, _proto: @218 /* protoStaticText */ *************** *** 5554,5560 **** --- 6172,6221 ---- + newtonName := + {text: nil, + viewBounds: {left: 4, top: 170, right: 196, bottom: 185}, + viewSetupFormScript: + func() + begin + local sn; + // Put in ID if NOS2.1 + self.text := "Newton Name:"&&getglobals().userConfiguration.name; + + /*// Do this once we get 2.1 defs file + try sn := call ROM_GetSerialNumber with () onException |evt.ex| do nil; + + if sn then // 2.1 unit + self.text := "Newton Serial Number:"&&StrHexDump(sn, 0); + else */ + self.text := "Newton Name:"&&getglobals().userConfiguration.name; + + end, + _proto: @218 /* protoStaticText */ + }; + AddStepForm(aboutBox, newtonName); + + + timeOnline := + {text: nil, + viewBounds: {left: 4, top: 185, right: 196, bottom: 200}, + viewSetupFormScript: + func() + begin + if ept AND ept.sessionActualStart AND fEndPointState <> kState_Disconnected then + self.text := "Connected for:"&& + SPrintObject(Floor((TimeInSeconds() - ept.sessionActualStart)/60))&&"minutes"; + else + self.text := "Not Currently Connected"; + end, + _proto: @218 /* protoStaticText */ + }; + AddStepForm(aboutBox, timeOnline); + + + + constant |layout_aboutBox.l| := aboutBox; // End of file aboutBox.l // Beginning of file PT100.l *************** *** 5564,5574 **** CopyToNote: func() begin ! local screenText, note; ! // Create the new note ! foreach line in screen.lines do ! screenText := screenText & "\n" & line.text; note := paperroll:MakeTextNote(screenText, nil); // Set the style to the one used in screen --- 6225,6259 ---- CopyToNote: func() begin ! local screenText := "", note; ! // create the new note ! if screen.scrolledBack then begin ! local dispStart := (screen.scrollback.dispStart + 1) MOD screen.scrollback.max; ! local i; ! local cursor := screen.scrollbackSoupCursor; ! local entry; ! ! screen:FlushScrollBackBuffer(); ! ! i := screen.scrollback.dispEnd; ! ! while(i<>screen.scrollback.dispStart) do begin ! // get the old entry from the soup! ! if entry := cursor:Gotokey(i) then begin ! screenText := screenText & "\n" & entry.text; ! end; ! ! i := i + 1; ! if i> screen.scrollback.max then i := i - screen.scrollback.max; ! end; ! ! ! end else begin ! foreach line in screen.lines do ! screenText := screenText & "\n" & line.text; ! end; ! note := paperroll:MakeTextNote(screenText, nil); // Set the style to the one used in screen *************** *** 5578,5583 **** --- 6263,6271 ---- note.data[0].viewBounds.bottom := 0; note.data[0].viewBounds.top := 0; TextBounds(screenText, screen.viewFont, note.data[0].viewBounds); + note.title := "PT100 Data: "& + if theSession then theSession.name + else "No Session"; paperRoll:NewNote(note, nil, nil); end, warning: nil, *************** *** 5629,5660 **** MMessage: func(message) begin ! if classof(message) <> 'string then ! message := "Message: "&message; - // Use the dialbox if it's open. if visible(dialbox) then begin dialbox:ShowMessage(message); - // If the dialbox is open, then we don't want to - // bother with popups or procrastinated actions. - return; end else begin // use the floater ! if visible(messageFloater) then begin ! messageFloater:ShowMessage(message); ! refreshviews(); ! end else begin ! messageFloater:Open(); ! messageFloater:ShowMessage(message); ! refreshviews(); ! end; ! AddProcrastinatedCall(Intern(kAppSymbol&"floater"), ! func (scr) begin scr:Close(); end, ! [messageFloater], 1000); end; - if kDebugOn then begin print("MMessage: " & message); end; --- 6317,6356 ---- MMessage: func(message) begin ! if classof(message) <> 'string then begin ! message := "Error "&message; ! // Also copy it to the screen! ! screen:GotoLeftEdge(); ! screen:PutString("PT100: "&message); ! screen:GotoLeftEdge(); ! screen:CursorMove('down); ! end; ! // Use the dialbox if it's open. + // If the dialbox is open, then we don't want to + // bother with popups or procrastinated actions. if visible(dialbox) then begin dialbox:ShowMessage(message); end else begin // use the floater ! if messageFloater then begin ! if visible(messageFloater) then begin ! messageFloater:ShowMessage(message); ! refreshviews(); ! end else begin ! messageFloater:Open(); ! messageFloater:ShowMessage(message); ! refreshviews(); ! end; ! AddProcrastinatedCall(Intern(kAppSymbol&"floater"), ! func (scr) begin scr:Close(); end, ! [messageFloater], 1000); ! ! end; end; + if kDebugOn then begin print("MMessage: " & message); end; *************** *** 5677,5688 **** linkID := nil; end; - // Store the popups in system soup if prefs then begin prefs.sessions := sessions; EntryChangeXmit(prefs, kAppSymbol); ! prefs := nil; end; if soupCursor exists then begin --- 6373,6397 ---- linkID := nil; end; + if (prefs.screen.scrollback AND prefs.screen.scrollback > 0) + OR screen.scrollbackSoup then begin + + // remove the temporary buffer + screen.scrollBackBuffer := nil; + screen.scrollbackSoupCursor := nil; + // remove the soup entirely + screen.scrollbackSoup:RemoveFromStore(); + + // remove the handle to the soup + screen.scrollbackSoup := nil; + end; + + // Store the popups in system soup if prefs then begin prefs.sessions := sessions; EntryChangeXmit(prefs, kAppSymbol); ! self.prefs := nil; end; if soupCursor exists then begin *************** *** 5690,5711 **** sysSoup := nil; end; ! if messageFloater exists and ! messageFloater and ! visible(messageFloater) then begin ! AddProcrastinatedCall(Intern(kAppSymbol&"floater"), ! func (scr) begin scr:Close(); scr:=nil; end, ! [messageFloater], 0); ! // messageFloater := nil; end; self.theSession := nil; self.sessions := nil; ! // self.lex := nil; // self.viewBounds := nil; ! debugToggle := nil; inherited:?viewQuitScript(); // this method is defined internally --- 6399,6420 ---- sysSoup := nil; end; ! if messageFloater exists and messageFloater then begin ! if visible(messageFloater) then begin ! messageFloater:Close(); ! end; ! // remove any procrastinated actions ! AddProcrastinatedCall(EnsureInternal(Intern(kAppSymbol&"floater")), EnsureInternal(func() nil), nil, 0); ! messageFloater := nil; end; self.theSession := nil; self.sessions := nil; ! self.lex := nil; // self.viewBounds := nil; ! debugToggle := nil; inherited:?viewQuitScript(); // this method is defined internally *************** *** 5724,5729 **** --- 6433,6470 ---- script: nil, advanced: kDefaultAdvancedPrefs}; end, + editPopupSetup: + func() + begin + local origList := Clone('[]); + + if NOT visible(editPopup) then begin + + // setup the popup with what to show -- remove the extraneous entries + ArrayMunger(origList, 0, nil, + labelCommands, 0, + LSearch(labelCommands, 'pickseparator, 0, func(a,b) a=b, nil)); + + // callback to set up the new stuff + editPopup.SetNewList := 'UpdatePopups; + + editPopup.origList := origList; + editPopup.caller := self; + editPopup.title := "Words"; // title to use + editPopup.defaultEntry := + if visible(InputArea.inputLine) AND + StrLen(InputArea.inputLine.entryline.text) > 0 then + Clone(InputArea.inputLine.entryline.text); + else + Clone(lastCommand); + + editPopup:Open(); + end else begin + :Notify(kNotifyQAlert, + ensureInternal("Close Edit Box"), + ensureInternal("Please close the edit box before attempting to add another entry to "&text)); + end; + end, rot13: func(orig) begin *************** *** 5750,5755 **** --- 6491,6522 ---- true; // all taken care of automagically in the justification end, + BufferOutput: + func(text) + begin + if NOT bufferWaiting then + self.bufferWaiting := Clone(text); + else + self.bufferWaiting := bufferWaiting&text; + + if StrLen(bufferWaiting) > kMaxKeyboardBuffer then begin + ept:MOutputNoRet(bufferWaiting); + + self.bufferWaiting:=nil; + + // remove the call that was sitting around + AddProcrastinatedCall('kbdBufferSymbol, func() nil, nil, 0); + end else begin + AddProcrastinatedCall('kbdBufferSymbol, func(s, e, sc) + begin e:MOutputNoRet(s.bufferWaiting); + s.bufferWaiting:=nil; + end;, + [self, ept, screen], 200); // 150ms seems to be the threshold for repeat + end; + end + + , + bufferWaiting: nil, DoInfoAux: DefineGlobalConstant('kDebugOption, { label: kCMOSerialIOParms, *************** *** 5789,5794 **** --- 6556,6564 ---- sessionEdit:open(); end else if index = kInfoCopytoNotes then begin :CopyToNote(); + end else if index = kInfoClearScreen then begin + screen:ClearScreen(); + screen:CursorHome(); // end else if index = kInfoDebugToggle then begin // debugToggle := NOT debugToggle; end else if index = kInfoRegister then begin *************** *** 5819,5825 **** else begin // handle all other (unexptected) exceptions by disconnecting the endpoint AddDeferredCall(func(ep) ep:MDisconnect(), [self]); :MNotifyError(NumberStr(exceptionFrame.data)); ! screen:PutString(NumberStr(exceptionFrame.data)); base.lastexception := exceptionFrame; end; end; --- 6589,6595 ---- else begin // handle all other (unexptected) exceptions by disconnecting the endpoint AddDeferredCall(func(ep) ep:MDisconnect(), [self]); :MNotifyError(NumberStr(exceptionFrame.data)); ! // screen:PutString(NumberStr(exceptionFrame.data)); base.lastexception := exceptionFrame; end; end; *************** *** 5847,5856 **** // PlaySound(something here); -gam XXX !!! PlaySound(ROM_funbeep); if kDebugOn then begin ! Print("MNotifyError..."); end; :MMessage(message); end, setSession: func(newSession) begin --- 6617,6645 ---- // PlaySound(something here); -gam XXX !!! PlaySound(ROM_funbeep); if kDebugOn then begin ! Print("MNotifyError..." & message); end; :MMessage(message); end, + viewScrollDownScript: + func() + begin + if screen.scrollback then begin + screen:FlushScrollBackBuffer(); + screen:ScrollBackMove('down); + end else begin + playsound(ROM_plinkBeep); + getroot():notify(kNotifyQAlert, kVersionString, + "You must turn scrollback on in Prefs (more than zero lines) before using it."); + end; + + + end, + viewOverviewScript: + func() + begin + screen:refresh(); + end, setSession: func(newSession) begin *************** *** 5865,5877 **** icon: GetPictAsBits("extras icon", nil), title: "PT100", fEndpointState: nil, checkLame: func() begin ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 4 min check // if StrCompare((call kCheckRegister with ()), prefs.registerString) <> 0 then begin ! ept:ResetTimer(); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND --- 6654,6680 ---- icon: GetPictAsBits("extras icon", nil), title: "PT100", fEndpointState: nil, + viewScrollUpScript: + func() + begin + if screen.scrollback then begin + screen:FlushScrollBackBuffer(); + screen:ScrollBackMove('up); + end else begin + playsound(ROM_plinkBeep); + getroot():notify(kNotifyQAlert, kVersionString, + "You must turn scrollback on in Prefs (more than zero lines) before using it."); + end; + + + end, checkLame: func() begin ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 7 min check // if StrCompare((call kCheckRegister with ()), prefs.registerString) <> 0 then begin ! ept:ResetTimer(nil); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND *************** *** 5879,5885 **** :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 5 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin --- 6682,6688 ---- :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 8 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin *************** *** 5895,5903 **** updatePopups: func(newPopup) begin ! // set the popup values ! local newArray := Clone(newPopup); ! if lastCommand then ArrayMunger(newArray, Length(newArray), 0, ['pickSeparator, lastCommand, 'pickSeparator, "Send Username", "Send Password", --- 6698,6718 ---- updatePopups: func(newPopup) begin ! local newArray; ! ! if NOT newPopup then begin ! newArray := Clone('[]); ! ArrayMunger(newArray, 0, nil, ! quickPicker.labelCommands, ! 0, LSearch(labelCommands, 'pickseparator, 0, func(a,b) a=b, nil)); ! ! end else begin ! // set the popup values ! newArray := Clone(newPopup); ! end; ! ! ! if lastCommand and StrLen(lastCommand)>0 then ArrayMunger(newArray, Length(newArray), 0, ['pickSeparator, lastCommand, 'pickSeparator, "Send Username", "Send Password", *************** *** 5910,5917 **** InputArea.inputLine.labelCommands := newArray; quickPicker.labelCommands := newArray; ! prefs.popup := newPopup; return newArray; end, --- 6725,6743 ---- InputArea.inputLine.labelCommands := newArray; quickPicker.labelCommands := newArray; + + if newPopup then begin + if visible(InputArea.inputLine) then + SetKeyView(InputArea.inputLine.entryline, 0); + else + SetKeyView(weekeyview, 0); ! // Save dem changes ! if prefs then begin ! prefs.popup := newPopup; ! EntryChangeXmit(prefs, kAppSymbol); ! end; ! end; return newArray; end, *************** *** 5957,5963 **** end else begin getroot():notify(kNotifyQAlert, kVersionString, "Could not find any monospaced fonts. Please install a monospaced font and restart PT100"); ! :Close(); end; end; --- 6783,6789 ---- end else begin getroot():notify(kNotifyQAlert, kVersionString, "Could not find any monospaced fonts. Please install a monospaced font and restart PT100"); ! AddDelayedSend(self, 'close, nil, 5000); end; end; *************** *** 6001,6006 **** --- 6827,6833 ---- 'pickSeparator, "Edit Sessions", "Copy to Notes", + "Clear Screen", // "Debug Toggle", 'pickSeparator, "Register", *************** *** 6022,6027 **** --- 6849,6855 ---- // Pass this to the lexer and let the lexer deal with it. lex:DoString(data, partial); end, + kbdBufferSymbol: Intern(kAppSymbol&&"kbdBufferSymbol"), viewClass: 74 /* clView */, defaultPrefs: func() *************** *** 6030,6036 **** popup: ["mail ", "ls ", "logout", "more "], sessions: [ :BlankSession()], lastSession: nil, ! screen: {width: 80, height:24, font: {Family: 'Minico, face: kFaceNormal, size: 12}}, inputLines: 4, --- 6858,6866 ---- popup: ["mail ", "ls ", "logout", "more "], sessions: [ :BlankSession()], lastSession: nil, ! screen: { ! scrollback : 0, ! width: 80, height:24, font: {Family: 'Minico, face: kFaceNormal, size: 12}}, inputLines: 4, *************** *** 6073,6079 **** kbdButton := {viewJustify: 8389670, ! viewBounds: {left: 5, top: 0, right: 23, bottom: 13}, pickCancelledScript: func() begin --- 6903,6909 ---- kbdButton := {viewJustify: 8389670, ! viewBounds: {left: 5, top: 0, right: 30, bottom: 13}, pickCancelledScript: func() begin *************** *** 6092,6098 **** end, viewFlags: 513, viewFormat: 67109457, ! icon: nil, pickActionScript: func(itemSelected) begin --- 6922,6928 ---- end, viewFlags: 513, viewFormat: 67109457, ! icon: GetPictAsBits("keyboard icon", nil), pickActionScript: func(itemSelected) begin *************** *** 6120,6126 **** // After Script for kbdButton thisView := kbdButton; thisView.viewBounds := buttonBounds(thisView.viewBounds.right - thisView.viewBounds.left); ! thisView.icon := ROM_keySmallButtonBitmap; nil // this code will be executed after the template is processed --- 6950,6956 ---- // After Script for kbdButton thisView := kbdButton; thisView.viewBounds := buttonBounds(thisView.viewBounds.right - thisView.viewBounds.left); ! // thisView.icon := ROM_keySmallButtonBitmap; nil // this code will be executed after the template is processed *************** *** 6171,6197 **** ept:MOutput(labelCommands[itemSelected]); else ept:MOutputNoRet(labelCommands[itemSelected]); ! ! // copy the line into the 'again' buffer ! if StrLen(labelCommands[itemSelected])>0 then begin ! lastCommand := Clone(labelCommands[itemSelected]); ! :updatePopups(prefs.popup); ! end; end else if itemSelected = Length(labelCommands)-1 then // fire up the edit window... ! editPopUp:Open(); ! else if itemSelected = Length(labelCommands)-3 then // Send Password ept:MOutput(:rot13(theSession.password)); ! else if itemSelected = Length(labelCommands)-4 then // Send username ept:MOutput(theSession.user); :Hilite(nil); // Check to see if they are reg'd ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 4 min check ! ept:ResetTimer(); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND --- 7001,7025 ---- ept:MOutput(labelCommands[itemSelected]); else ept:MOutputNoRet(labelCommands[itemSelected]); ! // copy the line into the 'again' buffer ! lastCommand := Clone(labelCommands[itemSelected]); ! :updatePopups(nil); ! end else if itemSelected = Length(labelCommands)-1 then // fire up the edit window... ! :editPopupSetup(); ! else if itemSelected = Length(labelCommands)-3 AND theSession AND StrLen(theSession.password)>0 then // Send Password ept:MOutput(:rot13(theSession.password)); ! else if itemSelected = Length(labelCommands)-4 AND theSession AND StrLen(theSession.user)>0 then // Send username ept:MOutput(theSession.user); :Hilite(nil); // Check to see if they are reg'd ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 7 min check ! ept:ResetTimer(nil); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND *************** *** 6199,6205 **** :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 5 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin --- 7027,7033 ---- :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 8 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin *************** *** 6261,6269 **** func() begin // if it's a return, then check to see if they have reg'd ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 4 min check ! ept:ResetTimer(); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND --- 7089,7097 ---- func() begin // if it's a return, then check to see if they have reg'd ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 7 min check ! ept:ResetTimer(nil); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND *************** *** 6271,6277 **** :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 5 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin --- 7099,7105 ---- :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 8 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin *************** *** 6362,6368 **** AddDeferredAction(func (v) v:close(), [InputArea.inputLine]); AddDeferredAction(func (v) v:open(), [kbd]); end else if prefs.inputType = 'lines then begin ! viewBounds.top := -prefs.inputLines * FontHeight(protoInputLine.viewFont); AddDeferredAction(func (v) v:close(), [kbd]); AddDeferredAction(func (v) begin v:open(); setkeyview(v.entryline, 0); end, [InputArea.inputLine]); end else if prefs.inputType = 'minimize then begin --- 7190,7196 ---- AddDeferredAction(func (v) v:close(), [InputArea.inputLine]); AddDeferredAction(func (v) v:open(), [kbd]); end else if prefs.inputType = 'lines then begin ! viewBounds.top := -Floor((prefs.inputLines+0.65) * FontHeight(protoInputLine.viewFont)); AddDeferredAction(func (v) v:close(), [kbd]); AddDeferredAction(func (v) begin v:open(); setkeyview(v.entryline, 0); end, [InputArea.inputLine]); end else if prefs.inputType = 'minimize then begin *************** *** 6373,6378 **** --- 7201,7222 ---- end; end, + WordTapped: + func(word) + begin + if IsString(word) then begin + + if visible(inputLine) then + InputLine:insertText(word); + else begin + if returnButton.lit then + ept:MOutput(word); + else + ept:MOutputNoRet(word); + end; + + end; + end, viewClass: 74 /* clView */ }; AddStepForm(PT100, inputArea); *************** *** 6387,6395 **** // if it's a return, then check to see if they have reg'd if output[0] = unicodeCR then begin ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 4 min check ! ept:ResetTimer(); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND --- 7231,7239 ---- // if it's a return, then check to see if they have reg'd if output[0] = unicodeCR then begin ! if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 7 min check ! ept:ResetTimer(nil); // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND *************** *** 6397,6403 **** :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 5 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin --- 7241,7247 ---- :NotifyWarning(); // lame people are warned before timed out! :WarningSet(true); // we've told them end ! end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 8 min check // Check twice (will almost always be short circuited) if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin *************** *** 6410,6418 **** ept:MDisconnect(); end; end; - if ept then - ept:MOutputNoRet(""&output); end, portraitBounds: {left: 0, top: 1, right: 200, bottom: 79}, landscapeBounds: {left: 0, top: 1, right: 230, bottom: 78}, --- 7254,7294 ---- ept:MDisconnect(); end; end; + if output[0] = kkbdLeftArrowKey then begin + if lex.cursorMode = 'set then + output := $\u001b&"OD"; + else if lex.cursorMode = 'reset then + output := $\u001b&"[D"; + end; + + if output[0] = kkbdRightArrowKey then begin + if lex.cursorMode = 'set then + output := $\u001b&"OC"; + else if lex.cursorMode = 'reset then + output := $\u001b&"[C"; + end; + + if output[0] = kkbdUpArrowKey then begin + if lex.cursorMode = 'set then + output := $\u001b&"OA"; + else if lex.cursorMode = 'reset then + output := $\u001b&"[A"; + end; + + if output[0] = kkbdDownArrowKey then begin + if lex.cursorMode = 'set then + output := $\u001b&"OB"; + else if lex.cursorMode = 'reset then + output := $\u001b&"[B"; + end; + + + if ept then begin + // ept:MOutputNoRet(""&output); + :BufferOutput(""&output); + end; + end, portraitBounds: {left: 0, top: 1, right: 200, bottom: 79}, landscapeBounds: {left: 0, top: 1, right: 230, bottom: 78}, *************** *** 6457,6466 **** if cmdIndex < Length(labelCommands)-4 then :insertText(labelCommands[cmdIndex]); else if cmdIndex = Length(labelCommands)-1 then // fire up the edit window... ! editPopUp:Open(); ! else if cmdIndex = Length(labelCommands)-3 then // Send Password ept:MOutput(:rot13(theSession.password)); ! else if cmdIndex = Length(labelCommands)-4 then // Send username ept:MOutput(theSession.user); return true; end, --- 7333,7342 ---- if cmdIndex < Length(labelCommands)-4 then :insertText(labelCommands[cmdIndex]); else if cmdIndex = Length(labelCommands)-1 then // fire up the edit window... ! :editPopupSetup(); ! else if cmdIndex = Length(labelCommands)-3 AND theSession AND StrLen(theSession.password)>0 then // Send Password ept:MOutput(:rot13(theSession.password)); ! else if cmdIndex = Length(labelCommands)-4 AND theSession AND StrLen(theSession.user)>0 then // Send username ept:MOutput(theSession.user); return true; end, *************** *** 6475,6481 **** // copy the line into the 'again' buffer if StrLen(entryline.text)>0 then begin lastCommand := Clone(entryLine.text); ! :updatePopups(prefs.popup); end; :flush(); --- 7351,7357 ---- // copy the line into the 'again' buffer if StrLen(entryline.text)>0 then begin lastCommand := Clone(entryLine.text); ! :updatePopups(nil); end; :flush(); *************** *** 6518,6628 **** weeKeyView := - {viewBounds: {left: -17, top: 15, right: -15, bottom: 17}, - viewFlags: 257, - viewFont: simpleFont9, - viewFormat: 0, - textFlags: vFixedTextStyle + vSingleKeystrokes, - ViewKeyDownScript: - func(char, modifier) - begin - /* - - Yech. Deal with modifiers - - 25 Indicates that the Command key was in effect. (kCommandModifier) - 26 Indicates that the Shift key was in effect. (kShiftModifier) - 27 Indicates that the Caps Lock key was in effect. (kCapsLockModifier) - 28 Indicates that the Option key was in effect. (kOptionsModifier) - 29 Indicates that the Control key was in effect. (kControlModifier) - - */ - - local output; - - - // if Band(modifier, 0x3e000000) = 0 then begin // no modifiers - // output := char; - // XXX might want to make this an option - send ESC or set high bit - - - if Ord(char) = 0 then begin - return; - end else if Band(modifier, 0x02000000) <> 0 then begin // We want META! - output := Chr(27)&char; - end else - output := char; - - // if it's a return, then check to see if they have reg'd - - if char = Chr(13) then begin // if it's a return, then check to see if they have reg'd - if NOT warning AND (TimeInSeconds() - ept.sessionStart > kWarnTime) then begin // 4 min check - - ept:ResetTimer(); - - // Check twice (will almost always be short circuited) - if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND - (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin - :NotifyWarning(); // lame people are warned before timed out! - :WarningSet(true); // we've told them - end - end else if warning AND (TimeInSeconds() - ept.sessionStart) > (kHangUpTime-kWarnTime) then begin // 5 min check - // Check twice (will almost always be short circuited) - if (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) AND - (NOT BinEqual(call kCheckRegister with (), call kEncode with (prefs.registerString))) then begin - - // lame people are timed out! - :NotifyHangup(); - ept:MDisconnect(); - end; - end else if TimeInSeconds() - ept.sessionStart < 0 then begin - ept:MDisconnect(); - end; - end; - - if ept then begin - ept:MOutputNoRet(""&output); - return true; - end; - - end, - viewClass: 81 /* clParagraphView */ - }; - AddStepForm(inputArea, weeKeyView); - StepDeclare(PT100, weeKeyView, 'weeKeyView); - - - - compass := - {viewBounds: {left: -32, top: 0, right: 0, bottom: 0}, - viewFlags: 513, - viewFormat: 1, - viewJustify: 230, - icon: GetPictAsBits("KeyboardReturn", nil), - viewSetupFormScript: - func() - begin - if icon.icon exists then - icon := icon.icon; // yes, this looks dumb. the icon is on ROMS in the ROM_Canonicalcompass bit - end, - viewClickScript: - // This function is called when the pen is down in the - // scroller controll, and it calls clipper1:ScrollMe to - // move the window around. Ideally this view should have - // its mask set, and if fact the mask is in the resource - // file, but NTK isn't dealing with the mask properly yet. - - func(unit) - begin - local deltaX, deltaY; - local bounds := :GlobalBox(); - local xcent := (bounds.left + bounds.right)/2; - local ycent := (bounds.top + bounds.bottom)/2; - InkOff(unit); - PlaySound(ROM_click); - - repeat begin - // compute where in the view the pen is currently and scroll in the right - // direction. The values are pretty arbitrary. - deltaX := if GetPoint(finalX, unit) < xcent - 5 then - screen.charWidth*8 - else if GetPoint(finalX, unit) > xcent + 5 then screen.charWidth*8 --- 7394,7396 ----