Ahh... I have done my menubar code, still not ported for this though... Here are the functions.
function CreateToolBar(c1,c2)
length=screen width()
box 0,0,length,20,c1,c2,c1,c2
endfunction
function CreateMenu(menu_id,text$,c1,c2,h1,h2)
PosX=menu_id*80
box PosX,0,PosX+80,20,c1,c2,c1,c2
if len(text$)>9 then text$=left$(text$,9)
ink rgb(255,255,255),0
text PosX+2,2,text$
`menu$(menu_id)=text$
if mousex()>PosX : if mousey()>PosY : if mousex()<PosX+80 : if mousey()<PosY+20
box PosX,0,PosX+80,20,h1,h2,h1,h2
ink rgb(255,255,0),0
text PosX+2,2,text$
endif : endif : endif : endif
endfunction
function ShowSubMenu(menu_id,submenu_id,text$,c1,c2,h1,h2)
PosX=menu_id*80
PosY=submenu_id*20
PosY=PosY+20
`Check for the event...
if len(text$)>9 then text$=left$(text$,9)
box PosX,PosY,PosX+80,PosY+20,c1,c2,c1,c2
ink rgb(255,255,255),0
text PosX+2,PosY+1,text$
if mousex()>PosX : if mousex()<PosX+80 : if mousey()>PosY : if mousey()<PosY+20
box PosX,PosY,PosX+80,PosY+20,h1,h2,h1,h2
ink rgb(255,255,0),0
text PosX+2,PosY+1,text$
endif : endif : endif : endif
`submenu$(menu_id,submenu_id)=text$
endfunction
function IsMenuClicked(menu_id)
PosX=menu_id*80
res=0
if mouseclick()=1
if mousex()>PosX : if mousex()<PosX+80 : if mousey()>0 : if mousey()<20
res=1
endif : endif : endif : endif
endif
endfunction res
function IsSubMenuClicked(menu_id,submenu_id)
PosX=menu_id*80
PosY=submenu_id*20
res=0
if mouseclick()=1
if mousex()>PosX : if mousex()<PosX+80 : if mousey()>PosY+20 : if mousey()<PosY+40
res=1
endif : endif : endif : endif
endif
endfunction res
function GuiButton(ButtonX,ButtonY,ButtonSizeX,ButtonSizeY,text$,c1,c2,h1,h2)
res=0
`This equasion isnt working! If anyone has a fix, please post...
`Middle=ButtonSizeX/2
`Middle=ButtonX+Middle
`This part just finds X and positions the text there, this is a fix to MIDDLE
Middle=ButtonX+2
box ButtonX,ButtonY,ButtonSizeX,ButtonSizeY,c1,c2,c1,c2
ink rgb(255,255,255),0
text Middle,ButtonY+2,text$
if mousex()>ButtonX : if mousex()<ButtonSizeX : if mousey()>ButtonY : if mousey()<ButtonSizeY
res=1
box ButtonX,ButtonY,ButtonSizeX,ButtonSizeY,h1,h2,h1,h2
ink rgb(255,255,0),0
`center text Middle,ButtonY+2,text$
text Middle,ButtonY+2,text$
if mouseclick()=1
res=2
endif
endif : endif : endif : endif
ink rgb(255,255,255),0
endfunction res
And a short example...
REM Project: EasyEdit
REM Created: 7/13/2006 2:30:23 PM
REM
REM ***** Main Source File *****
REM
`dim menu$(100)
`dim submenu$(100,100)
box 0,0,256,256,rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255))
get image 1,0,0,255,255
box 0,0,256,256,rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255))
get image 2,0,0,255,255
make object cone 1,200
set cartoon shading on 1,1,2
set ambient light 100
color backdrop rgb(0,0,0)
`draw to front
sync on
do
`Do not use the 'cls' command!!! It will cause 3D objects to not be seen!
CreateToolBar(rgb(50,50,50),rgb(150,150,150))
CreateMenu(0,"File",rgb(50,50,50),rgb(150,150,150),rgb(10,40,50),rgb(110,140,150))
CreateMenu(1,"Edit",rgb(50,50,50),rgb(150,150,150),rgb(10,40,50),rgb(110,140,150))
CreateMenu(2,"View",rgb(50,50,50),rgb(150,150,150),rgb(10,40,50),rgb(110,140,150))
CreateMenu(3,"Help",rgb(50,50,50),rgb(150,150,150),rgb(10,40,50),rgb(110,140,150))
CreateMenu(4,"123456789",rgb(50,50,50),rgb(150,150,150),rgb(10,40,50),rgb(110,140,150))
File=IsMenuClicked(0) : Edit=IsMenuClicked(1) : View=IsMenuClicked(2) : Help=IsMenuClicked(3) : Test=IsMenuClicked(4)
if File=1 : a=1 : endif : if Edit=1 : a=2 : endif : if View=1 : a=3 : endif : if Help=1 : a=4 : endif : if Test=1 : a=5 : endif
if File=1 : repeat : until mouseclick()=0 : endif
if Edit=1 : repeat : until mouseclick()=0 : endif
if View=1 : repeat : until mouseclick()=0 : endif
if Help=1 : repeat : until mouseclick()=0 : endif
if Test=1 : repeat : until mouseclick()=0 : endif
if a=1
ShowSubMenu(0,0,"File1",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
ShowSubMenu(0,1,"File2",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
ShowSubMenu(0,2,"File3",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
if IsMenuClicked(0)=1 then a=0
endif
if a=2
ShowSubMenu(1,0,"Edit1",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
ShowSubMenu(1,1,"Edit2",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
if IsMenuClicked(1)=1 then a=0
endif
if a=3
ShowSubMenu(2,0,"View1",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
if IsMenuClicked(2)=1 then a=0
endif
if a=4
ShowSubMenu(3,0,"Help1",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
ShowSubMenu(3,1,"Help2",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
if IsMenuClicked(3)=1 then a=0
endif
if a=5
ShowSubMenu(4,0,"Test1",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
ShowSubMenu(4,1,"Test2",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
ShowSubMenu(4,2,"Test3",rgb(50,50,50),rgb(150,150,150),rgb(0,0,50),rgb(0,0,150))
if IsMenuClicked(4)=1 then a=0
endif
turn object left 1,1
sync
loop
function CreateToolBar(c1,c2)
length=screen width()
box 0,0,length,20,c1,c2,c1,c2
endfunction
function CreateMenu(menu_id,text$,c1,c2,h1,h2)
PosX=menu_id*80
box PosX,0,PosX+80,20,c1,c2,c1,c2
if len(text$)>9 then text$=left$(text$,9)
ink rgb(255,255,255),0
text PosX+2,2,text$
`menu$(menu_id)=text$
if mousex()>PosX : if mousey()>PosY : if mousex()<PosX+80 : if mousey()<PosY+20
box PosX,0,PosX+80,20,h1,h2,h1,h2
ink rgb(255,255,0),0
text PosX+2,2,text$
endif : endif : endif : endif
endfunction
function ShowSubMenu(menu_id,submenu_id,text$,c1,c2,h1,h2)
PosX=menu_id*80
PosY=submenu_id*20
PosY=PosY+20
`Check for the event...
if len(text$)>9 then text$=left$(text$,9)
box PosX,PosY,PosX+80,PosY+20,c1,c2,c1,c2
ink rgb(255,255,255),0
text PosX+2,PosY+1,text$
if mousex()>PosX : if mousex()<PosX+80 : if mousey()>PosY : if mousey()<PosY+20
box PosX,PosY,PosX+80,PosY+20,h1,h2,h1,h2
ink rgb(255,255,0),0
text PosX+2,PosY+1,text$
endif : endif : endif : endif
`submenu$(menu_id,submenu_id)=text$
endfunction
function IsMenuClicked(menu_id)
PosX=menu_id*80
res=0
if mouseclick()=1
if mousex()>PosX : if mousex()<PosX+80 : if mousey()>0 : if mousey()<20
res=1
endif : endif : endif : endif
endif
endfunction res
function IsSubMenuClicked(menu_id,submenu_id)
PosX=menu_id*80
PosY=submenu_id*20
res=0
if mouseclick()=1
if mousex()>PosX : if mousex()<PosX+80 : if mousey()>PosY+20 : if mousey()<PosY+40
res=1
endif : endif : endif : endif
endif
endfunction res
I already posted this in the "Function Collection" Post, so you might already have it.
As for the windows... I'm unsure on how this would go about... But the menubar goes in the main window, you can re-edit the positions.
The GUI is a work in progress, that is why some things just arent working, and the example is messed up to (cant close menus), so that will have to be fixed as well (though, it's not a problem with the GUI...)
Hope that helps a little bit. To make it look more "Windows 98" edit the drawing function to use lines and a single color, with a single highlight, that way you can view my toolbars (and crappy button function) as a True 98 Environment (Well, maybe semi-true).
I may be able to port the code later though...
[EDIT] to avoid using media (if you like) there is an image to code converter in the "Mario - No Media!!!" code snippets post, here is the link, just go down a little bit...
http://forum.thegamecreators.com/?m=forum_view&t=72984&b=6
There ya go!
I finally have a NEW computer!!!
Windows XP Pro, AMD Athlon 64-BIT Processor, ATI Radeon Graphics, Windows Vista compatable, DirectX 9.0c, 2 Hard Drives, 6 Extra Drives, etc. etc.