|
153 | 153 | Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code. |
154 | 154 | Also read releases logs https://github.com/ocornut/imgui/releases for more details. |
155 | 155 |
|
156 | | - - 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore. |
157 | | - If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you. |
| 156 | + - 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore. |
| 157 | + If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you. |
158 | 158 | However if your TitleBg/TitleBgActive alpha was <1.0f you need to tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar. |
159 | 159 | This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color. |
160 | 160 | ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col) |
|
431 | 431 | io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese()); |
432 | 432 |
|
433 | 433 | Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic? |
434 | | - A: When loading a font, pass custom Unicode ranges to specify the glyphs to load. |
| 434 | + A: When loading a font, pass custom Unicode ranges to specify the glyphs to load. |
435 | 435 | All your strings needs to use UTF-8 encoding. Specifying literal in your source code using a local code page (such as CP-923 for Japanese or CP-1251 for Cyrillic) will not work. |
436 | 436 | In C++11 you can encode a string literal in UTF-8 by using the u8"hello" syntax. Otherwise you can convert yourself to UTF-8 or load text data from file already saved as UTF-8. |
437 | 437 | You can also try to remap your local codepage characters to their Unicode codepoint using font->AddRemapChar(), but international users may have problems reading/editing your source code. |
|
443 | 443 | As for text input, depends on you passing the right character code to io.AddInputCharacter(). The example applications do that. |
444 | 444 |
|
445 | 445 | Q: How can I use the drawing facilities without an ImGui window? (using ImDrawList API) |
446 | | - A: The easiest way is to create a dummy window. Call Begin() with NoTitleBar|NoResize|NoMove|NoScrollbar|NoSavedSettings|NoInputs flag, zero background alpha, |
| 446 | + A: The easiest way is to create a dummy window. Call Begin() with NoTitleBar|NoResize|NoMove|NoScrollbar|NoSavedSettings|NoInputs flag, zero background alpha, |
447 | 447 | then retrieve the ImDrawList* via GetWindowDrawList() and draw to it in any way you like. |
448 | 448 |
|
449 | 449 | - tip: the construct 'IMGUI_ONCE_UPON_A_FRAME { ... }' will run the block of code only once a frame. You can use it to quickly add custom UI in the middle of a deep nested inner loop in your code. |
|
485 | 485 | - main: IsItemHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode? |
486 | 486 | - input text: clean up the mess caused by converting UTF-8 <> wchar. the code is rather inefficient right now. |
487 | 487 | - input text: reorganize event handling, allow CharFilter to modify buffers, allow multiple events? (#541) |
488 | | - - input text: flag to disable live update of the user buffer (also applies to float/int text input) |
| 488 | + - input text: flag to disable live update of the user buffer (also applies to float/int text input) |
489 | 489 | - input text: resize behavior - field could stretch when being edited? hover tooltip shows more text? |
490 | 490 | - input text: add ImGuiInputTextFlags_EnterToApply? (off #218) |
491 | 491 | - input text multi-line: don't directly call AddText() which does an unnecessary vertex reserve for character count prior to clipping. and/or more line-based clipping to AddText(). and/or reorganize TextUnformatted/RenderText for more efficiency for large text (e.g TextUnformatted could clip and log separately, etc). |
@@ -800,8 +800,8 @@ ImGuiIO::ImGuiIO() |
800 | 800 | DisplaySize = ImVec2(-1.0f, -1.0f); |
801 | 801 | DeltaTime = 1.0f/60.0f; |
802 | 802 | IniSavingRate = 5.0f; |
803 | | - IniFilename = "imgui.ini"; |
804 | | - LogFilename = "imgui_log.txt"; |
| 803 | + IniFilename = "addons/imgui.ini"; |
| 804 | + LogFilename = "addons/imgui_log.txt"; |
805 | 805 | Fonts = &GImDefaultFontAtlas; |
806 | 806 | FontGlobalScale = 1.0f; |
807 | 807 | DisplayFramebufferScale = ImVec2(1.0f, 1.0f); |
@@ -833,7 +833,7 @@ ImGuiIO::ImGuiIO() |
833 | 833 | WordMovementUsesAltKey = true; // OS X style: Text editing cursor movement using Alt instead of Ctrl |
834 | 834 | ShortcutsUseSuperKey = true; // OS X style: Shortcuts using Cmd/Super instead of Ctrl |
835 | 835 | DoubleClickSelectsWord = true; // OS X style: Double click selects by word instead of selecting whole text |
836 | | - MultiSelectUsesSuperKey = true; // OS X style: Multi-selection in lists uses Cmd/Super instead of Ctrl |
| 836 | + MultiSelectUsesSuperKey = true; // OS X style: Multi-selection in lists uses Cmd/Super instead of Ctrl |
837 | 837 | #endif |
838 | 838 | } |
839 | 839 |
|
@@ -1655,8 +1655,8 @@ bool ImGuiListClipper::Step() |
1655 | 1655 | { |
1656 | 1656 | if (ItemsCount == 0 || ImGui::GetCurrentWindowRead()->SkipItems) |
1657 | 1657 | { |
1658 | | - ItemsCount = -1; |
1659 | | - return false; |
| 1658 | + ItemsCount = -1; |
| 1659 | + return false; |
1660 | 1660 | } |
1661 | 1661 | if (StepNo == 0) // Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height. |
1662 | 1662 | { |
@@ -2502,12 +2502,12 @@ static void AddDrawListToRenderList(ImVector<ImDrawList*>& out_render_list, ImDr |
2502 | 2502 | // Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc. |
2503 | 2503 | IM_ASSERT(draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size); |
2504 | 2504 | IM_ASSERT(draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size); |
2505 | | - IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); |
| 2505 | + IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); |
2506 | 2506 |
|
2507 | 2507 | // Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = 2 bytes = 64K vertices) |
2508 | 2508 | // If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly. |
2509 | 2509 | IM_ASSERT((int64_t)draw_list->_VtxCurrentIdx <= ((int64_t)1L << (sizeof(ImDrawIdx)*8))); // Too many vertices in same ImDrawList. See comment above. |
2510 | | - |
| 2510 | + |
2511 | 2511 | out_render_list.push_back(draw_list); |
2512 | 2512 | GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size; |
2513 | 2513 | GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size; |
@@ -4002,7 +4002,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us |
4002 | 4002 | // Apply minimum/maximum window size constraints and final size |
4003 | 4003 | ApplySizeFullWithConstraint(window, window->SizeFull); |
4004 | 4004 | window->Size = window->Collapsed ? window->TitleBarRect().GetSize() : window->SizeFull; |
4005 | | - |
| 4005 | + |
4006 | 4006 | // POSITION |
4007 | 4007 |
|
4008 | 4008 | // Position child window |
@@ -4204,8 +4204,8 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us |
4204 | 4204 | // Update ContentsRegionMax. All the variable it depends on are set above in this function. |
4205 | 4205 | window->ContentsRegionRect.Min.x = -window->Scroll.x + window->WindowPadding.x; |
4206 | 4206 | window->ContentsRegionRect.Min.x = -window->Scroll.y + window->WindowPadding.y + window->TitleBarHeight() + window->MenuBarHeight(); |
4207 | | - window->ContentsRegionRect.Max.x = -window->Scroll.x - window->WindowPadding.x + (window->SizeContentsExplicit.x != 0.0f ? window->SizeContentsExplicit.x : (window->Size.x - window->ScrollbarSizes.x)); |
4208 | | - window->ContentsRegionRect.Max.y = -window->Scroll.y - window->WindowPadding.y + (window->SizeContentsExplicit.y != 0.0f ? window->SizeContentsExplicit.y : (window->Size.y - window->ScrollbarSizes.y)); |
| 4207 | + window->ContentsRegionRect.Max.x = -window->Scroll.x - window->WindowPadding.x + (window->SizeContentsExplicit.x != 0.0f ? window->SizeContentsExplicit.x : (window->Size.x - window->ScrollbarSizes.x)); |
| 4208 | + window->ContentsRegionRect.Max.y = -window->Scroll.y - window->WindowPadding.y + (window->SizeContentsExplicit.y != 0.0f ? window->SizeContentsExplicit.y : (window->Size.y - window->ScrollbarSizes.y)); |
4209 | 4209 |
|
4210 | 4210 | // Setup drawing context |
4211 | 4211 | window->DC.IndentX = 0.0f + window->WindowPadding.x - window->Scroll.x; |
@@ -5473,7 +5473,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool |
5473 | 5473 | SetActiveID(0); |
5474 | 5474 | } |
5475 | 5475 |
|
5476 | | - // 'Repeat' mode acts when held regardless of _PressedOn flags (see table above). |
| 5476 | + // 'Repeat' mode acts when held regardless of _PressedOn flags (see table above). |
5477 | 5477 | // Relies on repeat logic of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings. |
5478 | 5478 | if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && g.IO.MouseDownDuration[0] > 0.0f && IsMouseClicked(0, true)) |
5479 | 5479 | pressed = true; |
|
0 commit comments