mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 21:05:39 +00:00
Merge pull request #2118 from Areloch/MenuAndPopups
Refactors the Popup menus and GuiMenuBars
This commit is contained in:
commit
2d05d9dd70
30 changed files with 995 additions and 3116 deletions
|
|
@ -35,5 +35,4 @@ exec("./GuiEaseEditDlg.ed.cs");
|
|||
exec("./guiObjectInspector.ed.cs");
|
||||
exec("./uvEditor.ed.gui");
|
||||
exec("./objectSelection.ed.cs");
|
||||
exec("./guiPlatformGenericMenubar.ed.cs");
|
||||
exec("./postFxManager.gui");
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
if(isClass(GuiPlatformGenericMenuBar))
|
||||
{
|
||||
exec("./guiPlatformGenericMenubar.ed.gui");
|
||||
}
|
||||
else
|
||||
{
|
||||
%guiContent = new GuiControl(PlatformGenericMenubar) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
|
||||
new GuiControl()
|
||||
{
|
||||
internalName = "menubar";
|
||||
extent = "1024 20";
|
||||
minExtent = "320 20";
|
||||
horizSizing = "width";
|
||||
profile = "GuiMenuBarProfile";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(PlatformGenericMenubar) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
|
||||
new GuiPlatformGenericMenuBar()
|
||||
{
|
||||
internalName = "menubar";
|
||||
extent = "1024 20";
|
||||
minExtent = "320 20";
|
||||
horizSizing = "width";
|
||||
profile = "GuiMenuBarProfile";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -66,9 +66,13 @@ function GuiEditCanvas::onCreateMenu(%this)
|
|||
}
|
||||
|
||||
// Menu bar
|
||||
%this.menuBar = new MenuBar()
|
||||
%this.menuBar = new GuiMenuBar(GuiEditorMenubar)
|
||||
{
|
||||
dynamicItemInsertPos = 3;
|
||||
extent = "1024 20";
|
||||
minExtent = "320 20";
|
||||
horizSizing = "width";
|
||||
profile = "GuiMenuBarProfile";
|
||||
|
||||
new PopupMenu()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2043,7 +2043,7 @@ function EWorldEditor::syncGui( %this )
|
|||
%this.syncToolPalette();
|
||||
|
||||
EditorTree.update();
|
||||
Editor.getUndoManager().updateUndoMenu( EditorGui.menuBar-->EditMenu );
|
||||
Editor.getUndoManager().updateUndoMenu( EditorGui.findMenu("Edit") );
|
||||
EditorGuiStatusBar.setSelectionObjectsByCount( %this.getSelectionSize() );
|
||||
|
||||
EWTreeWindow-->LockSelection.setStateOn( %this.getSelectionLockCount() > 0 );
|
||||
|
|
|
|||
|
|
@ -110,9 +110,13 @@ function EditorGui::buildMenus(%this)
|
|||
};
|
||||
|
||||
// Menu bar
|
||||
%this.menuBar = new MenuBar(WorldEditorMenubar)
|
||||
%this.menuBar = new GuiMenuBar(WorldEditorMenubar)
|
||||
{
|
||||
dynamicItemInsertPos = 3;
|
||||
extent = "1024 20";
|
||||
minExtent = "320 20";
|
||||
horizSizing = "width";
|
||||
profile = "GuiMenuBarProfile";
|
||||
};
|
||||
|
||||
// File Menu
|
||||
|
|
@ -158,7 +162,7 @@ function EditorGui::buildMenus(%this)
|
|||
%fileMenu.appendItem("Exit Level" TAB "" TAB "EditorExitMission();");
|
||||
%fileMenu.appendItem("Quit" TAB %quitShortcut TAB "EditorQuitGame();");
|
||||
|
||||
%this.menuBar.insert(%fileMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%fileMenu);
|
||||
|
||||
// Edit Menu
|
||||
%editMenu = new PopupMenu()
|
||||
|
|
@ -187,7 +191,7 @@ function EditorGui::buildMenus(%this)
|
|||
item[15] = "Game Options..." TAB "" TAB "Canvas.pushDialog(optionsDlg);";
|
||||
item[16] = "PostEffect Manager" TAB "" TAB "Canvas.pushDialog(PostFXManager);";
|
||||
};
|
||||
%this.menuBar.insert(%editMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%editMenu);
|
||||
|
||||
// View Menu
|
||||
%viewMenu = new PopupMenu()
|
||||
|
|
@ -201,7 +205,7 @@ function EditorGui::buildMenus(%this)
|
|||
item[ 0 ] = "Visibility Layers" TAB "Alt V" TAB "VisibilityDropdownToggle();";
|
||||
item[ 1 ] = "Show Grid in Ortho Views" TAB %cmdCtrl @ "-Shift-Alt G" TAB "EditorGui.toggleOrthoGrid();";
|
||||
};
|
||||
%this.menuBar.insert(%viewMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%viewMenu);
|
||||
|
||||
// Camera Menu
|
||||
%cameraMenu = new PopupMenu()
|
||||
|
|
@ -229,7 +233,7 @@ function EditorGui::buildMenus(%this)
|
|||
Item[15] = "Manage Bookmarks..." TAB "Ctrl-Shift B" TAB "EditorGui.toggleCameraBookmarkWindow();";
|
||||
item[16] = "Jump to Bookmark" TAB %this.cameraBookmarksMenu;
|
||||
};
|
||||
%this.menuBar.insert(%cameraMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%cameraMenu);
|
||||
|
||||
// Editors Menu
|
||||
%editorsMenu = new PopupMenu()
|
||||
|
|
@ -246,7 +250,7 @@ function EditorGui::buildMenus(%this)
|
|||
//item[4] = "Terrain Painter" TAB "F4" TAB TerrainPainterPlugin;
|
||||
//item[5] = "-";
|
||||
};
|
||||
%this.menuBar.insert(%editorsMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%editorsMenu);
|
||||
|
||||
// Lighting Menu
|
||||
%lightingMenu = new PopupMenu()
|
||||
|
|
@ -263,7 +267,7 @@ function EditorGui::buildMenus(%this)
|
|||
// NOTE: The light managers will be inserted as the
|
||||
// last menu items in EditorLightingMenu::onAdd().
|
||||
};
|
||||
%this.menuBar.insert(%lightingMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%lightingMenu);
|
||||
|
||||
// Tools Menu
|
||||
%toolsMenu = new PopupMenu()
|
||||
|
|
@ -278,7 +282,7 @@ function EditorGui::buildMenus(%this)
|
|||
item[2] = "Torque SimView" TAB "" TAB "tree();";
|
||||
item[3] = "Make Selected a Mesh" TAB "" TAB "makeSelectedAMesh();";
|
||||
};
|
||||
%this.menuBar.insert(%toolsMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%toolsMenu);
|
||||
|
||||
// Help Menu
|
||||
%helpMenu = new PopupMenu()
|
||||
|
|
@ -293,7 +297,7 @@ function EditorGui::buildMenus(%this)
|
|||
item[2] = "Offline Reference Guide..." TAB "" TAB "shellexecute(EWorldEditor.documentationReference);";
|
||||
item[3] = "Torque 3D Forums..." TAB "" TAB "gotoWebPage(EWorldEditor.forumURL);";
|
||||
};
|
||||
%this.menuBar.insert(%helpMenu, %this.menuBar.getCount());
|
||||
%this.menuBar.insert(%helpMenu);
|
||||
|
||||
// Menus that are added/removed dynamically (temporary)
|
||||
|
||||
|
|
@ -398,9 +402,9 @@ function EditorGui::setMenuDefaultState(%this)
|
|||
if(! isObject(%this.menuBar))
|
||||
return 0;
|
||||
|
||||
for(%i = 0;%i < %this.menuBar.getCount();%i++)
|
||||
for(%i = 0;%i < %this.menuBar.getMenuCount();%i++)
|
||||
{
|
||||
%menu = %this.menuBar.getObject(%i);
|
||||
%menu = %this.menuBar.getMenu(%i);
|
||||
%menu.setupDefaultState();
|
||||
}
|
||||
|
||||
|
|
@ -414,9 +418,10 @@ function EditorGui::findMenu(%this, %name)
|
|||
if(! isObject(%this.menuBar))
|
||||
return 0;
|
||||
|
||||
for(%i = 0;%i < %this.menuBar.getCount();%i++)
|
||||
|
||||
for(%i = 0; %i < %this.menuBar.getMenuCount(); %i++)
|
||||
{
|
||||
%menu = %this.menuBar.getObject(%i);
|
||||
%menu = %this.menuBar.getMenu(%i);
|
||||
|
||||
if(%name $= %menu.barTitle)
|
||||
return %menu;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue