If anyone is interested, I solved the problem I was talking about in the first post. The menu system now works. All viewports now show up as child windows of the main window. The main window is not a gadget! All the viewports now resize correctly when the main window is resized. I have faked the deleting or closing of the viewports by hiding them when you click on their close button. There are four extra buttons on the toolbar that will unhide or bring back each closed viewport. The main window sets itself to the users desktop resolution, and sets it's size to the size of the desktop minus the area for the taskbar.
In order to try this code, you will need both bluegui and styx enhancement packs.
startBlue "***","******"
set window on
#constant user32 1
#constant gdi32 2
load dll "user32.dll", user32
load dll "gdi32.dll", gdi32
`DLL CONSTANTS
#constant SM_CXSCREEN = 0
#constant SM_CYSCREEN = 1
#constant BITSPIXEL = 12
global hdc as dword
`Desktop Globals
global desktop_width
global desktop_height
global desktop_depth
`Taskbar Globals
`---------------
global taskbar `Handle to the windows taskbar
global tbleft
global tbtop
global tbright
global tbbottom
global tbwidth
global tbheight
`Window Globals
`--------------
global mww `Main Window Width
global mwh `Main Window Height
global mwx `Main Window X Position
global mwy `Main Window Y Position
global mwcw `Main Window Client Width
global mwch `Main Window Client Height
`Menu Globals
`------------
global menu
#constant MENU_FILE 0
global menuFile
#constant MENU_NEW 1
#constant MENU_OPEN 2
#constant MENU_SAVE 3
#constant MENU_SAVEAS 4
#constant MENU_SAVESELECTED 5
#constant MENU_IMPORT 7
global menuImport
#constant MENU_STEREOCAD3D2 8
#constant MENU_RHINOCEROS3DM 9
#constant MENU_ACROBAT3DMF 10
#constant MENU_3DSTUDIO3DS 11
#constant MENU_WORLD3DSTANDARD3DX 12
#constant MENU_ANIM8TORAN8 13
#constant MENU_CINEMA4DC4D 14
#constant MENU_LIGHTWAVE 15
global menuLightwave
#constant MENU_LIGHTWAVE3DLAYEREDOBJECTLWLO 16
#constant MENU_LIGHTWAVE3DOBJECTLWOB 17
#constant MENU_LIGHTWAVE3DSCENELWSC 18
#constant MENU_MILKSHAPE3DMS3D 19
#constant MENU_ALIASWAVEFRONTMATERIALLIBRARYFILEMTL 20
#constant MENU_WAVEFRONTOBJECTOBJ 21
#constant MENU_3DOBJECTFILEFORMATOFF 22
#constant MENU_OPENFLIGHTSCENEDESCRIPTIONFLT 23
#constant MENU_STANDARDTRIANGLEFORMATPLY 24
#constant MENU_STEREOLITHOGRAPHYCADSTL 25
#constant MENU_BLENDERMESHFILEGEO 26
#constant MENU_EXPORT 27
#constant MENU_COMPILING 29
global menuCompiling
#constant MENU_COMPILEPROGRAMWITHOUTSAVING 30
#constant MENU_COMPILEPROGRAMWITHSAVING 31
#constant MENU_PROGRAMOPTIONS 33
#constant MENU_EXIT 35
#constant MENU_EDIT 36
global menuEdit
#constant MENU_UNDO 37
#constant MENU_REDO 38
#constant MENU_CUTSHIFTC 40
#constant MENU_COPYSHIFTO 41
#constant MENU_PASTESHIFTP 42
#constant MENU_DELETE 43
#constant MENU_SELECTALL 45
#constant MENU_SELECTNONE 46
#constant MENU_INVERTSELECTION 47
#constant MENU_SELECTOBJECT 49
#constant MENU_SELECTFACE 50
#constant MENU_SELECTPOLYGON 51
#constant MENU_SELECTEDGE 52
#constant MENU_SELECTVERTEX 53
#constant MENU_VIEW 54
global menuView
#constant MENU_TOOLBAR 55
#constant MENU_EDITOR 56
#constant MENU_SCROLLBARS 57
#constant MENU_GRIDSIZELARGER 59
#constant MENU_GRIDSIZESMALLER 60
#constant MENU_ZOOMIN 62
#constant MENU_ZOOMOUT 63
#constant MENU_SINGLEVIEW 65
global menuSingleView
#constant MENU_TOPSHIFTT 66
#constant MENU_FRONTSHIFTF 67
#constant MENU_SIDESHIFTS 68
#constant MENU_PERSPECTIVESHIFTP 69
#constant MENU_RESTOREVIEWSSHIFTR 70
#constant MENU_DRAWMODE 72
global menuDrawMode
#constant MENU_WIREFRAME 73
#constant MENU_SOLID 74
#constant MENU_TEXTURED 75
#constant MENU_LIGHTMAPPED 76
#constant MENU_DRAWVIEW 77
global menuDrawView
#constant MENU_TOPT 78
#constant MENU_FRONTF 79
#constant MENU_SIDES 80
#constant MENU_PERSPECTIVEP 81
#constant MENU_DRAWTOFILE 83
#constant MENU_OBJECTCREATION 84
global menuObjectCreation
#constant MENU_GROUPITEMS 85
#constant MENU_UNGROUPITEMS 86
#constant MENU_PRIMITIVES 88
global menuPrimitives
#constant MENU_BOX 89
#constant MENU_CONE 90
#constant MENU_CUBE 91
#constant MENU_CYLINDER 92
#constant MENU_GRID 93
#constant MENU_PLANE 94
#constant MENU_SPHERE 95
#constant MENU_TRIANGLE 96
#constant MENU_ENTITIES 98
global menuEntities
#constant MENU_LIGHTS 99
global menuLights
#constant MENU_AMBIENTLIGHT 100
#constant MENU_DIRECTIONALLIGHT 101
#constant MENU_POINTLIGHT 102
#constant MENU_POINTLIGHTUSERDEFINED 103
#constant MENU_SPOTLIGHT 104
#constant MENU_CREATELIGHTMAP 105
#constant MENU_PLAYERCHARACTER 106
#constant MENU_NONPLAYERCHARACTER 107
#constant MENU_CSGCOMMANDS 109
global menuCSGCommands
#constant MENU_OBJECT 110
global menuObject
#constant MENU_UNIONU 111
#constant MENU_DIFFERENCED 112
#constant MENU_INTERSECTIONI 113
#constant MENU_VERTEX 114
global menuVertex
#constant MENU_UNIONSHIFTU 115
#constant MENU_DIFFERENCESHIFTD 116
#constant MENU_INTERSECTIONSHIFTI 117
#constant MENU_SCALE 119
#constant MENU_ROTATE 120
#constant MENU_MOVE 121
#constant MENU_EXTRUDE 122
#constant MENU_SPLIT 123
#constant MENU_INSET 124
#constant MENU_CONNECT 125
#constant MENU_FLIP 126
#constant MENU_AVERAGE 127
#constant MENU_BEVEL 128
#constant MENU_GENERATEUVCOORDINATES 129
#constant MENU_EXTRACT 130
#constant MENU_COPY 131
#constant MENU_WELD 132
#constant MENU_FILL 133
#constant MENU_ALIGN 134
#constant MENU_TURN 135
#constant MENU_OPTIMIZE 136
#constant MENU_SWEEP 137
#constant MENU_SMOOTH 138
#constant MENU_LEVEL 139
#constant MENU_PULL 140
#constant MENU_INSERT 141
#constant MENU_SNAP 142
global menuSnap
#constant MENU_ALL 143
#constant MENU_SELECTION 144
#constant MENU_OBJECTPROPERTIES 146
#constant MENU_TERRAINCREATION 147
global menuTerrainCreation
#constant MENU_NEWTERRAIN 148
#constant MENU_LOADTERRAIN 149
#constant MENU_SAVETERRAIN 150
#constant MENU_DELETETERRAIN 152
#constant MENU_IMPORTTERRAIN 154
global menuImportTerrain
#constant MENU_FROM3DOBJECT 155
#constant MENU_FROMHEIGHTMAP 156
#constant MENU_FROMSRTMDATAFILE 157
#constant MENU_EXPORTTERRAIN 158
global menuExportTerrain
#constant MENU_TO3DOBJECT 159
#constant MENU_TOHEIGHTMAP 160
#constant MENU_TOSRTMDATAFILE 161
#constant MENU_TERRAINPROPERTIES 163
#constant MENU_SKYCREATION 164
global menuSkyCreation
#constant MENU_SKY 165
#constant MENU_FOG 166
#constant MENU_AISYSTEM 167
global menuAISystem
#constant MENU_OBSTACLES 168
global menuObstacles
#constant MENU_CUSTOM 169
#constant MENU_FROMWORLD 170
#constant MENU_STATIC 171
#constant MENU_VIEWBLOCKING 172
#constant MENU_WAYPOINTS 173
global menuWayPoints
#constant MENU_ADDWAYPOINT 174
#constant MENU_REMOVEWAYPOINT 175
#constant MENU_CLEAR 177
#constant MENU_PATHS 178
global menuPaths
#constant MENU_BETWEENPOINTS 179
#constant MENU_FROMCLOSESTWAYPOINTS 180
#constant MENU_ZONES 181
global menuZones
#constant MENU_ADDZONE 182
#constant MENU_REMOVEZONE 183
#constant MENU_SOUNDS 184
global menuSounds
#constant MENU_CREATESOUND 185
#constant MENU_CONTAINERS 186
global menuContainers
#constant MENU_ADDCONTAINER 187
#constant MENU_REMOVECONTAINER 188
#constant MENU_AIPROPERTIES 190
#constant MENU_PHYSICSSYSTEM 191
global menuPhysicsSystem
#constant MENU_CREATEFLUIDSCENE 192
#constant MENU_CREATECLOTHSCENE 193
#constant MENU_CLOTH 195
global menuCloth
#constant MENU_CREATECLOTH 196
#constant MENU_DELETECLOTH 197
#constant MENU_FLUIDS 198
global menuFluids
#constant MENU_CREATEFLUID 199
#constant MENU_DELETEFLUID 200
#constant MENU_CREATEBOXDRAIN 202
#constant MENU_CREATESPHEREDRAIN 203
#constant MENU_DELETEDRAIN 204
#constant MENU_PARTICLECREATION 205
global menuParticleCreation
#constant MENU_FIRE 206
#constant MENU_PARTICLE 207
#constant MENU_SMOKE 208
#constant MENU_SNOWRAIN 209
#constant MENU_DELETEPARTICLE 211
#constant MENU_RIGIDBODY 212
global menuRigidBody
#constant MENU_CHARACTERCONTROLLERS 213
global menuCharacterControllers
#constant MENU_BOXCONTROLLER 214
#constant MENU_CAPSULECONTROLLER 215
#constant MENU_DELETECONTROLLER 216
#constant MENU_LOADINGCOMMANDS 217
global menuLoadingCommands
#constant MENU_DYNAMICCONVEXFILE 218
#constant MENU_DYNAMICMESHFILE 219
#constant MENU_STATICCONVEXFILE 220
#constant MENU_STATICMESHFILE 221
#constant MENU_STATICTERRAINFILE 222
#constant MENU_CREATIONOBJECTS 223
global menuCreationObjects
#constant MENU_RAGDOLL 224
#constant MENU_DYNAMICOBJECTS 225
global menuDynamicobjects
#constant MENU_DYNAMICBOX 226
#constant MENU_DYNAMICCAPSULE 227
#constant MENU_DYNAMICCONVEX 228
#constant MENU_DYNAMICMESH 229
#constant MENU_DYNAMICSPHERE 230
#constant MENU_STATICOBJECTS 231
global menuStaticObjects
#constant MENU_STATICBOX 232
#constant MENU_STATICCAPSULE 233
#constant MENU_STATICCONVEX 234
#constant MENU_STATICMESH 235
#constant MENU_STATICSPHERE 236
#constant MENU_STATICTERRAIN 237
#constant MENU_JOINTS 238
global menuJoints
#constant MENU_6DEGREESOFFREEDOMJOINT 239
#constant MENU_CYLINDRICALJOINT 240
#constant MENU_DISTANCEJOINT 241
#constant MENU_FIXEDJOINT 242
#constant MENU_POINTINPLANEJOINT 243
#constant MENU_POINTONLINEJOINT 244
#constant MENU_PRISMATICJOINT 245
#constant MENU_PULLEYJOINT 246
#constant MENU_REVOLUTEJOINT 247
#constant MENU_SPHEREJOINT 248
#constant MENU_BREAKLIMITS 250
#constant MENU_DELETEJOINT 252
#constant MENU_MATERIALS 253
global menuMaterials
#constant MENU_CREATEMATERIAL 254
#constant MENU_DELETEMATERIAL 255
#constant MENU_TRIGGERS 256
global menuTriggers
#constant MENU_BOXTRIGGER 257
#constant MENU_SPHERETRIGGER 258
#constant MENU_DELETETRIGGER 259
#constant MENU_CREATEVEHICLE 260
#constant MENU_OPTIONS 262
global menuOptions
#constant MENU_SCENES 263
global menuScenes
#constant MENU_CLOTHSCENE 264
#constant MENU_FLUIDSCENE 265
#constant MENU_ADAPTIVEFORCES 266
global menuAdaptiveForces
#constant MENU_ADAPTIVEFORCEON 267
#constant MENU_ADAPTIVEFORCEOFF 268
#constant MENU_BOUNCETHRESHOLD 269
#constant MENU_CONTINOUSCOLLISIONDETECTION 270
global menuContinousCollisionDetection
#constant MENU_CCDON 271
#constant MENU_CCDOFF 272
#constant MENU_CONTROLLEDFILTERING 273
global menuControlledFiltering
#constant MENU_CONTROLLEDFILTERINGON 274
#constant MENU_CONTROLLEDFILTERINGOFF 275
#constant MENU_ANGULARVELOCITYSQUAREDSLEEPSETTING 276
#constant MENU_LINEARVELOCITYSQUAREDSLEEPSETTING 277
#constant MENU_DYNAMICFRICTIONSETTING 278
#constant MENU_FIXEDTIMINGSETTING 279
#constant MENU_GRAVITYSETTING 280
#constant MENU_MAXIMUMANGULARVELOCITY 281
#constant MENU_SKINWIDTH 282
#constant MENU_STATICFRICTION 283
#constant MENU_TIMING 284
#constant MENU_TRIGGERCALLBACK 285
global menuTriggerCallback
#constant MENU_TRIGGERCALLBACKON 286
#constant MENU_TRIGGERCALLBACKOFF 287
#constant MENU_ANIMATIONEDITOR 288
global menuAnimationEditor
#constant MENU_NEWANIMATEDMODEL 289
#constant MENU_LOADANIMATEDMODEL 290
#constant MENU_SAVEANIMATEDMODEL 291
#constant MENU_ANIMATEDMODELPROPERTIES 293
#constant MENU_NEWANIMATION 295
#constant MENU_EXTRACTANIMATION 296
#constant MENU_SAVEANIMATION 297
#constant MENU_ANIMATIONPROPERTIES 299
#constant MENU_TEXTUREBROWSER 300
global menuTextureBrowser
#constant MENU_NEWTEXTURE 301
#constant MENU_LOADTEXTURE 302
#constant MENU_SAVETEXTURE 303
#constant MENU_DELETETEXTURE 305
#constant MENU_BROWSETEXTURES 307
#constant MENU_OBJECTBROWSER 308
global menuObjectBrowser
#constant MENU_ADDOBJECT 309
#constant MENU_REMOVEOBJECT 310
#constant MENU_BROWSEOBJECTS 312
#constant MENU_HELP 313
global menuHelp
#constant MENU_COMMANDHELP 314
#constant MENU_HELPCONTENTS 315
#constant MENU_INDEX 316
#constant MENU_ABOUT 318
global StatusBar
global sbw `StatusBar Width
global sbh `StatusBar Height
global Toolbar
global tbw `Toolbar width
global tbh `Toolbar height
`Background panel globals
global panel1
global panel1_left
global panel1_top
global panel1_right
global panel1_bottom
`Viewport globals
global vw
global vh
global top_view
global top_view_x
global top_view_y
global threed_view
global threed_view_x
global threed_view_y
global front_view
global front_view_x
global front_view_y
global side_view
global side_view_x
global side_view_y
desktop_width()
desktop_height()
desktop_depth()
set display mode desktop_width, desktop_height, desktop_depth, 1
taskbar = call dll(user32, "FindWindowA", "Shell_TrayWnd", "") `get the handle to the taskbar
Type RECT
Left as word
Top as word
Right as word
Bottom as word
EndType
dim position(0) as RECT
position(0).Left = 0
position(0).Top = 0
position(0).Right = 0
position(0).Bottom = 0
MAKE MEMBLOCK FROM ARRAY 1, position(0)
WRITE MEMBLOCK WORD 1, 0, 40
memptr1=get memblock ptr(1)
call dll user32, "GetWindowRect", taskbar, memptr1
make array from memblock position(0) ,1
tbleft = position(0).Left
tbtop = position(0).Top
tbright = position(0).Right
tbbottom = position(0).Bottom
tbwidth = tbright
tbheight = tbbottom - tbtop
mww = tbwidth `Main Window Width set to taskbar width in case of multiple moniter setup.
mwh = desktop_height - tbheight `Main Window Height - taskbar height
mwx = 0
mwy = 0
SET WINDOW SIZE mww, mwh
SET WINDOW TITLE "Reality World Editor"
SET WINDOW LAYOUT 1, 1, 0
set window position mwx, mwy
resetmainwindow
createUI()
createMainMenu()
`Create StatusBar Panes
addStatusPanel StatusBar, 200
addStatusPanel StatusBar, 200
addStatusPanel StatusBar, 200
addStatusPanel StatusBar, 200
addStatusPanel StatusBar, 200
addStatusPanel StatusBar, 200
`Toolbar Button States
setToolBarButtonState Toolbar, 14, 1
setToolBarButtonState Toolbar, 15, 1
setToolBarButtonState Toolbar, 16, 1
setToolBarButtonState Toolbar, 17, 1
main_window_info()
create_viewports()
`*******************************************************************************
`Main program loop
`*******************************************************************************
do
`Retrieve information about events
getevent
`get mouse position
mx = mouseposx()
my = mouseposy()
setstatustext StatusBar, 1, "mouse_x = " + str$(mx)
setstatustext StatusBar, 2, "mouse_y = " + str$(my)
`main window and viewports events - minimize, maximize, close, and highlight window / viewport
` Highlight window / viewport
if gadgetundermouse() = panel1 then bring window to front
if gadgetundermouse() = StatusBar then bring window to front
if gadgetundermouse() = Toolbar then bring window to front
if gadgetundermouse() = top_view then bringtofront top_view
if gadgetundermouse() = threed_view then bringtofront threed_view
if gadgetundermouse() = front_view then bringtofront front_view
if gadgetundermouse() = side_view then bringtofront side_view
` Close window / viewport. No need to process main window, this is done automatically.
if gadgetundermouse() = top_view and eventtype() = WINDOW_CLOSE then setgadgetvisible top_view, 0: setToolBarButtonState Toolbar, 14, 0
if gadgetundermouse() = threed_view and eventtype() = WINDOW_CLOSE then setgadgetvisible threed_view, 0: setToolBarButtonState Toolbar, 15, 0
if gadgetundermouse() = front_view and eventtype() = WINDOW_CLOSE then setgadgetvisible front_view, 0: setToolBarButtonState Toolbar, 16, 0
if gadgetundermouse() = side_view and eventtype() = WINDOW_CLOSE then setgadgetvisible side_view, 0: setToolBarButtonState Toolbar, 17, 0
`Resize Main Window and all viewports
mw = WINDOW RESIZED()
if mw = 1 then resize_all()
`menu events
if eventType()=MENU_CLICK
select eventData()
case 1: message "menuFile","New": endcase
case 2: message "menuFile","Open": endcase
case 3: message "menuFile","Save": endcase
case 4: message "menuFile","Save As": endcase
case 5: message "menuFile","Save Selected": endcase
case 7: message "menuFile","Import": endcase
case 8: message "menuImport","Stereo Cad 3D2": endcase
case 9: message "menuImport","Rhinoceros 3DM": endcase
case 10: message "menuImport","Acrobat 3DMF": endcase
case 11: message "menuImport","3D Studio 3DS": endcase
case 12: message "menuImport","World 3D Standard 3DX": endcase
case 13: message "menuImport","Anim8tor AN8": endcase
case 14: message "menuImport","Cinema 4D C4d": endcase
case 15: message "menuImport","Lightwave": endcase
case 16: message "menuLightwave","Lightwave 3D Layered Object LWLO": endcase
case 17: message "menuLightwave","Lightwave 3D Object LWOB": endcase
case 18: message "menuLightwave","Lightwave 3D Scene LWSC": endcase
case 19: message "menuImport","Milkshape 3D MS3D": endcase
case 20: message "menuImport","Alias / Wavefront Material Library File MTL": endcase
case 21: message "menuImport","Wavefront Object OBJ": endcase
case 22: message "menuImport","3D Object File Format OFF": endcase
case 23: message "menuImport","Open Flight Scene Description FLT": endcase
case 24: message "menuImport","Standard Triangle Format PLY": endcase
case 25: message "menuImport","stereolithography CAD STL": endcase
case 26: message "menuImport","Blender Mesh File GEO": endcase
case 27: message "menuFile","Export": endcase
case 29: message "menuFile","Compiling": endcase
case 30: message "menuCompiling","Compile Program Without Saving": endcase
case 31: message "menuCompiling","Compile Program With Saving": endcase
case 33: message "menuFile","Program Options": endcase
case 35: message "menuFile","Exit": endcase
case 37: message "menuEdit","Undo": endcase
case 38: message "menuEdit","Redo": endcase
case 40: message "menuEdit","Cut Shift + C": endcase
case 41: message "menuEdit","Copy Shift + O": endcase
case 42: message "menuEdit","Paste Shift + P": endcase
case 43: message "menuEdit","Delete": endcase
case 45: message "menuEdit","Select All": endcase
case 46: message "menuEdit","Select None": endcase
case 47: message "menuEdit","Invert Selection": endcase
case 49: message "menuEdit","Select Object": endcase
case 50: message "menuEdit","Select Face": endcase
case 51: message "menuEdit","Select Polygon": endcase
case 52: message "menuEdit","Select Edge": endcase
case 53: message "menuEdit","Select Vertex": endcase
case 55: message "menuView","Toolbar": endcase
case 56: message "menuView","Editor": endcase
case 57: message "menuView","Scroll Bars": endcase
case 59: message "menuView","Grid Size Larger": endcase
case 60: message "menuView","Grid size Smaller": endcase
case 62: message "menuView","Zoom In": endcase
case 63: message "menuView","Zoom Out": endcase
case 65: message "menuView","Single View": endcase
case 66: message "menuSingleView","Top Shift + T": endcase
case 67: message "menuSingleView","Front Shift + F": endcase
case 68: message "menuSingleView","Side Shift + S": endcase
case 69: message "menuSingleView","Perspective Shift + P": endcase
case 70: message "menuSingleView","Restore Views Shift + R": endcase
case 72: message "menuView","Draw Mode": endcase
case 73: message "menuDrawMode","Wireframe": endcase
case 74: message "menuDrawMode","Solid": endcase
case 75: message "menuDrawMode","Textured": endcase
case 76: message "menuDrawMode","Light Mapped": endcase
case 77: message "menuView","Draw View": endcase
case 78: message "menuDrawView","Top T": endcase
case 79: message "menuDrawView","Front F": endcase
case 80: message "menuDrawView","Side S": endcase
case 81: message "menuDrawView","Perspective P": endcase
case 83: message "menuView","Draw To File": endcase
case 85: message "menuObjectCreation","Group Items": endcase
case 86: message "menuObjectCreation","Ungroup Items": endcase
case 88: message "menuObjectCreation","Primitives": endcase
case 89: message "menuPrimitives","Box": endcase
case 90: message "menuPrimitives","Cone": endcase
case 91: message "menuPrimitives","Cube": endcase
case 92: message "menuPrimitives","Cylinder": endcase
case 93: message "menuPrimitives","Grid": endcase
case 94: message "menuPrimitives","Plane": endcase
case 95: message "menuPrimitives","Sphere": endcase
case 96: message "menuPrimitives","Triangle": endcase
case 98: message "menuObjectCreation","Entities": endcase
case 99: message "menuEntities","Lights": endcase
case 100: message "menuLights","Ambient Light": endcase
case 101: message "menuLights","Directional Light": endcase
case 102: message "menuLights","Point Light": endcase
case 103: message "menuLights","Point Light ( User Defined )": endcase
case 104: message "menuLights","Spot Light": endcase
case 105: message "menuLights","Create lightmap": endcase
case 106: message "menuEntities","Player Character": endcase
case 107: message "menuEntities","Non Player Character": endcase
case 109: message "menuObjectCreation","CSG Commands": endcase
case 110: message "menuCSGCommands","Object": endcase
case 111: message "menuObject","Union U": endcase
case 112: message "menuObject","Difference D": endcase
case 113: message "menuObject","Intersection I": endcase
case 114: message "menuCSGCommands","Vertex": endcase
case 115: message "menuVertex","Union Shift + U": endcase
case 116: message "menuVertex","Difference Shift + D": endcase
case 117: message "menuVertex","Intersection Shift + I": endcase
case 119: message "menuObjectCreation","Scale": endcase
case 120: message "menuObjectCreation","Rotate": endcase
case 121: message "menuObjectCreation","Move": endcase
case 122: message "menuObjectCreation","Extrude": endcase
case 123: message "menuObjectCreation","Split": endcase
case 124: message "menuObjectCreation","Inset": endcase
case 125: message "menuObjectCreation","Connect": endcase
case 126: message "menuObjectCreation","Flip": endcase
case 127: message "menuObjectCreation","Average": endcase
case 128: message "menuObjectCreation","Bevel": endcase
case 129: message "menuObjectCreation","Generate UV Coordinates": endcase
case 130: message "menuObjectCreation","Extract": endcase
case 131: message "menuObjectCreation","Copy": endcase
case 132: message "menuObjectCreation","Weld": endcase
case 133: message "menuObjectCreation","Fill": endcase
case 134: message "menuObjectCreation","Align": endcase
case 135: message "menuObjectCreation","Turn": endcase
case 136: message "menuObjectCreation","Optimize": endcase
case 137: message "menuObjectCreation","Sweep": endcase
case 138: message "menuObjectCreation","Smooth": endcase
case 139: message "menuObjectCreation","Level": endcase
case 140: message "menuObjectCreation","Pull": endcase
case 141: message "menuObjectCreation","Insert": endcase
case 142: message "menuObjectCreation","Snap": endcase
case 143: message "menuSnap","All": endcase
case 144: message "menuSnap","Selection": endcase
case 146: message "menuObjectCreation","Object Properties": endcase
case 148: message "menuTerrainCreation","New Terrain": endcase
case 149: message "menuTerrainCreation","Load Terrain": endcase
case 150: message "menuTerrainCreation","Save Terrain": endcase
case 152: message "menuTerrainCreation","Delete Terrain": endcase
case 154: message "menuTerrainCreation","Import Terrain": endcase
case 155: message "menuImportTerrain","From 3D Object": endcase
case 156: message "menuImportTerrain","From Heightmap": endcase
case 157: message "menuImportTerrain","From SRTM Data File": endcase
case 158: message "menuTerrainCreation","Export Terrain": endcase
case 159: message "menuExportTerrain","To 3D Object": endcase
case 160: message "menuExportTerrain","To Heightmap": endcase
case 161: message "menuExportTerrain","To SRTM Data File": endcase
case 163: message "menuTerrainCreation","Terrain Properties": endcase
case 165: message "menuSkyCreation","Sky": endcase
case 166: message "menuSkyCreation","Fog": endcase
case 168: message "menuAISystem","Obstacles": endcase
case 169: message "menuObstacles","Custom": endcase
case 170: message "menuObstacles","From World": endcase
case 171: message "menuObstacles","Static": endcase
case 172: message "menuObstacles","View Blocking": endcase
case 173: message "menuAISystem","Way Points": endcase
case 174: message "menuWayPoints","Add Waypoint": endcase
case 175: message "menuWayPoints","Remove Waypoint": endcase
case 177: message "menuWayPoints","Clear": endcase
case 178: message "menuAISystem","Paths": endcase
case 179: message "menuPaths","Between points": endcase
case 180: message "menuPaths","From closest Waypoints": endcase
case 181: message "menuAISystem","Zones": endcase
case 182: message "menuZones","Add Zone": endcase
case 183: message "menuZones","Remove Zone": endcase
case 184: message "menuAISystem","Sounds": endcase
case 185: message "menuSounds","Create Sound": endcase
case 186: message "menuAISystem","Containers": endcase
case 187: message "menuContainers","Add Container": endcase
case 188: message "menuContainers","Remove Container": endcase
case 190: message "menuAISystem","AI Properties": endcase
case 192: message "menuPhysicsSystem","Create Fluid Scene": endcase
case 193: message "menuPhysicsSystem","Create Cloth Scene": endcase
case 195: message "menuPhysicsSystem","Cloth": endcase
case 196: message "menuCloth","Create Cloth": endcase
case 197: message "menuCloth","Delete Cloth": endcase
case 198: message "menuPhysicsSystem","Fluids": endcase
case 199: message "menuFluids","Create Fluid": endcase
case 200: message "menuFluids","Delete Fluid": endcase
case 202: message "menuFluids","Create Box Drain": endcase
case 203: message "menuFluids","Create Sphere Drain": endcase
case 204: message "menuFluids","Delete Drain": endcase
case 205: message "menuPhysicsSystem","Particle Creation": endcase
case 206: message "menuParticleCreation","Fire": endcase
case 207: message "menuParticleCreation","Particle": endcase
case 208: message "menuParticleCreation","Smoke": endcase
case 209: message "menuParticleCreation","Snow / Rain": endcase
case 211: message "menuParticleCreation","Delete Particle": endcase
case 212: message "menuPhysicsSystem","Rigid Body": endcase
case 213: message "menuRigidBody","Character Controllers": endcase
case 214: message "menuCharacterControllers","Box Controller": endcase
case 215: message "menuCharacterControllers","Capsule Controller": endcase
case 216: message "menuCharacterControllers","Delete Controller": endcase
case 217: message "menuRigidBody","Loading Commands": endcase
case 218: message "menuLoadingCommands","Dynamic Convex File": endcase
case 219: message "menuLoadingCommands","Dynamic Mesh File": endcase
case 220: message "menuLoadingCommands","Static convex File": endcase
case 221: message "menuLoadingCommands","Static Mesh File": endcase
case 222: message "menuLoadingCommands","Static Terrain File": endcase
case 223: message "menuRigidBody","Creation Objects": endcase
case 224: message "menuCreationObjects","Ragdoll": endcase
case 225: message "menuCreationObjects","Dynamic objects": endcase
case 226: message "menuDynamicobjects","Dynamic Box": endcase
case 227: message "menuDynamicobjects","Dynamic Capsule": endcase
case 228: message "menuDynamicobjects","Dynamic Convex": endcase
case 229: message "menuDynamicobjects","Dynamic Mesh": endcase
case 230: message "menuDynamicobjects","Dynamic Sphere": endcase
case 231: message "menuCreationObjects","Static Objects": endcase
case 232: message "menuStaticObjects","Static Box": endcase
case 233: message "menuStaticObjects","Static Capsule": endcase
case 234: message "menuStaticObjects","Static Convex": endcase
case 235: message "menuStaticObjects","Static Mesh": endcase
case 236: message "menuStaticObjects","Static Sphere": endcase
case 237: message "menuStaticObjects","Static Terrain": endcase
case 238: message "menuRigidBody","Joints": endcase
case 239: message "menuJoints","6 Degrees Of Freedom Joint": endcase
case 240: message "menuJoints","Cylindrical Joint": endcase
case 241: message "menuJoints","distance Joint": endcase
case 242: message "menuJoints","Fixed Joint": endcase
case 243: message "menuJoints","Point In Plane Joint": endcase
case 244: message "menuJoints","Point On Line Joint": endcase
case 245: message "menuJoints","Prismatic Joint": endcase
case 246: message "menuJoints","Pulley Joint": endcase
case 247: message "menuJoints","Revolute Joint": endcase
case 248: message "menuJoints","Sphere Joint": endcase
case 250: message "menuJoints","Break Limits": endcase
case 252: message "menuJoints","Delete Joint": endcase
case 253: message "menuRigidBody","Materials": endcase
case 254: message "menuMaterials","Create Material": endcase
case 255: message "menuMaterials","Delete Material": endcase
case 256: message "menuRigidBody","Triggers": endcase
case 257: message "menuTriggers","Box Trigger": endcase
case 258: message "menuTriggers","Sphere Trigger": endcase
case 259: message "menuTriggers","Delete Trigger": endcase
case 260: message "menuRigidBody","Create Vehicle": endcase
case 262: message "menuRigidBody","Options": endcase
case 263: message "menuOptions","Scenes": endcase
case 264: message "menuScenes","Cloth Scene": endcase
case 265: message "menuScenes","Fluid Scene": endcase
case 266: message "menuOptions","Adaptive Forces": endcase
case 267: message "menuAdaptiveForces","Adaptive Force On": endcase
case 268: message "menuAdaptiveForces","Adaptive Force Off": endcase
case 269: message "menuOptions","Bounce Threshold": endcase
case 270: message "menuOptions","Continous Collision Detection": endcase
case 271: message "menuContinousCollisionDetection","CCD On": endcase
case 272: message "menuContinousCollisionDetection","CCD Off": endcase
case 273: message "menuOptions","Controlled Filtering": endcase
case 274: message "menuControlledFiltering","Controlled Filtering On": endcase
case 275: message "menuControlledFiltering","Controlled Filtering Off": endcase
case 276: message "menuOptions","Angular Velocity Squared Sleep Setting": endcase
case 277: message "menuOptions","Linear Velocity Squared Sleep Setting": endcase
case 278: message "menuOptions","Dynamic Friction Setting": endcase
case 279: message "menuOptions","Fixed Timing Setting": endcase
case 280: message "menuOptions","Gravity Setting": endcase
case 281: message "menuOptions","Maximum Angular Velocity": endcase
case 282: message "menuOptions","Skin Width": endcase
case 283: message "menuOptions","Static Friction": endcase
case 284: message "menuOptions","Timing": endcase
case 285: message "menuOptions","Trigger Callback": endcase
case 286: message "menuTriggerCallback","Trigger Callback On": endcase
case 287: message "menuTriggerCallback","Trigger Callback Off": endcase
case 289: message "menuAnimationEditor","New Animated Model": endcase
case 290: message "menuAnimationEditor","Load Animated Model": endcase
case 291: message "menuAnimationEditor","Save Animated Model": endcase
case 293: message "menuAnimationEditor","Animated Model Properties": endcase
case 295: message "menuAnimationEditor","New Animation": endcase
case 296: message "menuAnimationEditor","Extract Animation": endcase
case 297: message "menuAnimationEditor","Save Animation": endcase
case 299: message "menuAnimationEditor","Animation Properties": endcase
case 301: message "menuTextureBrowser","New Texture": endcase
case 302: message "menuTextureBrowser","Load Texture": endcase
case 303: message "menuTextureBrowser","Save Texture": endcase
case 305: message "menuTextureBrowser","Delete Texture": endcase
case 307: message "menuTextureBrowser","Browse Textures": endcase
case 309: message "menuObjectBrowser","Add Object": endcase
case 310: message "menuObjectBrowser","Remove Object": endcase
case 312: message "menuObjectBrowser","Browse Objects": endcase
case 314: message "menuHelp","Command Help": endcase
case 315: message "menuHelp","Help Contents": endcase
case 316: message "menuHelp","Index": endcase
case 318: message "menuHelp","About": endcase
endselect
endif
`Toolbar Event
if eventType()=MOUSE_CLICK and eventSource()=toolbar
select getToolbarItem(toolbar)
case 0:
setToolBarButtonState Toolbar, 0, 0
message "Toolbar", "New"
endcase
case 1:
setToolBarButtonState Toolbar, 1, 0
message "Toolbar", "Open"
endcase
case 2:
setToolBarButtonState Toolbar, 2, 0
message "Toolbar", "Save"
endcase
case 4:
setToolBarButtonState Toolbar, 4, 0
message "Toolbar", "Cut"
endcase
case 5:
setToolBarButtonState Toolbar, 5, 0
message "Toolbar", "Copy"
endcase
case 6:
setToolBarButtonState Toolbar, 6, 0
message "Toolbar", "Paste"
endcase
case 7:
setToolBarButtonState Toolbar, 7, 0
message "Toolbar", "Delete"
endcase
case 9:
setToolBarButtonState Toolbar, 9, 0
message "Toolbar", "Undo"
endcase
case 10:
setToolBarButtonState Toolbar, 10, 0
message "Toolbar", "Redo"
endcase
case 12:
setToolBarButtonState Toolbar, 12, 0
message "Toolbar", "Help"
endcase
case 14:
setgadgetvisible top_view, 1
setToolBarButtonState Toolbar, 14, 1
endcase
case 15:
setgadgetvisible threed_view, 1
setToolBarButtonState Toolbar, 15, 1
endcase
case 16:
setgadgetvisible front_view, 1
setToolBarButtonState Toolbar, 16, 1
endcase
case 17:
setgadgetvisible side_view, 1
setToolBarButtonState Toolbar, 17, 1
endcase
endselect
endif
loop
finish:
start:
a$=inkey$()
if a$="" then goto start
delete dll user32
delete memblock 1
end
`*******************************************************************************
`*******************************************************************************
`Create User Interface
`---------------------
function createUI()
If Not GUI_CONSTANTS Then errorMessage "GUI Constants not defined. Please include gui.dba when you compile" : end
Toolbar=createToolbar(0)`reality)
addStandardToolbarButtons Toolbar
addToolbarButton Toolbar, TOOLBAR_NEW, 1, "New File"
addToolbarButton Toolbar, TOOLBAR_OPEN, 1, "Open File"
addToolbarButton Toolbar, TOOLBAR_SAVE, 1, "Save File"
addToolbarSplitter Toolbar
addToolbarButton Toolbar, TOOLBAR_CUT, 1, "Cut"
addToolbarButton Toolbar, TOOLBAR_COPY, 1, "Copy"
addToolbarButton Toolbar, TOOLBAR_PASTE, 1, "Paste"
addToolbarButton Toolbar, TOOLBAR_DELETE, 1, "Delete"
addToolbarSplitter Toolbar
addToolbarButton Toolbar, TOOLBAR_UNDO, 1, "Undo"
addToolbarButton Toolbar, TOOLBAR_REDO, 1, "Redo"
addToolbarSplitter Toolbar
addToolbarButton Toolbar, TOOLBAR_HELP, 1, "Help"
`create extra buttons for toolbar
addToolbarSplitter Toolbar
addToolbarButton Toolbar, "tv.bmp", 1, "Show Top View"
addToolbarButton Toolbar, "3dv.bmp", 1, "Show 3D View"
addToolbarButton Toolbar, "fv.bmp", 1, "Show Front View"
addToolbarButton Toolbar, "sv.bmp", 1, "Show Side View"
StatusBar=createStatusBar(0)`reality)
endfunction
`Create Main Menu
`----------------
function createMainMenu()
menu=createMenu(reality)
addMenuItem menu,"File",0`reality
menuFile=createSubMenu(menu,0)`,reality)
addMenuItem menuFile,"New",1
addMenuItem menuFile,"Open",2
addMenuItem menuFile,"Save",3
addMenuItem menuFile,"Save As",4
addMenuItem menuFile,"Save Selected",5
addMenuSplitter menuFile
addMenuItem menuFile,"Import",7
menuImport=createSubMenu(menuFile,7)
addMenuItem menuImport,"Stereo Cad 3D2",8
addMenuItem menuImport,"Rhinoceros 3DM",9
addMenuItem menuImport,"Acrobat 3DMF",10
addMenuItem menuImport,"3D Studio 3DS",11
addMenuItem menuImport,"World 3D Standard 3DX",12
addMenuItem menuImport,"Anim8tor AN8",13
addMenuItem menuImport,"Cinema 4D C4d",14
addMenuItem menuImport,"Lightwave",15
menuLightwave=createSubMenu(menuImport,15)
addMenuItem menuLightwave,"Lightwave 3D Layered Object LWLO",16
addMenuItem menuLightwave,"Lightwave 3D Object LWOB",17
addMenuItem menuLightwave,"Lightwave 3D Scene LWSC",18
addMenuItem menuImport,"Milkshape 3D MS3D",19
addMenuItem menuImport,"Alias / Wavefront Material Library File MTL",20
addMenuItem menuImport,"Wavefront Object OBJ",21
addMenuItem menuImport,"3D Object File Format OFF",22
addMenuItem menuImport,"Open Flight Scene Description FLT",23
addMenuItem menuImport,"Standard Triangle Format PLY",24
addMenuItem menuImport,"stereolithography CAD STL",25
addMenuItem menuImport,"Blender Mesh File GEO",26
addMenuItem menuFile,"Export",27
addMenuSplitter menuFile
addMenuItem menuFile,"Compiling",29
menuCompiling=createSubMenu(menuFile,29)
addMenuItem menuCompiling,"Compile Program Without Saving",30
addMenuItem menuCompiling,"Compile Program With Saving",31
addMenuSplitter menuFile
addMenuItem menuFile,"Program Options",33
addMenuSplitter menuFile
addMenuItem menuFile,"Exit",35
addMenuItem menu,"Edit",36
menuEdit=createSubMenu(menu,36)
addMenuItem menuEdit,"Undo",37
addMenuItem menuEdit,"Redo",38
addMenuSplitter menuEdit
addMenuItem menuEdit,"Cut Shift + C",40
addMenuItem menuEdit,"Copy Shift + O",41
addMenuItem menuEdit,"Paste Shift + P",42
addMenuItem menuEdit,"Delete",43
addMenuSplitter menuEdit
addMenuItem menuEdit,"Select All",45
addMenuItem menuEdit,"Select None",46
addMenuItem menuEdit,"Invert Selection",47
addMenuSplitter menuEdit
addMenuItem menuEdit,"Select Object",49
addMenuItem menuEdit,"Select Face",50
addMenuItem menuEdit,"Select Polygon",51
addMenuItem menuEdit,"Select Edge",52
addMenuItem menuEdit,"Select Vertex",53
addMenuItem menu,"View",54
menuView=createSubMenu(menu,54)
addMenuItem menuView,"Toolbar",55
addMenuItem menuView,"Editor",56
addMenuItem menuView,"Scroll Bars",57
addMenuSplitter menuView
addMenuItem menuView,"Grid Size Larger",59
addMenuItem menuView,"Grid size Smaller",60
addMenuSplitter menuView
addMenuItem menuView,"Zoom In",62
addMenuItem menuView,"Zoom Out",63
addMenuSplitter menuView
addMenuItem menuView,"Single View",65
menuSingleView=createSubMenu(menuView,65)
addMenuItem menuSingleView,"Top Shift + T",66
addMenuItem menuSingleView,"Front Shift + F",67
addMenuItem menuSingleView,"Side Shift + S",68
addMenuItem menuSingleView,"Perspective Shift + P",69
addMenuItem menuSingleView,"Restore Views Shift + R",70
addMenuSplitter menuView
addMenuItem menuView,"Draw Mode",72
menuDrawMode=createSubMenu(menuView,72)
addMenuItem menuDrawMode,"Wireframe",73
addMenuItem menuDrawMode,"Solid",74
addMenuItem menuDrawMode,"Textured",75
addMenuItem menuDrawMode,"Light Mapped",76
addMenuItem menuView,"Draw View",77
menuDrawView=createSubMenu(menuView,77)
addMenuItem menuDrawView,"Top T",78
addMenuItem menuDrawView,"Front F",79
addMenuItem menuDrawView,"Side S",80
addMenuItem menuDrawView,"Perspective P",81
addMenuSplitter menuView
addMenuItem menuView,"Draw To File",83
addMenuItem menu,"Object Creation",84
menuObjectCreation=createSubMenu(menu,84)
addMenuItem menuObjectCreation,"Group Items",85
addMenuItem menuObjectCreation,"Ungroup Items",86
addMenuSplitter menuObjectCreation
addMenuItem menuObjectCreation,"Primitives",88
menuPrimitives=createSubMenu(menuObjectCreation,88)
addMenuItem menuPrimitives,"Box",89
addMenuItem menuPrimitives,"Cone",90
addMenuItem menuPrimitives,"Cube",91
addMenuItem menuPrimitives,"Cylinder",92
addMenuItem menuPrimitives,"Grid",93
addMenuItem menuPrimitives,"Plane",94
addMenuItem menuPrimitives,"Sphere",95
addMenuItem menuPrimitives,"Triangle",96
addMenuSplitter menuObjectCreation
addMenuItem menuObjectCreation,"Entities",98
menuEntities=createSubMenu(menuObjectCreation,98)
addMenuItem menuEntities,"Lights",99
menuLights=createSubMenu(menuEntities,99)
addMenuItem menuLights,"Ambient Light",100
addMenuItem menuLights,"Directional Light",101
addMenuItem menuLights,"Point Light",102
addMenuItem menuLights,"Point Light ( User Defined )",103
addMenuItem menuLights,"Spot Light",104
addMenuItem menuLights,"Create lightmap",105
addMenuItem menuEntities,"Player Character",106
addMenuItem menuEntities,"Non Player Character",107
addMenuSplitter menuObjectCreation
addMenuItem menuObjectCreation,"CSG Commands",109
menuCSGCommands=createSubMenu(menuObjectCreation,109)
addMenuItem menuCSGCommands,"Object",110
menuObject=createSubMenu(menuCSGCommands,110)
addMenuItem menuObject,"Union U",111
addMenuItem menuObject,"Difference D",112
addMenuItem menuObject,"Intersection I",113
addMenuItem menuCSGCommands,"Vertex",114
menuVertex=createSubMenu(menuCSGCommands,114)
addMenuItem menuVertex,"Union Shift + U",115
addMenuItem menuVertex,"Difference Shift + D",116
addMenuItem menuVertex,"Intersection Shift + I",117
addMenuSplitter menuObjectCreation
addMenuItem menuObjectCreation,"Scale",119
addMenuItem menuObjectCreation,"Rotate",120
addMenuItem menuObjectCreation,"Move",121
addMenuItem menuObjectCreation,"Extrude",122
addMenuItem menuObjectCreation,"Split",123
addMenuItem menuObjectCreation,"Inset",124
addMenuItem menuObjectCreation,"Connect",125
addMenuItem menuObjectCreation,"Flip",126
addMenuItem menuObjectCreation,"Average",127
addMenuItem menuObjectCreation,"Bevel",128
addMenuItem menuObjectCreation,"Generate UV Coordinates",129
addMenuItem menuObjectCreation,"Extract",130
addMenuItem menuObjectCreation,"Copy",131
addMenuItem menuObjectCreation,"Weld",132
addMenuItem menuObjectCreation,"Fill",133
addMenuItem menuObjectCreation,"Align",134
addMenuItem menuObjectCreation,"Turn",135
addMenuItem menuObjectCreation,"Optimize",136
addMenuItem menuObjectCreation,"Sweep",137
addMenuItem menuObjectCreation,"Smooth",138
addMenuItem menuObjectCreation,"Level",139
addMenuItem menuObjectCreation,"Pull",140
addMenuItem menuObjectCreation,"Insert",141
addMenuItem menuObjectCreation,"Snap",142
menuSnap=createSubMenu(menuObjectCreation,142)
addMenuItem menuSnap,"All",143
addMenuItem menuSnap,"Selection",144
addMenuSplitter menuObjectCreation
addMenuItem menuObjectCreation,"Object Properties",146
addMenuItem menu,"Terrain Creation",147
menuTerrainCreation=createSubMenu(menu,147)
addMenuItem menuTerrainCreation,"New Terrain",148
addMenuItem menuTerrainCreation,"Load Terrain",149
addMenuItem menuTerrainCreation,"Save Terrain",150
addMenuSplitter menuTerrainCreation
addMenuItem menuTerrainCreation,"Delete Terrain",152
addMenuSplitter menuTerrainCreation
addMenuItem menuTerrainCreation,"Import Terrain",154
menuImportTerrain=createSubMenu(menuTerrainCreation,154)
addMenuItem menuImportTerrain,"From 3D Object",155
addMenuItem menuImportTerrain,"From Heightmap",156
addMenuItem menuImportTerrain,"From SRTM Data File",157
addMenuItem menuTerrainCreation,"Export Terrain",158
menuExportTerrain=createSubMenu(menuTerrainCreation,158)
addMenuItem menuExportTerrain,"To 3D Object",159
addMenuItem menuExportTerrain,"To Heightmap",160
addMenuItem menuExportTerrain,"To SRTM Data File",161
addMenuSplitter menuTerrainCreation
addMenuItem menuTerrainCreation,"Terrain Properties",163
addMenuItem menu,"Sky Creation",164
menuSkyCreation=createSubMenu(menu,164)
addMenuItem menuSkyCreation,"Sky",165
addMenuItem menuSkyCreation,"Fog",166
addMenuItem menu,"AI System",167
menuAISystem=createSubMenu(menu,167)
addMenuItem menuAISystem,"Obstacles",168
menuObstacles=createSubMenu(menuAISystem,168)
addMenuItem menuObstacles,"Custom",169
addMenuItem menuObstacles,"From World",170
addMenuItem menuObstacles,"Static",171
addMenuItem menuObstacles,"View Blocking",172
addMenuItem menuAISystem,"Way Points",173
menuWayPoints=createSubMenu(menuAISystem,173)
addMenuItem menuWayPoints,"Add Waypoint",174
addMenuItem menuWayPoints,"Remove Waypoint",175
addMenuSplitter menuWayPoints
addMenuItem menuWayPoints,"Clear",177
addMenuItem menuAISystem,"Paths",178
menuPaths=createSubMenu(menuAISystem,178)
addMenuItem menuPaths,"Between points",179
addMenuItem menuPaths,"From closest Waypoints",180
addMenuItem menuAISystem,"Zones",181
menuZones=createSubMenu(menuAISystem,181)
addMenuItem menuZones,"Add Zone",182
addMenuItem menuZones,"Remove Zone",183
addMenuItem menuAISystem,"Sounds",184
menuSounds=createSubMenu(menuAISystem,184)
addMenuItem menuSounds,"Create Sound",185
addMenuItem menuAISystem,"Containers",186
menuContainers=createSubMenu(menuAISystem,186)
addMenuItem menuContainers,"Add Container",187
addMenuItem menuContainers,"Remove Container",188
addMenuSplitter menuAISystem
addMenuItem menuAISystem,"AI Properties",190
addMenuItem menu,"Physics System",191
menuPhysicsSystem=createSubMenu(menu,191)
addMenuItem menuPhysicsSystem,"Create Fluid Scene",192
addMenuItem menuPhysicsSystem,"Create Cloth Scene",193
addMenuSplitter menuPhysicsSystem
addMenuItem menuPhysicsSystem,"Cloth",195
menuCloth=createSubMenu(menuPhysicsSystem,195)
addMenuItem menuCloth,"Create Cloth",196
addMenuItem menuCloth,"Delete Cloth",197
addMenuItem menuPhysicsSystem,"Fluids",198
menuFluids=createSubMenu(menuPhysicsSystem,198)
addMenuItem menuFluids,"Create Fluid",199
addMenuItem menuFluids,"Delete Fluid",200
addMenuSplitter menuFluids
addMenuItem menuFluids,"Create Box Drain",202
addMenuItem menuFluids,"Create Sphere Drain",203
addMenuItem menuFluids,"Delete Drain",204
addMenuItem menuPhysicsSystem,"Particle Creation",205
menuParticleCreation=createSubMenu(menuPhysicsSystem,205)
addMenuItem menuParticleCreation,"Fire",206
addMenuItem menuParticleCreation,"Particle",207
addMenuItem menuParticleCreation,"Smoke",208
addMenuItem menuParticleCreation,"Snow / Rain",209
addMenuSplitter menuParticleCreation
addMenuItem menuParticleCreation,"Delete Particle",211
addMenuItem menuPhysicsSystem,"Rigid Body",212
menuRigidBody=createSubMenu(menuPhysicsSystem,212)
addMenuItem menuRigidBody,"Character Controllers",213
menuCharacterControllers=createSubMenu(menuRigidBody,213)
addMenuItem menuCharacterControllers,"Box Controller",214
addMenuItem menuCharacterControllers,"Capsule Controller",215
addMenuItem menuCharacterControllers,"Delete Controller",216
addMenuItem menuRigidBody,"Loading Commands",217
menuLoadingCommands=createSubMenu(menuRigidBody,217)
addMenuItem menuLoadingCommands,"Dynamic Convex File",218
addMenuItem menuLoadingCommands,"Dynamic Mesh File",219
addMenuItem menuLoadingCommands,"Static convex File",220
addMenuItem menuLoadingCommands,"Static Mesh File",221
addMenuItem menuLoadingCommands,"Static Terrain File",222
addMenuItem menuRigidBody,"Creation Objects",223
menuCreationObjects=createSubMenu(menuRigidBody,223)
addMenuItem menuCreationObjects,"Ragdoll",224
addMenuItem menuCreationObjects,"Dynamic objects",225
menuDynamicobjects=createSubMenu(menuCreationObjects,225)
addMenuItem menuDynamicobjects,"Dynamic Box",226
addMenuItem menuDynamicobjects,"Dynamic Capsule",227
addMenuItem menuDynamicobjects,"Dynamic Convex",228
addMenuItem menuDynamicobjects,"Dynamic Mesh",229
addMenuItem menuDynamicobjects,"Dynamic Sphere",230
addMenuItem menuCreationObjects,"Static Objects",231
menuStaticObjects=createSubMenu(menuCreationObjects,231)
addMenuItem menuStaticObjects,"Static Box",232
addMenuItem menuStaticObjects,"Static Capsule",233
addMenuItem menuStaticObjects,"Static Convex",234
addMenuItem menuStaticObjects,"Static Mesh",235
addMenuItem menuStaticObjects,"Static Sphere",236
addMenuItem menuStaticObjects,"Static Terrain",237
addMenuItem menuRigidBody,"Joints",238
menuJoints=createSubMenu(menuRigidBody,238)
addMenuItem menuJoints,"6 Degrees Of Freedom Joint",239
addMenuItem menuJoints,"Cylindrical Joint",240
addMenuItem menuJoints,"distance Joint",241
addMenuItem menuJoints,"Fixed Joint",242
addMenuItem menuJoints,"Point In Plane Joint",243
addMenuItem menuJoints,"Point On Line Joint",244
addMenuItem menuJoints,"Prismatic Joint",245
addMenuItem menuJoints,"Pulley Joint",246
addMenuItem menuJoints,"Revolute Joint",247
addMenuItem menuJoints,"Sphere Joint",248
addMenuSplitter menuJoints
addMenuItem menuJoints,"Break Limits",250
addMenuSplitter menuJoints
addMenuItem menuJoints,"Delete Joint",252
addMenuItem menuRigidBody,"Materials",253
menuMaterials=createSubMenu(menuRigidBody,253)
addMenuItem menuMaterials,"Create Material",254
addMenuItem menuMaterials,"Delete Material",255
addMenuItem menuRigidBody,"Triggers",256
menuTriggers=createSubMenu(menuRigidBody,256)
addMenuItem menuTriggers,"Box Trigger",257
addMenuItem menuTriggers,"Sphere Trigger",258
addMenuItem menuTriggers,"Delete Trigger",259
addMenuItem menuRigidBody,"Create Vehicle",260
addMenuSplitter menuRigidBody
addMenuItem menuRigidBody,"Options",262
menuOptions=createSubMenu(menuRigidBody,262)
addMenuItem menuOptions,"Scenes",263
menuScenes=createSubMenu(menuOptions,263)
addMenuItem menuScenes,"Cloth Scene",264
addMenuItem menuScenes,"Fluid Scene",265
addMenuItem menuOptions,"Adaptive Forces",266
menuAdaptiveForces=createSubMenu(menuOptions,266)
addMenuItem menuAdaptiveForces,"Adaptive Force On",267
addMenuItem menuAdaptiveForces,"Adaptive Force Off",268
addMenuItem menuOptions,"Bounce Threshold",269
addMenuItem menuOptions,"Continous Collision Detection",270
menuContinousCollisionDetection=createSubMenu(menuOptions,270)
addMenuItem menuContinousCollisionDetection,"CCD On",271
addMenuItem menuContinousCollisionDetection,"CCD Off",272
addMenuItem menuOptions,"Controlled Filtering",273
menuControlledFiltering=createSubMenu(menuOptions,273)
addMenuItem menuControlledFiltering,"Controlled Filtering On",274
addMenuItem menuControlledFiltering,"Controlled Filtering Off",275
addMenuItem menuOptions,"Angular Velocity Squared Sleep Setting",276
addMenuItem menuOptions,"Linear Velocity Squared Sleep Setting",277
addMenuItem menuOptions,"Dynamic Friction Setting",278
addMenuItem menuOptions,"Fixed Timing Setting",279
addMenuItem menuOptions,"Gravity Setting",280
addMenuItem menuOptions,"Maximum Angular Velocity",281
addMenuItem menuOptions,"Skin Width",282
addMenuItem menuOptions,"Static Friction",283
addMenuItem menuOptions,"Timing",284
addMenuItem menuOptions,"Trigger Callback",285
menuTriggerCallback=createSubMenu(menuOptions,285)
addMenuItem menuTriggerCallback,"Trigger Callback On",286
addMenuItem menuTriggerCallback,"Trigger Callback Off",287
addMenuItem menu,"Animation Editor",288
menuAnimationEditor=createSubMenu(menu,288)
addMenuItem menuAnimationEditor,"New Animated Model",289
addMenuItem menuAnimationEditor,"Load Animated Model",290
addMenuItem menuAnimationEditor,"Save Animated Model",291
addMenuSplitter menuAnimationEditor
addMenuItem menuAnimationEditor,"Animated Model Properties",293
addMenuSplitter menuAnimationEditor
addMenuItem menuAnimationEditor,"New Animation",295
addMenuItem menuAnimationEditor,"Extract Animation",296
addMenuItem menuAnimationEditor,"Save Animation",297
addMenuSplitter menuAnimationEditor
addMenuItem menuAnimationEditor,"Animation Properties",299
addMenuItem menu,"Texture Browser",300
menuTextureBrowser=createSubMenu(menu,300)
addMenuItem menuTextureBrowser,"New Texture",301
addMenuItem menuTextureBrowser,"Load Texture",302
addMenuItem menuTextureBrowser,"Save Texture",303
addMenuSplitter menuTextureBrowser
addMenuItem menuTextureBrowser,"Delete Texture",305
addMenuSplitter menuTextureBrowser
addMenuItem menuTextureBrowser,"Browse Textures",307
addMenuItem menu,"Object Browser",308
menuObjectBrowser=createSubMenu(menu,308)
addMenuItem menuObjectBrowser,"Add Object",309
addMenuItem menuObjectBrowser,"Remove Object",310
addMenuSplitter menuObjectBrowser
addMenuItem menuObjectBrowser,"Browse Objects",312
addMenuItem menu,"Help",313
menuHelp=createSubMenu(menu,313)
addMenuItem menuHelp,"Command Help",314
addMenuItem menuHelp,"Help Contents",315
addMenuItem menuHelp,"Index",316
addMenuSplitter menuHelp
addMenuItem menuHelp,"About",318
endfunction
function desktop_width()
desktop_width = call dll(user32,"GetSystemMetrics",SM_CXSCREEN)
endfunction desktop_width
function desktop_height()
desktop_height=call dll(1,"GetSystemMetrics",SM_CYSCREEN)
endfunction desktop_height
function desktop_depth()
hdc=call dll(1, "GetDC", 0)
desktop_depth=call dll(2, "GetDeviceCaps", hdc, BITSPIXEL)
call dll 1, "ReleaseDC", 0, hdc
endfunction desktop_depth
function create_viewports()
panel1_left = 0
panel1_top = tbh + 1
panel1_right = mwcw
panel1_bottom = mwch - (sbh + tbh)
panel1 = createpanel(panel1_left, panel1_top, panel1_right, panel1_bottom, 0)
vw = (gadgetwidth(panel1) /2)
vh = (gadgetheight(panel1) /2)
top_view_x = 0
top_view_y = 0
threed_view_x = vw
threed_view_y = 0
front_view_x = 0
front_view_y = vh
side_view_x = vw
side_view_y = vh
top_view = createwindow(top_view_x, top_view_y, vw, vh, "TOP VIEW", WINDOW_NORMAL, 0, 0, panel1)
setgadgetparent top_view, panel1
threed_view = createwindow(threed_view_x, threed_view_y, vw, vh, "3D VIEW", WINDOW_NORMAL, 0, 0, panel1)
setgadgetparent threed_view, panel1
front_view = createwindow(front_view_x, front_view_y, vw, vh, "FRONT VIEW", WINDOW_NORMAL, 0, 0, panel1)
setgadgetparent front_view, panel1
side_view = createwindow(side_view_x, side_view_y, vw, vh, "SIDE VIEW", WINDOW_NORMAL, 0, 0, panel1)
setgadgetparent side_view, panel1
endfunction
function resize_all()
mwcw = WINDOW CLIENT WIDTH()
mwch = WINDOW CLIENT HEIGHT()
panel1_left = 0
panel1_top = tbh + 1
panel1_right = mwcw
panel1_bottom = mwch - (sbh + tbh)
resizeGadget panel1, panel1_right, panel1_bottom
vw = (gadgetwidth(panel1) /2)
vh = (gadgetheight(panel1) /2)
top_view_x = 0
top_view_y = 0
threed_view_x = vw
threed_view_y = 0
front_view_x = 0
front_view_y = vh
side_view_x = vw
side_view_y = vh
setGadget top_view, top_view_x, top_view_y, vw, vh
setGadget threed_view, threed_view_x, threed_view_y, vw, vh
setGadget front_view, front_view_x, front_view_y, vw, vh
setGadget side_view, side_view_x, side_view_y, vw, vh
endfunction
function main_window_info()
`Main Window Info
mwx = WINDOW X()
mwy = WINDOW Y()
mww = WINDOW WIDTH()
mwh = WINDOW HEIGHT()
mwcw = WINDOW CLIENT WIDTH()
mwch = WINDOW CLIENT HEIGHT()
tbw = gadgetwidth(Toolbar)
tbh = gadgetheight(Toolbar)
sbw = gadgetwidth(StatusBar)
sbh = gadgetheight(StatusBar)
endfunction
Just thought I would post this solution as a way of giving back to the forum and to say thanks to all the people who have helped or tried to help me.