This was my first attempt at making a gui interface, but I dont have a use for this code nowas I have a differant version...
` Gui Environment
`
` By Michael Mihalyfi
` MSon648@Hotmail.Com
`
` Hi There, (READ THIS...)
`
` Complete With a `Mini Mouse data Box` and a Right Click Menu!!!
`
` This was Origionally Designed for a combination of a Matrix Editor and a Map Editor
` But now as im making a New Gui Environment this is 'Spare Code' Now.
`
` It's something that I Did a Long Time ago, but if anyone has a use for it
` then please feel free to use it, The Only thing I Ask is for my name in
` the credits, and to be notified at MSon648@Hotmail.Com
`
` Controls
` MouseClick(1) = Use Tool
` MouseClick(2) = Right Click Menu
` Space = Show/Hide MouseBox
` "q" = End
`
` ShowMiniData is a Value That Specifies If the MouseBox is to be Displayed
`
` Any before anyone says it, Ive not used functions because when I made this
` id only been programming in Darkasic for about a Week or 2 so it was to get
` use to the commands.
`
` Have fun with it :-)
Hide Mouse
Set Display Mode 1024, 768, 32
disable escapekey
Rem : Set System Colors
White = RGB(255,255,255)
Black = RGB(0,0,0)
Red = RGB(255,0,0)
Green = RGB(0,255,0)
Blue = RGB(0,0,255)
Rem : Set in User Settings
ShowMiniData = 1
MenuColor1 = RGB(0,50,0)
MenuColor2 = RGB(0,25,25)
MenuColor3 = RGB(0,0,255)
Rem : Menu Data
MiniMenu_Object_Title$ = "Object Menu" : ` LOOK HERES THE MENU!!!
MiniMenu_Object_Item1$ = "Move Object"
MiniMenu_Object_Item2$ = "Select Color/Texture"
MiniMenu_Object_Item3$ = "Open in Artist"
MiniMenu_Object_Item4$ = "Properties"
Rem : Set in Programme
ToolSelect$ = "Move/Select"
MouseOver$ = "Object"
Show Mouse
TheLoop: Do
KeyPress$ = Inkey$()
ClickMouse = MouseClick()
If Sub$ = "MiniMenu_Object_Loop" Then Goto MiniMenu_Object_Loop
If KeyPress$ <> "" Then Goto Inkey
If ClickMouse <> 0 Then Goto ClickMouse
If ShowMiniData = 1 Then Goto MiniData
Loop
Inkey: If Sub$ = "MiniMenu_Object_Loop" Then Goto MiniMenu_Object_Loop
If Sub$ = "Open in Artist" Then EXECUTE FILE "ARTIST2",Hi$, "C:Documents and SettingsAlanDesktop"
If KeyPress$ = "q" Then End
If KeyPress$ = " " Then GoSub ShowMiniData
Goto TheLoop
ClickMouse:
If ClickMouse = 1 Then Goto UseTool
If ClickMouse = 2 Then Goto MiniMenu
Goto TheLoop
JoyPad: Goto TheLoop
Rem : Use the Selected Tool
Rem :
UseTool: Goto TheLoop
Rem : Right Click Menu
Rem :
Rem : Remove the 'Mini Data Viewer'
MiniMenu: If ShowMiniData = 1 Then Ink Black,Black : Box XMouse+20,YMouse-10,XMouse+120,YMouse+30
Rem : What Menu to Use?
If MouseOver$ = "Object" Then Goto MiniMenu_Object
Goto TheLoop
MiniMenu_Object: Sub$ = "MiniMenu_Object_Loop"
MiniMenuStartX = XMouse
MiniMenuStartY = YMouse
MiniMenuEndX = XMouse+150
MiniMenuEndY = YMouse+150
MiniMenu_Object_Loop: ` Remove the Old Mini Menu
Ink Black,Black
Box MiniMenuStartX,MiniMenuStartY,MiniMenuEndX,MiniMenuEndY
XMouse = MouseX()
YMouse = MouseY()
` Make a New Menu
Ink MenuColor2,Black
Box MiniMenuStartX,MiniMenuStartY,MiniMenuEndX,MiniMenuEndY
Ink MenuColor1,Black
Box MiniMenuStartX+1,MiniMenuStartY+17,MiniMenuEndX-1,MiniMenuEndY-1
` What is the Mouse Over?
Ink Blue,Black :
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+17 And YMouse <= MiniMenuStartY+31 Then Box MiniMenuStartX+1,MiniMenuStartY+17,MiniMenuEndX-1,MiniMenuStartY+31
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+32 And YMouse <= MiniMenuStartY+45 Then Box MiniMenuStartX+1,MiniMenuStartY+32,MiniMenuEndX-1,MiniMenuStartY+45
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+46 And YMouse <= MiniMenuStartY+59 Then Box MiniMenuStartX+1,MiniMenuStartY+46,MiniMenuEndX-1,MiniMenuStartY+59
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+60 And YMouse <= MiniMenuStartY+73 Then Box MiniMenuStartX+1,MiniMenuStartY+60,MiniMenuEndX-1,MiniMenuStartY+73
Ink White,White
` Whats in the Menu?
Text MiniMenuStartX+5,MiniMenuStartY+3,MiniMenu_Object_Title$
Text MiniMenuStartX+5,MiniMenuStartY+18,MiniMenu_Object_Item1$
Text MiniMenuStartX+5,MiniMenuStartY+33,MiniMenu_Object_Item2$
Text MiniMenuStartX+5,MiniMenuStartY+47,MiniMenu_Object_Item3$
Text MiniMenuStartX+5,MiniMenuStartY+61,MiniMenu_Object_Item4$
ClickMouse = MouseClick()
If ClickMouse <> 0 Then Goto MiniMenu_Object_Tasks
Goto TheLoop
MiniMenu_Object_Tasks: Sub$ = ""
` What Have you Selected?
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+17 And YMouse <= MiniMenuStartY+31 Then Sub$ = MiniMenu_Object_Item1$
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+32 And YMouse <= MiniMenuStartY+45 Then Sub$ = MiniMenu_Object_Item2$
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+46 And YMouse <= MiniMenuStartY+59 Then Sub$ = MiniMenu_Object_Item3$
If XMouse => MiniMenuStartX And XMouse <= MiniMenuEndX And YMouse => MiniMenuStartY+60 And YMouse <= MiniMenuStartY+73 Then Sub$ = MiniMenu_Object_Item4$
` Remove the Menu from Screen
Ink Black,Black
Box MiniMenuStartX,MiniMenuStartY,MiniMenuEndX+150,MiniMenuEndY+300
Goto TheLoop
ShowMiniData: Ink Black,Black
Box XMouse+20,YMouse-10,XMouse+120,YMouse+30
ShowMiniData = ShowMiniData + 1
If ShowMiniData = 2 Then ShowMiniData = 0
Return
` Mini Data View Next to Mouse
MiniData: Ink Black,Black
Box XMouse+20,YMouse-10,XMouse+120,YMouse+30
XMouse = MouseX()
YMouse = MouseY()
XMouse$ = Str$(XMouse)
YMouse$ = Str$(YMouse)
L$ = Str$(L)
MousePos$ = XMouse$ + "," + YMouse$ + "," + L$
Ink MenuColor2,Black
Box XMouse+20,YMouse-10,XMouse+120,YMouse+30
Ink MenuColor1,Black
Box XMouse+21,YMouse-9,XMouse+119,YMouse+29
Ink White,White
Text XMouse+24,YMouse-7,MousePos$
Text XMouse+24,YMouse+5,ToolSelect$
Text XMouse+24,YMouse+17,MouseOver$
Goto TheLoop
Rem : Whats under the Mouse?
CheckUnderMouse: Goto TheLoop