yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
item_context_menu.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_CANVAS_ITEM_CONTEXT_MENU_H
2#define YAZE_APP_GUI_CANVAS_ITEM_CONTEXT_MENU_H
3
4#include <functional>
5#include <string>
6#include <vector>
7
9#include "imgui/imgui.h"
10
11namespace yaze {
12namespace gui {
13
25bool ItemContextMenu(const char* id,
26 const std::function<std::vector<MenuItemSpec>()>& build,
27 ImGuiPopupFlags flags = ImGuiPopupFlags_None);
28
29// Same, for menus that need section titles.
30bool ItemContextMenu(const char* id,
31 const std::function<CanvasMenuDefinition()>& build,
32 ImGuiPopupFlags flags = ImGuiPopupFlags_None);
33
34// Render a flat list of items (no popup handling). For use inside an existing
35// BeginPopup / BeginPopupContext* block.
36void RenderMenuItems(const std::vector<MenuItemSpec>& items);
37
38// "Copy <thing>" item that places `text` on the clipboard.
39MenuItemSpec CopyToClipboardItem(const std::string& label,
40 const std::string& text);
41
42} // namespace gui
43} // namespace yaze
44
45#endif // YAZE_APP_GUI_CANVAS_ITEM_CONTEXT_MENU_H
bool ItemContextMenu(const char *id, const std::function< std::vector< MenuItemSpec >()> &build, ImGuiPopupFlags flags)
Right-click menu for the last submitted ImGui item.
CanvasMenuItem MenuItemSpec
Neutral alias for menu items used outside canvases (list rows, tabs, chips). Same type,...
MenuItemSpec CopyToClipboardItem(const std::string &label, const std::string &text)
void RenderMenuItems(const std::vector< MenuItemSpec > &items)