this one is biggy smirk

but i dunno what should it be done to make it work?
i mean, it worked on older mdx, but on last it wont smirk
and please no dcx reccomedations =)

~edit~
just to clarify: code for executing works (when i press i.e. F2 or F5) just this dialog doesnt work and its code.
so when i run it, i see nothing on list inside dialog to edit/remove/add, and nothing to select altho list is loaded into dialog (which you can see on bottom of this post)

Code:
alias Fkeys { if ($dialog(Fkeys)) { halt } | else { dialog -m Fkeys Fkeys } }

dialog Fkeys {
  title "Function Key"
  size -1 -1 160 145
  option dbu
  text "Double click to edit a command.", 1, 4 4 144 6
  list 2, 4 14 152 116, size extsel 
  button "&Close", 4, 128 133 27 10, cancel
  button "&Hide", 99, 0 0 0 0, hide Ok
}

on *:dialog:Fkeys:init:0:{

  did -f $dname 99
  dll $mircdirsystem\dlls\mdx.dll MarkDialog $dname 
  dll $mircdirsystem\dlls\mdx.dll SetMircVersion $version
  dll $mircdirsystem\dlls\mdx.dll SetControlMDX $dname 2 ListView headerdrag report rowselect flatsb showsel nosortheader single > $views 
  did -i $dname 2 1 header @80:1,204 Fkey $chr(9) Command
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 2 12 1 verdana 
  dll $mircdirsystem\dlls\mdx.dll SetFont $dname 1 12 1 verdana 
  var %x = 0 
  :nloop
  inc %x 
  if %x > 36 { goto end } 
  did -a $dname 2 %x $gettok($read(system\fkeys.txt,%x),1,42) $chr(9) $gettok($read(system\fkeys.txt,%x),2,42) 
  goto nloop
  :end
}

on 1:dialog:Fkeys:dclick:*: {
  if ($did == 2) {
    if ($did(fkeys,2).sel == 5) { halt }
    %fkeys.num = $calc($did(fkeys,2).sel - 1)
    %fkeys.command = $gettok($read(system\fkeys.txt,$calc($did(fkeys,2).sel - 1)),2,42)
    %fkeys.fkey = $gettok($read(system\fkeys.txt,$calc($did(fkeys,2).sel - 1)),1,42)
    if ($dialog(Fkeys2)) { .dialog -o fkeys2 fkeys2 } | else { .dialog -m Fkeys2 Fkeys2 }
  }
}

dialog Fkeys2 {
  title "Fkeys"
  size -1 -1 131 36
  option dbu
  edit %fkeys.command, 1, 4 12 124 10, multi return autohs
  button "&Ok", 2, 80 24 24 10, Ok
  text "Enter command to assign to ", 3, 4 4 68 8
  text %fkeys.fkey, 4, 72 4 30 6
  button "&Cancel", 5, 104 24 24 10, cancel
  button "&Hide", 99, 0 0 0 0, hide
}

on *:dialog:Fkeys2:init:0:{

}

on 1:dialog:Fkeys2:sclick:2: { 
  did -o Fkeys 2 $calc(%fkeys.num + 1) $gettok($read(system\fkeys.txt,%fkeys.num),1,42) $chr(9) $did(fkeys2,1)
  write -l $+ %fkeys.num $mircdirsystem\fkeys.txt $gettok($read(system\fkeys.txt,%fkeys.num),1,42) $+ * $+ $did(fkeys2,1)
  unset %fkeys.*
  .dialog -c $dname $dname
}

on 1:dialog:Fkeys2:sclick:5: { 
  unset %fkeys.*
  .dialog -c $dname $dname
}
  


it reads fkeys.txt

so this is stored:

F1*hlp
F2*setup
F3*servers
F4* <reserved to the script routine>
F5*away
F6*email
F7*themes
F8*sounds
F9*news
F10*fquits
F11*
F12*info

and each F-key runs aliases (which arent important here) :P

Last edited by raZOR; 18/02/06 09:29 PM.

IceCapped