Skip to content

Commit

Permalink
Merge pull request #110 from rmpowell77/issue/108-attachTo
Browse files Browse the repository at this point in the history
Issue #108: make attachToAndFit the default
  • Loading branch information
rmpowell77 authored Jun 6, 2023
2 parents 4b8ce63 + db57925 commit e5c8a3c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions LATEST_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ Other changes:
* [#89](../../issues/89) Change stack to sizer
* [#92](../../issues/92) Need a Bitmap
* [#95](../../issues/95) Text needs to customize font
* [#104](../../issues/104) Proxy objects
* [#108](../../issues/108) make attachToAndFit the default

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ExampleDialog::ExampleDialog(wxWindow* parent)

Generic { CreateStdDialogButtonSizer(wxOK) },
}
.attachToAndFit(this);
.attachTo(this);
}
```
<img src="docs/images/ExampleDialog.png"/>
Expand Down Expand Up @@ -147,7 +147,7 @@ ExampleDialog::ExampleDialog(wxWindow* parent)
},
// ...
}
.attachToAndFit(this);
.attachTo(this);
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/ProgrammersGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The basics of `wxUI` layout is the *Layout*. You use a specific type of *Layout
"Text examples",
// ...
}
.attachToAndFit(this);
.attachTo(this);
```

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.
Expand Down Expand Up @@ -147,7 +147,7 @@ One special type of *Layout* is `Generic`. There are cases where you may have a
// ...
Generic { CreateStdDialogButtonSizer(wxOK) },
}
.attachToAndFit(this);
.attachTo(this);
```
### Controllers
Expand Down
2 changes: 1 addition & 1 deletion examples/HelloWorld/ExtendedExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,5 @@ ExtendedExample::ExtendedExample(wxWindow* parent)
Generic { CreateStdDialogButtonSizer(wxOK) },
// endsnippet CustomExample
}
.attachToAndFit(this);
.attachTo(this);
}
2 changes: 1 addition & 1 deletion examples/HelloWorld/HelloWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ ExampleDialog::ExampleDialog(wxWindow* parent)
// snippet withwxUI
// snippet wxUILayoutBasic
}
.attachToAndFit(this);
.attachTo(this);
// endsnippet wxUIGeneric
// endsnippet wxUILayoutBasic
}
Expand Down
6 changes: 3 additions & 3 deletions include/wxUI/Layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace details {
return sizer;
}

auto attachTo(wxWindow* parent) -> auto&
auto attachToWithoutSizeHints(wxWindow* parent) -> auto&
{
auto sizer = constructSizer(parent);
auto currentFlags = flags ? *flags : wxSizerFlags {};
Expand All @@ -76,9 +76,9 @@ namespace details {
return *this;
}

auto attachToAndFit(wxWindow* parent) -> auto&
auto attachTo(wxWindow* parent) -> auto&
{
attachTo(parent);
attachToWithoutSizeHints(parent);
auto* sizer = parent->GetSizer();
sizer->SetSizeHints(parent);
return *this;
Expand Down

0 comments on commit e5c8a3c

Please sign in to comment.