I got the first toolbar buttons to work but after that when I click on the save and save as button,etc. nothing works. And I can't get the filmenu variable to go away help!
`Clear screen
cls
for a = 1 to 5000
if sprite exist(a) = 1 then delete sprite a
next a
`Make the toolbar image
paste image tbid,1,1
`Make border
bid = 50000
load image "Bmps\border.bmp",bid
paste image bid,1,30
`Make the toolbar buttons
`File Button
tb1 = 20000
load image "Bmps\file.bmp",tb1
sprite tb1,5,5,tb1
hide sprite tb1
paste image tb1,5,5
`Make the edit button
tb2 = tb1+1
load image "Bmps\edit1.bmp",tb2
sprite tb2,100,3,tb2
hide sprite tb2
paste image tb2,100,3
`Make the view button
tb3 = tb2 + 1
load image "Bmps\view.bmp",tb3
sprite tb3,200,4,tb3
hide sprite tb3
paste image tb3,200,4
`Load the menu button
tb4 = tb3 + 1
load image "Bmps\menu.bmp",tb4
`Start a loop
do
`Create mouse
hide mouse
sprite 1,mousex(),mousey(),1
`The file menu
if mouseclick() = 1 and sprite collision(tb1,1) = 1
editmenu = 0:viewmenu = 0:filmenu = 1
`Functions
`File Menu
case1:
tb24 = 50000
load image "Bmps\menu.bmp",tb24
paste image tb24,1,15
tb5 = tb24 + 1
load image "Bmps\save_new.bmp",tb5
paste image tb5,4,20
sprite tb5,4,20,tb5
hide sprite tb5
tb6 = tb5+1
load image "Bmps\save_as.bmp",tb6
sprite_save_as = tb6 + 1
load image "Bmps\save_as1.bmp",sprite_save_as
paste image tb6,4,40
sprite sprite_save_as,4,40,sprite_save_as
hide sprite sprite_save_as
tb7 = tb6+1
load image "Bmps\quit_new.bmp",tb7
paste image tb7,4,60
sprite tb7,4,60,tb7
hide sprite tb7
if sprite collision(1,tb5) = 1 and mouseclick() = 1 then save_new=1:filmenu = 0
if sprite collision(1,sprite_save_as) = 1 and mouseclick() = 1 then save_as = 1:filmenu = 0
if sprite collision(1,tb1) =1 and mouseclick() = 2 and filmenu = 1 then filmenu = 0
if sprite collision(1,tb7) = 1 and mouseclick() = 1 then end
endif
`The edit menu
if mouseclick() = 1 and sprite collision(tb2,1) = 1 then viewmenu = 0:filmenu = 0:editmenu = 1
if editmenu = 1
paste image tb4,100,15
endif
`The view menu
if mouseclick() = 1 and sprite collision(tb3,1) = 1 then editmenu = 0:filmenu = 0:viewmenu = 1
if viewmenu = 1
paste image tb4,200,15
endif
`Refresh the screen
sync
loop
`Save a new file
if save_new = 1 and save_as = 0
gosub start_save_new
else
`do something like save on it's own
filmenu = 0
endif
`The actual new start_saving junk
start_save_new:
`Just checking to make sure the screen is actually clean
for a = 1 to 60000
if sprite exist(a) = 1 then delete sprite a
next a
cls
`Start the saving thing now
Need Tutorials? New to DarkBASIC? - http://jonsdbpage.tripod.com