Thanks to both of you
I will Keep working on this.
!!Edit!!
ok i have worked with this and heres what i have. you can create more than one window. color the title. color the window. make button(s) and i started working on a priority type thing where when you call window you can say weather its infront or not. but it only works with window 1 i don't know why though. next i'm going to work on moving the window.
i think this is good for a hours worth of work lol
remstart
-------------------------------------------------------------------
program name:
-------------------------------------------------------------------
written by: Caleb Stewart
date:
-------------------------------------------------------------------
comments:
-------------------------------------------------------------------
remend
Sync on
Sync rate 0
WinX=(640/2)/2+25
WinY=(480/2)/2+25
Set window on
Set window position WinX,WinY
Dim ButtonData(100,100,100)
Dim WindowData(100,7)
Dim WindowSysData(5)
DIm Window$(100)
Dim Button$(100,100)
Dim WinOrder(100)
Create Bitmap 1,640,480
set current bitmap 1 : Cls RGB(0,255,0) : Set current bitmap 0
WindowSysData(0)=1
CreateWindow(1,100,100,400,300,"Window 1",RGB(192,192,192),RGB(0,0,255),1)
Createbutton(1,1,100,100,75,20,"Button")
CreateWindow(2,15,15,400,400,"Window 2",RGB(192,192,192),RGB(0,0,255),0)
CreateWindow(3,200,30,100,100,"Window 3",RGB(192,192,192),RGB(0,0,255),0)
Do
UpdateWindow()
Sync
Loop
Function Mouseinside(X,Y,X2,Y2)
if mouseX()>X and MouseX()<X2
If mouseY()>Y and MouseY()<Y2
exitfunction 1
endif
endif
endfunction -1
Function CreateButton(window,Button,X,Y,W,H,Text$)
Button$(window,Button)=Text$
ButtonData(window,Button,0)=1
ButtonData(window,Button,1)=X
ButtonData(window,Button,2)=Y
ButtonData(window,Button,3)=W
ButtonData(window,Button,4)=H
WindowData(Window,7)=WindowData(Window,7)+1
RedrawWindow(Window)
endfunction
Function CreateWindow(Window,X,Y,W,H,Title$,BColor,TColor,Front)
Window$(Window)=Title$
WindowData(Window,0)=1
WindowData(Window,1)=X
WindowData(Window,2)=Y
WindowData(Window,3)=W
WindowData(Window,4)=H
WindowData(Window,5)=Bcolor
WindowData(Window,6)=TColor
WindowSysData(1)=WindowSysData(1)+1
If Front=1
For X=1 to WindowsysData(1)
If WinOrder(X)=1 then Winorder(X)=0
next x
Winorder(Window)=1
else
winorder(window)=0
endif
RedrawWindow(Window)
endfunction
Function RedrawWindow(Window)
X=WindowData(Window,1)
Y=WindowData(Window,2)
W=WindowData(Window,3)
H=WindowData(Window,4)
Buttons=WindowData(Window,7)
set current bitmap WindowSysData(0)
If WindowData(Window,0)=1
Ink WindowData(Window,6),0
Box X,Y-15,X+W,Y
Ink WindowData(Window,5),0
Box X,Y,X+W,Y+H
ink RGB(255,255,255),0
line X,Y-15,X,Y+H
Line X,Y-15,X+W,Y-15
ink rgb(0,0,0),0
line X+W,Y-15,X+W,Y+H
line X,Y+H,X+W,Y+H
Text X+1,Y-14,Window$(Window)
For B=1 to 1
If ButtonData(Window,B,5)=1
DrawButton(Window,B,1)
else
DrawButton(Window,b,0)
endif
next b
endif
set current bitmap 0
endfunction
Function DrawButton(Window,Button,Press)
X=WindowData(Window,1)+ButtonData(Window,button,1)
Y=WindowData(Window,2)+BUttonData(Window,button,2)
W=ButtonData(Window,Button,3)
H=ButtonData(Window,Button,4)
If Press=0
Ink RGB(192,192,192),0
Box X,Y,X+W,Y+H
Ink RGB(255,255,255),0
line X,Y,X+W,Y
Line X,Y,X,Y+H
ink rgb(0,0,0),0
Line X+W,y,X+W,Y+H
Line X,Y+H,X+W,Y+H
Text X+1,Y+1,Button$(Window,Button)
else
Ink RGB(192,192,192),0
Box X,Y,X+W,Y+H
Ink RGB(0,0,0),0
line X,Y,X+W,Y
Line X,Y,X,Y+H
ink rgb(255,255,255),0
Line X+W,y,X+W,Y+H
Line X,Y+H,X+W,Y+H
Text X+1,Y+1,Button$(Window,Button)
endif
endfunction
Function CHeckAction(Window)
Copy Bitmap 1,0
For B=1 to windowdata(window,7)
BX=ButtonData(Window,B,1)+WindowData(WIndow,1)
BY=ButtonData(Window,B,2)+WindowData(Window,2)
BX2=ButtonData(Window,B,1)+ButtonData(Window,B,3)+WIndowData(Window,1)
By2=ButtonData(Window,B,2)+ButtonData(Window,B,4)+WindowData(Window,2)
If MouseClick() and Mouseinside(BX,BY,bx2,BY2)=1
ButtonData(Window,B,5)=1
RedrawWindow(Window)
else
If Buttondata(Window,B,5)=0 then RedrawWindow(WIndow) : Print "hi"
Buttondata(Window,B,5)=0
endif
next x
endfunction
Function UpdateWindow()
For X=1 to WindowSysData(1)
If WinOrder(X)=0
CheckAction(Window)
else
front=X
endif
next x
CheckAction(Front)
endfunction
New Site! Check it out \/