I've made the UI for my level editor but when i click any of the buttons it also comes up with the export code and export .x, i've been trying to fix this for hours can anyone spot something wrong?
REM Project: Level Editor
REM Created: 17/05/2006 19:30:58
REM
REM ***** Main Source File *****
REM
global menu
global filemenu
global editmenu
global toolsmenu
global viewmenu
global optionsmenu
global helpmenu
global toolbox
global toolbox
global insertFurnitureButton
global insertRoomButton
global insertRoomDialog
global insertFurnitureDialog
startblue "ID","KEY"
#include "gui.dba"
create_ui()
do
getevent
handle_ui()
loop
`creates the user interface
function create_ui()
menu = createmenu(0)
addmenuitem menu,"File",1
filemenu = createsubmenu(menu,1)
addmenuitem filemenu, "New",2
addmenuitem filemenu, "Open",3
addmenuitem filemenu, "Save",4
addmenuitem filemenu, "Save as...",5
addmenuitem filemenu, "Export code",6
addmenuitem filemenu, "Export .x",7
addmenuitem filemenu, "Exit",8
addmenuitem menu,"Edit",9
editmenu = createsubmenu(menu,9)
addmenuitem editmenu,"Copy",10
addmenuitem editmenu,"Cut",11
addmenuitem editmenu,"Paste",12
addmenuitem editmenu,"Delete",13
addmenuitem menu,"Tools",14
toolsmenu = createsubmenu(menu,14)
addmenuitem toolsmenu,"Rotate",15
addmenuitem toolsmenu,"Move",16
addmenuitem toolsmenu,"Calculate Lights",17
addmenuitem toolsmenu,"Properties",18
addmenuitem menu,"View",19
viewmenu = createsubmenu(menu,19)
addmenuitem viewmenu,"Top",20
addmenuitem viewmenu,"Side",21
addmenuitem viewmenu,"Front",22
addmenuitem viewmenu,"Perspective",23
addmenuitem viewmenu,"Preview",24
addmenuitem viewmenu,"Wireframe",25
addmenuitem viewmenu,"Normal",26
addmenuitem viewmenu,"Textured & Lights",27
addmenuitem menu,"Options",28
optionsmenu = createsubmenu(menu,28)
addmenuitem optionsmenu,"System Options",29
addmenuitem menu,"Help",30
helpmenu = createsubmenu(menu,30)
addmenuitem helpmenu,"Contents",31
addmenuitem helpmenu,"Index",32
addmenuitem helpmenu,"About",33
toolbox = createwindow(834,0,190,600,"Toolbox",WINDOW_NORMAL,WINDOW_TOOLWINDOW ,0,0)
insertRoomButton = createbutton(45,20,75,25,"Insert Room",0,toolbox)
insertFurnitureButton = createbutton(45,55,75,25,"Insert Furniture",0,toolbox)
endfunction
`searches for any user interactions
function handle_ui()
if eventtype()=MENU_CLICK
select eventdata()
case 2:new():endcase
case 3:open():endcase
case 4:save():endcase
case 5:save_as():endcase
case 6:export_code():endcase
case 7:export_x():endcase
case 8:exit_program():endcase
case 10:copy():endcase
case 11:cut():endcase
case 12:paste():endcase
case 13:delete():endcase
case 15:rotate():endcase
case 16:move():endcase
case 17:calculate_lights():endcase
case 18:properties():endcase
case 20:view_top():endcase
case 21:view_side():endcase
case 22:view_front():endcase
case 23:view_perspective:endcase
case 24:preview():endcase
case 26:view_wireframe():endcase
case 29:view_solid_lights():endcase
case 30:system_options():endcase
case 31:contents():endcase
case 32:index():endcase
case 33:about():endcase
endselect
endif
if eventtype() = MOUSE_CLICK and eventsource()= insertRoomButton
insert_room_dialog()
endif
if eventtype() = MOUSE_CLICK and eventsource() = insertFurnitureButton
insert_furniture_dialog()
endif
endfunction
function insert_room_dialog()
insertRoomDialog = createwindow(100,100,600,700,"Insert Room...",WINDOW_NORMAL,WINDOW_TOOLWINDOW ,0,0)
endfunction
function insert_furniture_dialog()
insertFurnitureDialog = createwindow(100,100,600,700,"Insert Furniture...",WINDOW_NORMAL,WINDOW_TOOLWINDOW ,0,0)
endfunction
function new()
message "You clicked","New"
endfunction
function open()
message "You clicked","Open"
endfunction
function save()
message "You clicked","Save"
endfunction
function save_as()
message "You clicked","Save as..."
endfunction
function export_code()
message "You clicked","Export Code"
endfunction
function export_x()
message "You clicked","Export .x"
endfunction
function exit_program()
message "You clicked","Exit Program"
end
endfunction
function cut()
message "You clicked","Cut"
endfunction
function copy()
message "You clicked","Copy"
endfunction
function paste()
message "You clicked","Paste"
endfunction
function delete()
message "You clicked","Delete"
endfunction
function rotate()
message "You clicked","Rotate"
endfunction
function move()
message "You clicked","Move"
endfunction
function calculate_lights()
message "You clicked","Calculate Lights"
endfunction
function properties()
message "You clicked","Properties"
endfunction
function view_top()
message "You clicked","View Top"
endfunction
function view_side()
message "You clicked","View Side"
endfunction
function view_front()
message "You clicked","View Front"
endfunction
function view_perspective()
message "You clicked","View Perspective"
endfunction
function preview()
message "You clicked","Preview"
endfunction
function view_wireframe()
message "You clicked","Wireframe"
endfunction
function view_solid()
message "You clicked","Solid"
endfunction
function view_solid_lights()
message "You clicked","Lights"
endfunction
function system_options()
message "You clicked","System Options"
endfunction
function contents()
message "You clicked","Contents"
endfunction
function index()
message "You clicked","Index"
endfunction
function about()
message "You clicked","About"
endfunction
I pwn n00bs - current project "Darkness Falls"