feat: add C++ ImGui functions for core UI and visualization
Funciones C++/ImGui para dashboards (grid, panel, docking, sidebar, tabs), visualizaciones (candlestick, gauge, histogram, pie, sparkline, heatmap, scatter, line, bar, surface3d, kpi, table), grafos (force layout, renderer, viewport, spatial hash, types) y utilidades (time series buffer, tracy zones, memory/fps overlay, plot theme). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
---
|
||||
name: sidebar
|
||||
kind: component
|
||||
lang: cpp
|
||||
domain: core
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "bool sidebar_begin(const char* title, bool* open, float width = 250.0f)"
|
||||
description: "Panel lateral colapsable para filtros y controles de dashboard"
|
||||
tags: [imgui, sidebar, panel, layout, dashboard, controls]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: [imgui]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "cpp/functions/core/sidebar.cpp"
|
||||
framework: imgui
|
||||
params:
|
||||
- name: title
|
||||
desc: "Titulo del sidebar mostrado en la barra de titulo de la ventana"
|
||||
- name: open
|
||||
desc: "Puntero al estado abierto/cerrado; se pone a false si el usuario cierra la ventana"
|
||||
- name: width
|
||||
desc: "Ancho del sidebar en pixels (por defecto 250)"
|
||||
output: "true si el sidebar esta abierto y se debe renderizar contenido entre sidebar_begin y sidebar_end"
|
||||
---
|
||||
|
||||
# sidebar
|
||||
|
||||
Panel lateral colapsable. Cuando `*open == true` renderiza una ventana ImGui de ancho fijo con boton de cierre. Cuando `*open == false` muestra un boton compacto ">" para reabrir.
|
||||
|
||||
Siempre llamar `sidebar_end()` despues de `sidebar_begin()`, independientemente del valor de retorno.
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```cpp
|
||||
static bool filters_open = true;
|
||||
|
||||
void render_fn() {
|
||||
if (sidebar_begin("Filters", &filters_open)) {
|
||||
ImGui::SliderFloat("Min value", &min_val, 0.0f, 100.0f);
|
||||
ImGui::Checkbox("Show inactive", &show_inactive);
|
||||
}
|
||||
sidebar_end();
|
||||
|
||||
// contenido principal
|
||||
ImGui::Begin("Main");
|
||||
// ...
|
||||
ImGui::End();
|
||||
}
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
El estado de `s_sidebar_was_open` es una variable estatica interna que coordina `sidebar_begin` y `sidebar_end`. Solo un sidebar activo a la vez por frame (patron begin/end clasico de ImGui). Para multiples sidebars simultaneos, instanciar logica propia con estado separado.
|
||||
Reference in New Issue
Block a user