Draggable, dockable card for editor sub-windows. More...
#include <editor_layout.h>
Public Types | |
| enum class | Position { Free , Right , Left , Bottom , Floating } |
Public Member Functions | |
| EditorCard (const char *title, const char *icon=nullptr) | |
| EditorCard (const char *title, const char *icon, bool *p_open) | |
| void | SetDefaultSize (float width, float height) |
| void | SetPosition (Position pos) |
| void | SetMinimizable (bool minimizable) |
| void | SetClosable (bool closable) |
| void | SetHeadless (bool headless) |
| void | SetDockingAllowed (bool allowed) |
| void | SetIconCollapsible (bool collapsible) |
| bool | Begin (bool *p_open=nullptr) |
| void | End () |
| void | SetMinimized (bool minimized) |
| bool | IsMinimized () const |
| void | Focus () |
| bool | IsFocused () const |
| const char * | GetWindowName () const |
Private Member Functions | |
| void | DrawFloatingIconButton () |
Private Attributes | |
| std::string | title_ |
| std::string | icon_ |
| std::string | window_name_ |
| ImVec2 | default_size_ |
| Position | position_ = Position::Free |
| bool | minimizable_ = true |
| bool | closable_ = true |
| bool | minimized_ = false |
| bool | first_draw_ = true |
| bool | focused_ = false |
| bool * | p_open_ = nullptr |
| bool | imgui_begun_ = false |
| bool | headless_ = false |
| bool | docking_allowed_ = true |
| bool | icon_collapsible_ = false |
| bool | collapsed_to_icon_ = false |
| ImVec2 | saved_icon_pos_ = ImVec2(10, 100) |
Draggable, dockable card for editor sub-windows.
Replaces traditional child windows with modern cards that can be:
Usage:
Definition at line 106 of file editor_layout.h.
|
strong |
| Enumerator | |
|---|---|
| Free | |
| Right | |
| Left | |
| Bottom | |
| Floating | |
Definition at line 108 of file editor_layout.h.
| yaze::gui::EditorCard::EditorCard | ( | const char * | title, |
| const char * | icon = nullptr |
||
| ) |
Definition at line 231 of file editor_layout.cc.
References icon_, title_, and window_name_.
| yaze::gui::EditorCard::EditorCard | ( | const char * | title, |
| const char * | icon, | ||
| bool * | p_open | ||
| ) |
Definition at line 236 of file editor_layout.cc.
References icon_, p_open_, title_, and window_name_.
| void yaze::gui::EditorCard::SetDefaultSize | ( | float | width, |
| float | height | ||
| ) |
Definition at line 242 of file editor_layout.cc.
References default_size_.
Referenced by yaze::editor::ObjectEditorCard::Draw(), yaze::editor::PaletteEditor::DrawCustomPaletteCard(), yaze::editor::DungeonEditorV2::DrawDebugControlsCard(), yaze::editor::DungeonEditorV2::DrawEntrancesListCard(), yaze::editor::PaletteEditor::DrawQuickAccessCard(), yaze::editor::DungeonEditorV2::DrawRoomGraphicsCard(), yaze::editor::DungeonEditorV2::DrawRoomMatrixCard(), yaze::editor::DungeonEditorV2::DrawRoomsListCard(), yaze::emu::Emulator::RenderEmulatorInterface(), yaze::editor::OverworldEditor::Update(), yaze::editor::DungeonEditorV2::Update(), yaze::editor::GraphicsEditor::Update(), yaze::editor::ScreenEditor::Update(), yaze::editor::MessageEditor::Update(), yaze::editor::MusicEditor::Update(), yaze::editor::PaletteEditor::Update(), yaze::editor::SpriteEditor::Update(), and yaze::editor::SettingsEditor::Update().
| void yaze::gui::EditorCard::SetPosition | ( | Position | pos | ) |
Definition at line 246 of file editor_layout.cc.
References position_.
Referenced by yaze::editor::ObjectEditorCard::Draw(), yaze::editor::PaletteEditor::DrawCustomPaletteCard(), yaze::editor::PaletteEditor::DrawQuickAccessCard(), yaze::editor::DungeonEditorV2::DrawRoomGraphicsCard(), and yaze::editor::OverworldEditor::Update().
|
inline |
Definition at line 122 of file editor_layout.h.
References minimizable_.
|
inline |
Definition at line 123 of file editor_layout.h.
References closable_.
|
inline |
Definition at line 124 of file editor_layout.h.
References headless_.
|
inline |
Definition at line 125 of file editor_layout.h.
References docking_allowed_.
|
inline |
Definition at line 126 of file editor_layout.h.
References icon_collapsible_.
| bool yaze::gui::EditorCard::Begin | ( | bool * | p_open = nullptr | ) |
Definition at line 250 of file editor_layout.cc.
References Bottom, closable_, collapsed_to_icon_, default_size_, docking_allowed_, DrawFloatingIconButton(), first_draw_, Floating, Free, yaze::gui::GetAccentColor(), yaze::gui::GetThemeColor(), headless_, icon_, icon_collapsible_, imgui_begun_, yaze::gui::WidgetIdRegistry::Instance(), Left, p_open_, position_, yaze::gui::WidgetIdRegistry::RegisterWidget(), Right, and title_.
Referenced by yaze::editor::ObjectEditorCard::Draw(), yaze::editor::PaletteEditor::DrawCustomPaletteCard(), yaze::editor::DungeonEditorV2::DrawDebugControlsCard(), yaze::editor::DungeonEditorV2::DrawEntrancesListCard(), yaze::editor::DungeonEditorV2::DrawLayout(), yaze::editor::PaletteEditor::DrawQuickAccessCard(), yaze::editor::DungeonEditorV2::DrawRoomGraphicsCard(), yaze::editor::DungeonEditorV2::DrawRoomMatrixCard(), yaze::editor::DungeonEditorV2::DrawRoomsListCard(), yaze::emu::Emulator::RenderEmulatorInterface(), yaze::editor::OverworldEditor::Update(), yaze::editor::DungeonEditorV2::Update(), yaze::editor::GraphicsEditor::Update(), yaze::editor::ScreenEditor::Update(), yaze::editor::MessageEditor::Update(), yaze::editor::MusicEditor::Update(), yaze::editor::PaletteEditor::Update(), yaze::editor::SpriteEditor::Update(), yaze::editor::SettingsEditor::Update(), and yaze::editor::AssemblyEditor::UpdateCodeView().
| void yaze::gui::EditorCard::End | ( | ) |
Definition at line 339 of file editor_layout.cc.
References focused_, and imgui_begun_.
Referenced by yaze::editor::ObjectEditorCard::Draw(), yaze::editor::PaletteEditor::DrawCustomPaletteCard(), yaze::editor::DungeonEditorV2::DrawDebugControlsCard(), yaze::editor::DungeonEditorV2::DrawEntrancesListCard(), yaze::editor::DungeonEditorV2::DrawLayout(), yaze::editor::PaletteEditor::DrawQuickAccessCard(), yaze::editor::DungeonEditorV2::DrawRoomGraphicsCard(), yaze::editor::DungeonEditorV2::DrawRoomMatrixCard(), yaze::editor::DungeonEditorV2::DrawRoomsListCard(), yaze::emu::Emulator::RenderEmulatorInterface(), yaze::editor::OverworldEditor::Update(), yaze::editor::DungeonEditorV2::Update(), yaze::editor::GraphicsEditor::Update(), yaze::editor::ScreenEditor::Update(), yaze::editor::MessageEditor::Update(), yaze::editor::MusicEditor::Update(), yaze::editor::PaletteEditor::Update(), yaze::editor::SpriteEditor::Update(), yaze::editor::SettingsEditor::Update(), and yaze::editor::AssemblyEditor::UpdateCodeView().
|
inline |
Definition at line 135 of file editor_layout.h.
References minimized_.
|
inline |
Definition at line 136 of file editor_layout.h.
References minimized_.
| void yaze::gui::EditorCard::Focus | ( | ) |
Definition at line 352 of file editor_layout.cc.
References focused_, and window_name_.
|
inline |
Definition at line 140 of file editor_layout.h.
References focused_.
|
inline |
Definition at line 143 of file editor_layout.h.
References window_name_.
|
private |
Definition at line 358 of file editor_layout.cc.
References collapsed_to_icon_, icon_, saved_icon_pos_, title_, and window_name_.
Referenced by Begin().
|
private |
Definition at line 146 of file editor_layout.h.
Referenced by Begin(), DrawFloatingIconButton(), EditorCard(), and EditorCard().
|
private |
Definition at line 147 of file editor_layout.h.
Referenced by Begin(), DrawFloatingIconButton(), EditorCard(), and EditorCard().
|
private |
Definition at line 148 of file editor_layout.h.
Referenced by DrawFloatingIconButton(), EditorCard(), EditorCard(), Focus(), and GetWindowName().
|
private |
Definition at line 149 of file editor_layout.h.
Referenced by Begin(), and SetDefaultSize().
|
private |
Definition at line 150 of file editor_layout.h.
Referenced by Begin(), and SetPosition().
|
private |
Definition at line 151 of file editor_layout.h.
Referenced by SetMinimizable().
|
private |
Definition at line 152 of file editor_layout.h.
Referenced by Begin(), and SetClosable().
|
private |
Definition at line 153 of file editor_layout.h.
Referenced by IsMinimized(), and SetMinimized().
|
private |
Definition at line 154 of file editor_layout.h.
Referenced by Begin().
|
private |
Definition at line 155 of file editor_layout.h.
Referenced by End(), Focus(), and IsFocused().
|
private |
Definition at line 156 of file editor_layout.h.
Referenced by Begin(), and EditorCard().
|
private |
Definition at line 157 of file editor_layout.h.
|
private |
Definition at line 160 of file editor_layout.h.
Referenced by Begin(), and SetHeadless().
|
private |
Definition at line 161 of file editor_layout.h.
Referenced by Begin(), and SetDockingAllowed().
|
private |
Definition at line 162 of file editor_layout.h.
Referenced by Begin(), and SetIconCollapsible().
|
private |
Definition at line 163 of file editor_layout.h.
Referenced by Begin(), and DrawFloatingIconButton().
|
private |
Definition at line 164 of file editor_layout.h.
Referenced by DrawFloatingIconButton().