1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-25 00:00:40 +01:00

Merge branch 'master' into navigation

This commit is contained in:
omar 2017-10-04 18:46:09 -07:00
commit 3ddcdcf6e7
4 changed files with 49 additions and 16 deletions

View File

@ -25,6 +25,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- window: double-clicking on title bar to minimize isn't consistent, perhaps move to single-click on left-most collapse icon?
- window: expose contents size. (#1045)
- window: GetWindowSize() returns (0,0) when not calculated? (#1045)
- window: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate.
!- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
- scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y). (2017-08-20: can't repro)
@ -55,6 +56,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- input text: flag to disable live update of the user buffer (also applies to float/int text input) (#701)
- input text: way to dynamically grow the buffer without forcing the user to initially allocate for worse case, e.g. more natural std::string (follow up on #200)
- input text: hover tooltip could show unclamped text
- input text: option to Tab after an Enter validation.
- input text: add ImGuiInputTextFlags_EnterToApply? (off #218)
- input text: easier ways to update buffer (from source char*) while owned. preserve some sort of cursor position for multi-line text.
- input text: add discard flag (e.g. ImGuiInputTextFlags_DiscardActiveBuffer) or make it easier to clear active focus for text replacement during edition (#725)
@ -80,7 +82,9 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- columns: sizing policy (e.g. for each column: fixed size, %, fill, distribute default size among fills) (#513, #125)
- columns: add a conditional parameter to SetColumnOffset() (#513, #125)
- columns: headers. with sort op/button. reorderable. (#513, #125)
- columns: headers. reorderable. (#513, #125)
- columns: optional sorting modifiers (up/down), sort list so sorting can be done multi-critera. notify user when sort order changed.
- columns: option to alternate background colors on odd/even scanlines.
- columns: allow columns to recurse.
- columns: separator function or parameter that works within the column (currently Separator() bypass all columns) (#125)
- columns: flag to add horizontal separator above/below?
@ -134,7 +138,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- combo: option for ComboEx to not return true when unchanged (#1182)
- combo/listbox: keyboard control. need InputText-like non-active focus + key handling. considering keyboard for custom listbox (pr #203)
- listbox: multiple selection.
- listbox: unselect (#1208)
- listbox: unselect option (#1208)
- listbox: make it easier/more natural to implement range-select (need some sort of info/ref about the last clicked/focused item that user can translate to an index?)
- listbox: user may want to initial scroll to focus on the one selected value?
- listbox: expose hovered item for a basic ListBox
@ -142,7 +146,6 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- listbox: scrolling should track modified selection.
!- popups/menus: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331, #402)
- popups/nav: esc/enter default behavior for popups.
- popups: reopening context menu at new position should be the behavior by default? (equivalent to internal OpenPopupEx() with reopen_existing=true)
- popups: if the popup functions took explicit ImGuiID it would allow the user to manage the scope of those ID. (#331)
- popups: clicking outside (to close popup) and holding shouldn't drag window below.
@ -217,13 +220,16 @@ 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.
!- keyboard: tooltip & combo boxes are messing up / not honoring keyboard tabbing.
- keyboard: full keyboard navigation and focus. (#323)
!- nav/keyboard: tooltip & combo boxes are messing up / not honoring keyboard tabbing.
- nav: integrate navigation branch into master. (#787)
- nav: integrate/design keyboard controls.
- nav: once tab should go through most/all widgets (in submission order?)
- nav: esc/enter default behavior for popups, e.g. be able to mark an "ok" or "cancel" button that would get triggered by those keys.
- focus: preserve ActiveId/focus stack state, e.g. when opening a menu and close it, previously selected InputText() focus gets restored (#622)
- focus: SetKeyboardFocusHere() on with >= 0 offset could be done on same frame (else latch and modulate on beginning of next frame)
- focus: unable to use SetKeyboardFocusHere() on clipped widgets. (#343)
- focus: unable to use SetKeyboardFocusHere() on clipped widgets. (#787)
- inputs: rework IO system to be able to pass actual ordered/timestamped events. use an event queue? (~#335, #71)
- inputs: allow to decide and pass explicit double-clicks (e.g. for windows by the CS_DBLCLKS style).
- inputs: allow to pass explicit double-clicks if that's the only thing the user's backend can get them. (e.g. for windows by the CS_DBLCLKS style).
- inputs: support track pad style scrolling & slider edit.
- misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)

View File

@ -53,8 +53,7 @@ int main(int argc, char** argv)
}
}
binary_to_compressed_c(argv[argn], argv[argn+1], use_base85_encoding, use_compression);
return 1;
return binary_to_compressed_c(argv[argn], argv[argn+1], use_base85_encoding, use_compression) ? 0 : 1;
}
char Encode85Byte(unsigned int x)

View File

@ -110,7 +110,7 @@
- See examples/ folder for standalone sample applications. To understand the integration process, you can read examples/opengl2_example/ because it is short,
then switch to the one more appropriate to your use case.
- You may be able to grab and copy a ready made imgui_impl_*** file from the examples/.
- When using Dear ImGui, your programming IDE if your friend: follow the declaration of variables, functions and types to find comments about them.
- When using Dear ImGui, your programming IDE is your friend: follow the declaration of variables, functions and types to find comments about them.
- Init: retrieve the ImGuiIO structure with ImGui::GetIO() and fill the fields marked 'Settings': at minimum you need to set io.DisplaySize (application resolution).
Later on you will fill your keyboard mapping, clipboard handlers, and other advanced features but for a basic integration you don't need to worry about it all.
@ -784,6 +784,29 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.12f);
}
// To scale your entire UI (e.g. if you want your app to use High DPI or generally be DPI aware) you may use this helper function. Scaling the fonts is done separately and is up to you.
// Tips: if you need to change your scale multiple times, prefer calling this on a freshly initialized ImGuiStyle structure rather than scaling multiple times (because floating point multiplications are lossy).
void ImGuiStyle::ScaleAllSizes(float scale_factor)
{
WindowPadding *= scale_factor;
WindowMinSize *= scale_factor;
WindowRounding *= scale_factor;
ChildWindowRounding *= scale_factor;
FramePadding *= scale_factor;
FrameRounding *= scale_factor;
ItemSpacing *= scale_factor;
ItemInnerSpacing *= scale_factor;
TouchExtraPadding *= scale_factor;
IndentSpacing *= scale_factor;
ColumnsMinSpacing *= scale_factor;
ScrollbarSize *= scale_factor;
ScrollbarRounding *= scale_factor;
GrabMinSize *= scale_factor;
GrabRounding *= scale_factor;
DisplayWindowPadding *= scale_factor;
DisplaySafeAreaPadding *= scale_factor;
}
ImGuiIO::ImGuiIO()
{
// Most fields are initialized with zero
@ -4516,9 +4539,9 @@ static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
char title[256];
if (name)
ImFormatString(title, IM_ARRAYSIZE(title), "%s.%s.%08X", parent_window->Name, name, id);
ImFormatString(title, IM_ARRAYSIZE(title), "%s/%s_%08X", parent_window->Name, name, id);
else
ImFormatString(title, IM_ARRAYSIZE(title), "%s.%08X", parent_window->Name, id);
ImFormatString(title, IM_ARRAYSIZE(title), "%s/%08X", parent_window->Name, id);
bool ret = ImGui::Begin(title, NULL, size, -1.0f, flags);
ImGuiWindow* child_window = ImGui::GetCurrentWindow();
@ -11647,6 +11670,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
int elem_offset = 0;
for (const ImDrawCmd* pcmd = draw_list->CmdBuffer.begin(); pcmd < draw_list->CmdBuffer.end(); elem_offset += pcmd->ElemCount, pcmd++)
{
if (pcmd->UserCallback == NULL && pcmd->ElemCount == 0)
continue;
if (pcmd->UserCallback)
{
ImGui::BulletText("Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData);
@ -11701,8 +11726,9 @@ void ImGui::ShowMetricsWindow(bool* p_open)
if (!ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, window->Active || window->WasActive, window))
return;
NodeDrawList(window->DrawList, "DrawList");
ImGui::BulletText("Pos: (%.1f,%.1f)", window->Pos.x, window->Pos.y);
ImGui::BulletText("Size: (%.1f,%.1f), SizeContents (%.1f,%.1f)", window->Size.x, window->Size.y, window->SizeContents.x, window->SizeContents.y);
ImGui::BulletText("Pos: (%.1f,%.1f), Size: (%.1f,%.1f), SizeContents (%.1f,%.1f)", window->Pos.x, window->Pos.y, window->Size.x, window->Size.y, window->SizeContents.x, window->SizeContents.y);
if (ImGui::IsItemHovered())
GImGui->OverlayDrawList.AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255,255,0,255));
ImGui::BulletText("Scroll: (%.2f,%.2f)", window->Scroll.x, window->Scroll.y);
ImGui::BulletText("Active: %d, Accessed: %d", window->Active, window->Accessed);
ImGui::BulletText("NavLastIds: 0x%08X,0x%08X, NavLayerActiveMask: %X", window->NavLastIds[0], window->NavLastIds[1], window->DC.NavLayerActiveMask);
@ -11718,8 +11744,9 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Funcs::NodeWindows(g.Windows, "Windows");
if (ImGui::TreeNode("DrawList", "Active DrawLists (%d)", g.RenderDrawLists[0].Size))
{
for (int i = 0; i < g.RenderDrawLists[0].Size; i++)
Funcs::NodeDrawList(g.RenderDrawLists[0][i], "DrawList");
for (int layer = 0; layer < IM_ARRAYSIZE(g.RenderDrawLists); layer++)
for (int i = 0; i < g.RenderDrawLists[layer].Size; i++)
Funcs::NodeDrawList(g.RenderDrawLists[0][i], "DrawList");
ImGui::TreePop();
}
if (ImGui::TreeNode("Popups", "Open Popups Stack (%d)", g.OpenPopupStack.Size))

View File

@ -806,6 +806,7 @@ struct ImGuiStyle
ImVec4 Colors[ImGuiCol_COUNT];
IMGUI_API ImGuiStyle();
IMGUI_API void ScaleAllSizes(float scale_factor);
};
// This is where your app communicate with ImGui. Access via ImGui::GetIO().