From 70728e3209fe44823b6dc3e347a66ff02c573721 Mon Sep 17 00:00:00 2001 From: Richard Powell Date: Sun, 12 Feb 2023 21:45:34 -0800 Subject: [PATCH] Issue #89: Change stack to sizer --- README.md | 12 +- docs/ProgrammersGuide.md | 34 ++-- docs/src/docs/ProgrammersGuide.md | 24 +-- examples/HelloWorld/ExtendedExample.cpp | 36 ++-- examples/HelloWorld/HelloWorld.cpp | 8 +- include/wxUI/Layout.h | 58 +++---- tests/wxUI_LayoutTests.cpp | 212 ++++++++++++------------ 7 files changed, 192 insertions(+), 192 deletions(-) diff --git a/README.md b/README.md index dd85aa4..2625869 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ ExampleDialog::ExampleDialog(wxWindow* parent) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { using namespace wxUI; - VStack { + VSizer { wxSizerFlags().Expand().Border(), - VStack { + VSizer { "Text examples", Text { "Example of Text in wxUI" }, TextCtrl { "Single line of text" } @@ -37,7 +37,7 @@ ExampleDialog::ExampleDialog(wxWindow* parent) .withMajorDim(1) .withSelection(1), - HStack { + HSizer { "Details", CheckBox { "Show" }, Choice { { "Less", "More" } }, @@ -45,7 +45,7 @@ ExampleDialog::ExampleDialog(wxWindow* parent) .withStyle(wxALIGN_LEFT), }, - HStack { + HSizer { wxSizerFlags().Center().Border(), Button { wxSizerFlags().Border(wxRIGHT), "Left" } .bind([] { wxLogMessage("Pressed Left"); }), @@ -103,9 +103,9 @@ ExampleDialog::ExampleDialog(wxWindow* parent) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { using namespace wxUI; - VStack { + VSizer { wxSizerFlags().Expand().Border(), - VStack { + VSizer { "Text examples", Text { "Example of Text in wxUI" }, TextCtrl { "Single line of text" } diff --git a/docs/ProgrammersGuide.md b/docs/ProgrammersGuide.md index bc12384..326ec25 100644 --- a/docs/ProgrammersGuide.md +++ b/docs/ProgrammersGuide.md @@ -85,41 +85,41 @@ The `wxUI::MenuBar` and related objects are generally "lazy" objects. They hold ### Layout -The basics of `wxUI` layout is the "Layout". You use a specific type of "Layout", with the `VStack` and `HStack` being the most common. When a "Layout" is set as the top level, it uses the layout as a sort of "blueprint" for stamping out the UI by constructing the ownership hierarchy and layout. +The basics of `wxUI` layout is the "Layout". You use a specific type of "Layout", with the `VSizer` (Vertical Sizer or "row") and `HSizer` (Horizontal Sizer or "column") being the most common. When a "Layout" is set as the top level, it uses the layout as a sort of "blueprint" for stamping out the UI by constructing the ownership hierarchy and layout. ```cpp - VStack { + VSizer { wxSizerFlags().Expand().Border(), - VStack { + VSizer { "Text examples", // ... } .attachTo(this); ``` -In the above example we have constructed a vertical layout stack that will use a `wxSizer` with the `wxSizerFlags` set to expand with a default border. Then the first item in the stack is a second layer stack with another vertical layout. The `wxSizerFlags` are propogated to each layer so the vertical layout in this example would also be set to expand with a default border. The second stack would be created as a "named" box vertical stack. +In the above example we have constructed a vertical layout sizer that will use a `wxSizer` with the `wxSizerFlags` set to expand with a default border. Then the first item in the sizer is a second layer sizer with horizontal layout. The `wxSizerFlags` are propogated to each layer so the horizontal layout in this example would also be set to expand with a default border. The second sizer would be created as a "named" box horizonal sizer. -A "Layout" takes a collection of Items, which can be either additional "Layout" (to create a tree of "Layouts") or "Controllers". Here is the general form of constructions for Stacks: +A "Layout" takes a collection of Items, which can be either additional "Layout" (to create a tree of "Layouts") or "Controllers". Here is the general form of constructions for Sizers: ``` -Stack { Items... } -Stack { SizerFlags, Items... } -Stack { "Name", Items... } -Stack { "Name", SizerFlags, Items... } +Sizer { Items... } +Sizer { SizerFlags, Items... } +Sizer { "Name", Items... } +Sizer { "Name", SizerFlags, Items... } ``` -`wxUI` supports 3 flavors of Stacks: `VStack` (Vertical Stacks), `HStack` (Horizontal Stacks), and `FlexGridStack` (Flexible Grid Stacks). Both `VStack` and `HStack` can be created with a string to create a "named" box. +`wxUI` supports 3 flavors of Sizers: `VSizer` (Vertical Sizers), `HSizer` (Horizontal Sizers), and `FlexGridSizer` (Flexible Grid Sizers). Both `VSizer` and `HSizer` can be created with a string to create a "named" box. -Note: Because Stacks are intented to be "recursive" data structures, it is possible for a `VStack` to contain a `VStack`. However, be aware that if an empty `VStack` is created with *just* a `VStack` as the argument, we collapse that to be a single `VStack`. ie, this: +Note: Because Sizers are intented to be "recursive" data structures, it is possible for a `VSizer` to contain a `VSizer`. However, be aware that if an empty `VSizer` is created with *just* a `VSizer` as the argument, we collapse that to be a single `VSizer`. ie, this: ``` -wxUI::VStack { wxUI::VStack { "Current Frame" } }.attachTo(this); +wxUI::VSizer { wxUI::VSizer { "Current Frame" } }.attachTo(this); ``` is equivalant to: ``` -wxUI::VStack { "Current Frame" }.attachTo(this); +wxUI::VSizer { "Current Frame" }.attachTo(this); ``` @@ -128,7 +128,7 @@ wxUI::VStack { "Current Frame" }.attachTo(this); One special type of "Layout" is `Generic`. There are cases where you may have an existing layout as a `wxSizer` (such as a common dialog) or `wxWindow` (such as a custom window) that you wish to use with `wxUI`. This is a case to use `Generic`: ```cpp - VStack { + VSizer { wxSizerFlags().Expand().Border(), // ... Generic { CreateStdDialogButtonSizer(wxOK) }, @@ -141,7 +141,7 @@ One special type of "Layout" is `Generic`. There are cases where you may have a "Controllers" are the general term to refer to items that behave like a [`wxContol`](https://docs.wxwidgets.org/3.0/classwx_control.html). In `wxUI` we attempt to conform a consistent style that favors the common things you do with a specific `wxControl`. ```cpp - HStack { + HSizer { "Details", CheckBox { "Show" }, Choice { { "Less", "More" } }, @@ -210,7 +210,7 @@ ExtendedExample::ExtendedExample(wxWindow* parent) : wxDialog(parent, wxID_ANY, "ExtendedExample") { using namespace wxUI; - VStack { + VSizer { TextCtrl { "Hello" } .getHandle(&mText), }, @@ -236,7 +236,7 @@ concept CreateAndAddFunction = requires(T function, wxWindow* window, wxSizer* s You would then create the controller to confomr ```cpp - HStack { + HSizer { Custom { [](wxWindow* window, wxSizer* sizer, wxSizerFlags flags) { for (auto&& title : { "1", "2", "3" }) { diff --git a/docs/src/docs/ProgrammersGuide.md b/docs/src/docs/ProgrammersGuide.md index 5c37be9..2cf5857 100644 --- a/docs/src/docs/ProgrammersGuide.md +++ b/docs/src/docs/ProgrammersGuide.md @@ -53,35 +53,35 @@ The `wxUI::MenuBar` and related objects are generally "lazy" objects. They hold ### Layout -The basics of `wxUI` layout is the "Layout". You use a specific type of "Layout", with the `VStack` and `HStack` being the most common. When a "Layout" is set as the top level, it uses the layout as a sort of "blueprint" for stamping out the UI by constructing the ownership hierarchy and layout. +The basics of `wxUI` layout is the "Layout". You use a specific type of "Layout", with the `VSizer` (Vertical Sizer or "row") and `HSizer` (Horizontal Sizer or "column") being the most common. When a "Layout" is set as the top level, it uses the layout as a sort of "blueprint" for stamping out the UI by constructing the ownership hierarchy and layout. ```cpp {{{ examples/HelloWorld/HelloWorld.cpp wxUILayoutBasic " // ..." }}} ``` -In the above example we have constructed a vertical layout stack that will use a `wxSizer` with the `wxSizerFlags` set to expand with a default border. Then the first item in the stack is a second layer stack with another vertical layout. The `wxSizerFlags` are propogated to each layer so the vertical layout in this example would also be set to expand with a default border. The second stack would be created as a "named" box vertical stack. +In the above example we have constructed a vertical layout sizer that will use a `wxSizer` with the `wxSizerFlags` set to expand with a default border. Then the first item in the sizer is a second layer sizer with horizontal layout. The `wxSizerFlags` are propogated to each layer so the horizontal layout in this example would also be set to expand with a default border. The second sizer would be created as a "named" box horizonal sizer. -A "Layout" takes a collection of Items, which can be either additional "Layout" (to create a tree of "Layouts") or "Controllers". Here is the general form of constructions for Stacks: +A "Layout" takes a collection of Items, which can be either additional "Layout" (to create a tree of "Layouts") or "Controllers". Here is the general form of constructions for Sizers: ``` -Stack { Items... } -Stack { SizerFlags, Items... } -Stack { "Name", Items... } -Stack { "Name", SizerFlags, Items... } +Sizer { Items... } +Sizer { SizerFlags, Items... } +Sizer { "Name", Items... } +Sizer { "Name", SizerFlags, Items... } ``` -`wxUI` supports 3 flavors of Stacks: `VStack` (Vertical Stacks), `HStack` (Horizontal Stacks), and `FlexGridStack` (Flexible Grid Stacks). Both `VStack` and `HStack` can be created with a string to create a "named" box. +`wxUI` supports 3 flavors of Sizers: `VSizer` (Vertical Sizers), `HSizer` (Horizontal Sizers), and `FlexGridSizer` (Flexible Grid Sizers). Both `VSizer` and `HSizer` can be created with a string to create a "named" box. -Note: Because Stacks are intented to be "recursive" data structures, it is possible for a `VStack` to contain a `VStack`. However, be aware that if an empty `VStack` is created with *just* a `VStack` as the argument, we collapse that to be a single `VStack`. ie, this: +Note: Because Sizers are intented to be "recursive" data structures, it is possible for a `VSizer` to contain a `VSizer`. However, be aware that if an empty `VSizer` is created with *just* a `VSizer` as the argument, we collapse that to be a single `VSizer`. ie, this: ``` -wxUI::VStack { wxUI::VStack { "Current Frame" } }.attachTo(this); +wxUI::VSizer { wxUI::VSizer { "Current Frame" } }.attachTo(this); ``` is equivalant to: ``` -wxUI::VStack { "Current Frame" }.attachTo(this); +wxUI::VSizer { "Current Frame" }.attachTo(this); ``` @@ -158,7 +158,7 @@ ExtendedExample::ExtendedExample(wxWindow* parent) : wxDialog(parent, wxID_ANY, "ExtendedExample") { using namespace wxUI; - VStack { + VSizer { TextCtrl { "Hello" } .getHandle(&mText), }, diff --git a/examples/HelloWorld/ExtendedExample.cpp b/examples/HelloWorld/ExtendedExample.cpp index 9993937..3255e7b 100644 --- a/examples/HelloWorld/ExtendedExample.cpp +++ b/examples/HelloWorld/ExtendedExample.cpp @@ -33,63 +33,63 @@ ExtendedExample::ExtendedExample(wxWindow* parent) { using namespace wxUI; wxStaticText* text = nullptr; - VStack { + VSizer { wxSizerFlags().Expand().Border(), - HStack { + HSizer { BitmapButton { wxBitmap {} }, }, - HStack { + HSizer { BitmapComboBox { { std::tuple { "", wxBitmap {} } } }, }, - HStack { + HSizer { BitmapToggleButton { wxBitmap {} }, }, - HStack { + HSizer { Button {}, }, - HStack { + HSizer { CheckBox {}, }, - HStack { + HSizer { ComboBox { { "hello" } }, }, - HStack { + HSizer { Line {}, }, - HStack { + HSizer { ListBox { {} }, }, - HStack { + HSizer { RadioBox { std::vector { "hello" } }, }, - HStack { + HSizer { Slider {}, }, - HStack { + HSizer { SpinCtrl {}, }, - HStack { + HSizer { Text {}, }, - HStack { + HSizer { TextCtrl {}, }, // getHandle example - HStack { + HSizer { Text { "Hello" } .getHandle(&text), }, // bind examples - HStack { + HSizer { TextCtrl { "Hello" } .bind([] {}), }, - VStack { + VSizer { wxUI::Choice { std::vector { wxT("Numbers"), wxT("Letters") } } .bind([](auto& e) { (void)e; }), }, // snippet CustomExample - HStack { + HSizer { Custom { [](wxWindow* window, wxSizer* sizer, wxSizerFlags flags) { for (auto&& title : { "1", "2", "3" }) { diff --git a/examples/HelloWorld/HelloWorld.cpp b/examples/HelloWorld/HelloWorld.cpp index 8d24f1b..0f46ce6 100644 --- a/examples/HelloWorld/HelloWorld.cpp +++ b/examples/HelloWorld/HelloWorld.cpp @@ -232,10 +232,10 @@ ExampleDialog::ExampleDialog(wxWindow* parent) using namespace wxUI; // snippet wxUILayoutBasic // snippet wxUIGeneric - VStack { + VSizer { wxSizerFlags().Expand().Border(), // endsnippet wxUIGeneric - VStack { + VSizer { "Text examples", // endsnippet wxUILayoutBasic Text { "Example of Text in wxUI" }, @@ -257,7 +257,7 @@ ExampleDialog::ExampleDialog(wxWindow* parent) .withSelection(1), // snippet wxUIController - HStack { + HSizer { "Details", CheckBox { "Show" }, Choice { { "Less", "More" } }, @@ -266,7 +266,7 @@ ExampleDialog::ExampleDialog(wxWindow* parent) }, // endsnippet wxUIController - HStack { + HSizer { wxSizerFlags().Center().Border(), // snippet wxUIBind Button { wxSizerFlags().Border(wxRIGHT), "Left" } diff --git a/include/wxUI/Layout.h b/include/wxUI/Layout.h index 61a6f3e..2231185 100644 --- a/include/wxUI/Layout.h +++ b/include/wxUI/Layout.h @@ -93,48 +93,48 @@ namespace details { }; template - struct Stack : Sizer { + struct SizerBase : Sizer { using super = Sizer; - explicit Stack(W const&... widgets) + explicit SizerBase(W const&... widgets) : super(std::make_tuple(widgets...)) { } - explicit Stack(wxString const& caption, W const&... widgets) + explicit SizerBase(wxString const& caption, W const&... widgets) : super(std::make_tuple(widgets...)) , caption(caption) { } - explicit Stack(wxSizerFlags const& flags, W const&... widgets) + explicit SizerBase(wxSizerFlags const& flags, W const&... widgets) : super(flags, std::make_tuple(widgets...)) { } - Stack(wxString const& caption, wxSizerFlags const& flags, W const&... widgets) + SizerBase(wxString const& caption, wxSizerFlags const& flags, W const&... widgets) : super(flags, std::make_tuple(widgets...)) , caption(caption) { } - explicit Stack(std::tuple const& widgets) + explicit SizerBase(std::tuple const& widgets) : super(widgets) { } - Stack(wxString const& caption, std::tuple const& widgets) + SizerBase(wxString const& caption, std::tuple const& widgets) : super(widgets) , caption(caption) { } - Stack(wxSizerFlags const& flags, std::tuple const& widgets) + SizerBase(wxSizerFlags const& flags, std::tuple const& widgets) : super(flags, widgets) { } - Stack(wxString const& caption, wxSizerFlags const& flags, std::tuple const& widgets) + SizerBase(wxString const& caption, wxSizerFlags const& flags, std::tuple const& widgets) : super(flags, widgets) , caption(caption) { @@ -148,90 +148,90 @@ namespace details { } template -struct VStack : public details::Stack { - using super = details::Stack; +struct VSizer : public details::SizerBase { + using super = details::SizerBase; - explicit VStack(W const&... widgets) + explicit VSizer(W const&... widgets) : super(std::make_tuple(widgets...)) { } - explicit VStack(wxString const& caption, W const&... widgets) + explicit VSizer(wxString const& caption, W const&... widgets) : super(caption, std::make_tuple(widgets...)) { } - explicit VStack(wxSizerFlags const& flags, W const&... widgets) + explicit VSizer(wxSizerFlags const& flags, W const&... widgets) : super(flags, std::make_tuple(widgets...)) { } - VStack(wxString const& caption, wxSizerFlags const& flags, W const&... widgets) + VSizer(wxString const& caption, wxSizerFlags const& flags, W const&... widgets) : super(caption, flags, std::make_tuple(widgets...)) { } - explicit VStack(std::tuple const& widgets) + explicit VSizer(std::tuple const& widgets) : super(widgets) { } - VStack(wxString const& caption, std::tuple const& widgets) + VSizer(wxString const& caption, std::tuple const& widgets) : super(caption, widgets) { } - VStack(wxSizerFlags const& flags, std::tuple const& widgets) + VSizer(wxSizerFlags const& flags, std::tuple const& widgets) : super(flags, widgets) { } - VStack(wxString const& caption, wxSizerFlags const& flags, std::tuple const& widgets) + VSizer(wxString const& caption, wxSizerFlags const& flags, std::tuple const& widgets) : super(caption, flags, widgets) { } }; template -struct HStack : public details::Stack { - using super = details::Stack; +struct HSizer : public details::SizerBase { + using super = details::SizerBase; - explicit HStack(W const&... widgets) + explicit HSizer(W const&... widgets) : super(std::make_tuple(widgets...)) { } - explicit HStack(wxString const& caption, W const&... widgets) + explicit HSizer(wxString const& caption, W const&... widgets) : super(caption, std::make_tuple(widgets...)) { } - explicit HStack(wxSizerFlags const& flags, W const&... widgets) + explicit HSizer(wxSizerFlags const& flags, W const&... widgets) : super(flags, std::make_tuple(widgets...)) { } - HStack(wxString const& caption, wxSizerFlags const& flags, W const&... widgets) + HSizer(wxString const& caption, wxSizerFlags const& flags, W const&... widgets) : super(caption, flags, std::make_tuple(widgets...)) { } - explicit HStack(std::tuple const& widgets) + explicit HSizer(std::tuple const& widgets) : super(widgets) { } - HStack(wxString const& caption, std::tuple const& widgets) + HSizer(wxString const& caption, std::tuple const& widgets) : super(caption, widgets) { } - HStack(wxSizerFlags const& flags, std::tuple const& widgets) + HSizer(wxSizerFlags const& flags, std::tuple const& widgets) : super(flags, widgets) { } - HStack(wxString const& caption, wxSizerFlags const& flags, std::tuple const& widgets) + HSizer(wxString const& caption, wxSizerFlags const& flags, std::tuple const& widgets) : super(caption, flags, widgets) { } diff --git a/tests/wxUI_LayoutTests.cpp b/tests/wxUI_LayoutTests.cpp index 05cd3bc..dbc1625 100644 --- a/tests/wxUI_LayoutTests.cpp +++ b/tests/wxUI_LayoutTests.cpp @@ -34,7 +34,7 @@ auto CheckSizerEmpty(wxSizer* sizer) CHECK(sizer->IsEmpty() == true); } -auto CheckStack(wxSizer* sizer, int orientation) +auto CheckSizer(wxSizer* sizer, int orientation) { auto* boxSizer = dynamic_cast(sizer); CHECK(nullptr != boxSizer); @@ -43,7 +43,7 @@ auto CheckStack(wxSizer* sizer, int orientation) CHECK(nullptr == staticBoxSizer); } -auto CheckStack(wxSizer* sizer, int orientation, std::string_view name) +auto CheckSizer(wxSizer* sizer, int orientation, std::string_view name) { auto* boxSizer = dynamic_cast(sizer); CHECK(nullptr != boxSizer); @@ -55,60 +55,60 @@ auto CheckStack(wxSizer* sizer, int orientation, std::string_view name) CHECK(box->GetLabel() == std::string { name }); } -auto CheckVStackEmpty(wxSizer* sizer) +auto CheckVSizerEmpty(wxSizer* sizer) { CheckSizerEmpty(sizer); - CheckStack(sizer, wxVERTICAL); + CheckSizer(sizer, wxVERTICAL); } -auto CheckHStackEmpty(wxSizer* sizer) +auto CheckHSizerEmpty(wxSizer* sizer) { CheckSizerEmpty(sizer); - CheckStack(sizer, wxHORIZONTAL); + CheckSizer(sizer, wxHORIZONTAL); } -auto CheckVStackNamedEmpty(wxSizer* sizer, std::string_view name) +auto CheckVSizerNamedEmpty(wxSizer* sizer, std::string_view name) { CheckSizerEmpty(sizer); - CheckStack(sizer, wxVERTICAL, name); + CheckSizer(sizer, wxVERTICAL, name); } -auto CheckHStackNamedEmpty(wxSizer* sizer, std::string_view name) +auto CheckHSizerNamedEmpty(wxSizer* sizer, std::string_view name) { CheckSizerEmpty(sizer); - CheckStack(sizer, wxHORIZONTAL, name); + CheckSizer(sizer, wxHORIZONTAL, name); } -auto CheckVStackHasOne(wxSizer* sizer, auto passAnswer) +auto CheckVSizerHasOne(wxSizer* sizer, auto passAnswer) { - CheckStack(sizer, wxVERTICAL); + CheckSizer(sizer, wxVERTICAL); auto children = sizer->GetChildren(); CHECK(children.GetCount() == 1); passAnswer((*children.begin())->GetSizer()); } -auto CheckVStackHasOne(wxSizer* sizer, std::string_view name, auto passAnswer) +auto CheckVSizerHasOne(wxSizer* sizer, std::string_view name, auto passAnswer) { - CheckStack(sizer, wxVERTICAL, name); + CheckSizer(sizer, wxVERTICAL, name); auto children = sizer->GetChildren(); CHECK(children.GetCount() == 1); passAnswer((*children.begin())->GetSizer()); } -auto CheckHStackHasOne(wxSizer* sizer, auto passAnswer) +auto CheckHSizerHasOne(wxSizer* sizer, auto passAnswer) { - CheckStack(sizer, wxHORIZONTAL); + CheckSizer(sizer, wxHORIZONTAL); auto children = sizer->GetChildren(); CHECK(children.GetCount() == 1); passAnswer((*children.begin())->GetSizer()); } -auto CheckHStackHasOne(wxSizer* sizer, std::string_view name, auto passAnswer) +auto CheckHSizerHasOne(wxSizer* sizer, std::string_view name, auto passAnswer) { - CheckStack(sizer, wxHORIZONTAL, name); + CheckSizer(sizer, wxHORIZONTAL, name); auto children = sizer->GetChildren(); CHECK(children.GetCount() == 1); @@ -117,184 +117,184 @@ auto CheckHStackHasOne(wxSizer* sizer, std::string_view name, auto passAnswer) TEST_CASE("Size") { - SECTION("vstack.empty") + SECTION("vSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack {}.attachTo(&frame); - CheckVStackEmpty(frame.GetSizer()); + wxUI::VSizer {}.attachTo(&frame); + CheckVSizerEmpty(frame.GetSizer()); } - SECTION("vstack.named.empty") + SECTION("vSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { "Test1" }.attachTo(&frame); - CheckVStackNamedEmpty(frame.GetSizer(), "Test1"); + wxUI::VSizer { "Test1" }.attachTo(&frame); + CheckVSizerNamedEmpty(frame.GetSizer(), "Test1"); } - SECTION("hstack.empty") + SECTION("hSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack {}.attachTo(&frame); - CheckHStackEmpty(frame.GetSizer()); + wxUI::HSizer {}.attachTo(&frame); + CheckHSizerEmpty(frame.GetSizer()); } - SECTION("hstack.named.empty") + SECTION("hSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { "Test2" }.attachTo(&frame); - CheckHStackNamedEmpty(frame.GetSizer(), "Test2"); + wxUI::HSizer { "Test2" }.attachTo(&frame); + CheckHSizerNamedEmpty(frame.GetSizer(), "Test2"); } - SECTION("vstack.collapse.vstack.empty") + SECTION("vSizer.collapse.vSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { wxUI::VStack {} }.attachTo(&frame); - CheckVStackEmpty(frame.GetSizer()); + wxUI::VSizer { wxUI::VSizer {} }.attachTo(&frame); + CheckVSizerEmpty(frame.GetSizer()); } - SECTION("vstack.collapse.vstack.named.empty") + SECTION("vSizer.collapse.vSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { wxUI::VStack { "Test1" } }.attachTo(&frame); - CheckVStackNamedEmpty(frame.GetSizer(), "Test1"); + wxUI::VSizer { wxUI::VSizer { "Test1" } }.attachTo(&frame); + CheckVSizerNamedEmpty(frame.GetSizer(), "Test1"); } - SECTION("vstack.vstack.empty") + SECTION("vSizer.vSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { std::tuple { wxUI::VStack {} } }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckVStackEmpty(sizer); + wxUI::VSizer { std::tuple { wxUI::VSizer {} } }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckVSizerEmpty(sizer); }); } - SECTION("vstack.vstack.named.empty") + SECTION("vSizer.vSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { std::tuple { wxUI::VStack { "Test1" } } }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckVStackNamedEmpty(sizer, "Test1"); + wxUI::VSizer { std::tuple { wxUI::VSizer { "Test1" } } }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckVSizerNamedEmpty(sizer, "Test1"); }); } - SECTION("vstack.hstack.empty") + SECTION("vSizer.hSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { wxUI::HStack {} }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckHStackEmpty(sizer); + wxUI::VSizer { wxUI::HSizer {} }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckHSizerEmpty(sizer); }); } - SECTION("vstack.hstack.named.empty") + SECTION("vSizer.hSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { wxUI::HStack { "Test2" } }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckHStackNamedEmpty(sizer, "Test2"); + wxUI::VSizer { wxUI::HSizer { "Test2" } }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckHSizerNamedEmpty(sizer, "Test2"); }); } - SECTION("vstack.named.vstack.empty") + SECTION("vSizer.named.vSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { "Test3", wxUI::VStack {} }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckVStackEmpty(sizer); + wxUI::VSizer { "Test3", wxUI::VSizer {} }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckVSizerEmpty(sizer); }); } - SECTION("vstack.named.vstack.named.empty") + SECTION("vSizer.named.vSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { "Test3", wxUI::VStack { "Test1" } }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckVStackNamedEmpty(sizer, "Test1"); + wxUI::VSizer { "Test3", wxUI::VSizer { "Test1" } }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckVSizerNamedEmpty(sizer, "Test1"); }); } - SECTION("vstack.named.hstack.empty") + SECTION("vSizer.named.hSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { "Test3", wxUI::HStack {} }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckHStackEmpty(sizer); + wxUI::VSizer { "Test3", wxUI::HSizer {} }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckHSizerEmpty(sizer); }); } - SECTION("vstack.named.hstack.named.empty") + SECTION("vSizer.named.hSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::VStack { "Test3", wxUI::HStack { "Test2" } }.attachTo(&frame); - CheckVStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckHStackNamedEmpty(sizer, "Test2"); + wxUI::VSizer { "Test3", wxUI::HSizer { "Test2" } }.attachTo(&frame); + CheckVSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckHSizerNamedEmpty(sizer, "Test2"); }); } - SECTION("hstack.vstack.empty") + SECTION("hSizer.vSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { wxUI::VStack {} }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckVStackEmpty(sizer); + wxUI::HSizer { wxUI::VSizer {} }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckVSizerEmpty(sizer); }); } - SECTION("hstack.vstack.named.empty") + SECTION("hSizer.vSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { wxUI::VStack { "Test1" } }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckVStackNamedEmpty(sizer, "Test1"); + wxUI::HSizer { wxUI::VSizer { "Test1" } }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckVSizerNamedEmpty(sizer, "Test1"); }); } - SECTION("hstack.collapse.hstack.empty") + SECTION("hSizer.collapse.hSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { wxUI::HStack {} }.attachTo(&frame); - CheckHStackEmpty(frame.GetSizer()); + wxUI::HSizer { wxUI::HSizer {} }.attachTo(&frame); + CheckHSizerEmpty(frame.GetSizer()); } - SECTION("hstack.collapse.hstack.named.empty") + SECTION("hSizer.collapse.hSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { wxUI::HStack { "Test2" } }.attachTo(&frame); - CheckHStackNamedEmpty(frame.GetSizer(), "Test2"); + wxUI::HSizer { wxUI::HSizer { "Test2" } }.attachTo(&frame); + CheckHSizerNamedEmpty(frame.GetSizer(), "Test2"); } - SECTION("hstack.hstack.empty") + SECTION("hSizer.hSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { std::tuple { wxUI::HStack {} } }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckHStackEmpty(sizer); + wxUI::HSizer { std::tuple { wxUI::HSizer {} } }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckHSizerEmpty(sizer); }); } - SECTION("hstack.hstack.named.empty") + SECTION("hSizer.hSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { std::tuple { wxUI::HStack { "Test1" } } }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), [](wxSizer* sizer) { - CheckHStackNamedEmpty(sizer, "Test1"); + wxUI::HSizer { std::tuple { wxUI::HSizer { "Test1" } } }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), [](wxSizer* sizer) { + CheckHSizerNamedEmpty(sizer, "Test1"); }); } - SECTION("hstack.named.vstack.empty") + SECTION("hSizer.named.vSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { "Test3", wxUI::VStack {} }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckVStackEmpty(sizer); + wxUI::HSizer { "Test3", wxUI::VSizer {} }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckVSizerEmpty(sizer); }); } - SECTION("hstack.named.vstack.named.empty") + SECTION("hSizer.named.vSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { "Test3", wxUI::VStack { "Test1" } }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckVStackNamedEmpty(sizer, "Test1"); + wxUI::HSizer { "Test3", wxUI::VSizer { "Test1" } }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckVSizerNamedEmpty(sizer, "Test1"); }); } - SECTION("hstack.named.hstack.empty") + SECTION("hSizer.named.hSizer.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { "Test3", wxUI::HStack {} }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckHStackEmpty(sizer); + wxUI::HSizer { "Test3", wxUI::HSizer {} }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckHSizerEmpty(sizer); }); } - SECTION("hstack.named.hstack.named.empty") + SECTION("hSizer.named.hSizer.named.empty") { wxFrame frame { nullptr, wxID_ANY, "" }; - wxUI::HStack { "Test3", wxUI::HStack { "Test2" } }.attachTo(&frame); - CheckHStackHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { - CheckHStackNamedEmpty(sizer, "Test2"); + wxUI::HSizer { "Test3", wxUI::HSizer { "Test2" } }.attachTo(&frame); + CheckHSizerHasOne(frame.GetSizer(), "Test3", [](wxSizer* sizer) { + CheckHSizerNamedEmpty(sizer, "Test2"); }); } }