2026-03-20 17:08:06 +08:00
|
|
|
#include "MenuBar.h"
|
|
|
|
|
#include <imgui.h>
|
|
|
|
|
|
2026-03-24 20:02:38 +08:00
|
|
|
namespace XCEngine {
|
|
|
|
|
namespace Editor {
|
2026-03-20 17:08:06 +08:00
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-24 20:02:38 +08:00
|
|
|
}
|
2026-03-20 17:08:06 +08:00
|
|
|
}
|