Skip to content

Commit

Permalink
Fix tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
vczh committed Jul 6, 2023
1 parent c1012a8 commit 31855a2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Tutorial/GacUI_Controls/Animation/UI/Resource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@
var sin = Math::Sin(angle);
var cos = Math::Cos(angle);
var cx = (container.Bounds.x2 - container.Bounds.x1) / 2;
var cy = (container.Bounds.y2 - container.Bounds.y1) / 2;
var radiusBall = (ball.Bounds.x2 - ball.Bounds.x1) / 2;
var cx = (container.CachedBounds.x2 - container.CachedBounds.x1) / 2;
var cy = (container.CachedBounds.y2 - container.CachedBounds.y1) / 2;
var radiusBall = (ball.CachedBounds.x2 - ball.CachedBounds.x1) / 2;
var radiusOrbit = Math::Min(cx, cy) - radiusBall;
var x = cast int Math::Round(cos * radiusOrbit + cx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ Closures
auto angle = (((circleRatio * ::vl::reflection::description::Math::Pi()) * static_cast<double>(static_cast<::vl::vint>(2))) + (::vl::reflection::description::Math::Pi() * static_cast<double>(1.5)));
auto sin = ::vl::reflection::description::Math::Sin(angle);
auto cos = ::vl::reflection::description::Math::Cos(angle);
auto cx = ((::vl::__vwsn::This(container)->GetBounds().x2 - ::vl::__vwsn::This(container)->GetBounds().x1) / static_cast<::vl::vint>(2));
auto cy = ((::vl::__vwsn::This(container)->GetBounds().y2 - ::vl::__vwsn::This(container)->GetBounds().y1) / static_cast<::vl::vint>(2));
auto radiusBall = ((::vl::__vwsn::This(ball)->GetBounds().x2 - ::vl::__vwsn::This(ball)->GetBounds().x1) / static_cast<::vl::vint>(2));
auto cx = ((::vl::__vwsn::This(container)->GetCachedBounds().x2 - ::vl::__vwsn::This(container)->GetCachedBounds().x1) / static_cast<::vl::vint>(2));
auto cy = ((::vl::__vwsn::This(container)->GetCachedBounds().y2 - ::vl::__vwsn::This(container)->GetCachedBounds().y1) / static_cast<::vl::vint>(2));
auto radiusBall = ((::vl::__vwsn::This(ball)->GetCachedBounds().x2 - ::vl::__vwsn::This(ball)->GetCachedBounds().x1) / static_cast<::vl::vint>(2));
auto radiusOrbit = (::vl::reflection::description::Math::Min(cx, cy) - radiusBall);
auto x = static_cast<::vl::vint>(::vl::reflection::description::Math::Round(((cos * static_cast<double>(radiusOrbit)) + static_cast<double>(cx))));
auto y = static_cast<::vl::vint>(::vl::reflection::description::Math::Round(((sin * static_cast<double>(radiusOrbit)) + static_cast<double>(cx))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Window Text="Instance_MultipleWindows" ClientSize="x:480 y:320">
<att.ContainerComposition-set PreferredMinSize="x:480 y:320"/>
<Button Text="Click me to show another window!" ev.Clicked="buttonShowWindow_Clicked">
<att.BoundsComposition-set Margin="left:20 top:20 right:-1 bottom:-1"/>
<att.BoundsComposition-set AlignmentToParent="left:20 top:20 right:-1 bottom:-1"/>
</Button>
</Window>
</Instance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Class (::demo::MainWindowConstructor)
}
(this->__vwsn_precompile_2 = ::vl::__vwsn::This(this->__vwsn_precompile_1)->GetBoundsComposition());
{
::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(20); __vwsn_temp__.top = static_cast<::vl::vint>(20); __vwsn_temp__.right = (- static_cast<::vl::vint>(1)); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }());
::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(20); __vwsn_temp__.top = static_cast<::vl::vint>(20); __vwsn_temp__.right = (- static_cast<::vl::vint>(1)); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }());
}
{
::vl::__vwsn::This(this->__vwsn_precompile_1)->SetText(::vl::WString::Unmanaged(L"Click me to show another window!"));
Expand Down
6 changes: 3 additions & 3 deletions Tutorial/GacUI_Xml/Member_Property/UI/Resource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Window Text="Member_Property" ClientSize="x:480 y:320">
<att.ContainerComposition-set PreferredMinSize="x:480 y:320"/>
<x:MyControl ref.Name="myControl" Text-format="Selected: $(myControl.SelectedOption)">
<att.BoundsComposition-set Margin="left:10 top:10"/>
<att.BoundsComposition-set AlignmentToParent="left:10 top:10 right:-1 bottom:-1"/>
</x:MyControl>
</Window>
</Instance>
Expand All @@ -31,8 +31,8 @@
<x:MutexGroupController ref.Name="optionGroup"/>
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren"/>
<GroupBox Text-bind="self.Text">
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren"/>
<Stack Direction="Vertical" Margin="left:5 top:5 right:5 bottom:5" Padding="10" MinSizeLimitation="LimitToElementAndChildren">
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren" InternalMargin="left:5 top:5 right:5 bottom:5"/>
<Stack Direction="Vertical" Padding="10" MinSizeLimitation="LimitToElementAndChildren">
<StackItem>
<RadioButton Text="Option A" GroupController-ref="optionGroup" Selected="true">
<ev.SelectedChanged-eval>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ namespace demo
(this->myControl = new ::demo::MyControl());
(this->__vwsn_precompile_1 = ::vl::__vwsn::This(this->myControl)->GetBoundsComposition());
{
::vl::__vwsn::This(this->__vwsn_precompile_1)->SetMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(10); __vwsn_temp__.top = static_cast<::vl::vint>(10); return __vwsn_temp__; }());
::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(10); __vwsn_temp__.top = static_cast<::vl::vint>(10); __vwsn_temp__.right = (- static_cast<::vl::vint>(1)); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }());
}
{
::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->myControl));
Expand Down Expand Up @@ -317,6 +317,9 @@ Class (::demo::MyControlConstructor)
(this->__vwsn_precompile_0 = new ::vl::presentation::controls::GuiControl(::vl::presentation::theme::ThemeName::GroupBox));
}
(this->__vwsn_precompile_6 = ::vl::__vwsn::This(this->__vwsn_precompile_0)->GetContainerComposition());
{
::vl::__vwsn::This(this->__vwsn_precompile_6)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }());
}
{
::vl::__vwsn::This(this->__vwsn_precompile_6)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren);
}
Expand All @@ -330,9 +333,6 @@ Class (::demo::MyControlConstructor)
{
::vl::__vwsn::This(this->__vwsn_precompile_1)->SetDirection(::vl::presentation::compositions::GuiStackComposition::Direction::Vertical);
}
{
::vl::__vwsn::This(this->__vwsn_precompile_1)->SetMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }());
}
(this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiStackItemComposition());
{
(this->__vwsn_precompile_3 = new ::vl::presentation::controls::GuiSelectableButton(::vl::presentation::theme::ThemeName::RadioButton));
Expand Down

0 comments on commit 31855a2

Please sign in to comment.