Try my new website: www.urcho.com - the new SIMPLE social network
blitz code snippets Sign up | 284 members | 114 snippets
Search for:

Username:
Password:


Load a menu from a file by Leadwerks

[back]
Author: Archive | Viewed: 771 times | Language: BlitzBasic 3D | Category: File Controls
Author Comments:
This is a useful routine to load your applications menu from a file. You can even load a new menu, and the old one will be destroyed. Menu gadgets are stored in a global MenuItem[] array, according to their tag. If you need to check or disable a menu item, just check to see if the menu item exists, then perform the action: Select WaitEvent() Case EVENT_MENUEVENT Select EventData() Case MENU_ACTION If MenuItem[MENU_ACTION] CheckMenu MenuItem[MENU_ACTION] Here is a sample menu file: [File] menu "New", NewFile <> menu "Open...", OpenFile, O, 2 menu "Merge...", MergeFile <> menu "Save", SaveFile, S, 2 menu "Save As...", SaveFileAs menu "Save Selected...", SaveSelected <> menu "Import....", ImportFile menu "Export...", ExportFile menu "Export Selected...", ExportSelected <> menu "Run Map...", NewFile, F5 <> menu "Exit", Exit [Edit] menu "Undo", Undo, Z, 2 menu "Redo", Redo, Z, 6 <> menu "Cut", CutSelection, X, 2 menu "Copy", CopySelection, C, 2 menu "Paste", PasteSelection, V, 2 <> menu "Select All", SelectAll menu "Select None", SelectNone, Space menu "Intert Selection", SelectInvert <> menu "Select Object", SelectObject, Z menu "Select Subobject", SelectSubobject, X menu "Select Vertex", SelectVertex, C <> menu "Properties...", ShowProperties, Enter, 4 [View] menu "Material Browser", ShowMaterialBrowser menu "Model Browser", ShowModelBrowser <> menu "Toolbar", ShowToolbar menu "Sidepanel", ShowSidepanel menu "Scrollbars",ShowScrollbars <> menu "Console", ShowConsole menu "Map Statistics", ShowStats <> menu "Full-Screen", FullScreenMode, F12 <> menu "Increase Grid Size", GridMore, [ menu "Decrease Grid Size", GridLess, ] <> menu "Zoom In", ZoomMore, + menu "Zoom Out", ZoomLess, - <> menu "Render View" { menu "Perspective" menu "Front - XY" menu "Top - XZ" menu "Side - ZY" } menu "Culling" { menu "Occlusion" menu "Frustum" <> menu "Freeze Culling" } <> menu "World Render Mode" { menu "Wireframe" menu "Solid" menu "Textured" menu "Lighting" menu "Textured+Lighting" } menu "Model Render Mode" { menu "Wireframe" menu "Solid" menu "Textured" menu "Lighting" menu "Textured+Lighting" } <> menu "Render To File", RenderFile, F11 [Help] menu "Help Contents...", Help, F1 <> menu "About...", About
Login or create an account to comment on this snippet