home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR22 / JORF21_2.ZIP / EDITINI.J < prev    next >
Text File  |  1993-07-05  |  26KB  |  769 lines

  1. EditIni:Start
  2.   New (Ini:IniStruct, FileName,PrintChoice, WinChoice)
  3.  
  4.   FileName = EditIni:FileName()
  5.   If (File:Exist (FileName)==False)
  6.     Msg:Add ('Error', 'Ok')
  7.       Cannot find file "{FileName}"
  8.     Return
  9.  
  10.   EditIni:Backup(FileName)
  11.   Event:Add("EditIni")
  12.   Win:Add ('JORF Options',0,0,0,0,Here)
  13.     Idle:"Editini:CheckRead(IniStruct,FileName)"
  14.     Menu:"&File"
  15.       Menu:"&About EditIni" Action:"EditIni:About"
  16.       Menu:"&New File"      Action:"Editini:GetFile(IniStruct,FileName)"
  17.       Menu:"E&xit"          Action:"EditIni:Cancel(FileName)"
  18.     Group:"Windows and DOS Options" Row:1 Col:1 Len:3 Wid:30
  19.     ChBox:"&MultiUser Mode"  Check:"IniStruct->Multiuser=='Yes'"
  20.       Action:"IniStruct->MultiUser='Yes'" UnAction:"IniStruct->MultiUser='No'"
  21.     ChBox:"Memory &status "   Check:"IniStruct->MemStats=='Yes'"
  22.       Action:"IniStruct->MemStats='Yes'" UnAction:"IniStruct->MemStats='No'"
  23.     Input:"Ram Disk       " Field:"IniStruct->RamDisk" Wid:10
  24.     Group:"&DOS Options" Row:6 Col:1 Len:5 Wid:30
  25.     ChBox:"&Bios Screens"      Check:"IniStruct->Bios=='Yes'"
  26.       Action:"IniStruct->Bios='Yes'" UnAction:"IniStruct->Bios='No'"
  27.     ChBox:"&Monochrome Override" Check:"IniStruct->Monochrome=='Yes'"
  28.       Action:"IniStruct->Monochrome='Yes'" UnAction:"IniStruct->Monochrome='No'"
  29.     ChBox:"Use &Graphics Mode"      Check:"IniStruct->Graphics=='Yes'"
  30.       Action:"IniStruct->Graphics='Yes'" UnAction:"IniStruct->Graphics='No'"
  31.     ChBox:"Using XT &Keyboard"      Check:"IniStruct->IsXt=='Yes'"
  32.       Action:"IniStruct->IsXt='Yes'" UnAction:"IniStruct->IsXt='No'"
  33.     Input:"Explode Speed (0-9)  " Field:"IniStruct->Explode" Wid:1
  34.  
  35.     Group:"&Printer prompts" Row:1 Col:34 Len:5 Wid:24
  36.     Array:"" Field:"IniStruct->PrintList"
  37.        Show:"EditIni:PrintShow"
  38.        Choice:"PrintChoice"
  39.        Action:"EditIni:PrintDo(IniStruct,PrintChoice)"
  40.     Group:"&Window colors"  Row:8 Col:34 Len:7 Wid:24
  41.     Array:"" Field:"IniStruct->WinList"
  42.        Show:"EditIni:WinShow"
  43.        Choice:"WinChoice"
  44.        Action:"EditIni:WinDo(IniStruct,WinChoice)"
  45.     Input:"&File:" Field:"FileName" Row:13 Col:1 Wid:26 Before:Null
  46.     Button:"&Ok"     Row:14 Col:1 Wid:14 Action:"Return Null"
  47.     Button:"&Cancel" Row:14 Col:19 Wid:14 Action:"EditIni:Cancel(FileName)"
  48.  
  49.   If (Kbd:Got!='Esc_Key')
  50.     EditIni:Write(FileName,IniStruct)
  51.   Return Ok
  52.  
  53. Class:Ini
  54.   Bios
  55.   Monochrome
  56.   Multiuser
  57.   Memstats
  58.   Decimal
  59.   Graphics
  60.   Isxt
  61.   Ramdisk
  62.   Explode
  63.   Printlist
  64.   Winlist
  65.  
  66. class:IniPrint
  67.   Prompt
  68.   Device
  69.  
  70. class:IniWin
  71.   Name
  72.   MonoColor
  73.   Linestyle
  74.   Clrborder
  75.   Clrtitle
  76.   Clrshadow
  77.   Clrmessage
  78.   Clrnormal
  79.   Clrlow
  80.   Clrmedium
  81.   Clrhigh
  82.   Clrbold
  83.  
  84. Editini:About
  85.   Msg:Add ("EditIni")
  86.     Flrco:"Center"
  87.     Program to edit JORF.INI files
  88.  
  89.     Written by Wayland Bruns
  90.     March 10, 1993 for Version 2.1
  91.   Return (Ok)
  92.  
  93. Editini:Alt_F5_Key
  94.   Jorf:Flush
  95.   Return (Ok)
  96.  
  97. EditIni:Backup(FileName)
  98.   New (BakName)
  99.   BakName = Str:AtCut(FileName,Str:In(FileName,".")) + ".BAK"
  100.   File:Copy(FileName,BakName)
  101.   Return (Ok)
  102.  
  103. EditIni:Cancel(FileName)
  104.   New (BakName)
  105.   BakName = Str:AtCut(FileName,Str:In(FileName,".")) + ".BAK"
  106.   File:Copy(BakName,FileName)
  107.   Kbd:Put("Esc_Key")
  108.   Return (Ok)
  109.  
  110. Editini:CheckRead(*IniStruct,FileName)
  111.   If (IniStruct->Bios==Null)
  112.     Win:Msg("Reading INI file")
  113.     IniStruct=EditIni:Read(FileName)
  114.     If (IniStruct->Bios==Null)
  115.       IniStruct->Bios="No"
  116.     Win:Msg
  117.     Win:Dsp
  118.   Return (Ok)
  119.  
  120. EditIni:ChkBkdColor(WorkColor,Color)
  121.   Return (Color==Str:At(WorkColor,Str:In(WorkColor,"/")+1))
  122.  
  123. EditIni:ChkForColor(WorkColor,Color)
  124.   Return (Color==Str:AtCut(WorkColor,Str:In(WorkColor,"/")))
  125.  
  126. EditIni:ColorSet(OldWin)
  127.   New (ArrColor,ArrChoice,LastChoice,WorkColor,IniWin:Win)
  128.  
  129.   Win = Jorf:Dup(OldWin)
  130.   ArrChoice  = 1
  131.   LastChoice = 1
  132.   WorkColor  = Win->ClrNormal
  133.  
  134.   ArrColor[1] = "Normal  - Text and prompts"
  135.   ArrColor[2] = "Low     - Hot keys"
  136.   ArrColor[3] = "Medium  - Lines and Groups"
  137.   ArrColor[4] = "High    - Unselected fields"
  138.   ArrColor[5] = "Bold    - Selected field"
  139.   ArrColor[6] = "Message - Window message"
  140.   ArrColor[7] = "Border  - DOS Border"
  141.   ArrColor[8] = "Title   - DOS Title"
  142.   ArrColor[9] = "Shadow  - DOS Shadow"
  143.  
  144.   Win:Add("JORF Window Colors")
  145.     Group:"&Color to change"     Row:10 Col:1 Len:9 Wid:30
  146.       Display:"EditIni:ColorShow(Win)"
  147.     Array:"" Field:"ArrColor"
  148.       Choice:"ArrChoice"
  149.       Action:"EditIni:NewColor(Win,WorkColor,ArrChoice,LastChoice)"
  150.     Input:"Setting" Field:"ArrColor[ArrChoice]" Row:2 Col:36 Wid:28 Before:"Null"
  151.       Display:"EditIni:NewColor(Win,WorkColor,ArrChoice,LastChoice)"
  152.  
  153.     Group:"&Foreground" Row:3 Col:36 Len:16 Wid:16
  154.     Radio:"Black"
  155.       Check:"EditIni:ChkForColor(WorkColor,'Black')"
  156.       Action:"EditIni:SetForColor(Win,WorkColor,'Black',ArrChoice)"
  157.     Radio:"Blue"
  158.       Check:"EditIni:ChkForColor(WorkColor,'Blue')"
  159.       Action:"EditIni:SetForColor(Win,WorkColor,'Blue',ArrChoice)"
  160.     Radio:"Green"
  161.       Check:"EditIni:ChkForColor(WorkColor,'Green')"
  162.       Action:"EditIni:SetForColor(Win,WorkColor,'Green',ArrChoice)"
  163.     Radio:"Cyan"
  164.       Check:"EditIni:ChkForColor(WorkColor,'Cyan')"
  165.       Action:"EditIni:SetForColor(Win,WorkColor,'Cyan',ArrChoice)"
  166.     Radio:"Red"
  167.       Check:"EditIni:ChkForColor(WorkColor,'Red')"
  168.       Action:"EditIni:SetForColor(Win,WorkColor,'Red',ArrChoice)"
  169.     Radio:"Magenta"
  170.       Check:"EditIni:ChkForColor(WorkColor,'Magenta')"
  171.       Action:"EditIni:SetForColor(Win,WorkColor,'Magenta',ArrChoice)"
  172.     Radio:"Brown"
  173.       Check:"EditIni:ChkForColor(WorkColor,'Brown')"
  174.       Action:"EditIni:SetForColor(Win,WorkColor,'Brown',ArrChoice)"
  175.     Radio:"White"
  176.       Check:"EditIni:ChkForColor(WorkColor,'White')"
  177.       Action:"EditIni:SetForColor(Win,WorkColor,'White',ArrChoice)"
  178.     Radio:"Gray"
  179.       Check:"EditIni:ChkForColor(WorkColor,'Gray')"
  180.       Action:"EditIni:SetForColor(Win,WorkColor,'Gray',ArrChoice)"
  181.     Radio:"Light Blue"
  182.       Check:"EditIni:ChkForColor(WorkColor,'Light Blue')"
  183.       Action:"EditIni:SetForColor(Win,WorkColor,'Light Blue',ArrChoice)"
  184.     Radio:"Light Green"
  185.       Check:"EditIni:ChkForColor(WorkColor,'Light Green')"
  186.       Action:"EditIni:SetForColor(Win,WorkColor,'Light Green',ArrChoice)"
  187.     Radio:"Light Cyan"
  188.       Check:"EditIni:ChkForColor(WorkColor,'Light Cyan')"
  189.       Action:"EditIni:SetForColor(Win,WorkColor,'Light Cyan',ArrChoice)"
  190.     Radio:"Light Red"
  191.       Check:"EditIni:ChkForColor(WorkColor,'Light Red')"
  192.       Action:"EditIni:SetForColor(Win,WorkColor,'Light Red',ArrChoice)"
  193.     Radio:"Light Magenta"
  194.       Check:"EditIni:ChkForColor(WorkColor,'Light Magenta')"
  195.       Action:"EditIni:SetForColor(Win,WorkColor,'Light Magenta',ArrChoice)"
  196.     Radio:"Yellow"
  197.       Check:"EditIni:ChkForColor(WorkColor,'Yellow')"
  198.       Action:"EditIni:SetForColor(Win,WorkColor,'Yellow',ArrChoice)"
  199.     Radio:"Bright White"
  200.       Check:"EditIni:ChkForColor(WorkColor,'Bright White')"
  201.       Action:"EditIni:SetForColor(Win,WorkColor,'Bright White',ArrChoice)"
  202.     Group:"&Background" Row:3 Col:56 Len:16 Wid:16
  203.     Radio:"Black"
  204.       Check:"EditIni:ChkBkdColor(WorkColor,'Black')"
  205.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Black')"
  206.     Radio:"Blue"
  207.       Check:"EditIni:ChkBkdColor(WorkColor,'Blue')"
  208.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Blue',ArrChoice)"
  209.     Radio:"Green"
  210.       Check:"EditIni:ChkBkdColor(WorkColor,'Green')"
  211.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Green',ArrChoice)"
  212.     Radio:"Cyan"
  213.       Check:"EditIni:ChkBkdColor(WorkColor,'Cyan')"
  214.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Cyan',ArrChoice)"
  215.     Radio:"Red"
  216.       Check:"EditIni:ChkBkdColor(WorkColor,'Red')"
  217.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Red',ArrChoice)"
  218.     Radio:"Magenta"
  219.       Check:"EditIni:ChkBkdColor(WorkColor,'Magenta')"
  220.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Magenta',ArrChoice)"
  221.     Radio:"Brown"
  222.       Check:"EditIni:ChkBkdColor(WorkColor,'Brown')"
  223.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Brown',ArrChoice)"
  224.     Radio:"White"
  225.       Check:"EditIni:ChkBkdColor(WorkColor,'White')"
  226.       Action:"EditIni:SetBkdColor(Win,WorkColor,'White',ArrChoice)"
  227.     Radio:"Gray"
  228.       Check:"EditIni:ChkBkdColor(WorkColor,'Gray')"
  229.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Gray',ArrChoice)"
  230.     Radio:"Light Blue"
  231.       Check:"EditIni:ChkBkdColor(WorkColor,'Light Blue')"
  232.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Light Blue',ArrChoice)"
  233.     Radio:"Light Green"
  234.       Check:"EditIni:ChkBkdColor(WorkColor,'Light Green')"
  235.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Light Green',ArrChoice)"
  236.     Radio:"Light Cyan"
  237.       Check:"EditIni:ChkBkdColor(WorkColor,'Light Cyan')"
  238.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Light Cyan',ArrChoice)"
  239.     Radio:"Light Red"
  240.       Check:"EditIni:ChkBkdColor(WorkColor,'Light Red')"
  241.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Light Red',ArrChoice)"
  242.     Radio:"Light Magenta"
  243.       Check:"EditIni:ChkBkdColor(WorkColor,'Light Magenta')"
  244.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Light Magenta',ArrChoice)"
  245.     Radio:"Yellow"
  246.       Check:"EditIni:ChkBkdColor(WorkColor,'Yellow')"
  247.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Yellow',ArrChoice)"
  248.     Radio:"Bright White"
  249.       Check:"EditIni:ChkBkdColor(WorkColor,'Bright White')"
  250.       Action:"EditIni:SetBkdColor(Win,WorkColor,'Bright White',ArrChoice)"
  251.     Button:"&Ok"          Row:21 Col:2 Wid:14 Action:"Return Null"
  252.     Button:"&Cancel"      Row:21 Col:18 Wid:14 Action:"Kbd:Put('Esc_Key')"
  253.     Button:"&Pick Scheme" Row:21 Col:42 Wid:24 Action:"EditIni:Scheme(Win,WorkColor,ArrChoice)"
  254.   If (Kbd:Got!='Esc_Key')
  255.     Jorf:Move(Win,OldWin)
  256.     Win:Dsp
  257.   Jorf:Del(Win)
  258.   Return (Ok)
  259.  
  260. EditIni:ColorShow(Win)
  261.   New (LineChars,i)
  262.  
  263.   Switch (Win->LineStyle)
  264.     Case 'Double'
  265.       LineChars = "╔═╗║║╚═╝╟─╢"
  266.     Case 'Single'
  267.       LineChars = "┌─┐││└─┘├─┤"
  268.     Case 'Thick'
  269.       LineChars = "█▀████▄██─█"
  270.     Else
  271.       LineChase = "         ─ "
  272.   Win:Attr(Win->ClrBorder)
  273.   Move:To(2,4)
  274.   Str:Put(Str:At(LineChars,1,1))
  275.   Str:Put(Str:AtSet(Null,1,Str:At(LineChars,2,1),25))
  276.   Str:Put(Str:At(LineChars,3,1))
  277.   Move:To(2,12)
  278.   Win:Attr(Win->ClrTitle)
  279.   Str:Put(" Title ")
  280.  
  281.   EditIni:OneLine(Win,LineChars,3)
  282.  
  283.   Move:To(3,5)
  284.   Win:Attr(Win->ClrBold)
  285.   Str:Put("M")
  286.   Win:Attr(Win->ClrHigh)
  287.   Str:Put("enu high")
  288.   Win:Attr(Win->ClrNormal)
  289.   Str:Put("   ")
  290.   Win:Attr(Win->ClrLow)
  291.   Str:Put("M")
  292.   Win:Attr(Win->ClrNormal)
  293.   Str:Put("enu low")
  294.  
  295.   EditIni:OneLine(Win,LineChars,4)
  296.   Move:To(4,5)
  297.   Win:Attr(Win->ClrMedium)
  298.   Str:Put(Str:AtSet(Null,1,Str:At(LineChars,10,1),25))
  299.   Win:Attr(Win->ClrLow)
  300.   Move:To(4,6)
  301.   Str:Put("Line")
  302.  
  303.   EditIni:OneLine(Win,LineChars,5)
  304.   Move:To(0,5)
  305.   Win:Attr(Win->ClrLow)
  306.   Str:Put("P")
  307.   Win:Attr(Win->ClrNormal)
  308.   Str:Put("rompt 1")
  309.   Move:To(0,14)
  310.   Win:Attr(Win->ClrBold)
  311.   Str:Put("Selected Field  ")
  312.  
  313.   EditIni:OneLine(Win,LineChars,6)
  314.   Move:To(0,5)
  315.   Win:Attr(Win->ClrLow)
  316.   Str:Put("P")
  317.   Win:Attr(Win->ClrNormal)
  318.   Str:Put("rompt 2")
  319.   Move:To(0,14)
  320.   Win:Attr(Win->ClrHigh)
  321.   Str:Put("Unselected Field")
  322.  
  323.   Win:Attr(Win->ClrBorder)
  324.   Move:To(7,4)
  325.   Str:Put(Str:At(LineChars,6,1))
  326.   Str:Put(Str:AtSet(Null,1,Str:At(LineChars,7,1),25))
  327.   Str:Put(Str:At(LineChars,8,1))
  328.   If (Win->ClrShadow!='Black/Black')
  329.     Win:Attr(Win->ClrShadow)
  330.   Else
  331.     Win:Attr(0)
  332.   Str:Put("  ")
  333.   Move:To(8,6)
  334.   Str:Put(Str:AtSet(Null,1," ",27))
  335.  
  336.   Move:To(7,6)
  337.   Win:Attr(Win->ClrMessage)
  338.   Str:Put("Message")
  339.  
  340.   Win:Attr(0)
  341.   Return (Ok)
  342.  
  343. EditIni:FileName
  344.   New (FileName)
  345.   FileName   = Str:At (Mem:Ptr->Args, 1, Str:In (Mem:Ptr->Args, '.'))
  346.   FileName   = FileName + 'INI'
  347.   Return (FileName)
  348.  
  349. EditIni:GetColor(Win,*WorkColor,ArrChoice)
  350.   Switch (ArrChoice)
  351.     Case 1
  352.       WorkColor = Win->ClrNormal
  353.     Case 2
  354.       WorkColor = Win->ClrLow
  355.     Case 3
  356.       WorkColor = Win->ClrMedium
  357.     Case 4
  358.       WorkColor = Win->ClrHigh
  359.     Case 5
  360.       WorkColor = Win->ClrBold
  361.     Case 6
  362.       WorkColor = Win->ClrMessage
  363.     Case 7
  364.       WorkColor = Win->ClrBorder
  365.     Case 8
  366.       WorkColor = Win->ClrTitle
  367.     Case 9
  368.       WorkColor = Win->ClrShadow
  369.   Return (Ok)
  370.  
  371. Editini:GetFile(*IniStruct,*FileName)
  372.   New (Res,NewFile)
  373.   NewFile = DirList:GetFIle("*.INI")
  374.   If (NewFile And NewFile!=FileName)
  375.     Res = Msg:Add("Save Changes","Yes")
  376.       Do you want to save changes &
  377.       to last file {FileName}?
  378.     If (res)
  379.       EditIni:Write(FileName,IniStruct)
  380.     FileName  = NewFile
  381.     Win:Add
  382.       Reading INI file
  383.     IniStruct = EditIni:Read(FileName)
  384.     Win:Dsp
  385.   Return (Ok)
  386.  
  387. EditIni:NewColor(Win,*WorkColor,ArrChoice,*LastChoice)
  388.   EditIni:SetColor(Win,WorkColor,LastChoice)
  389.   EditIni:GetColor(Win,WorkColor,ArrChoice)
  390.   LastChoice = ArrChoice
  391.   Return (Ok)
  392.  
  393. EditIni:NewPrint(Line)
  394.   New (Pos,IniPrint:Print)
  395.   Pos = Str:In(Line,",")
  396.   If (Pos)
  397.     Print->Prompt = Str:At(Line,1,Pos-1)
  398.     Print->Device = Str:Aft(Str:At(Line,Pos+1)," ")
  399.   Return (Print)
  400.  
  401. EditIni:NewScheme(Win,Color)
  402.   Switch (Color)
  403.     Case 'Blue'
  404.       Win->LineStyle    ='Double'
  405.       Win->ClrBorder    ='Bright White/Blue'
  406.       Win->ClrTitle     ='Bright White/Cyan'
  407.       Win->ClrShadow    ='White/Black'
  408.       Win->ClrNormal    ='Light Blue/Blue'
  409.       Win->ClrLow       ='Bright White/Blue'
  410.       Win->ClrMedium    ='Light Blue/Blue'
  411.       Win->ClrHigh      ='Bright White/White'
  412.       Win->ClrBold      ='Light Blue/White'
  413.       Win->ClrMessage   ='Yellow/Blue'
  414.     Case 'White'
  415.       Win->LineStyle    ='Thick'
  416.       Win->ClrBorder    ='Bright White/White'
  417.       Win->ClrTitle     ='Bright White/White'
  418.       Win->ClrShadow    ='Black/Gray'
  419.       Win->ClrMessage   ='Gray/White'
  420.       Win->ClrNormal    ='Bright White/White'
  421.       Win->ClrLow       ='Gray/White'
  422.       Win->ClrMedium    ='Bright White/White'
  423.       Win->ClrHigh      ='White/Gray'
  424.       Win->ClrBold      ='Bright White/Gray'
  425.     Case 'Default'
  426.       Win->LineStyle    ='Single'
  427.       Win->ClrBorder    ='Bright White/White'
  428.       Win->ClrTitle     ='Light Blue/White'
  429.       Win->ClrShadow    ='Light Magenta/Blue'
  430.       Win->ClrNormal    ='Bright White/White'
  431.       Win->ClrLow       ='Yellow/White'
  432.       Win->ClrMedium    ='Light Blue/White'
  433.       Win->ClrHigh      ='Yellow/Blue'
  434.       Win->ClrBold      ='Bright White/Blue'
  435.       Win->ClrMessage   ='Yellow/White'
  436.     Case 'Gray'
  437.       Win->LineStyle    ='Double'
  438.       Win->ClrBorder    ='Light Blue/Gray'
  439.       Win->ClrTitle     ='Bright White/Gray'
  440.       Win->ClrShadow    ='Blue/Black'
  441.       Win->ClrMessage   ='Light Cyan/Gray'
  442.       Win->ClrNormal    ='Bright White/Gray'
  443.       Win->ClrLow       ='Light Cyan/Gray'
  444.       Win->ClrMedium    ='Light Blue/Gray'
  445.       Win->ClrHigh      ='Light Cyan/White'
  446.       Win->ClrBold      ='Bright White/White'
  447.     Case 'Green'
  448.       Win->LineStyle    ='Double'
  449.       Win->ClrBorder    ='Bright White/Cyan'
  450.       Win->ClrTitle     ='Bright Cyan/White'
  451.       Win->ClrShadow    ='Cyan/Black'
  452.       Win->ClrMessage   ='Yellow/Cyan'
  453.       Win->ClrNormal    ='Bright White/Cyan'
  454.       Win->ClrLow       ='Yellow/Cyan'
  455.       Win->ClrMedium    ='Light Cyan/Cyan'
  456.       Win->ClrHigh      ='Yellow/Blue'
  457.       Win->ClrBold      ='Bright White/Blue'
  458.     Case 'Mono'
  459.       Win->LineStyle    ='Double'
  460.       Win->ClrBorder    ='Bright White/Black'
  461.       Win->ClrTitle     ='Bright White/Black'
  462.       Win->ClrShadow    ='Black/White'
  463.       Win->ClrMessage   ='Bright White/Black'
  464.       Win->ClrNormal    ='White/Black'
  465.       Win->ClrLow       ='Blue/Black'
  466.       Win->ClrMedium    ='Bright Cyan/Black'
  467.       Win->ClrHigh      ='Black/White'
  468.       Win->ClrBold      ='Blue/White'
  469.     Case 'RevMono'
  470.       Win->LineStyle    ='Double'
  471.       Win->ClrBorder    ='Black/White'
  472.       Win->ClrTitle     ='Black/Bright White'
  473.       Win->ClrShadow    ='White/Black'
  474.       Win->ClrMessage   ='Black/Bright White'
  475.       Win->ClrNormal    ='Black/White'
  476.       Win->ClrLow       ='Blue/White'
  477.       Win->ClrMedium    ='Black/White'
  478.       Win->ClrHigh      ='Bright White/Black'
  479.       Win->ClrBold      ='Blue/Black'
  480.   Return (Null)
  481.  
  482. EditIni:NewWin(Line)
  483.   New (IniWin:Win)
  484.   Win->Name   = Line
  485.   Return (Win)
  486.  
  487. EditIni:OneLine(Win,LineChars,Row)
  488.   Move:To(Row,4)
  489.   Win:Attr(Win->ClrBorder)
  490.   Str:Put(Str:At(LineChars,4,1))
  491.   Win:Attr(Win->ClrNormal)
  492.   Str:Put(Str:AtSet(Null,1,' ',25))
  493.   Win:Attr(Win->ClrBorder)
  494.   Str:Put(Str:At(LineChars,5,1))
  495.   If (Win->ClrShadow!='Black/Black')
  496.     Win:Attr(Win->ClrShadow)
  497.   Else
  498.     Win:Attr(0)
  499.   Str:Put("  ")
  500.   Return (Ok)
  501.  
  502. EditIni:PrintDo(IniStruct,PrintChoice)
  503.   New (IniPrint:Print)
  504.   Print = IniStruct->PrintList[PrintChoice]
  505.   Win:Add("Printer prompt and device",0,0,8,40,Here)
  506.     Input:"Prompt" Field:"Print->Prompt" Wid:26 Row:2 Col:2
  507.     Group:"&Device" Row:4 Col:2 Len:4 Wid:36
  508.     Radio:"&Screen" Row:5 Col:4
  509.       Check:"Print->Device=='Screen'"
  510.       Action:"Print->Device='Screen'"
  511.       UnAction:"Print->Device=Null"
  512.     Radio:"&File"
  513.       Check:"Print->Device=='File'"
  514.       Action:"Print->Device='File'"
  515.       UnAction:"Print->Device=Null"
  516.  
  517.     Radio:"LPT&1" Row:5 Col:15
  518.       Check:"Print->Device=='LPT1'"
  519.       Action:"Print->Device='LPT1'"
  520.       UnAction:"Print->Device=Null"
  521.     Radio:"LPT&2"
  522.       Check:"Print->Device=='LPT2'"
  523.       Action:"Print->Device='LPT2'"
  524.       UnAction:"Print->Device=Null"
  525.     Radio:"LPT&3"
  526.       Check:"Print->Device=='LPT3'"
  527.       Action:"Print->Device='LPT3'"
  528.       UnAction:"Print->Device=Null"
  529.     Radio:"LPT&4"
  530.       Check:"Print->Device=='LPT4'"
  531.       Action:"Print->Device='LPT4'"
  532.       UnAction:"Print->Device=Null"
  533.  
  534.     Radio:"&COM1" Row:5 Col:28
  535.       Check:"Print->Device=='COM1'"
  536.       Action:"Print->Device='COM1'"
  537.       UnAction:"Print->Device=Null"
  538.     Radio:"COM2"
  539.       Check:"Print->Device=='COM2'"
  540.       Action:"Print->Device='COM2'"
  541.       UnAction:"Print->Device=Null"
  542.     Radio:"COM3"
  543.       Check:"Print->Device=='COM3'"
  544.       Action:"Print->Device='COM3'"
  545.       UnAction:"Print->Device=Null"
  546.     Radio:"COM4"
  547.       Check:"Print->Device=='COM4'"
  548.       Action:"Print->Device='COM4'"
  549.       UnAction:"Print->Device=Null"
  550.  
  551.     Button:"&Ok" Row:10 Col:10 Wid:20 Action:"Null"
  552.   Win:Dsp
  553.   Return (Ok)
  554.  
  555. EditIni:PrintShow(Print)
  556.   Return (Str:Pad(Print->Prompt,16)+" "+Print->Device)
  557.  
  558. EditIni:Read(FileName)
  559.   New (Line,Pos,Value,Ini:IniStruct,IniPrint:Print,PrintCount,IniWin:Win,WinCount)
  560.  
  561.   While (File:Ok(FileName))
  562.     Line  = File:Read(FileName)
  563.     Pos = Str:In(Line,"=")
  564.     If (Pos)
  565.       Value = Str:Aft(Str:At(Line,Pos+1)," ")
  566.     Else
  567.       Value = Null
  568.  
  569.     Switch (Str:At(Line,1,4))
  570.       Case Null
  571.         | Nothing
  572.       Case "Bios"
  573.         IniStruct->Bios = Value
  574.       Case "Mono"
  575.         IniStruct->Monochrome = Value
  576.       Case "Mult"
  577.         IniStruct->Multiuser = Value
  578.       Case "Mem "
  579.         IniStruct->MemStats  = Value
  580.       Case "Deci"
  581.         IniStruct->Decimal   = Value
  582.       Case "Grap"
  583.         IniStruct->Graphics  = Value
  584.       Case "IsXt"
  585.         IniStruct->IsXt      = Value
  586.       Case "Ram "
  587.         IniStruct->Ramdisk   = Value
  588.       Case "Expl"
  589.         IniStruct->Explode   = Value
  590.       Case "Prin"
  591.         ++PrintCount
  592.         Print = EditIni:NewPrint(Value)
  593.         IniStruct->PrintList[PrintCount] = Print
  594.       Case "Wind"
  595.         ++WinCount
  596.         Win = EditIni:NewWin(Value)
  597.         IniStruct->WinList[WinCount] = Win
  598.  
  599.       Case "+Mon"
  600.         Win->MonoColor = Value
  601.       Case "+Lin"
  602.         Win->LineStyle = Value
  603.       Case "+Bor"
  604.         Win->ClrBorder = Value
  605.       Case "+Tit"
  606.         Win->ClrTitle  = Value
  607.       Case "+Sha"
  608.         Win->ClrShadow = Value
  609.       Case "+Mes"
  610.         Win->ClrMessage= Value
  611.       Case "+Nor"
  612.         Win->ClrNormal = Value
  613.       Case "+Low"
  614.         Win->ClrLow    = Value
  615.       Case "+Med"
  616.         Win->ClrMedium = Value
  617.       Case "+Hig"
  618.         Win->ClrHigh   = Value
  619.       Case "+Bol"
  620.         Win->ClrBold   = Value
  621.   Return (IniStruct)
  622.  
  623. EditIni:Scheme(Win,*WorkColor,ArrChoice)
  624.   Win:Add ("Color Schemes",14,46)
  625.     MLine:"&Barbara Blue    "  Action:"EditIni:NewScheme(Win,'Blue')"
  626.     MLine:"&NYC White       "  Action:"EditIni:NewScheme(Win,'White')"
  627.     MLine:"&JORF Default    "  Action:"EditIni:NewScheme(Win,'Default')"
  628.     MLine:"Traffic Cop &Gray"  Action:"EditIni:NewScheme(Win,'Gray')"
  629.     MLine:"Jealous G&reen   "  Action:"EditIni:NewScheme(Win,'Green')"
  630.     MLine:"&Monochrome      "  Action:"EditIni:NewScheme(Win,'Mono')"
  631.     MLine:"&Rev Monochrome  "  Action:"EditIni:NewScheme(Win,'RevMono')"
  632.   EditIni:GetColor(Win,WorkColor,LastChoice)
  633.   Win:Dsp
  634.   Return (Ok)
  635.  
  636. EditIni:SetBkdColor(Win,*WorkColor,Color,ArrChoice)
  637.   WorkColor = Str:AtCut(WorkColor,Str:In(WorkColor,"/")+1) + Color
  638.   EditIni:SetColor(Win,WorkColor,ArrChoice)
  639.   Win:Dsp
  640.   Return (Ok)
  641.  
  642. EditIni:SetColor(Win,*WorkColor,LastChoice)
  643.   Switch (LastChoice)
  644.     Case 1
  645.       Win->ClrNormal = WorkColor
  646.     Case 2
  647.       Win->ClrLow = WorkColor
  648.     Case 3
  649.       Win->ClrMedium = WorkColor
  650.     Case 4
  651.       Win->ClrHigh = WorkColor
  652.     Case 5
  653.       Win->ClrBold = WorkColor
  654.     Case 6
  655.       Win->ClrMessage = WorkColor
  656.     Case 7
  657.       Win->ClrBorder = WorkColor
  658.     Case 8
  659.       Win->ClrTitle = WorkColor
  660.     Case 9
  661.       Win->ClrShadow = WorkColor
  662.   Return (Ok)
  663.  
  664. EditIni:SetForColor(Win,*WorkColor,Color,ArrChoice)
  665.   WorkColor = Color + Str:At(WorkColor,Str:In(WorkColor,"/"))
  666.   EditIni:SetColor(Win,WorkColor,ArrChoice)
  667.   Win:Dsp
  668.   Return (Ok)
  669.  
  670. Editini:Shift_F5_Key
  671.   Jorf:Status
  672.   Jorf:StatusClear
  673.   Return (Ok)
  674.  
  675. EditIni:WinDo(IniStruct,WinChoice)
  676.   New (IniWin:Win)
  677.   Win = Jorf:Dup(IniStruct->WinList[WinChoice])
  678.   Win:Add("JORF Window Options and Colors",0,0,8,40,Here)
  679.     Input:"Name" Field:"Win->Name" Wid:12 Row:2 Col:4
  680.     Group:"Scheme is for" Row:4 Col:2 Len:2 Wid:20
  681.     Radio:"&Monochrome" Row:5 Col:4
  682.       Check:"Win->MonoColor=='Mono'"
  683.       Action:"Win->MonoColor='Mono'"
  684.       UnAction:"Win->MonoColor='Color'"
  685.     Radio:"Co&lor"
  686.       Check:"Win->MonoColor=='Color'"
  687.       Action:"Win->MonoColor='Color'"
  688.       UnAction:"Win->MonoColor='Mono'"
  689.     Group:"DOS Line Style" Row:8 Col:2 Len:4 Wid:20
  690.     Radio:"S&ingle"
  691.       Check:"Win->LineStyle=='Single'"
  692.       Action:"Win->LineStyle='Single'"
  693.       UnAction:"Win->LineStyle=Null"
  694.     Radio:"&Double"
  695.       Check:"Win->LineStyle=='Double'"
  696.       Action:"Win->LineStyle='Double'"
  697.       UnAction:"Win->LineStyle=Null"
  698.     Radio:"&Thick"
  699.       Check:"Win->LineStyle=='Thick'"
  700.       Action:"Win->LineStyle='Thick'"
  701.       UnAction:"Win->LineStyle=Null"
  702.     Radio:"&Blank"
  703.       Check:"Win->LineStyle=='Blank'"
  704.       Action:"Win->LineStyle='Blank'"
  705.       UnAction:"Win->LineStyle=Null"
  706.  
  707.     Group:"Text Colors" Row:1 Col:26 Len:6 Wid:33
  708.     Input:"Normal " Field:"Win->ClrNormal"  Wid:24 Before:"Null"
  709.     Input:"Low    " Field:"Win->ClrLow"     Wid:24 Before:"Null"
  710.     Input:"Medium " Field:"Win->ClrMedium"  Wid:24 Before:"Null"
  711.     Input:"High   " Field:"Win->ClrHigh"    Wid:24 Before:"Null"
  712.     Input:"Bold   " Field:"Win->ClrBold"    Wid:24 Before:"Null"
  713.     Input:"Message" Field:"Win->ClrMessage" Wid:24 Before:"Null"
  714.  
  715.     Group:"DOS Box Colors"     Row:9 Col:26 Len:3 Wid:33
  716.     Input:"Border " Field:"Win->ClrBorder" Wid:24 Before:"Null"
  717.     Input:"Title  " Field:"Win->ClrTitle"  Wid:24 Before:"Null"
  718.     Input:"Shadow " Field:"Win->ClrShadow" Wid:24 Before:"Null"
  719.  
  720.     Button:"&Ok"          Row:14 Col:2  Wid:10 Action:"Return Null"
  721.     Button:"&Cancel"      Row:14 Col:14 Wid:10 Action:"Kbd:Put('Esc_Key')"
  722.     Button:"&Set Colors"  Row:14 Col:29 Wid:30 Action:"EditIni:ColorSet(Win)"
  723.  
  724.   If (Kbd:Got!='Esc_Key')
  725.     IniStruct->WinList[WinChoice] = Win
  726.     Win:Dsp
  727.   Return (Ok)
  728.  
  729. EditINi:WinShow(Win)
  730.   Return (Str:Pad(Win->Name,16)+" "+Win->MonoColor)
  731.  
  732. EditIni:Write(FileName,IniStruct)
  733.   New (I,IniPrint:Print,IniWin:Win)
  734.   File:Del (FileName)
  735.   File:Write (FileName,"Bios       = "+IniStruct->Bios)
  736.   File:Write (FileName,"Monochrome = "+IniStruct->Monochrome)
  737.   File:Write (FileName,"Multiuser  = "+IniStruct->Multiuser)
  738.   File:Write (FileName,"Mem Status = "+IniStruct->Memstats)
  739.   File:Write (FileName,"Decimal    = "+IniStruct->Decimal)
  740.   File:Write (FileName,"Graphics   = "+IniStruct->Graphics)
  741.   File:Write (FileName,"IsXt       = "+IniStruct->IsXT)
  742.   File:Write (FileName,"Ram Disk   = "+IniStruct->Ramdisk)
  743.   File:Write (FileName,"Explode    = "+IniStruct->Explode)
  744.  
  745.   File:Write(FileName)
  746.   For (I = 1 Thru Arr:Len(IniStruct->PrintList))
  747.     Print = IniStruct->PrintList[i]
  748.     File:Write(FileName,"Printer = "+Print->Prompt+", "+print->device)
  749.  
  750.   File:Write(FileName)
  751.   For (I = 1 Thru Arr:Len(IniStruct->WinList))
  752.     Win = IniStruct->WinList[i]
  753.     File:Write(FileName,Null)
  754.     File:Write(FileName,"Window = "+Win->Name)
  755.     File:Write(FileName,"+Mono/Color="+Win->MonoColor)
  756.     File:Write(FileName,"+Line Style="+Win->LineStyle)
  757.     File:Write(FileName,"+Border Color="+Win->ClrBorder)
  758.     File:Write(FileName,"+Title Color="+Win->ClrTitle)
  759.     File:Write(FileName,"+Shadow Color="+Win->ClrShadow)
  760.     File:Write(FileName,"+Message Color="+Win->ClrMessage)
  761.     File:Write(FileName,"+Normal Color="+Win->ClrNormal)
  762.     File:Write(FileName,"+Low Color="+Win->ClrLow)
  763.     File:Write(FileName,"+Med Color="+Win->ClrMedium)
  764.     File:Write(FileName,"+High Color="+Win->ClrHigh)
  765.     File:Write(FileName,"+Bold Color="+Win->ClrBold)
  766.  
  767.   Return (Ok)
  768.  
  769.