@ -237,12 +237,12 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- font: fix AddRemapChar() to work before font has been built.
- font: (api breaking) removed "TTF" from symbol names. also because it now supports OTF.
- nav: integrate navigation branch into master. (#787)
- nav: SetItemDefaultFocus() level of priority, so widget like Selectable when inside a popup could claim a low-priority default focus on the first selected iem
- nav: allow input system to be be more tolerant of io.DeltaTime=0.0f
- nav: Left within a tree node block as a fallback.
- nav: Esc on a flattened child
- nav: ESC on a flattened child
- nav: Left within a tree node block as a fallback (ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default?)
- nav: menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
- nav: menus: allow pressing Menu to leave a sub-menu.
- nav: integrate/design keyboard controls.
- nav: simulate right-click or context activation? (SHIFT+F10)
- nav: tabs should go through most/all widgets (in submission order?).
- nav: when CTRL-Tab/windowing is active, the HoveredWindow detection doesn't take account of the window display re-ordering.
ImGui::Text("HoveredId: 0x%08X/0x%08X (%.2f sec)",g.HoveredId,g.HoveredIdPreviousFrame,g.HoveredIdTimer);// Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not
boolKeysDown[512];// Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys).
ImWcharInputCharacters[16+1];// List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
floatNavInputs[ImGuiNavInput_COUNT];// Gamepad inputs (keyboard keys will be auto-mapped and be written here by ImGui::NewFrame)
floatNavInputs[ImGuiNavInput_COUNT];// Gamepad inputs (keyboard keys will be auto-mapped and be written here by ImGui::NewFrame, all values will be cleared back to zero in ImGui::EndFrame)
// Functions
IMGUI_APIvoidAddInputCharacter(ImWcharc);// Add new character into InputCharacters[]
//ImGui::Combo("combo w/ array of char*", ¤t_item_2_idx, items, IM_ARRAYSIZE(items)); // Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
// General BeginCombo() API, you have full control over your selection data and display type
if(ImGui::BeginCombo("combo 2",current_item_2))// The second parameter is the label previewed before opening the combo.
{
for(intn=0;n<IM_ARRAYSIZE(items);n++)
{
boolis_selected=(current_item_2==items[n]);// You can store your selection however you want, outside or inside your objects
if(ImGui::Selectable(items[n],is_selected))
current_item_2=items[n];
if(is_selected)
ImGui::SetItemDefaultFocus();// Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch)
}
ImGui::EndCombo();
}
// Using the _simplified_ one-liner Combo() api here
ImGui::SameLine();ShowHelpMarker("Refer to the \"Combo\" section below for an explanation of the full BeginCombo/EndCombo API, and demonstration of various flags.\n");
ImGui::SameLine();ShowHelpMarker("Click on the colored square to open a color picker.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
ImGuiIO&io=ImGui::GetIO();
ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
// Here we are grabbing the font texture because that's the only one we have access to inside the demo code.
// Remember that ImTextureID is just storage for whatever you want it to be, it is essentially a value that will be passed to the render function inside the ImDrawCmd structure.
staticconstchar*item_current=items[0];// Here our selection is a single pointer stored outside the object.
if(ImGui::BeginCombo("combo 1",item_current,flags))// The second parameter is the label previewed before opening the combo.
{
for(intn=0;n<IM_ARRAYSIZE(items);n++)
{
boolis_selected=(item_current==items[n]);
if(ImGui::Selectable(items[n],is_selected))
item_current=items[n];
if(is_selected)
ImGui::SetItemDefaultFocus();// Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch)
}
ImGui::EndCombo();
}
// Simplified one-liner Combo() API, using values packed in a single constant string
ImGuiIDNavNextActivateId;// Set by ActivateItem(), queued until next frame
ImGuiIDNavJustMovedToId;// Just navigated to this id (result of a successfully MoveRequest)
ImGuiIDNavNextActivateId;// Set by ActivateItem(), queued until next frame
ImGuiInputSourceNavInputSource;// Keyboard or Gamepad mode?
ImRectNavScoringRectScreen;// Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring.
intNavScoringCount;// Metrics for debugging
ImGuiWindow*NavWindowingTarget;// When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed front-most.
floatNavWindowingHighlightTimer;
floatNavWindowingHighlightAlpha;
boolNavWindowingToggleLayer;
ImGuiInputSourceNavWindowingInputSource;// Gamepad or keyboard mode
intNavLayer;// Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
intNavIdTabCounter;// == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRefRectRel is valid