:Class Setup ⍝ Script for Personalization of Spice ⎕ML←1 ⋄ ⎕IO←1 rtb←{(-⊥⍨' '=⍵)↓⍵} ∇ r←List :Access Shared Public r←⎕NS'' r.Name←'USetup' r.(Group Parse)←'Spice' '' r.Desc←'Personalize your environment (edit Spice\Setup to do so)' r←,r ∇ ∇ r←Run(Cmd Args);z;la;t;fn;⎕TRAP :Access Shared Public r←0 0⍴'' ⍝ Select action to perform (initially only 'keys' & 'init' are possible but this may be changed) :If 'keys '≡5↑la←⎕SE.Dyalog.Utils.lcase rtb Args setupKeys 5↓la :ElseIf 'init'≡la ⍝ Set the 'set focus to the spice command line' PFKey (change this to personalize it) :If (11>z←1+(⎕PFKEY¨1+⍳9)⍳⊂'')∧'Namespace'≢'⎕se.cbbot'⎕WG'type' ⍝ When this PFkey is hit the 'select' event will happen on this (invisible) button t←('accelerator'(2↑111+z))('event' 'select' '⎕se.cbbot.bandsalt.switch.PFx') ⍝ It is possible that Spice was not initialized in a GUI fashion in which case we skip the following :Trap 0 :If ⎕SE.cbbot.bandsalt.Type≡'CoolBand' '⎕SE.cbbot.bandsalt.switch'⎕WC'button'('posn' ¯2 ¯2)('size' 1 1),t ⍝ Create a function to deal with this fn←'PFx m;GetFocus;GetParent;to' '⎕NA''u user32|GetFocus''⋄⎕NA''u user32|GetParent u''' fn,←⊂'to←''⎕se'',(⎕SE.cbbot.bandsalt.Edit.Handle≢GetParent GetFocus)/''.cbbot.bandsalt.Edit''' fn,←⊂'2 ⎕nq to ''GotFocus''' ⍝ Since this class is unnamed we cannot use 'select' with a name OR EXPRESSION(!) from this namespace ⍝ so we create a fn IN ⎕SE and call it from there: ⎕SE.cbbot.bandsalt.switch.⎕FX fn t←('FontObj'⎕SE.FontObj)('Attach' 'Top' 'Left' 'Top' 'Left') '⎕se.cbbot.bandsalt.Edit'⎕WC'Combo'('Style' 'DropEdit')('Size'(0 ¯150+⎕SE.cbbot.bandsb1.Size)),t ⎕SE.cbbot.bandsalt.Edit.Event←⊂('KeyPress' '⎕SE.SALTUtils.Spice') ⍝ keypress '⎕PFKEY'z'will jump to the Spice command line' :EndIf :EndTrap :EndIf ⍝ Any custom adjustments can be made here. If file Spice/custom exists the fn in it is run :Trap 22 ⎕SE.SALT.Load'Spice/custom -target=',⍕⎕THIS.## ⎕THIS.##.custom :EndTrap :Else r←'Unknown setup request' :EndIf ∇ ∇ r←Help Cmd :Access Shared Public r←⊂'The argument to Setup can be: INIT or KEYS' r,←⊂'INIT: initializes the Spice session' r,←⊂'KEYS: sets the PFkeys' r←↑r ∇ ∇ setupKeys arg;sp :If ''≡arg sp←{d←326=⎕DR ¯1↑v←,⍵ ⋄ v[b/⍳⍴b←v∊'"']←'''' ⋄ ⍺,(v,d↓⊂'ER')⎕PFKEY ⍺} 13 sp'"." ⎕wg "aplversion"' 2 sp'⎕se.SALTUtils.EditorFix "chk"' :EndIf ∇ :EndClass