Code: Select all
type btype
as integer x, y, w, h
as string s, g
end type
dim as string s, ifelse
'this will be used to draw a box the size of the form
dim shared box as string
'this four will be used for the buttons. it shouldn't need this many but i haven't got around to changing it
dim shared bstring(300) as btype
dim shared bdraw(300) as btype
dim bif(300) as btype
dim brelease(300) as btype
'this two will be used for the in/out boxes. it should need only one but i haven't got around to changing it
dim shared inbox(300) as btype
dim inboxif(300) as btype
'this one is for the progress bars
dim shared pbar(300) as btype
'this one is for radio buttons
dim shared radio(300) as btype
'this one will be used for check boxes
dim shared cbox(300) as btype
'this one will be used for labels
dim shared label(300) as btype
'this one will be used for slides
dim shared sliderh(300) as btype
dim as integer x, y, x1, y1, w, h, hh, buttons, wheel, boxes, bttns, pbars, cboxs, radios, labels, sliderhs, resx, resy
dim shared as integer i, ii
dim shared as integer bg, fg, sd
'this will draw all the objects that have been made
declare sub drawform
'this draws the color picker everything screen
declare sub drawcolors()
'this draws the buttons on the color picker screen
declare sub bttn(x as integer, y as integer, s as string)
'quotes that will be used in the outputed .bas file
const q = chr(34)
'find out the desktop size and make the window a bit smaller
screeninfo x, y
screenres x - x / 5, y - y / 5
'get the output file name
input "Form name"; s
open s & ".bas" for binary as #1
cls
' draw the color bar
for x = 1 to 738
for y = 60 to 90
pset (x, y), x / 3
next y
next x
'difine the foreground, background and shadow colors
fg = 0: bg = 15: sd = 7
'draw the buttons for the color picker
drawcolors
'mian color picker loop
do
'wait for a mouse click or end the program by clicking the X or hitting Esc
do while buttons < 1
getmouse (x, y, , buttons)
s = inkey$
if s = chr(255) & "k" or s = chr(27) then end
sleep 10
loop
'buttons
'foreground button
if x > 219 and x < 313 and y > 14 and y < 44 then
'hang while the mouse button is still down
getmouse (x, y, , buttons)
do while x > 1 and buttons > 0: getmouse (x, y, , buttons): sleep 10: loop
'color the buttons foreground using the mouses x
do while buttons < 1
getmouse (x, y, , buttons)
'end the program by clicking the X or hitting Esc
s = inkey$
if s = chr(255) & "k" or s = chr(27) then end
'divide x by 3 because each color is made of 3 vertical lines
fg = x / 3
'stop the color from going out of range
if fg > 256 then fg = 0
'draw the buttons for the color picker
drawcolors
sleep 10
loop
elseif x > 323 and x < 417 and y > 14 and y < 44 then
'hang while the mouse button is still down
getmouse (x, y, , buttons)
do while x > 1 and buttons > 0: getmouse (x, y, , buttons): sleep 10: loop
'color the buttons foreground using the mouses x
do while buttons < 1
getmouse (x, y, , buttons)
'end the program by clicking the X or hitting Esc
s = inkey$
if s = chr(255) & "k" or s = chr(27) then end
'divide x by 3 because each color is made of 3 vertical lines
bg = x / 3
'stop the color from going out of range
if bg > 256 then bg = 0
'draw the buttons for the color picker
drawcolors
sleep 10
loop
elseif x > 427 and x < 489 and y > 14 and y < 44 then
'hang while the mouse button is still down
getmouse (x, y, , buttons)
do while x > 1 and buttons > 0: getmouse (x, y, , buttons): sleep 10: loop
'color the buttons foreground using the mouses x
do while buttons < 1
getmouse (x, y, , buttons)
'end the program by clicking the X or hitting Esc
s = inkey$
if s = chr(255) & "k" or s = chr(27) then end
'divide x by 3 because each color is made of 3 vertical lines
sd = x / 3
'stop the color from going out of range
if sd > 256 then sd = 0
'draw the buttons for the color picker
drawcolors
sleep 10
loop
elseif x > 547 and x < 593 and y > 14 and y < 44 then
exit do
end if
sleep 10
getmouse (x, y, , buttons)
do while x > 1 and buttons > 0: getmouse (x, y, , buttons): sleep 10: loop
loop
'hang while the mouse button is still down
getmouse (x, y, , buttons)
do while x > 1 and buttons > 0: getmouse (x, y, , buttons): sleep 10: loop
'clear the screen
cls
'form size picker
do while buttons < 1
getmouse (resx, resy, , buttons)
'end the program by clicking the X or hitting Esc
s = inkey$
if s = chr(255) & "k" or s = chr(27) then end
'write the form size in the midle of the box
color 15, 0: locate resy/2/9,resx/2/8 - 5
print using "#### : ####"; resx; resy
'draw the form size box up and left from the curser
line (0, 0)-(resx, 0), 15
line (0, 0)-(0, resy), 15
line (0, resy)-(resx, resy), 15
line (resx, 0)-(resx, resy), 15
sleep 10
'clear the screen
cls
loop
'hang while the mouse button is still down
getmouse (resx, resy, , buttons)
do while resx > 1 and buttons > 0: getmouse (resx, resy, , buttons): sleep 10: loop
'make the form using chosen color and size + plus some
screenres resx + 10, resy + 25, 8
color fg, bg
'clear the screen
cls
'start the objects(button, boxes etc.) at 1 in the arrays
boxes = 1
bttns = 1
pbars = 1
cboxs = 1
radios = 1
labels = 1
sliderhs = 1
'draw a the size of the form
box = "C" & fg & "BM5,20 D" & resy & "R" & resx & "U" & resy & "L" & resx
'main loop for the object picker/placer
do while inkey$ = ""
'loop until a button is preesed
do
s = inkey$
'end the program and build the .bas file by clicking the X or hitting Esc
if s = chr(255) & "k" or s = chr(27) then
print #1, "dim as integer x, y, buttons, i";
'print the progress bar's state variable if there was a progress bar placed
if pbar(1).x > 0 then
print #1, ", pbarstate"
else
print #1,
end if
print #1, "dim as string s"
print #1,
'prints the radiogroup variable if a radio button was placed (not yet used)
if radio(1).x > 0 then print #1, "dim radiogroup(30) as integer": print #1,
'an array for use with check boxes
if cbox(1).x > 0 then print #1, "dim checkbox(" & cboxs - 1 & ") as integer": print #1,
'declare the subs
print #1, "declare sub bttn(x as integer, y as integer, s as string)"
print #1, "declare sub buttonup(x as integer, y as integer, s as integer)"
print #1, "declare sub buttondown(x as integer, y as integer, s as integer)"
print #1, "declare sub inbox(x as integer, y as integer, w as integer, h as integer)"
print #1, "declare sub clearbox(x as integer, y as integer)"
print #1, "declare sub pbar(x as integer, y as integer, w as integer, state as double)"
print #1, "declare sub cbox(x as integer, y as integer, check as integer)"
print #1, "declare sub label(x as integer, y as integer, s as string)"
print #1, "declare sub radio(x as integer, y as integer, fill as integer)"
print #1, "declare function sliderh(x as integer, y as integer, w as integer) as integer"
print #1,
print #1, "screenres " & resx & "," & resy
print #1, "color " & fg & ", " & bg
print #1, "cls"
print #1,
'outputs lines that draw the buttons
for i = 1 to 300
if bdraw(i).x = 0 then exit for
print #1, "bttn (" & bdraw(i).x - 5 & ", " & bdraw(i).y - 20 & ", " & q & bstring(i).s & q & ")" & " 'Button #" & i
next i
'outputs lines that draw the in/out boxes
for i = 1 to 300
if inbox(i).x = 0 then exit for
print #1, "inbox (" & inbox(i).x - 5 & ", " & inbox(i).y - 20 & ", " & inbox(i).w & ", " & inbox(i).h & ")" & " 'In/Out box #" & i
next i
'outputs lines that draw the progress bars
for i = 1 to 300
if pbar(i).x = 0 then exit for
print #1, "pbar (" & pbar(i).x - 5 & ", " & pbar(i).y - 20 & ", " & pbar(i).w & ", pbarstate)" & " 'Progrees bar #" & i
next i
'outputs lines that draw the radio buttons
for i = 1 to 300
if radio(i).x = 0 then exit for
print #1, "radio (" & radio(i).x - 5 & ", " & radio(i).y - 20 & ", 0)" & " 'Radio button #" & i & " Group #" & radio(i).g
next i
'outputs lines that draw the check boxes
for i = 1 to 300
if cbox(i).x = 0 then exit for
print #1, "cbox (" & cbox(i).x - 5 & ", " & cbox(i).y - 20 & ", 0)" & " 'Check box #" & i
next i
'outputs lines that draw the labels
for i = 1 to 300
if label(i).x = 0 then exit for
print #1, "label (" & label(i).x - 5 & ", " & label(i).y - 20 & ", " & q & label(i).s & q & ")" & " 'Label #" & i
next i
'outputs lines that draw the sliders
for i = 1 to 300
if sliderh(i).x = 0 then exit for
print #1, "i = sliderh (" & sliderh(i).x - 5 & ", " & sliderh(i).y - 20 & ", " & sliderh(i).w & ")" & " 'Slider #" & i
next i
print #1,
print #1, "do"
print #1, " do while buttons < 1"
print #1, " getmouse (x, y, , buttons)"
print #1, " s = inkey$"
print #1, " if s = chr(255) & " & q & "k" & q & " or s = chr(27) then end"
print #1, " sleep 10"
print #1, " loop"
print #1,
'prints out the if statments for the buttons
if bttns > 1 then print #1, "'BUTTONS========================================================"
ifelse = " if x > "
for i = 1 to 300
if bif(i).x = 0 then exit for
print #1, "'" & bstring(i).s
print #1, ifelse & bif(i).x - 5 & " and x < " & bif(i).x + bif(i).w - 1 & " and y > " & bif(i).y - 20 & " and y < " & bif(i).y + 10 & " then" & chr(13) & " buttondown (" & bif(i).x - 2 & ", " & bif(i).y + 9 & ", " & bif(i).w & ")"
print #1, " "
ifelse = " elseif x > "
next i
if boxes > 1 then print #1, "'IN/OUT BOXES==================================================="
if bttns > 1 then
ifelse = " elseif x > "
else
ifelse = " if x > "
end if
'prints out the if statments for the in/out boxes
for i = 1 to 300
if inboxif(i).x = 0 then exit for
print #1, "'Box #" & i
print #1, ifelse & inboxif(i).x - 5 & " and x < " & inboxif(i).x + inboxif(i).w - 1 & " and y > " & inboxif(i).y - 20 & " and y < " & inbox(i).h + inboxif(i).y - 17 & " then" & chr(13) & " 'clearbox (" & inboxif(i).x - 2 & ", " & inboxif(i).y - 17 & ")"
print #1, " 'locate " & cint(inboxif(i).y / 8) & ", " & 1 + cint(inboxif(i).x / 8) & ": color " & fg & "," & bg & ": print " & q & "???" & q
print #1, " "
ifelse = " elseif x > "
next i
if radios > 1 then print #1, "'RADIO BUTTONS=================================================="
if bttns > 1 or boxes > 1 then
ifelse = " elseif x > "
else
ifelse = " if x > "
end if
'prints out the if statments for the radio buttons
for i = 1 to 300
if radio(i).x = 0 then exit for
print #1, "'Radio button #" & i
print #1, ifelse & radio(i).x - 12 & " and x < " & radio(i).x + 2 & " and y > " & radio(i).y - 25 & " and y < " & radio(i).y - 11 & " then"
print #1, " ";
for ii = 1 to 300
if radio(ii).g = radio(i).g then
print #1, "radio (" & radio(ii).x - 5 & ", " & radio(ii).y - 20 & ", 0): ";
end if
next ii
print #1, "radio (" & radio(i).x - 5 & ", " & radio(i).y - 20 & ", 1)"
print #1, " "
ifelse = " elseif x > "
next i
if cboxs > 1 then print #1, "'CHECK BOXES===================================================="
if bttns > 1 or boxes > 1 or radios > 1 then
ifelse = " elseif x > "
else
ifelse = " if x > "
end if
'prints out the if statments for the check boxes
for i = 1 to 300
if cbox(i).x = 0 then exit for
print #1, "'Chech box #" & i
print #1, ifelse & cbox(i).x - 5 & " and x < " & cbox(i).x + 10 & " and y > " & cbox(i).y - 13 & " and y < " & cbox(i).y + 2 & " then" & chr(13) & " if checkbox(" & i & ") = 1 then" & chr(13) & " cbox ("& cbox(i).x - 5 & ","& cbox(i).y - 20 & ", 0)" & chr(13) & " checkbox(" & i & ") = 0" & chr(13)
print #1, " elseif checkbox(" & i & ") = 0 then" & chr(13) & " cbox ("& cbox(i).x - 5 & ", "& cbox(i).y - 20 & ", 1)" & chr(13) & " checkbox(" & i & ") = 1" & chr(13) & " end if"
print #1, " "
ifelse = " elseif x > "
next i
if cboxs > 1 then print #1, "'SLIDERS===================================================="
if bttns > 1 or boxes > 1 or radios > 1 then
ifelse = " elseif x > "
else
ifelse = " if x > "
end if
'prints out the if statments for the check boxes
for i = 1 to 300
if sliderh(i).x = 0 then exit for
print #1, "'sliderh #" & i
print #1, ifelse & sliderh(i).x - 5 & " and x < " & sliderh(i).x + w & " and y > " & sliderh(i).y - 15 & " and y < " & sliderh(i).y + 5 & " then"
print #1, " i = sliderh (" & sliderh(i).x - 5 & ", " & sliderh(i).y - 20 & ", " & sliderh(i).w & ")"
print #1, " "
ifelse = " elseif x > "
next i
print #1, " end if"
print #1,
print #1, " sleep 10"
print #1, " getmouse (x, y, , buttons)"
print #1, " do while x > 1 and buttons > 0: getmouse (x, y, , buttons): sleep 10: loop"
'prints out the button up lines if there are buttons
for i = 1 to 300
if brelease(i).x = 0 then exit for
print #1, " buttonup (" & brelease(i).x & "," & brelease(i).y & "," & brelease(i).w & ")"
next i
print #1, "loop"
print #1,
'prints out the subs
print #1, "sub bttn(x as integer, y as integer, s as string)" & chr(13) & " dim as integer w" & chr(13) & " w = len(s) * 8 + 10" & chr(13) & " draw string (x + 8, y + 10), s" & chr(13) & " draw " & q & "C" & fg & " BM" & q & " & x & " & q & "," & q & " & y & " & q & "D26 R D R D R" & q & " & w & " & q & "U R U R U26 L U L U L" & q & " & w & " & q & "D L D L C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 1 & " & q & "BD26 BR BD BR BD R" & q & " & w & " & q & "U R U R U26 C" & fg & q & chr(13) & "end sub"
print #1,
print #1, "sub buttonup(x as integer, y as integer, w as integer)" & chr(13) & " draw " & q & "C" & bg & " BM" & q & " & x & " & q & "," & q & " & y & " & q & "U24 R U R U R" & q & " & w - 2 & " & q & "C" & sd & " BM" & q & " & x + 2 & " & q & "," & q & " & y + 4 & " & q & "R" & q & " & w & " & q & "U R U R U26" & q & chr(13) & "end sub"
print #1,
print #1, "sub buttondown(x as integer, y as integer, w as integer)" & chr(13) & " draw " & q & "C" & bg & " BM" & q & " & x & " & q & "," & q & " & y & " & q & " R " & q & " & w & " & q & " U R U R U26 C" & sd & " BM" & q & " & x - 2 & " & q & "," & q & " & y - 4 & " & q & " U24 R U R U R" & q & " & w - 2" & chr(13) & "end sub"
print #1,
print #1, "sub inbox(x as integer, y as integer, w as integer, h as integer)" & chr(13) & " draw " & q & "C" & fg & " BM" & q & " & x & " & q & "," & q & " & y & " & q & " D" & q & " & h & " & q & " R D R D R" & q & " & w & " & q & " U R U R U" & q & " & h & " & q & " L U L U L" & q & " & w & " & q & " D L D L C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 1 & " & q & " D" & q & " & h - 2 & " & q & " R D R D R" & q & " & w - 2 & " & q & " U R U R U" & q & " & h - 2 & " & q & " L U L U L" & q & " & w - 2 & " & q & "D L D" & q & chr(13) & "end sub"
print #1,
print #1, "sub clearbox(x as integer, y as integer)" & chr(13) & " draw " & q & "BM" & q & " & x & " & q & "," & q & " & y & " & q & "P" & bg & "," & sd & " C" & fg & q & chr(13) & "end sub"
print #1,
print #1, "sub pbar(x as integer, y as integer, w as integer, state as double)" & chr(13) & " dim as integer i" & chr(13) & " state = state / 100" & chr(13) & " screenlock"& chr(13) & " draw " & q & " C" & fg & " BM" & q & " & x & " & q & "," & q & " & y & " & q & " D26 R" & q & " & w + 4 & " & q & " U26 L" & q & " & w + 4 & " & q & " C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 1 & " & q & " D24 R" & q & " & w + 2 & " & q & " U24 L" & q & " & w + 2 & "& q & "BM" & q & " & x + 4 & " & q & "," & q & " & y + 4 & " & q & "P" & bg & ","& sd & q
print #1, " for i = 0 to w * state" & chr(13) & " line (x + 2 + i, y + 2)-(x + i + 2, y + 24)," & fg & chr(13) & " next i" & chr(13) & " if state > .5 then" & chr(13) & " draw string (x - 8 + w / 2, y + 10), str(cint(state * 100)) & " & q & "%" & q & "," & bg & chr(13) & " else" & chr(13) & " draw string (x - 8 + w / 2, y + 10), str(cint(state * 100)) & " & q & "%" & q & "," & fg & chr(13) & " end if" & chr(13) & " screenunlock" & chr(13) & "end sub"
print #1,
print #1, "sub cbox(x as integer, y as integer, check as integer)" & chr(13) & " draw " & q & "C" & fg & " BM" & q & " & x & " & q & "," & q & " & y + 5 & " & q & " D15 R15 U15 L14 D C" & sd & " D13 R13 U13 L13" & q & chr(13) & " if check = 1 then" & chr(13) & " line (x + 3, y + 8)-(x + 12, y + 17), " & fg & chr(13) & " line (x + 12, y + 8)-(x + 3, y + 17), " & fg & chr(13) & " elseif check = 0 then"
print #1, " line (x + 3, y + 8)-(x + 12, y + 17), " & bg & chr(13) & " line (x + 12, y + 8)-(x + 3, y + 17), " & bg & chr(13) & " end if" & chr(13) & "end sub"
print #1,
print #1, "sub label(x as integer, y as integer, s as string)" & chr(13) & " draw string (x, y), s, " & fg & chr(13) & "end sub"
print #1,
print #1, "sub radio(x as integer, y as integer, fill as integer)" & chr(13) & " circle (x, y), 6," & fg & chr(13) & " circle (x, y), 3," & fg & chr(13) & " if fill = 1 then" & chr(13) & " draw " & q & "BM" & q & " & x & " & q & "," & q & " & y & " & q & "P" & sd & "," & fg & q & chr(13) & " else" & chr(13) & " draw " & q & "BM" & q & " & x & " & q & "," & q & " & y & " & q & "P" & bg & "," & fg & q & chr(13) & " end if" & chr(13) & "end sub"
print #1,
print #1, "function sliderh(x as integer, y as integer, w as integer) as integer" & chr(13) & " dim as integer buttons, y1, x1" & chr(13) & " draw " & q & "C" & fg & " BM" & q & " & x + 0 & " & q & "," & q & " & y + 3 & " & q & " D20 R" & q & " & w + 4 & " & q & " U20 L" & q & " & w + 4 & " & q & " C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 4 & " & q & " D18 R" & q & " & w + 2 & " & q & " U18 L" & q & " & w + 2"
print #1, " do" & chr(13) & " screenlock" & chr(13) & " getmouse (x1, y1, , buttons)" & chr(13) & " if x1 < x + 10 then x1 = x + 10" & chr(13) & " draw" & q & "C" & fg & " BM" & q & " & x + 0 & " & q & "," & q & " & y + 3 & " & q & " D20 R" & q & " & w + 4 & " & q & " U20 L" & q & " & w + 4 & " & q & " C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 4 & " & q & " D18 R" & q & " & w + 2 & " & q & " U18 L" & q & " & w + 2"
print #1, " if x1 > x + w - 6 then x1 = x + w - 6" & chr(13) & " draw " & q & "BM" & q & " & x + 2 & " & q & "," & q & " & y + 6 & " & q & "P" & bg & "," & sd & q & chr(13) & " draw " & q & "BM" & q & " & x + 2 & " & q & "," & q & " & y + 6 & " & q & "P" & bg & "," & fg & " C" & fg & " BM" & q & " & x + 0 & " & q & "," & q & " & y + 3 & " & q & " D20 R" & q & " & w + 4 & " & q & " U20 L" & q & " & w + 4 & " & q & " C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 4 & " & q & " D18 R" & q & " & w + 2 & " & q & " U18 L" & q & " & w + 2" & chr(13) & " circle (x1, y + 13), 8," & fg & chr(13) & " draw " & q & "BM" & q & " & x1 & " & q & "," & q & " & y + 13 & " & q & "P" & sd & "," & fg & "C" & fg & q
print #1, " screenunlock" & chr(13) & " sleep 10" & chr(13) & " loop while x > 1 and buttons > 0" & chr(13) & " return 100 * (x1 - x - 10) / (w - 16)" & chr(13) & "end function"
print #1,
'print #1, "function sliderv(x as integer, y as integer, w as integer) as integer" & chr(13) & " dim as integer buttons, y1, x1" & chr(13) & " draw " & q & "C" & fg & " BM" & q & " & x + 3 & " & q & "," & q & " & y + 0 & " & q & " D" & q & " & w + 4 & " & q & "R20 U" & q & w + 4 & " L20" & q & " C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 4 & " & q & " D18 R" & q & " & w + 2 & " & q & " U18 L" & q & " & w + 2"
'print #1, " do" & chr(13) & " screenlock" & chr(13) & " getmouse (x1, y1, , buttons)" & chr(13) & " if x1 < x + 10 then x1 = x + 10" & chr(13) & " draw" & q & "C" & fg & " BM" & q & " & x + 0 & " & q & "," & q & " & y + 3 & " & q & " D20 R" & q & " & w + 4 & " & q & " U20 L" & q & " & w + 4 & " & q & " C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 4 & " & q & " D18 R" & q & " & w + 2 & " & q & " U18 L" & q & " & w + 2"
'print #1, " if x1 > x + w - 6 then x1 = x + w - 6" & chr(13) & " draw " & q & "BM" & q & " & x + 2 & " & q & "," & q & " & y + 6 & " & q & "P" & bg & "," & sd & q & chr(13) & " draw " & q & "BM" & q & " & x + 2 & " & q & "," & q & " & y + 6 & " & q & "P" & bg & "," & fg & " C" & fg & " BM" & q & " & x + 0 & " & q & "," & q & " & y + 3 & " & q & " D20 R" & q & " & w + 4 & " & q & " U20 L" & q & " & w + 4 & " & q & " C" & sd & " BM" & q & " & x + 1 & " & q & "," & q & " & y + 4 & " & q & " D18 R" & q & " & w + 2 & " & q & " U18 L" & q & " & w + 2" & chr(13) & " circle (x1, y + 13), 8," & fg & chr(13) & " draw " & q & "BM" & q & " & x1 & " & q & "," & q & " & y + 13 & " & q & "P" & sd & "," & fg & "C" & fg & q
'print #1, " screenunlock" & chr(13) & " sleep 10" & chr(13) & " loop while x > 1 and buttons > 0" & chr(13) & " return 100 * (x1 - x - 10) / (w - 16)" & chr(13) & "end function"
close #1
end
end if
'lock the screen, clear it and redraw it
screenlock
cls
drawform
screenunlock
sleep 10
loop while s = ""
'BUTTONS
'place a button
if s = "1" then
'color using the chosen colors
color fg, bg: locate 2, 1
'get the button text
input "Button text"; s
getmouse (x, y, , buttons)
'loop and draw the button where ever the mouse is
do while buttons < 1
getmouse (x, y, , buttons)
'snap the object to make it easier to aline and easier to use the "Input" and "Print" in the outputed .bas file
x1 = cint(x / 8) * 8
y1 = cint(y / 8) * 8 + 2
'find out how wide to make the button using the amount of characters in the string
w = len(s) * 8 + 10
'lock the screen, draw the object where the mouse is, draw the rest of the objects and draw x and y lines to help aline the objects
screenlock
'clear the screen
cls
'write the x and y(-5 and - 20 because form is out and down) using the chosen colors
color fg, bg: locate 1,1
print using "##### : ##### : # "; x1 - 5; y1 - 20; buttons
'draw the button text down and right from the x and y
draw string (x1 + 8, y1 + 10), s, fg
'draw the button with shadow using the chosen colors
draw "C" & fg & "BM" & x1 & "," & y1 & " D26 R D R D R" & w & " U R U R U26 L U L U L" & w & " D L D L C" & sd & " C" & sd & "BM" & x1 + 1 & "," & y1 + 1 & " BD26 BR BD BR BD R" & w & " U R U R U26 C0"
'draw the rest of the objects
drawform
'draw the x and y lines to help aline the objects
line (5, y1 - 2)-(resx + 5, y1 - 2), fg
line (x1, 20)-(x1, resy + 20), fg
screenunlock
sleep 20
loop
'load the arrays with the info
bstring(bttns).x = x1 + 8: bstring(bttns).y = y1 + 10: bstring(bttns).s = s
bdraw(bttns).x = x1: bdraw(bttns).y = y1: bdraw(bttns).w = w
bif(bttns).x = x1: bif(bttns).y = y1: bif(bttns).w = w
brelease(bttns).x = x1 - 4: brelease(bttns).y = y1 + 5: brelease(bttns).w = w
'increment the object number
bttns += 1
end if
'BOXES
'place an input/output box
if s = "2" then
'color using the chosen colors
color fg, bg: locate 1, 1
'get the size of the box
input "Box width"; i
input "Box hight"; hh
'clear the screen
cls
'fill "s" with spaces so we can use this: "w = len(s) * 8 + 11" to find the width
s = space(i - 1)
getmouse (x, y, , buttons)
'loop and draw the box where ever the mouse is
do while buttons < 1
getmouse (x, y, , buttons)
'snap the object to make it easier to aline and easier to use the "Input" and "Print" in the outputed .bas file
x1 = cint(x / 8) * 8
y1 = cint(y / 8) * 8 + 2
'find out how wide to make the box using the amount of spaces in the string
w = len(s) * 8 + 11
'I forget what this does lol
if hh = 0 then hh = 1
h = 18 + 8 * hh
'lock the screen, draw the object where the mouse is, draw the rest of the objects and draw x and y lines to help aline the objects
screenlock
'clear the screen
cls
'write the x and y(-5 and - 20 because form is out and down) using the chosen colors
color fg, bg: locate 1,1
print using "##### : ##### : # "; x1 - 5; y1 - 20; buttons
'draw the box with inside shadow using the chosen colors
draw "C" & fg & " BM" & x1 & "," & y1 & " D" & h & " R D R D R" & w & " U R U R U" & h & " L U L U L" & w & " D L D L C" & sd & " BM" & x1 + 1 & "," & y1 + 1 & " D" & h - 2 & " R D R D R" & w - 2 & " U R U R U" & h - 2 & " L U L U L" & w - 2 & "D L D"
'draw the rest of the objects
drawform
'draw the x and y lines to help aline the objects
line (5, y1 - 2)-(resx + 5, y1 - 2), fg
line (x1, 20)-(x1, resy + 20), fg
screenunlock
sleep 20
loop
'load the arrays with the info
inbox(boxes).x = x1: inbox(boxes).y = y1: inbox(boxes).w = w: inbox(boxes).h = h
inboxif(boxes).x = x1: inboxif(boxes).y = y1: inboxif(boxes).w = w: inboxif(boxes).h = h
'increment the object number
boxes += 1
end if
'PROGRESS BARS
'place a progress bar
if s = "3" then
'color using the chosen colors
color fg, bg: locate 2, 1
'get the width of the bar
input "Bar width"; i
'clear the screen
cls
'fill "s" with spaces so we can use this: "w = len(s) * 8 + 11" to find the width
s = space(i - 1)
getmouse (x, y, , buttons)
'loop and draw the bar where ever the mouse is
do while buttons < 1
getmouse (x, y, , buttons)
'snap the object to make it easier to aline and easier to use the "Input" and "Print" in the outputed .bas file
x1 = cint(x / 8) * 8
y1 = cint(y / 8) * 8 + 2
'find out how wide to make the box using the amount of spaces in the string
w = len(s) * 8 + 11
'lock the screen, draw the object where the mouse is, draw the rest of the objects and draw x and y lines to help aline the objects
screenlock
'clear the screen
cls
'write the x and y(-5 and - 20 because form is out and down) using the chosen colors
color fg, bg: locate 1,1
print using "##### : ##### : # "; x1 - 5; y1 - 20; buttons
'draw the bar with inside shadow using the chosen colors
draw "C" & fg & " BM" & x1 & "," & y1 & " D26 R" & w + 4 & " U26 L" & w + 4 & " C" & sd & " BM" & x1 + 1 & "," & y1 + 1 & " D24 R" & w + 2 & " U24 L" & w + 2
'draw the rest of the objects
drawform
'draw the x and y lines to help aline the objects
line (5, y1 - 2)-(resx + 5, y1 - 2), fg
line (x1, 20)-(x1, resy + 20), fg
screenunlock
sleep 20
loop
'load the arrays with the info
pbar(pbars).x = x1: pbar(pbars).y = y1: pbar(pbars).w = w
'increment the object number
pbars += 1
end if
'RADIO BUTTONS
'place a radio button
if s = "4" then
'color using the chosen colors
color fg, bg: locate 2, 1
'get the width of the bar
input "Group #"; radio(radios).g
'clear the screen
cls
getmouse (x, y, , buttons)
'loop and draw the radio button where ever the mouse is
do while buttons < 1
getmouse (x, y, , buttons)
'snap the object to make it easier to aline and easier to use the "Input" and "Print" in the outputed .bas file
x1 = cint(x / 8) * 8
y1 = cint(y / 8) * 8 + 2
'lock the screen, draw the object where the mouse is, draw the rest of the objects and draw x and y lines to help aline the objects
screenlock
'clear the screen
cls
'write the x and y(-5 and - 20 because form is out and down) using the chosen colors
color fg, bg: locate 1,1
print using "##### : ##### : # "; x1 - 5; y1 - 20; buttons
'draw the radio button with inside shadow using the chosen colors
circle (x1 + 7, y1 + 13), 6, fg
circle (x1 + 7, y1 + 13), 3, fg
'draw the rest of the objects
drawform
'draw the x and y lines to help aline the objects
line (5, y1 - 2)-(resx + 5, y1 - 2), fg
line (x1, 20)-(x1, resy + 20), fg
screenunlock
sleep 20
loop
'load the arrays with the info
radio(radios).x = x1 + 7: radio(radios).y = y1 + 13
'increment the object number
radios += 1
end if
'CHECK BOXES
'place a check box
if s = "5" then
getmouse (x, y, , buttons)
'loop and draw the check box where ever the mouse is
do while buttons < 1
getmouse (x, y, , buttons)
'snap the object to make it easier to aline and easier to use the "Input" and "Print" in the outputed .bas file
x1 = cint(x / 8) * 8
y1 = cint(y / 8) * 8 + 2
'lock the screen, draw the object where the mouse is, draw the rest of the objects and draw x and y lines to help aline the objects
screenlock
'clear the screen
cls
'write the x and y(-5 and - 20 because form is out and down) using the chosen colors
color fg, bg: locate 1,1
print using "##### : ##### : # "; x1 - 5; y1 - 20; buttons
'draw the check box with inside shadow using the chosen colors
draw "C" & fg & " BM" & x1 & "," & y1 + 5 & " D15 R15 U15 L14 D C" & sd & " D13 R13 U13 L13"
'draw the X in the check box
line (x1 + 3, y1 + 8)-(x1 + 12, y1 + 17), fg
line (x1 + 12, y1 + 8)-(x1 + 3, y1 + 17), fg
'draw the rest of the objects
drawform
'draw the x and y lines to help aline the objects
line (5, y1 - 2)-(resx + 5, y1 - 2), fg
line (x1, 20)-(x1, resy + 20), fg
screenunlock
sleep 20
loop
'load the arrays with the info
cbox(cboxs).x = x1: cbox(cboxs).y = y1
'increment the object number
cboxs += 1
end if
'LABELS
'place a label
if s = "6" then
'color using the chosen colors
color fg, bg: locate 2, 1
'get the label text
input "Label text"; s
getmouse (x, y, , buttons)
'loop and draw the label where ever the mouse is
do while buttons < 1
getmouse (x, y, , buttons)
'snap the object to make it easier to aline and easier to use the "Input" and "Print" in the outputed .bas file
x1 = cint(x / 8) * 8
y1 = cint(y / 8) * 8 + 2
'lock the screen, draw the object where the mouse is, draw the rest of the objects and draw x and y lines to help aline the objects
screenlock
'clear the screen
cls
'write the x and y(-5 and - 20 because form is out and down) using the chosen colors
color fg, bg: locate 1,1
print using "##### : ##### : # "; x1 - 5; y1 - 20; buttons
'draw the label using the chosen colors
draw string (x1 + 8, y1 + 10), s, fg
'draw the x and y lines to help aline the objects
drawform
'draw the x and y lines to help aline the objects
line (5, y1 - 2)-(resx + 5, y1 - 2), fg
line (x1, 20)-(x1, resy + 20), fg
screenunlock
sleep 20
loop
'load the arrays with the info
label(labels).x = x1 + 8: label(labels).y = y1 + 10: label(labels).s = s
'increment the object number
labels += 1
end if
'SLIDERS
'place a slider
if s = "7" then
'color using the chosen colors
color fg, bg: locate 2, 1
'get the width of the bar
input "Slider width"; i
'clear the screen
cls
'fill "s" with spaces so we can use this: "w = len(s) * 8 + 11" to find the width
s = space(i - 1)
getmouse (x, y, , buttons)
'loop and draw the bar where ever the mouse is
do while buttons < 1
getmouse (x, y, , buttons)
'snap the object to make it easier to aline and easier to use the "Input" and "Print" in the outputed .bas file
x1 = cint(x / 8) * 8
y1 = cint(y / 8) * 8 + 2
'find out how wide to make the box using the amount of spaces in the string
w = len(s) * 8 + 11
'lock the screen, draw the object where the mouse is, draw the rest of the objects and draw x and y lines to help aline the objects
screenlock
'clear the screen
cls
'write the x and y(-5 and - 20 because form is out and down) using the chosen colors
color fg, bg: locate 1,1
print using "##### : ##### : # "; x1 - 5; y1 - 20; buttons
'draw the bar with inside shadow using the chosen colors
draw " BM" & x1 + 0 & "," & y1 + 3 & " D20 R" & w + 4 & " U20 L" & w + 4 & " C" & sd & " BM" & x1 + 1 & "," & y1 + 4 & " D18 R" & w + 2 & " U18 L" & w + 2
circle (x1 + 10, y1 + 13), 8, fg
draw "BM" & x1 + 10 & "," & y1 + 13 & "P" & sd & "," & fg & "C0"
'draw the rest of the objects
drawform
'draw the x and y lines to help aline the objects
line (5, y1 - 2)-(resx + 5, y1 - 2), fg
line (x1, 20)-(x1, resy + 20), fg
screenunlock
sleep 20
loop
'load the arrays with the info
sliderh(sliderhs).x = x1: sliderh(sliderhs).y = y1: sliderh(sliderhs).w = w
'increment the object number
sliderhs += 1
end if
'UNDO
'undo an object
if s = "0" then
'clear the screen
cls
'color using the chosen colors
color fg, bg: locate 1, 1
'print undo options and put the answer into "s"
print "Undo button: 1"
print "Undo box: 2"
print "Undo pbar: 3"
print "Undo radio: 4"
print "Undo checkbox: 5"
print "Undo label: 6"
print "Undo slider: 7"
input "", s
'undo string
if s = "1" then
'clear the last data to be put into the button arrays
bstring(bttns - 1).x = 0: bstring(bttns - 1).y = 0: bstring(bttns - 1).s = ""
bdraw(bttns - 1).x = 0: bdraw(bttns - 1).y = 0: bdraw(bttns - 1).w = 0
bif(bttns - 1).x = 0: bif(bttns - 1).y = 0: bif(bttns - 1).w = 0
brelease(bttns - 1).x = 0: brelease(bttns - 1).y = 0: brelease(bttns - 1).w = 0
if bttns = 1 then
else
'decrement the button number
bttns -= 1
end if
'undo in/out box
elseif s = "2" then
'clear the last data to be put into the in/out box arrays
inbox(boxes - 1).x = 0: inbox(boxes - 1).y = 0: inbox(boxes - 1).w = 0
inboxif(boxes - 1).x = 0: inboxif(boxes - 1).y = 0: inboxif(boxes - 1).w = 0
if boxes = 1 then
else
'decrement the in/out box number
boxes -= 1
end if
'undo progress bar
elseif s = "3" then
'clear the last data to be put into the progress bar array
pbar(pbars - 1).x = 0: pbar(pbars - 1).y = 0: pbar(pbars - 1).w = 0
if pbars = 1 then
else
'decrement the progress bar number
pbars -= 1
end if
'undo radio
elseif s = "4" then
'clear the last data to be put into the radio button array
radio(radios - 1).x = 0: radio(radios - 1).y = 0: radio(radios - 1).w = 0
if radios = 1 then
else
'decrement the radio button box number
radios -= 1
end if
'undo check box
elseif s = "5" then
'clear the last data to be put into the check box array
cbox(cboxs - 1).x = 0: cbox(cboxs - 1).y = 0: cbox(cboxs - 1).w = 0
if cboxs = 1 then
else
'decrement the check box number
cboxs -= 1
end if
'undo label
elseif s = "6" then
'clear the last data to be put into the label array
label(labels - 1).x = 0: label(labels - 1).y = 0: label(labels - 1).s = ""
if labels = 1 then
else
'decrement the label number
labels -= 1
end if
'undo slider
elseif s = "7" then
'clear the last data to be put into the check box array
sliderh(sliderhs - 1).x = 0: sliderh(sliderhs - 1).y = 0: sliderh(sliderhs - 1).w = 0
if sliderhs = 1 then
else
'decrement the check box number
sliderhs -= 1
end if
end if
end if
loop
'draw all the buttons, in/out boxes, progress bars and labes
sub drawform
for i = 1 to 300
if bstring(i).s = "" then exit for
draw string (bstring(i).x, bstring(i).y), bstring(i).s, fg
next i
for i = 1 to 300
if bdraw(i).x = 0 then exit for
draw "C" & fg & " BM" & bdraw(i).x & "," & bdraw(i).y & " D26 R D R D R" & bdraw(i).w & " U R U R U26 L U L U L" & bdraw(i).w & " D L D L C" & sd & " BM" & bdraw(i).x + 1 & "," & bdraw(i).y + 1 & " BD26 BR BD BR BD R" & bdraw(i).w & " U R U R U26 C0" & q
next i
for i = 1 to 300
if inbox(i).x = 0 then exit for
draw "C" & fg & " BM" & inbox(i).x & "," & inbox(i).y & " D" & inbox(i).h & " R D R D R" & inbox(i).w & " U R U R U" & inbox(i).h & " L U L U L" & inbox(i).w & " D L D L C" & sd & " BM" & inbox(i).x + 1 & "," & inbox(i).y + 1 & " D" & inbox(i).h - 2 & " R D R D R" & inbox(i).w - 2 & " U R U R U" & inbox(i).h - 2 & " L U L U L" & inbox(i).w - 2 & "D L D"
next i
for i = 1 to 300
if pbar(i).x = 0 then exit for
draw "C" & fg & " BM" & pbar(i).x & "," & pbar(i).y & " D26 R" & pbar(i).w + 4 & " U26 L" & pbar(i).w + 4 & " C" & sd & " BM" & pbar(i).x + 1 & "," & pbar(i).y + 1 & " D24 R" & pbar(i).w + 2 & " U24 L" & pbar(i).w + 2
next i
for i = 1 to 300
if radio(i).x = 0 then exit for
circle (radio(i).x, radio(i).y), 6, fg
circle (radio(i).x, radio(i).y), 3, fg
next i
for i = 1 to 300
if cbox(i).x = 0 then exit for
draw "C" & fg & " BM" & cbox(i).x & "," & cbox(i).y + 5 & " D15 R15 U15 L14 D C" & sd & " D13 R13 U13 L13"
line (cbox(i).x + 3, cbox(i).y + 8)-(cbox(i).x + 12, cbox(i).y + 17), fg
line (cbox(i).x + 12, cbox(i).y + 8)-(cbox(i).x + 3, cbox(i).y + 17), fg
next i
for i = 1 to 300
if label(i).s = "" then exit for
draw string (label(i).x, label(i).y), label(i).s, fg
next i
for i = 1 to 300
if sliderh(i).x = 0 then exit for
draw "C" & fg & " BM" & sliderh(i).x + 0 & "," & sliderh(i).y + 3 & " D20 R" & sliderh(i).w + 4 & " U20 L" & sliderh(i).w + 4 & " C" & sd & " BM" & sliderh(i).x + 1 & "," & sliderh(i).y + 4 & " D18 R" & sliderh(i).w + 2 & " U18 L" & sliderh(i).w + 2
circle (sliderh(i).x + 10, sliderh(i).y + 13), 8, fg
draw "BM" & sliderh(i).x + 10 & "," & sliderh(i).y + 13 & "P" & sd & "," & fg & "C0"
next i
draw box
end sub
'draws everything on the color picker screen
sub drawcolors()
dim as integer x, y
screenlock
cls
'draws two boxes ,with the buttons inside,using two color so when the inside of the box is filled it doesn't overflow
line (211, 6)-(602, 6), 15
line (211, 50)-(602, 50), 15
line (211, 6)-(211, 50), 15
line (602, 6)-(602, 50), 15
line (212, 7)-(601, 7), 31
line (212, 49)-(601, 49), 31
line (212, 7)-(212, 49), 31
line (601, 7)-(601, 49), 31
if bg <> 15 then
draw "BM214,9 P" & bg & ",15"
elseif bg <> 31 then
draw "BM214,9 P" & bg & ",31"
end if
'draws the buttons
bttn (219, 14, "Foreground")
bttn (323, 14, "Background")
bttn (427, 14, "Shadow")
bttn (547, 14, "Done")
'draws the color bar
for x = 1 to 738
for y = 60 to 90
pset (x, y), x / 3
next y
next x
screenunlock
end sub
'draws the buttons on the color picker screen
sub bttn(x as integer, y as integer, s as string)
dim as integer w
w = len(s) * 8 + 10
draw string (x + 8, y + 10), s, fg
draw "C" & fg & " BM" & x & "," & y & "D26 R D R D R" & w & "U R U R U26 L U L U L" & w & "D L D L C" & sd & "BM" & x + 1 & "," & y + 1 & "BD26 BR BD BR BD R" & w & "U R U R U26"
end sub