home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1998-06-24 | 2.4 KB | 133 lines |
- G4C
-
- winbig 116 67 390 78 "User Command List Editor"
- winsmall -1 -1 390 78
- wintype 11110000
- winout nil:
- varpath "climaster/*/usred.g"
-
- xonload
- guiopen user.g
-
- xonopen
- lvuse user.g 1
- ifexists file cmst:config/user.com
- lvchange cmst:config/user.com
- endif
- update user.g 4 0
-
- xonclose
- lvuse climaster $cm_srce
- guiquit usred.g
- guiquit user.g
-
- xonrmb
- guiclose user.g
-
- box 300 13 90 13 in button
-
- xlistview 0 26 300 55 "" extprg "" 0 multi
- gadid 1
- guiwindow user.g wait
- guiopen usred.g
- cutvar extprg cut word 1 cm_gpvar
- extract extprg clean extprg
- extract extprg unquote extprg
- update usred.g 1 $extprg
- setgad usred.g 1 on
-
- xtextin 0 0 300 13 "" extprg "" 512
- gadid 2
- gosub user.g headercheck
-
- xtextin 0 13 300 13 Arguments args "" 512
- gadid 3
- gadtitle right
-
- xcycler 300 26 90 13 "" cm_run
- gadid 4
- cstr "CLI" "[CLI]"
- cstr "RUN" "[RUN]"
-
- xbutton 300 39 90 13 "Add Comm."
- lvuse user.g 1
- if $extprg > ""
- if $cm_run == "[cli]"
- or $cm_run == "[run]"
- lvadd "$cm_run $extprg $args"
- else
- lvadd "$cm_run $extprg"
- setgad user.g 4 on
- update user.g 4 0
- endif
- update user.g 2 ""
- update user.g 3 ""
- lvsave cmst:config/user.com
- endif
-
- xbutton 300 52 90 13 "Del Comm."
- lvmulti first
- if $$lv.line > ''
- while $$lv.line > ''
- lvdel -1
- lvmulti first
- endwhile
- endif
- if $$lv.total > 0
- lvsave cmst:config/user.com
- elseif $$lv.total = 0
- andifexists file cmst:config/user.com
- delete cmst:config/user.com
- endif
-
- xbutton 300 65 90 13 "Del List"
- ifexists file cmst:config/user.com
- ezreq "DELETE LIST: Are You Sure?" "Delete|Cancel" opt
- if $opt = 1
- delete cmst:config/user.com
- lvclear
- endif
- endif
-
- xbutton 300 0 90 13 Command
- update user.g 2 ""
- reqfile -1 -1 240 -60 "Choose Command..." load extprg SYS:
- extract extprg unquote extprg
- update user.g 2 $extprg
- gosub user.g headercheck
-
- xroutine headercheck
- ifexists file $extprg
- if $extprg H= "G4C"
- cm_run = "[GUI]"
- setgad user.g 4 off
- else
- setgad user.g 4 on
- endif
- else
- update user.g 2 ""
- endif
-
- ; -------------------------------------
-
- newfile usred.g
-
- winbig -1 -1 400 13 "Edit User Command"
- wintype 11000000
- varpath 'user.g'
-
- xonclose
- guiwindow user.g resume
- update usred.g 1 ""
-
- xtextin 0 0 400 13 "" extprg "" 512
- gadid 1
- if $extprg > ""
- lvput '$cm_gpvar $extprg'
- lvsave cmst:config/user.com
- endif
- guiwindow user.g resume
- guiclose usred.g
-
- ; -------------------------------------
-