1+ @file:OptIn(ExperimentalStdlibApi ::class )
2+
13package imgui.api
24
35import glm_.*
@@ -10,7 +12,6 @@ import imgui.ImGui.beginChildFrame
1012import imgui.ImGui.beginCombo
1113import imgui.ImGui.beginItemTooltip
1214import imgui.ImGui.beginTable
13- import imgui.ImGui.beginTooltip
1415import imgui.ImGui.bulletText
1516import imgui.ImGui.button
1617import imgui.ImGui.calcTextSize
@@ -93,14 +94,14 @@ import imgui.ImGui.treeNode
9394import imgui.ImGui.treeNodeToLabelSpacing
9495import imgui.ImGui.treePop
9596import imgui.ImGui.unindent
96- import imgui.classes.ListClipper
9797import imgui.classes.Style
9898import imgui.classes.listClipper
9999import imgui.demo.DemoWindow
100100import imgui.demo.showExampleApp.StyleEditor
101101import imgui.dsl.indent
102102import imgui.dsl.listBox
103103import imgui.dsl.treeNode
104+ import imgui.dsl.withID
104105import imgui.internal.DrawIdx
105106import imgui.internal.DrawVert
106107import imgui.internal.api.debugTools.Companion.metricsHelpMarker
@@ -176,7 +177,6 @@ interface demoDebugInformations {
176177 text(" Application average %.3f ms/frame (%.1f FPS)" , 1000f / io.framerate, io.framerate)
177178 text(" ${io.metricsRenderVertices} vertices, ${io.metricsRenderIndices} indices (${io.metricsRenderIndices / 3 } triangles)" )
178179 text(" ${io.metricsRenderWindows} visible windows, ${io.metricsActiveAllocations} active allocations" )
179- text(" If your company uses this, please consider sponsoring the project!" )
180180 // SameLine(); if (SmallButton("GC")) { g.GcCompactAll = true; }
181181
182182 separator()
@@ -205,7 +205,7 @@ interface demoDebugInformations {
205205 if (showEncodingViewer) {
206206 setNextItemWidth(- Float .MIN_VALUE )
207207 inputText(" ##Text" , buf)
208- if (buf.isNotEmpty() )
208+ if (buf[ 0 ] != 0 .b )
209209 debugTextEncoding(buf)
210210 treePop()
211211 }
@@ -265,7 +265,7 @@ interface demoDebugInformations {
265265 continue
266266 for (columnN in 0 until table.columnsCount) {
267267 val r = Funcs .getTableRect(table, rectN, columnN)
268- val buf = " (%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) Col $columnN ${rectN.name} " .format(r.min.x, r.min.y, r.max.x, r.max.y, r.width, r.height)
268+ val buf = " (%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) Col $columnN ${rectN.name} " .format(r.min.x, r.min.y, r.max.x, r.max.y, r.width, r.height)
269269 selectable(buf)
270270 if (isItemHovered())
271271 foregroundDrawList.addRect(r.min - 1 , r.max + 1 , COL32 (255 , 255 , 0 , 255 ), thickness = 2f )
@@ -339,14 +339,16 @@ interface demoDebugInformations {
339339 }
340340
341341 // Details for TabBars
342- treeNode(" TabBars" , " Tab Bars (${g.tabBars.size} )" ) {
343- for (n in g.tabBars.indices)
344- debugNodeTabBar(g.tabBars[n]!! , " TabBar" )
342+ treeNode(" TabBars" , " Tab Bars (${g.tabBars.aliveCount.i} )" ) {
343+ for (tabBar in g.tabBars)
344+ withID(tabBar) {
345+ debugNodeTabBar(tabBar, " TabBar" )
346+ }
345347 }
346348
347- treeNode(" Tables" , " Tables (${g.tables.size } )" ) {
348- for (n in 0 until g.tables.size )
349- debugNodeTable(g.tables.getByIndex(n) )
349+ treeNode(" Tables" , " Tables (${g.tables.aliveCount.i } )" ) {
350+ for (table in g.tables)
351+ debugNodeTable(table )
350352 }
351353
352354 // Details for Fonts
@@ -362,10 +364,11 @@ interface demoDebugInformations {
362364
363365
364366 // Details for Docking
365- // #ifdef IMGUI_HAS_DOCK
366- treeNode(" Dock nodes" ) {
367+ if ( IMGUI_HAS_DOCK )
368+ treeNode(" Dock nodes" ) {
367369
368- } // #endif // #define IMGUI_HAS_DOCK
370+ }
371+ // #endif // #define IMGUI_HAS_DOCK
369372
370373 // Settings
371374 treeNode(" Settings" ) {
@@ -455,7 +458,7 @@ interface demoDebugInformations {
455458 text(" WheelingWindow: '${g.wheelingWindow?.name ? : " NULL" } '" )
456459 text(" WheelingWindowReleaseTimer: %.2f" , g.wheelingWindowReleaseTimer)
457460 val axis = if (g.wheelingAxisAvg.x > g.wheelingAxisAvg.y) " X" else if (g.wheelingAxisAvg.x < g.wheelingAxisAvg.y) " Y" else " <none>"
458- text(" WheelingAxisAvg[] = { %.3f, %.3f }, Main Axis: %s " , g.wheelingAxisAvg.x, g.wheelingAxisAvg.y)
461+ text(" WheelingAxisAvg[] = { %.3f, %.3f }, Main Axis: $axis " , g.wheelingAxisAvg.x, g.wheelingAxisAvg.y)
459462 }
460463
461464 text(" KEY OWNERS" )
@@ -486,7 +489,7 @@ interface demoDebugInformations {
486489 }
487490 }
488491 }
489- text(" (ActiveIdUsing: AllKeyboardKeys: %d , NavDirMask: 0x%X)" , g.activeIdUsingAllKeyboardKeys , g.activeIdUsingNavDirMask)
492+ text(" (ActiveIdUsing: AllKeyboardKeys: ${g.activeIdUsingAllKeyboardKeys.i} , NavDirMask: 0x%X)" , g.activeIdUsingNavDirMask)
490493 }
491494 }
492495
@@ -524,7 +527,7 @@ interface demoDebugInformations {
524527 debugLocateItemOnHover(g.navId)
525528 text(" NavInputSource: ${g.navInputSource} " )
526529 text(" NavActive: ${io.navActive} , NavVisible: ${io.navVisible} " )
527- text(" NavActivateId/DownId/PressedId: %08X/%08X/%08X/%08X " , g.navActivateId, g.navActivateDownId, g.navActivatePressedId)
530+ text(" NavActivateId/DownId/PressedId: %08X/%08X/%08X" , g.navActivateId, g.navActivateDownId, g.navActivatePressedId)
528531 text(" NavActivateFlags: %04X" , g.navActivateFlags)
529532 text(" NavDisableHighlight: ${g.navDisableHighlight} , NavDisableMouseHover: ${g.navDisableMouseHover} " )
530533 text(" NavFocusScopeId = 0x%08X" , g.navFocusScopeId)
@@ -730,6 +733,7 @@ interface demoDebugInformations {
730733 separator()
731734 text(" By Omar Cornut and all Dear Imgui contributors." )
732735 text(" Dear ImGui is licensed under the MIT License, see LICENSE for more information." )
736+ text(" If your company uses this, please consider sponsoring the project!" )
733737
734738 checkbox(" Config/Build Information" , ::showConfigInfo)
735739 if (showConfigInfo) {
@@ -1002,6 +1006,6 @@ interface demoDebugInformations {
10021006 return formatString(buf, " ???" )
10031007 }
10041008
1005- val buf = " "
1009+ val buf = ByteArray ( 100 )
10061010 }
10071011}
0 commit comments