Rem Project: GameEngineTest1
Rem Created: Monday, January 28, 2013
Rem ***** Main Source File *****
//
#Constant MENU_EXIT 1
//
Type Application
dbwindow as integer
mainmenu as integer
filemenu as integer
statusbar as integer
Endtype
//
Global myApp As Application
//
CreateUi()
//
Do
//
ProcessEvents()
Loop
End
//
Function ProcessEvents()
//
GetEvent
//
_EventType = EventType()
_EventData = EventData()
_EventDataEx = EventDataEx()
_EventSource = EventSource()
//
If _EventType = WINDOW_CLOSE || ( _EventType = MENU_CLICK && _EventData = MENU_EXIT )
DeleteGadget myApp.dbwindow
End
Endif
EndFunction
//
Function CreateUi()
// grab dark basic pro window
myApp.dbwindow = CreateGadgetFromWindow( MainWindow( ) )
// attach a menu bar
myApp.mainmenu = CreateMenu( myApp.dbwindow )
// add main menu items
AddMenuItem myApp.mainmenu, "&File", MENU_EXIT
// create file sub menu & attach it to the main menu
myApp.filemenu = CreateSubMenu( myApp.mainmenu, MENU_EXIT )
// add sub items to file menu
AddMenuItem myApp.filemenu, "&Exit", MENU_EXIT
EndFunction
hexeg0n