dialog color { title "text changer" size -1 -1 325 300 box "foreground color", 3, 5 5 list 4, 22 23 110 230 button "ok", 1, 140 265 50 25, text "bold", 9, 35 265 25 25 check "" 10, 60 265 15 15, check "" 11, 60 280 15 15, text "underline", 8, 10 280 45 box "background color", 5, 170 list 6, 190 23 110 230 } on *:dialog:color:init:*: { /did -a color 4 none /did -a color 4 white /did -a color 4 black /did -a color 4 dark blue /did -a color 4 dark green /did -a color 4 red /did -a color 4 maroon /did -a color 4 purple /did -a color 4 orange /did -a color 4 yellow /did -a color 4 green /did -a color 4 blue-green /did -a color 4 light blue /did -a color 4 blue /did -a color 4 pink /did -a color 4 dark grey /did -a color 4 light grey /did -ck color 4 %fgstatus /did -a color 6 none /did -a color 6 white /did -a color 6 black /did -a color 6 dark blue /did -a color 6 dark green /did -a color 6 red /did -a color 6 maroon /did -a color 6 purple /did -a color 6 orange /did -a color 6 yellow /did -a color 6 green /did -a color 6 blue-green /did -a color 6 light blue /did -a color 6 blue /did -a color 6 pink /did -a color 6 dark grey /did -a color 6 light grey /did -ck color 6 %bgstatus if (%bold == #) { did -c color 10 } if (%underline == #) { did -c color 11 }
150 250 ok
25 5 150 250
} on *:dialog:color:sclick:10: { if ($did(color,10).state) { /echo #bold# text turned on. /set %bold # } else { /echo #bold# text turned off. /unset %bold } } on *:dialog:color:sclick:11: { if ($did(color,11).state) { /echo #underline# text turned on. /set %underline # } else { /echo #underline# text turned off. /unset %underline } } on *:dialog:color:sclick:13: { /set %color on /echo text changer turned on. } on *:dialog:color:sclick:15: { /unset %color /echo text changer turned off. } on *:dialog:color:sclick:1: { if ($did(color,4,1) != $null) { /write -c test.txt | /write test.txt $did(color,4,1) } if ($did(color,4,2) != $null) { /write test.txt $did(color,4,2) } if ($did(color,4,3) != $null) { /write test.txt $did(color,4,3) } } on *:dialog:color:sclick:4: { if ($did(color,4).sel == 1) { /echo foreground color turned off. | set %foreground none | set %fgstatus 01 } if ($did(color,4).sel == 2) { /echo foreground color switched to white. | set %foreground 00 | set %fgstatus 02 } if ($did(color,4).sel == 3) { /echo foreground color switched to black. | set %foreground 01 | set %fgstatus 03 } if ($did(color,4).sel == 4) { /echo foreground color switched to #02dark blue#. | set %foreground 02 | set %fgstatus 04 } if ($did(color,4).sel == 5) { /echo foreground color switched to #03dark green#. | set %foreground 03 | set %fgstatus 05 } if ($did(color,4).sel == 6) { /echo foreground color switched to #04red#. | set %foreground 04 | set %fgstatus 06 } if ($did(color,4).sel == 7) { /echo foreground color switched to #05maroon#. | set %foreground 05 | set %fgstatus 07 } if ($did(color,4).sel == 8) { /echo foreground color switched to #06purple#. | set %foreground 06 | set %fgstatus 08 } if ($did(color,4).sel == 9) { /echo foreground color switched to #07orange#. | set %foreground 07 | set %fgstatus 09 } if ($did(color,4).sel == 10) { /echo foreground color switched to #08yellow#. | set %foreground 08 | set %fgstatus 10 } if ($did(color,4).sel == 11) { /echo foreground color switched to #09green#. |
set %foreground 09 | set %fgstatus 11 } if ($did(color,4).sel == 12) { /echo foreground color switched to #10bluegreen#. | set %foreground 10 | set %fgstatus 12 } if ($did(color,4).sel == 13) { /echo foreground color switched to #11light blue#. | set %foreground 11 | set %fgstatus 13 } if ($did(color,4).sel == 14) { /echo foreground color switched to #12blue#. | set %foreground 12 | set %fgstatus 14 } if ($did(color,4).sel == 15) { /echo foreground color switched to #13pink#. | set %foreground 13 | set %fgstatus 15 } if ($did(color,4).sel == 16) { /echo foreground color switched to #14dark grey#. | set %foreground 14 | set %fgstatus 16 } if ($did(color,4).sel == 17) { /echo foreground color switched to #15light grey#. | set %foreground 15 | set %fgstatus 17 } } on *:dialog:color:sclick:6: { if ($did(color,6).sel == 1) { /echo background color turned off. | set %background none | set %bgstatus 01 } if ($did(color,6).sel == 2) { /echo background color switched to white. | set %background 00 | set %bgstatus 02 } if ($did(color,6).sel == 3) { /echo background color switched to black. | set %background 01 | set %bgstatus 03 } if ($did(color,6).sel == 4) { /echo background color switched to #02dark blue#. | set %background 02 | set %bgstatus 04 } if ($did(color,6).sel == 5) { /echo background color switched to #03dark green#. | set %background 03 | set %bgstatus 05 } if ($did(color,6).sel == 6) { /echo background color switched to #04red#. | set %background 04 | set %bgstatus 06 } if ($did(color,6).sel == 7) { /echo background color switched to #05maroon#. | set %background 05 | set %bgstatus 07 } if ($did(color,6).sel == 8) { /echo background color switched to #06purple#. | set %background 06 | set %bgstatus 08 } if ($did(color,6).sel == 9) { /echo background color switched to #07orange#. | set %background 07 | set %bgstatus 09 } if ($did(color,6).sel == 10) { /echo background color switched to #08yellow#. | set %background 08 | set %bgstatus 10 } if ($did(color,6).sel == 11) { /echo background color switched to #09green#. | set %background 09 | set %bgstatus 11 } if ($did(color,6).sel == 12) { /echo background color switched to #10bluegreen#. | set %background 10 | set %bgstatus 12 } if ($did(color,6).sel == 13) { /echo background color switched to #11light blue#. | set %background 11 | set %bgstatus 13 } if ($did(color,6).sel == 14) { /echo background color switched to #12blue#. | set %background 12 | set %bgstatus 14 } if ($did(color,6).sel == 15) { /echo background color switched to #13pink#. | set %background 13 | set %bgstatus 15 } if ($did(color,6).sel == 16) { /echo background color switched to #14dark grey#. | set %background 14 | set %bgstatus 16 } if ($did(color,6).sel == 17) { /echo background color switched to #15light grey#. | set %background 15 | set %bgstatus 17 } } on *:input:* { if (($left($1,1) != /) && (%foreground != none) && (%background != none) && ($active != status window)) { msg $active %bold $+ %underline $+ # $+ %foreground $+ , $+ %background $+ $$1- | haltdef } if (($left($1,1) != /) && (%foreground != none) && (%background == none) &&
($active != status window)) { msg $active %bold $+ %underline $+ # $+ haltdef } if (($left($1,1) != /) && (%foreground == ($active != status window)) { msg $active %bold $+ %underline $+ # $+ haltdef } if (($left($1,1) != /) && (%foreground == ($active != status window)) { msg $active %bold $+ %underline $+ $$1} } alias f4 dialog -dm color color }
%foreground $+ , $+ 16 $+ $$1- | none) && (%background != none) && 16 $+ , $+ %background $+ $$1- | none) && (%background == none) && | haltdef