@@ -2591,7 +2591,7 @@ static void ShowDemoWindowWidgets()
2591
2591
static bool embed_all_inside_a_child_window = false ;
2592
2592
ImGui::Checkbox (" Embed everything inside a child window for testing _RootWindow flag." , &embed_all_inside_a_child_window);
2593
2593
if (embed_all_inside_a_child_window)
2594
- ImGui::BeginChild (" outer_child" , ImVec2 (0 , ImGui::GetFontSize () * 20 .0f ), true );
2594
+ ImGui::BeginChild (" outer_child" , ImVec2 (0 , ImGui::GetFontSize () * 20 .0f ), ImGuiChildFlags_Border );
2595
2595
2596
2596
// Testing IsWindowFocused() function with its various flags.
2597
2597
ImGui::BulletText (
@@ -2639,7 +2639,7 @@ static void ShowDemoWindowWidgets()
2639
2639
ImGui::IsWindowHovered (ImGuiHoveredFlags_AnyWindow),
2640
2640
ImGui::IsWindowHovered (ImGuiHoveredFlags_Stationary));
2641
2641
2642
- ImGui::BeginChild (" child" , ImVec2 (0 , 50 ), true );
2642
+ ImGui::BeginChild (" child" , ImVec2 (0 , 50 ), ImGuiChildFlags_Border );
2643
2643
ImGui::Text (" This is another child window for testing the _ChildWindows flag." );
2644
2644
ImGui::EndChild ();
2645
2645
if (embed_all_inside_a_child_window)
@@ -2723,7 +2723,7 @@ static void ShowDemoWindowLayout()
2723
2723
ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar;
2724
2724
if (disable_mouse_wheel)
2725
2725
window_flags |= ImGuiWindowFlags_NoScrollWithMouse;
2726
- ImGui::BeginChild (" ChildL" , ImVec2 (ImGui::GetContentRegionAvail ().x * 0 .5f , 260 ), false , window_flags);
2726
+ ImGui::BeginChild (" ChildL" , ImVec2 (ImGui::GetContentRegionAvail ().x * 0 .5f , 260 ), ImGuiChildFlags_None , window_flags);
2727
2727
for (int i = 0 ; i < 100 ; i++)
2728
2728
ImGui::Text (" %04d: scrollable region" , i);
2729
2729
ImGui::EndChild ();
@@ -2739,7 +2739,7 @@ static void ShowDemoWindowLayout()
2739
2739
if (!disable_menu)
2740
2740
window_flags |= ImGuiWindowFlags_MenuBar;
2741
2741
ImGui::PushStyleVar (ImGuiStyleVar_ChildRounding, 5 .0f );
2742
- ImGui::BeginChild (" ChildR" , ImVec2 (0 , 260 ), true , window_flags);
2742
+ ImGui::BeginChild (" ChildR" , ImVec2 (0 , 260 ), ImGuiChildFlags_Border , window_flags);
2743
2743
if (!disable_menu && ImGui::BeginMenuBar ())
2744
2744
{
2745
2745
if (ImGui::BeginMenu (" Menu" ))
@@ -2780,14 +2780,15 @@ static void ShowDemoWindowLayout()
2780
2780
2781
2781
ImGui::SetCursorPosX (ImGui::GetCursorPosX () + (float )offset_x);
2782
2782
ImGui::PushStyleColor (ImGuiCol_ChildBg, IM_COL32 (255 , 0 , 0 , 100 ));
2783
- ImGui::BeginChild (" Red" , ImVec2 (200 , 100 ), true , ImGuiWindowFlags_None);
2783
+ ImGui::BeginChild (" Red" , ImVec2 (200 , 100 ), ImGuiChildFlags_Border, ImGuiWindowFlags_None);
2784
+ ImGui::PopStyleColor ();
2785
+
2784
2786
for (int n = 0 ; n < 50 ; n++)
2785
2787
ImGui::Text (" Some test %d" , n);
2786
2788
ImGui::EndChild ();
2787
2789
bool child_is_hovered = ImGui::IsItemHovered ();
2788
2790
ImVec2 child_rect_min = ImGui::GetItemRectMin ();
2789
2791
ImVec2 child_rect_max = ImGui::GetItemRectMax ();
2790
- ImGui::PopStyleColor ();
2791
2792
ImGui::Text (" Hovered: %d" , child_is_hovered);
2792
2793
ImGui::Text (" Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)" , child_rect_min.x , child_rect_min.y , child_rect_max.x , child_rect_max.y );
2793
2794
}
@@ -3176,7 +3177,7 @@ static void ShowDemoWindowLayout()
3176
3177
3177
3178
const ImGuiWindowFlags child_flags = enable_extra_decorations ? ImGuiWindowFlags_MenuBar : 0 ;
3178
3179
const ImGuiID child_id = ImGui::GetID ((void *)(intptr_t )i);
3179
- const bool child_is_visible = ImGui::BeginChild (child_id, ImVec2 (child_w, 200 .0f ), true , child_flags);
3180
+ const bool child_is_visible = ImGui::BeginChild (child_id, ImVec2 (child_w, 200 .0f ), ImGuiChildFlags_Border , child_flags);
3180
3181
if (ImGui::BeginMenuBar ())
3181
3182
{
3182
3183
ImGui::TextUnformatted (" abc" );
@@ -3223,7 +3224,7 @@ static void ShowDemoWindowLayout()
3223
3224
float child_height = ImGui::GetTextLineHeight () + style.ScrollbarSize + style.WindowPadding .y * 2 .0f ;
3224
3225
ImGuiWindowFlags child_flags = ImGuiWindowFlags_HorizontalScrollbar | (enable_extra_decorations ? ImGuiWindowFlags_AlwaysVerticalScrollbar : 0 );
3225
3226
ImGuiID child_id = ImGui::GetID ((void *)(intptr_t )i);
3226
- bool child_is_visible = ImGui::BeginChild (child_id, ImVec2 (-100 , child_height), true , child_flags);
3227
+ bool child_is_visible = ImGui::BeginChild (child_id, ImVec2 (-100 , child_height), ImGuiChildFlags_Border , child_flags);
3227
3228
if (scroll_to_off)
3228
3229
ImGui::SetScrollX (scroll_to_off_px);
3229
3230
if (scroll_to_pos)
@@ -3265,7 +3266,7 @@ static void ShowDemoWindowLayout()
3265
3266
ImGui::PushStyleVar (ImGuiStyleVar_FrameRounding, 3 .0f );
3266
3267
ImGui::PushStyleVar (ImGuiStyleVar_FramePadding, ImVec2 (2 .0f , 1 .0f ));
3267
3268
ImVec2 scrolling_child_size = ImVec2 (0 , ImGui::GetFrameHeightWithSpacing () * 7 + 30 );
3268
- ImGui::BeginChild (" scrolling" , scrolling_child_size, true , ImGuiWindowFlags_HorizontalScrollbar);
3269
+ ImGui::BeginChild (" scrolling" , scrolling_child_size, ImGuiChildFlags_Border , ImGuiWindowFlags_HorizontalScrollbar);
3269
3270
for (int line = 0 ; line < lines; line++)
3270
3271
{
3271
3272
// Display random stuff. For the sake of this trivial demo we are using basic Button() + SameLine()
@@ -3409,7 +3410,7 @@ static void ShowDemoWindowLayout()
3409
3410
}
3410
3411
if (show_child)
3411
3412
{
3412
- ImGui::BeginChild (" child" , ImVec2 (0 , 0 ), true );
3413
+ ImGui::BeginChild (" child" , ImVec2 (0 , 0 ), ImGuiChildFlags_Border );
3413
3414
ImGui::EndChild ();
3414
3415
}
3415
3416
ImGui::End ();
@@ -5958,7 +5959,7 @@ static void ShowDemoWindowColumns()
5958
5959
{
5959
5960
ImGui::SetNextWindowContentSize (ImVec2 (1500 .0f , 0 .0f ));
5960
5961
ImVec2 child_size = ImVec2 (0 , ImGui::GetFontSize () * 20 .0f );
5961
- ImGui::BeginChild (" ##ScrollingRegion" , child_size, false , ImGuiWindowFlags_HorizontalScrollbar);
5962
+ ImGui::BeginChild (" ##ScrollingRegion" , child_size, ImGuiChildFlags_None , ImGuiWindowFlags_HorizontalScrollbar);
5962
5963
ImGui::Columns (10 );
5963
5964
5964
5965
// Also demonstrate using clipper for large vertical lists
@@ -6575,7 +6576,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
6575
6576
" Left-click on color square to open color picker,\n "
6576
6577
" Right-click to open edit options menu." );
6577
6578
6578
- ImGui::BeginChild (" ##colors" , ImVec2 (0 , 0 ), true , ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
6579
+ ImGui::BeginChild (" ##colors" , ImVec2 (0 , 0 ), ImGuiChildFlags_Border , ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
6579
6580
ImGui::PushItemWidth (ImGui::GetFontSize () * -12 );
6580
6581
for (int i = 0 ; i < ImGuiCol_COUNT; i++)
6581
6582
{
@@ -6802,7 +6803,7 @@ static void ShowExampleMenuFile()
6802
6803
{
6803
6804
static bool enabled = true ;
6804
6805
ImGui::MenuItem (" Enabled" , " " , &enabled);
6805
- ImGui::BeginChild (" child" , ImVec2 (0 , 60 ), true );
6806
+ ImGui::BeginChild (" child" , ImVec2 (0 , 60 ), ImGuiChildFlags_Border );
6806
6807
for (int i = 0 ; i < 10 ; i++)
6807
6808
ImGui::Text (" Scrolling Text %d" , i);
6808
6809
ImGui::EndChild ();
@@ -6968,7 +6969,7 @@ struct ExampleAppConsole
6968
6969
6969
6970
// Reserve enough left-over height for 1 separator + 1 input text
6970
6971
const float footer_height_to_reserve = ImGui::GetStyle ().ItemSpacing .y + ImGui::GetFrameHeightWithSpacing ();
6971
- if (ImGui::BeginChild (" ScrollingRegion" , ImVec2 (0 , -footer_height_to_reserve), false , ImGuiWindowFlags_HorizontalScrollbar))
6972
+ if (ImGui::BeginChild (" ScrollingRegion" , ImVec2 (0 , -footer_height_to_reserve), ImGuiChildFlags_None , ImGuiWindowFlags_HorizontalScrollbar))
6972
6973
{
6973
6974
if (ImGui::BeginPopupContextWindow ())
6974
6975
{
@@ -7279,7 +7280,7 @@ struct ExampleAppLog
7279
7280
7280
7281
ImGui::Separator ();
7281
7282
7282
- if (ImGui::BeginChild (" scrolling" , ImVec2 (0 , 0 ), false , ImGuiWindowFlags_HorizontalScrollbar))
7283
+ if (ImGui::BeginChild (" scrolling" , ImVec2 (0 , 0 ), ImGuiChildFlags_None , ImGuiWindowFlags_HorizontalScrollbar))
7283
7284
{
7284
7285
if (clear)
7285
7286
Clear ();
@@ -7398,7 +7399,7 @@ static void ShowExampleAppLayout(bool* p_open)
7398
7399
// Left
7399
7400
static int selected = 0 ;
7400
7401
{
7401
- ImGui::BeginChild (" left pane" , ImVec2 (150 , 0 ), true );
7402
+ ImGui::BeginChild (" left pane" , ImVec2 (150 , 0 ), ImGuiChildFlags_Border );
7402
7403
for (int i = 0 ; i < 100 ; i++)
7403
7404
{
7404
7405
// FIXME: Good candidate to use ImGuiSelectableFlags_SelectOnNav
@@ -7967,7 +7968,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
7967
7968
// To use a child window instead we could use, e.g:
7968
7969
// ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); // Disable padding
7969
7970
// ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(50, 50, 50, 255)); // Set a background color
7970
- // ImGui::BeginChild("canvas", ImVec2(0.0f, 0.0f), true , ImGuiWindowFlags_NoMove);
7971
+ // ImGui::BeginChild("canvas", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Border , ImGuiWindowFlags_NoMove);
7971
7972
// ImGui::PopStyleColor();
7972
7973
// ImGui::PopStyleVar();
7973
7974
// [...]
0 commit comments