|
rigCodeEditor 0.1.0
RigKit pack API - rigCodeEditor
|
Full code-editor chrome (menu, find/replace, open-file tabs). More...
#include <rigCodeEditor/src/TextEditorPanel.h>
Classes | |
| struct | SidebarEntry |
| One host-supplied source tab - a file or a live buffer. More... | |
Public Member Functions | |
| void | setDialogCallbacks (std::function< void(const std::string &title, std::vector< std::string > filters, ConfirmPath onConfirm)> openFile, std::function< void(const std::string &title, std::vector< std::string > filters, ConfirmPath onConfirm)> saveFile) |
| Host open/save (IMui FileDialogs - extension filters like ".py", ".*"). | |
| void | drawContents () |
| Menu bar + tabs + editor + status - call inside an open ImGui window. | |
| bool | selectSidebarEntryById (const std::string &id) |
| Activate the host tab whose id matches (no-op if missing). | |
| std::string | selectedSidebarId () const |
| Id of the host tab currently shown. | |
| void | setOpenFilesSidebarEnabled (bool enabled) |
| Show disk-opened buffers as closable tabs (default on). | |
| void | setShowTabBar (bool enabled) |
| Draw the tab strip. | |
| void | setFileActions (std::function< void()> onNew, std::function< void(const std::string &)> onOpen, std::function< void()> onClose) |
| Hand New / Open / Close to the host. | |
| void | setStatusNote (std::function< StatusNote(const std::string &text, const char *language)> fn) |
| Extra status-bar text for the buffer on screen. | |
| void | openPath (const std::string &path) |
| Open a disk path as its own tab. | |
| void | loadPath (const std::string &path) |
Load path into this panel. | |
| void | setOpenResourceMenuDraw (std::function< void()> cb) |
| Optional File to Open to Resource menu body (drawn live each frame). | |
| void | setFont (ImFont *font) |
| Monospace editor font (JetBrains Mono). | |
Static Public Attributes | |
| static constexpr std::size_t | kMaxLoadBytes = 2 * 1024 * 1024 |
| Refuse loads larger than this (TextEditor builds one glyph per character). | |
Full code-editor chrome (menu, find/replace, open-file tabs).
Draw into an existing ImGui window begun with ImGuiWindowFlags_MenuBar. Host buffers and disk opens appear as Sublime-style tabs above the editor.
| void rigkit::TextEditorPanel::loadPath | ( | const std::string & | path | ) |
Load path into this panel.
Does not call the Open file action.
| void rigkit::TextEditorPanel::openPath | ( | const std::string & | path | ) |
Open a disk path as its own tab.
Reloads when that path is already open. Directories are refused. Does not create a CCode entity.
| std::string rigkit::TextEditorPanel::selectedSidebarId | ( | ) | const |
Id of the host tab currently shown.
| bool rigkit::TextEditorPanel::selectSidebarEntryById | ( | const std::string & | id | ) |
Activate the host tab whose id matches (no-op if missing).
Re-selecting the tab already shown reloads it from its backing buffer, so a host that just swapped the buffer text (and bumped revision) can call this to make the editor follow.
|
inline |
Hand New / Open / Close to the host.
Set when each file is its own window. Empty callbacks keep the in-panel tab behavior. Invoked from the menu and shortcuts; the host should defer window creation until after the current ImGui frame.
|
inline |
Optional File to Open to Resource menu body (drawn live each frame).
When set, File to Open becomes a submenu: File... + Resource to ....
|
inline |
Draw the tab strip.
Off when this window is a single file.
|
inline |
Extra status-bar text for the buffer on screen.
Called when the undo index or language changes, with the full buffer text. Empty label draws nothing. Not called every frame.