From 6eef3d211bae2da4456a94628edaf763bd2a02f0 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Thu, 23 May 2013 20:46:33 -0400 Subject: [PATCH] Editing a single character now prompts for ASCII # instead of forcing people to play the ALT-NUMPAD game. --- mystic/bbs_ansi_menuform.pas | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/mystic/bbs_ansi_menuform.pas b/mystic/bbs_ansi_menuform.pas index 7df9d4d..d7f3be4 100644 --- a/mystic/bbs_ansi_menuform.pas +++ b/mystic/bbs_ansi_menuform.pas @@ -72,6 +72,7 @@ Type Procedure EditPercentBar (Var Bar: RecPercent); Function GetColorAttr (C: Byte) : Byte; Procedure EditAccessFlags (Var Flags: TMenuFormFlagsRec); + Procedure EditCharacter (Var C: Char); Procedure AddBasic (HK: Char; D: String; X, Y, FX, FY, DS, FS, MS: Byte; I: FormItemType; P: Pointer; H: String); Procedure BarON; Procedure BarOFF (RecPos: Word); @@ -222,6 +223,25 @@ Begin Box.Free; End; +Procedure TAnsiMenuForm.EditCharacter (Var C: Char); +Var + Box : TAnsiMenuBox; + Str : String[3]; +Begin + Box := TAnsiMenuBox.Create; + + Box.Open (19, 8, 62, 10); + + WriteXY ( 21, 9, 113, 'Enter ASCII character number (1-254)'); + + Str := strI2S(Ord(C)); + Str := Input.GetStr(58, 9, 3, 3, 1, Str); + C := Chr(strS2I(Str)); + + Box.Close; + Box.Free; +End; + Procedure TAnsiMenuForm.EditAccessFlags (Var Flags: TMenuFormFlagsRec); Var Box : TAnsiMenuBox; @@ -567,7 +587,6 @@ End; Procedure TAnsiMenuForm.EditOption; Var - TempStr : String; TempByte : Byte; TempLong : LongInt; Begin @@ -598,11 +617,7 @@ Begin If Not DirCreate(S^) Then ShowMsgBox(0, 'Unable to create'); End; - ItemChar : Begin - TempStr := Input.GetStr(FieldX, FieldY, FieldSize, MaxSize, 1, C^); - Changed := TempStr[1] <> C^; - C^ := TempStr[1]; - End; + ItemChar : EditCharacter(C^); ItemAttr : Begin TempByte := GetColorAttr(B^); Changed := TempByte <> B^;