@@ -34,6 +34,7 @@ const aboutId = "_about"
3434const backId = "_back"
3535const scratchId = "_scratch"
3636const scratch_file = HOME + "/scratch.bas"
37+ const sortEnd = chr( 255 )
3738
3839func mk_menu(value, lab, x)
3940 local bn
@@ -76,16 +77,20 @@ func mk_scratch()
7677 return result
7778end
7879
79- sub do_okay_button(bn_extra )
80+ sub do_okay_button(bn_extra1, bn_extra2 )
8081 local frm, button
8182 button.label = "[Close]"
8283 button.x = (xmax - txtw(button.label)) / 2
8384 button.y = ypos * char_h
8485 button.color = colNav
8586 button.type = "link"
86- if (ismap(bn_extra )) then
87- frm.inputs << bn_extra
87+ if (ismap(bn_extra1 )) then
88+ frm.inputs << bn_extra1
8889 endif
90+ if (ismap(bn_extra2)) then
91+ frm.inputs << bn_extra2
92+ endif
93+
8994 frm.inputs << button
9095 frm = form(frm)
9196 print
@@ -130,6 +135,17 @@ sub do_about()
130135 bn_home.color = colNav
131136 print:print
132137
138+ local bn_privacy
139+ color colNav2
140+ bn_privacy.x = 2
141+ bn_privacy.y = ypos * char_h + char_h + 2
142+ bn_privacy.type = "link"
143+ bn_privacy.isExternal = true
144+ bn_privacy.color = colNav
145+ bn_privacy.label = "https://smallbasic.github.io/pages/privacy.html"
146+ print "Privacy Policy:"
147+ print:print
148+
133149 color colText2
134150 print "SmallBASIC comes with ABSOLUTELY NO WARRANTY. " ;
135151 print "This program is free software; you can use it " ;
@@ -139,7 +155,7 @@ sub do_about()
139155 print
140156 color colText
141157 server_info()
142- do_okay_button(bn_home)
158+ do_okay_button(bn_home, bn_privacy )
143159 clear_screen()
144160end
145161
@@ -215,13 +231,17 @@ end
215231func fileCmpFunc0(l, r)
216232 local f1 = lower(l.name)
217233 local f2 = lower(r.name)
234+ if (right(f1, 4 ) != ".bas" ) then f1 = sortEnd + f1
235+ if (right(f2, 4 ) != ".bas" ) then f2 = sortEnd + f2
218236 local n = iff(f1 == f2, 0 , iff(f1 > f2, 1 , - 1 ))
219237 return iff(l.dir == r.dir, n, iff(l.dir, 1 , - 1 ))
220238end
221239
222240func fileCmpFunc1(l, r)
223241 local f1 = lower(l.name)
224242 local f2 = lower(r.name)
243+ if (right(f1, 4 ) != ".bas" ) then f1 = sortEnd + f1
244+ if (right(f2, 4 ) != ".bas" ) then f2 = sortEnd + f2
225245 local n = iff(f1 == f2, 0 , iff(f1 > f2, - 1 , 1 ))
226246 return iff(l.dir == r.dir, n, iff(l.dir, 1 , - 1 ))
227247end
@@ -270,7 +290,7 @@ sub loadFileList(path, byref basList)
270290 end
271291
272292 func androidWalker(node)
273- if (node.dir == 0 && lower(right(node.name, 4 )) == ".bas" ) then
293+ if (node.dir == 0 ) then
274294 basList << node
275295 endif
276296 return node.depth == 0
@@ -377,7 +397,8 @@ sub listFiles(byref frm, path, sortDir, byref basList)
377397 endif
378398 if (abbr) then
379399 bn = mk_bn(path + name, name, txtcol)
380- bn.type = "link"
400+ bn.type = iff(lower(right(name, 4 )) == ".bas" , "link" , "label" )
401+ if (bn.type == "label" ) then bn.color = colText
381402 if (!node.dir) then bn.isExit = true
382403 else
383404 if (len(name) > 27 ) then
@@ -386,7 +407,8 @@ sub listFiles(byref frm, path, sortDir, byref basList)
386407 lab = name
387408 endif
388409 bn = mk_bn(path + name, lab, txtcol)
389- bn.type = "link"
410+ bn.type = iff(lower(right(name, 4 )) == ".bas" , "link" , "label" )
411+ if (bn.type == "label" ) then bn.color = colText
390412 if (!node.dir) then bn.isExit = true
391413 frm.inputs << bn
392414 gap = 12 - len(str(node.size))
@@ -538,7 +560,7 @@ sub manageFiles()
538560 for i = 0 to len_buffer
539561 print buffer(i)
540562 next i
541- do_okay_button(nil)
563+ do_okay_button(nil, nil )
542564 clear_screen()
543565 wnd.graphicsScreen1()
544566 f.value = selectedFile
0 commit comments