@@ -7,7 +7,10 @@ const char_w = txtw(".")
77const lineSpacing = 2 + char_h
88const idxEdit = 6
99const idxFiles = 7
10- const colGrey = rgb( 100 , 100 , 100 )
10+ const colGrey = rgb( 100 , 100 , 100 )
11+ const colBkGnd = rgb( 31 , 28 , 31 )
12+ const colText = 2
13+ const colLink = 3
1114const menu_gap = -(char_w / 2 )
1215const is_sdl = instr(sbver, "SDL" ) != 0
1316const onlineUrl = "http://smallbasic.github.io/samples/index.bas"
@@ -43,8 +46,7 @@ func mk_menu(value, lab, x)
4346 bn.y = ypos * char_h
4447 bn.value = value
4548 bn.label = "[" + lab + "]"
46- bn.color = 3
47- bn.backgroundColor = 0
49+ bn.color = colLink
4850 bn.type = "link"
4951 mk_menu = bn
5052end
@@ -84,8 +86,7 @@ sub do_okay_button(bn_extra)
8486 button.label = "[Close]"
8587 button.x = (xmax - txtw(button.label)) / 2
8688 button.y = ypos * char_h
87- button.backgroundColor = 0
88- button.color = 3
89+ button.color = colLink
8990 button.type = "link"
9091 if (ismap(bn_extra)) then
9192 frm.inputs << bn_extra
@@ -96,9 +97,14 @@ sub do_okay_button(bn_extra)
9697 frm.doEvents()
9798end
9899
100+ sub clear_screen()
101+ color colText, colBkGnd
102+ cls
103+ end
104+
99105sub do_about()
100106 cls
101- color 2 , 0
107+ color colText
102108 if (char_w * 45 < xmax) then
103109 print " ____ _______ ___ _____________"
104110 print " / ____ _ ___ _/ / / _ )/ _ | / __/ _/ ___/"
@@ -110,7 +116,7 @@ sub do_about()
110116 print "__)| | |(_||||_)/--\__)|\_"
111117 endif
112118 print
113- color 7 , 0
119+ color 7
114120 print "Version " ; sbver
115121 print
116122 print "Copyright (c) 2002-2018 Chris Warren-Smith"
@@ -122,26 +128,26 @@ sub do_about()
122128 bn_home.type = "link"
123129 bn_home.isExternal = true
124130 bn_home.label = "https://smallbasic.github.io"
125- bn_home.color = 3
131+ bn_home.color = colLink
126132 print:print
127133
128- color colGrey, 0
134+ color colGrey
129135 print "SmallBASIC comes with ABSOLUTELY NO WARRANTY. " ;
130136 print "This program is free software; you can use it " ;
131137 print "redistribute it and/or modify it under the terms of the " ;
132138 print "GNU General Public License version 2 as published by " ;
133139 print "the Free Software Foundation." + chr( 10 )
134140 print
135- color 7 , 0
141+ color 7
136142 server_info()
137143 do_okay_button(bn_home)
138- cls
144+ clear_screen()
139145end
140146
141147sub do_setup()
142148 local frm
143149
144- color 3 , 0
150+ color 3
145151 cls
146152 print boldOn + "Setup web service port number."
147153 print boldOff
@@ -163,7 +169,7 @@ sub do_setup()
163169 env( "serverToken=" + token)
164170 endif
165171
166- color 3 , 0
172+ color 3
167173 cls
168174 print "Web service port number: " + env( "serverSocket" )
169175 print
@@ -187,8 +193,7 @@ sub do_setup()
187193 local msg = "You must restart SmallBASIC for this change to take effect."
188194 local wnd = window()
189195 wnd.alert(msg, "Restart required" )
190- color 7 , 0
191- cls
196+ clear_screen()
192197end
193198
194199sub server_info()
@@ -422,7 +427,7 @@ sub manageFiles()
422427 bn_files.y = bn_edit.y + char_h + 2
423428 bn_files.height = ymax - bn_files.y
424429 bn_files.width = xmax - x1
425- bn_files.color = 2
430+ bn_files.color = colText
426431 bn_files.type = "list"
427432 bn_files.resizable = TRUE
428433 bn_files.help = "No .bas files in " + cwd
@@ -508,13 +513,14 @@ sub manageFiles()
508513 else
509514 tload selectedFile, buffer
510515 wnd.graphicsScreen2()
516+ color 7
511517 cls
512- color 7 , 0
513518 len_buffer = len(buffer) - 1
514519 for i = 0 to len_buffer
515520 print buffer(i)
516521 next i
517522 do_okay_button(nil)
523+ clear_screen()
518524 wnd.graphicsScreen1()
519525 f.value = selectedFile
520526 endIf
@@ -649,6 +655,7 @@ sub main
649655 path = backPath
650656 end
651657
658+ clear_screen()
652659 path = cwd
653660 frm = makeUI(path, sortDir)
654661
0 commit comments