- 添加新的UI控件系统(Core.h, ScalarControls.h, VectorControls.h, UI.h) - 更新SceneManager支持场景层级管理 - 优化SelectionManager选择管理 - 改进InspectorPanel/GameViewPanel/HierarchyPanel等面板 - 更新RHI文档说明Vulkan实现计划
57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
#include "MenuBar.h"
|
|
#include <imgui.h>
|
|
|
|
namespace XCEngine {
|
|
namespace Editor {
|
|
|
|
MenuBar::MenuBar() : Panel("MenuBar") {}
|
|
|
|
void MenuBar::Render() {
|
|
if (ImGui::BeginMainMenuBar()) {
|
|
ShowFileMenu();
|
|
ShowEditMenu();
|
|
ShowViewMenu();
|
|
ShowHelpMenu();
|
|
ImGui::EndMainMenuBar();
|
|
}
|
|
}
|
|
|
|
void MenuBar::ShowFileMenu() {
|
|
if (ImGui::BeginMenu("File")) {
|
|
if (ImGui::MenuItem("New Scene", "Ctrl+N")) {}
|
|
if (ImGui::MenuItem("Open Scene", "Ctrl+O")) {}
|
|
if (ImGui::MenuItem("Save Scene", "Ctrl+S")) {}
|
|
ImGui::Separator();
|
|
if (ImGui::MenuItem("Exit", "Alt+F4")) {}
|
|
ImGui::EndMenu();
|
|
}
|
|
}
|
|
|
|
void MenuBar::ShowEditMenu() {
|
|
if (ImGui::BeginMenu("Edit")) {
|
|
if (ImGui::MenuItem("Undo", "Ctrl+Z")) {}
|
|
if (ImGui::MenuItem("Redo", "Ctrl+Y")) {}
|
|
ImGui::Separator();
|
|
if (ImGui::MenuItem("Cut", "Ctrl+X")) {}
|
|
if (ImGui::MenuItem("Copy", "Ctrl+C")) {}
|
|
if (ImGui::MenuItem("Paste", "Ctrl+V")) {}
|
|
ImGui::EndMenu();
|
|
}
|
|
}
|
|
|
|
void MenuBar::ShowViewMenu() {
|
|
if (ImGui::BeginMenu("View")) {
|
|
if (ImGui::MenuItem("Reset Layout")) {}
|
|
ImGui::EndMenu();
|
|
}
|
|
}
|
|
|
|
void MenuBar::ShowHelpMenu() {
|
|
if (ImGui::BeginMenu("Help")) {
|
|
if (ImGui::MenuItem("About")) {}
|
|
ImGui::EndMenu();
|
|
}
|
|
}
|
|
|
|
}
|
|
} |